From f9d2ca374d3925996d97e6e0548e7c4ed46e544f Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Mon, 23 Feb 2026 02:50:12 +0000 Subject: [PATCH] Autosave: 20260223-025012 --- assets/js/main.js | 20 +++++++++++++++++++- pos.php | 11 ++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/assets/js/main.js b/assets/js/main.js index 891a641..326d542 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -233,6 +233,13 @@ document.addEventListener('DOMContentLoaded', () => { function openTableSelectionModal() { const container = document.getElementById('table-list-container'); container.innerHTML = '
'; + + // Update Modal Title + const modalTitle = document.querySelector('#tableSelectionModal .modal-title'); + if (modalTitle && typeof CURRENT_OUTLET !== 'undefined') { + modalTitle.textContent = `Select Table - ${CURRENT_OUTLET.name}`; + } + tableSelectionModal.show(); const outletId = new URLSearchParams(window.location.search).get('outlet_id') || 1; @@ -255,7 +262,11 @@ document.addEventListener('DOMContentLoaded', () => { container.innerHTML = ''; if (tables.length === 0) { - container.innerHTML = '
No tables found.
'; + const outletName = (typeof CURRENT_OUTLET !== 'undefined') ? CURRENT_OUTLET.name : 'this outlet'; + container.innerHTML = `
+ + No tables found for ${outletName}. +
`; return; } @@ -715,6 +726,13 @@ document.addEventListener('DOMContentLoaded', () => { } // Initialize logic + const urlParams = new URLSearchParams(window.location.search); + if (!urlParams.has('order_type')) { + const otTakeaway = document.getElementById('ot-takeaway'); + if (otTakeaway) { + otTakeaway.checked = true; + } + } checkOrderType(); // --- Add Customer Logic --- diff --git a/pos.php b/pos.php index 3bfacd4..2078ec4 100644 --- a/pos.php +++ b/pos.php @@ -19,6 +19,14 @@ $table_id = $_GET['table'] ?? '1'; // Default table $outlet_id = isset($_GET['outlet_id']) ? (int)$_GET['outlet_id'] : 1; $settings = get_company_settings(); $order_type = $_GET['order_type'] ?? 'takeaway'; + +$current_outlet_name = 'Unknown Outlet'; +foreach ($outlets as $o) { + if ($o['id'] == $outlet_id) { + $current_outlet_name = $o['name']; + break; + } +} ?> @@ -260,7 +268,7 @@ $order_type = $_GET['order_type'] ?? 'takeaway';