Autosave: 20260223-025012
This commit is contained in:
parent
a238062edb
commit
f9d2ca374d
@ -233,6 +233,13 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
function openTableSelectionModal() {
|
||||
const container = document.getElementById('table-list-container');
|
||||
container.innerHTML = '<div class="text-center py-5"><div class="spinner-border text-primary" role="status"></div></div>';
|
||||
|
||||
// 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 = '<div class="col-12 text-center">No tables found.</div>';
|
||||
const outletName = (typeof CURRENT_OUTLET !== 'undefined') ? CURRENT_OUTLET.name : 'this outlet';
|
||||
container.innerHTML = `<div class="col-12 text-center text-muted py-4">
|
||||
<i class="bi bi-slash-circle fs-1 d-block mb-2"></i>
|
||||
No tables found for <strong>${outletName}</strong>.
|
||||
</div>`;
|
||||
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 ---
|
||||
|
||||
11
pos.php
11
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;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
@ -260,7 +268,7 @@ $order_type = $_GET['order_type'] ?? 'takeaway';
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title fw-bold">Select Table</h5>
|
||||
<h5 class="modal-title fw-bold" id="tableSelectionModalLabel">Select Table</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" id="close-table-modal" style="display:none;"></button>
|
||||
</div>
|
||||
<div class="modal-body bg-light">
|
||||
@ -334,6 +342,7 @@ $order_type = $_GET['order_type'] ?? 'takeaway';
|
||||
const COMPANY_SETTINGS = <?= json_encode($settings) ?>;
|
||||
const PRODUCT_VARIANTS = <?= json_encode($variants_by_product) ?>;
|
||||
const PAYMENT_TYPES = <?= json_encode($payment_types) ?>;
|
||||
const CURRENT_OUTLET = <?= json_encode(['id' => $outlet_id, 'name' => $current_outlet_name]) ?>;
|
||||
</script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="assets/js/main.js?v=<?= time() ?>"></script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user