diff --git a/assets/js/main.js b/assets/js/main.js index 7969b51..3c548aa 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -378,6 +378,81 @@ document.addEventListener('DOMContentLoaded', () => { }); } + window.openTableSelectionModal = function() { + if (!tableSelectionModal) return; + fetchTables(); + tableSelectionModal.show(); + }; + + function fetchTables() { + const grid = document.getElementById("tables-grid"); + if (!grid) return; + grid.innerHTML = "
"; + + const outletId = CURRENT_OUTLET ? CURRENT_OUTLET.id : 1; + fetch(`api/tables.php?outlet_id=${outletId}`) + .then(res => res.json()) + .then(data => { + grid.innerHTML = ""; + if (data.success && data.tables.length > 0) { + renderTables(data.tables); + } else { + grid.innerHTML = `
${_t("none")}
`; + } + }) + .catch(() => { + grid.innerHTML = `
${_t("error")}
`; + }); + } + + function renderTables(tables) { + const grid = document.getElementById("tables-grid"); + if (!grid) return; + grid.innerHTML = ""; + + const areas = {}; + tables.forEach(t => { + const area = t.area_name || "General"; + if (!areas[area]) areas[area] = []; + areas[area].push(t); + }); + + for (const area in areas) { + const areaHeader = document.createElement("div"); + areaHeader.className = "col-12 mt-3"; + areaHeader.innerHTML = `
${area}
`; + grid.appendChild(areaHeader); + + areas[area].forEach(table => { + const col = document.createElement("div"); + col.className = "col-3 col-sm-2"; + const statusClass = table.is_occupied ? "btn-outline-danger" : "btn-outline-success"; + col.innerHTML = ` + + `; + grid.appendChild(col); + }); + } + } + + window.selectTable = function(id, name) { + currentTableId = id; + currentTableName = name; + const nameDisplay = document.getElementById("selected-table-name"); + if (nameDisplay) nameDisplay.textContent = name; + if (tableSelectionModal) tableSelectionModal.hide(); + + const dineInInput = document.getElementById("ot-dine-in"); + if (dineInInput) { + dineInInput.checked = true; + checkOrderType(); + } + }; + window.checkOrderType = function() { const checked = document.querySelector('input[name="order_type"]:checked'); if (!checked) return; @@ -570,4 +645,15 @@ document.addEventListener('DOMContentLoaded', () => { } else showToast(data.error, 'danger'); }); }; -}); \ No newline at end of file + + window.openRatingQRModal = function() { + const qrContainer = document.getElementById('rating-qr-container'); + const ratingUrl = BASE_URL + '/rate.php'; + const qrCodeUrl = "https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=" + encodeURIComponent(ratingUrl); + + qrContainer.innerHTML = 'Rating QR Code'; + + const modal = new bootstrap.Modal(document.getElementById('qrRatingModal')); + modal.show(); + }; +}); diff --git a/index.php b/index.php index 5c5861c..a943053 100644 --- a/index.php +++ b/index.php @@ -2,6 +2,7 @@ declare(strict_types=1); require_once __DIR__ . '/db/config.php'; $settings = get_company_settings(); +$baseUrl = get_base_url(); ?> @@ -11,7 +12,7 @@ $settings = get_company_settings(); <?= htmlspecialchars($settings['company_name']) ?> - Welcome - + @@ -67,7 +68,7 @@ $settings = get_company_settings(); } .hero-card { - background: rgba(255, 255, 255, 0.8); + background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(12px); border-radius: 32px; border: 1px solid rgba(255, 255, 255, 0.5); @@ -78,9 +79,21 @@ $settings = get_company_settings(); text-align: center; } + .logo-wrapper { + background: #f1f5f9; + display: inline-flex; + align-items: center; + justify-content: center; + padding: 1.5rem; + border-radius: 24px; + margin-bottom: 2rem; + box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05); + } + .company-logo { - max-height: 100px; - margin-bottom: 1.5rem; + max-height: 120px; + width: auto; + display: block; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1)); } @@ -188,13 +201,13 @@ $settings = get_company_settings();
- - - -
+
+ + + -
- + +

Your all-in-one business management solution.

diff --git a/pos.php b/pos.php index 954142d..c77acdd 100644 --- a/pos.php +++ b/pos.php @@ -85,7 +85,7 @@ if (!$loyalty_settings) { <?= htmlspecialchars($settings['company_name']) ?> - POS - + @@ -166,7 +166,7 @@ if (!$loyalty_settings) {
- Logo + Logo @@ -175,6 +175,7 @@ if (!$loyalty_settings) {
Kitchen +
@@ -290,6 +291,12 @@ if (!$loyalty_settings) { >
+ +
@@ -345,6 +352,37 @@ if (!$loyalty_settings) {
+ + + + +