diff --git a/admin/ad_edit.php b/admin/ad_edit.php index a6ce844..6bb518f 100644 --- a/admin/ad_edit.php +++ b/admin/ad_edit.php @@ -23,6 +23,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $title = trim($_POST['title']); $sort_order = (int)$_POST['sort_order']; $is_active = isset($_POST['is_active']) ? 1 : 0; + $display_layout = $_POST['display_layout'] ?? 'both'; $image_path = $isEdit ? $ad['image_path'] : null; if (isset($_FILES['image']) && $_FILES['image']['error'] === UPLOAD_ERR_OK) { @@ -56,13 +57,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { if (empty($message)) { try { if ($isEdit) { - $stmt = $pdo->prepare("UPDATE ads_images SET title = ?, sort_order = ?, is_active = ?, image_path = ? WHERE id = ?"); - $stmt->execute([$title, $sort_order, $is_active, $image_path, $id]); + $stmt = $pdo->prepare("UPDATE ads_images SET title = ?, sort_order = ?, is_active = ?, display_layout = ?, image_path = ? WHERE id = ?"); + $stmt->execute([$title, $sort_order, $is_active, $display_layout, $image_path, $id]); header("Location: ads.php?success=updated"); exit; } else { - $stmt = $pdo->prepare("INSERT INTO ads_images (title, sort_order, is_active, image_path) VALUES (?, ?, ?, ?)"); - $stmt->execute([$title, $sort_order, $is_active, $image_path]); + $stmt = $pdo->prepare("INSERT INTO ads_images (title, sort_order, is_active, display_layout, image_path) VALUES (?, ?, ?, ?, ?)"); + $stmt->execute([$title, $sort_order, $is_active, $display_layout, $image_path]); header("Location: ads.php?success=created"); exit; } @@ -77,6 +78,7 @@ if (!$isEdit) { 'title' => $_POST['title'] ?? '', 'sort_order' => $_POST['sort_order'] ?? 0, 'is_active' => 1, + 'display_layout' => 'both', 'image_path' => '' ]; } @@ -106,6 +108,22 @@ include 'includes/header.php';
Lower numbers appear first in the slider.
+ +
+ +
+ > + + + > + + + > + +
+
Choose where this advertisement should be visible.
+
+
> diff --git a/admin/ads.php b/admin/ads.php index 823914c..49a61e1 100644 --- a/admin/ads.php +++ b/admin/ads.php @@ -9,6 +9,7 @@ $pdo->exec("CREATE TABLE IF NOT EXISTS ads_images ( title VARCHAR(255) DEFAULT NULL, sort_order INT DEFAULT 0, is_active TINYINT(1) DEFAULT 1, + display_layout ENUM('both', 'split', 'fullscreen') DEFAULT 'both', created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP )"); @@ -53,7 +54,7 @@ include 'includes/header.php';
These images will be displayed in a slider on the ads.php page. - You can upload up to 7 images for optimal performance. + You can now choose to show specific images in Split View or Fullscreen layout.
@@ -69,6 +70,7 @@ include 'includes/header.php'; Order Preview Title / Caption + Layout Status Actions @@ -87,6 +89,20 @@ include 'includes/header.php';
+ + + + Active @@ -102,7 +118,7 @@ include 'includes/header.php'; - + No advertisement images found. Click "Add Image" to get started. diff --git a/admin/includes/header.php b/admin/includes/header.php index d4f3b03..976aca5 100644 --- a/admin/includes/header.php +++ b/admin/includes/header.php @@ -54,7 +54,7 @@ function getGroupToggleClass($pages) { - + diff --git a/admin/tables.php b/admin/tables.php index 1fb81b4..118dc6a 100644 --- a/admin/tables.php +++ b/admin/tables.php @@ -28,6 +28,15 @@ $tables = $tables_pagination['data']; $areas = $pdo->query("SELECT id, name FROM areas ORDER BY name ASC")->fetchAll(); include 'includes/header.php'; + +// Determine base URL for QR codes +$isHttps = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') + || ($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? '') === 'https' + || $_SERVER['SERVER_PORT'] == 443; +$protocol = $isHttps ? "https://" : "http://"; +$host = $_SERVER['HTTP_HOST']; +$dir = dirname($_SERVER['PHP_SELF'], 2); +$baseUrl = $protocol . $host . ($dir === '/' ? '' : $dir) . '/qorder.php'; ?>
@@ -55,13 +64,20 @@ include 'includes/header.php'; - + # pax + @@ -120,4 +136,51 @@ include 'includes/header.php';
+ + + + + \ No newline at end of file diff --git a/ads.php b/ads.php index f5f533c..a2b6528 100644 --- a/ads.php +++ b/ads.php @@ -90,6 +90,10 @@ $companyName = $company['company_name'] ?? 'Foody'; object-fit: contain; background-color: #000; } + + /* Layout filtering */ + body.split-view .carousel-item.layout-fullscreen { display: none !important; } + body.fullscreen-promo .carousel-item.layout-split { display: none !important; } /* Fullscreen Promo View */ .fullscreen-promo .serving-board { @@ -154,10 +158,23 @@ $companyName = $company['company_name'] ?? 'Foody';
-