From bd73e2313152c0620f5748901f3194888dadee83 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Fri, 27 Feb 2026 02:55:44 +0000 Subject: [PATCH] fix 4 --- admin/orders.php | 4 +++- admin/tables.php | 7 +++++-- api/order.php | 4 +++- api/tables.php | 2 ++ qorder.php | 33 ++++++++++++++++++++------------- 5 files changed, 33 insertions(+), 17 deletions(-) diff --git a/admin/orders.php b/admin/orders.php index 218a88d..dc62386 100644 --- a/admin/orders.php +++ b/admin/orders.php @@ -1,4 +1,6 @@ - \ No newline at end of file + diff --git a/admin/tables.php b/admin/tables.php index 571ff7d..0c284a6 100644 --- a/admin/tables.php +++ b/admin/tables.php @@ -1,4 +1,6 @@ - + \ No newline at end of file diff --git a/api/order.php b/api/order.php index 6663482..6bea303 100644 --- a/api/order.php +++ b/api/order.php @@ -1,4 +1,6 @@ inTransaction()) $pdo->rollBack(); error_log("Order Error: " . $e->getMessage()); echo json_encode(['success' => false, 'error' => $e->getMessage()]); -} \ No newline at end of file +} diff --git a/api/tables.php b/api/tables.php index f9bba96..ab84bf8 100644 --- a/api/tables.php +++ b/api/tables.php @@ -1,4 +1,6 @@ prepare(" - SELECT t.id, t.table_number as table_name, a.outlet_id, o.name as outlet_name - FROM tables t - JOIN areas a ON t.area_id = a.id - JOIN outlets o ON a.outlet_id = o.id - WHERE t.id = ? -"); -$stmt->execute([$table_id]); -$table_info = $stmt->fetch(); +try { + $stmt = $pdo->prepare(" + SELECT t.id, t.table_number as table_name, a.outlet_id, o.name as outlet_name + FROM tables t + JOIN areas a ON t.area_id = a.id + JOIN outlets o ON a.outlet_id = o.id + WHERE t.id = ? + "); + $stmt->execute([$table_id]); + $table_info = $stmt->fetch(); -if (!$table_info) { - die("Table not found. Please contact staff."); + if (!$table_info) { + die("Table with ID $table_id not found. Please contact staff."); + } +} catch (PDOException $e) { + die("Database error: " . $e->getMessage()); } $outlet_id = (int)$table_info['outlet_id'];