diff --git a/admin/includes/footer.php b/admin/includes/footer.php index 0251726..6424f09 100644 --- a/admin/includes/footer.php +++ b/admin/includes/footer.php @@ -13,6 +13,16 @@ return new bootstrap.Dropdown(dropdownToggleEl) }); + // Override global alert + window.alert = function(message) { + Swal.fire({ + title: 'Notification', + text: message, + icon: 'info', + confirmButtonColor: '#3085d6' + }); + }; + // Global SweetAlert2 replacement for confirm() const confirmLinks = document.querySelectorAll('a[onclick^="return confirm"]'); @@ -45,6 +55,33 @@ }); }); + // Intercept confirm in form onsubmit + const confirmForms = document.querySelectorAll('form[onsubmit^="return confirm"]'); + confirmForms.forEach(form => { + const originalOnSubmit = form.getAttribute('onsubmit'); + const match = originalOnSubmit.match(/confirm\(['"](.+?)['"]\)/); + const message = match ? match[1] : 'Are you sure?'; + + form.removeAttribute('onsubmit'); + + form.addEventListener('submit', function(e) { + e.preventDefault(); + Swal.fire({ + title: 'Are you sure?', + text: message, + icon: 'warning', + showCancelButton: true, + confirmButtonColor: '#d33', + cancelButtonColor: '#3085d6', + confirmButtonText: 'Yes, proceed!' + }).then((result) => { + if (result.isConfirmed) { + form.submit(); + } + }); + }); + }); + }); diff --git a/kitchen.php b/kitchen.php index c57994d..fa2ed5c 100644 --- a/kitchen.php +++ b/kitchen.php @@ -462,5 +462,15 @@ setInterval(fetchOrders, 10000); + diff --git a/online_order.php b/online_order.php index 704f3fb..174d6d6 100644 --- a/online_order.php +++ b/online_order.php @@ -472,6 +472,17 @@ foreach ($variants_by_product as $pid => $vars) { } .qty-val { width: 30px; text-align: center; font-weight: 600; } + + diff --git a/qorder.php b/qorder.php index 125cdc1..3911a9a 100644 --- a/qorder.php +++ b/qorder.php @@ -364,6 +364,17 @@ foreach ($variants_raw as $v) { } .qty-val { width: 30px; text-align: center; font-weight: 600; } + +