From 9a50d0a34e78840386eb2b90c303f258adbf0f80 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Mon, 23 Feb 2026 08:23:40 +0000 Subject: [PATCH] settin qr orders --- admin/table_edit.php | 13 ++++++++----- admin/tables.php | 23 +++++++++++++++-------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/admin/table_edit.php b/admin/table_edit.php index 4645cfa..fb94237 100644 --- a/admin/table_edit.php +++ b/admin/table_edit.php @@ -31,8 +31,11 @@ if (!$table) { die("Table not found."); } -// Fetch Areas for Dropdown -$areas = $pdo->query("SELECT id, name FROM areas ORDER BY name ASC")->fetchAll(); +// Fetch Areas for Dropdown (with outlet names) +$areas = $pdo->query("SELECT areas.id, areas.name, outlets.name as outlet_name + FROM areas + JOIN outlets ON areas.outlet_id = outlets.id + ORDER BY outlets.name ASC, areas.name ASC")->fetchAll(); include 'includes/header.php'; ?> @@ -53,12 +56,12 @@ include 'includes/header.php';
- + @@ -77,4 +80,4 @@ include 'includes/header.php';
- + \ No newline at end of file diff --git a/admin/tables.php b/admin/tables.php index 118dc6a..c6e39a1 100644 --- a/admin/tables.php +++ b/admin/tables.php @@ -15,17 +15,21 @@ if (isset($_GET['delete'])) { exit; } -// Fetch tables with area names -$query = "SELECT tables.*, areas.name as area_name +// Fetch tables with area and outlet names +$query = "SELECT tables.*, areas.name as area_name, outlets.name as outlet_name FROM tables LEFT JOIN areas ON tables.area_id = areas.id + LEFT JOIN outlets ON areas.outlet_id = outlets.id ORDER BY tables.id DESC"; $tables_pagination = paginate_query($pdo, $query); $tables = $tables_pagination['data']; -// Fetch areas for dropdown -$areas = $pdo->query("SELECT id, name FROM areas ORDER BY name ASC")->fetchAll(); +// Fetch areas for dropdown (with outlet names) +$areas = $pdo->query("SELECT areas.id, areas.name, outlets.name as outlet_name + FROM areas + JOIN outlets ON areas.outlet_id = outlets.id + ORDER BY outlets.name ASC, areas.name ASC")->fetchAll(); include 'includes/header.php'; @@ -58,7 +62,7 @@ $baseUrl = $protocol . $host . ($dir === '/' ? '' : $dir) . '/qorder.php'; ID Name - Area + Outlet / Area Capacity Actions @@ -70,7 +74,10 @@ $baseUrl = $protocol . $host . ($dir === '/' ? '' : $dir) . '/qorder.php'; # - + + + + pax