Autosave: 20260225-190532
This commit is contained in:
parent
2bb3386b5d
commit
0c98d8d160
@ -21,6 +21,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action'])) {
|
|||||||
$promo_discount_percent = !empty($_POST['promo_discount_percent']) ? (float)$_POST['promo_discount_percent'] : null;
|
$promo_discount_percent = !empty($_POST['promo_discount_percent']) ? (float)$_POST['promo_discount_percent'] : null;
|
||||||
$promo_date_from = !empty($_POST['promo_date_from']) ? $_POST['promo_date_from'] : null;
|
$promo_date_from = !empty($_POST['promo_date_from']) ? $_POST['promo_date_from'] : null;
|
||||||
$promo_date_to = !empty($_POST['promo_date_to']) ? $_POST['promo_date_to'] : null;
|
$promo_date_to = !empty($_POST['promo_date_to']) ? $_POST['promo_date_to'] : null;
|
||||||
|
$is_loyalty = isset($_POST['is_loyalty']) ? 1 : 0;
|
||||||
|
|
||||||
$image_url = null;
|
$image_url = null;
|
||||||
if ($id) {
|
if ($id) {
|
||||||
@ -201,7 +202,14 @@ include 'includes/header.php';
|
|||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<div>
|
<div>
|
||||||
<div class="fw-bold text-dark fs-6"><?= htmlspecialchars($product['name']) ?></div>
|
<div class="fw-bold text-dark fs-6">
|
||||||
|
<?= htmlspecialchars($product['name']) ?>
|
||||||
|
<?php if ($product['is_loyalty']): ?>
|
||||||
|
<span class="badge bg-info bg-opacity-10 text-info border border-info rounded-pill ms-1" style="font-size: 0.7rem;">
|
||||||
|
<i class="bi bi-star-fill"></i> Loyalty
|
||||||
|
</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
<small class="text-muted"><?= htmlspecialchars($product['name_ar'] ?? '') ?></small>
|
<small class="text-muted"><?= htmlspecialchars($product['name_ar'] ?? '') ?></small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -339,15 +347,14 @@ include 'includes/header.php';
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12 mt-4">
|
<div class="col-12 mt-4">
|
||||||
<div class="col-12 mt-2">
|
<div class="form-check form-switch p-3 bg-light rounded-3 border d-flex justify-content-between align-items-center mb-3">
|
||||||
<div class="form-check form-switch p-3 bg-light rounded-3 border d-flex justify-content-between align-items-center">
|
|
||||||
<div class="ms-1">
|
<div class="ms-1">
|
||||||
<label class="form-check-label fw-bold text-dark mb-0" for="productIsLoyalty">Loyalty System Participation</label>
|
<label class="form-check-label fw-bold text-dark mb-0" for="productIsLoyalty">Loyalty System Participation</label>
|
||||||
<div class="small text-muted">Include this product in earning and redeeming loyalty points</div>
|
<div class="small text-muted">Include this product in earning and redeeming loyalty points</div>
|
||||||
</div>
|
</div>
|
||||||
<input class="form-check-input ms-0" type="checkbox" name="is_loyalty" id="productIsLoyalty" style="width: 2.5rem; height: 1.25rem;">
|
<input class="form-check-input ms-0" type="checkbox" name="is_loyalty" id="productIsLoyalty" style="width: 2.5rem; height: 1.25rem;">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<h6 class="fw-bold border-bottom pb-2 mb-3"><i class="bi bi-percent me-1"></i> Promotion Settings</h6>
|
<h6 class="fw-bold border-bottom pb-2 mb-3"><i class="bi bi-percent me-1"></i> Promotion Settings</h6>
|
||||||
<div class="row g-3">
|
<div class="row g-3">
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
@ -399,6 +406,7 @@ function prepareEditForm(p) {
|
|||||||
document.getElementById('productPromoDiscount').value = p.promo_discount_percent || '';
|
document.getElementById('productPromoDiscount').value = p.promo_discount_percent || '';
|
||||||
document.getElementById('productPromoFrom').value = p.promo_date_from || '';
|
document.getElementById('productPromoFrom').value = p.promo_date_from || '';
|
||||||
document.getElementById('productPromoTo').value = p.promo_date_to || '';
|
document.getElementById('productPromoTo').value = p.promo_date_to || '';
|
||||||
|
document.getElementById('productIsLoyalty').checked = p.is_loyalty == 1;
|
||||||
|
|
||||||
if (p.image_url) {
|
if (p.image_url) {
|
||||||
const preview = document.getElementById('productImagePreview');
|
const preview = document.getElementById('productImagePreview');
|
||||||
@ -448,4 +456,4 @@ async function translateTo(targetLang) {
|
|||||||
</script>
|
</script>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php include 'includes/footer.php'; ?>
|
<?php include 'includes/footer.php'; ?>
|
||||||
Loading…
x
Reference in New Issue
Block a user