88 lines
3.4 KiB
PHP
88 lines
3.4 KiB
PHP
<footer class="mt-5 pt-4 border-top text-center text-muted small">
|
|
<p>© <?= date('Y') ?> <?= htmlspecialchars($companyName ?? 'Foody') ?>. All rights reserved.</p>
|
|
<p>Powered By Abidarcafe @2026</p>
|
|
</footer>
|
|
</div> <!-- End Main Content -->
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// Initialize all dropdowns manually to ensure they work
|
|
var dropdownElementList = [].slice.call(document.querySelectorAll('.dropdown-toggle'))
|
|
var dropdownList = dropdownElementList.map(function (dropdownToggleEl) {
|
|
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"]');
|
|
|
|
confirmLinks.forEach(link => {
|
|
const originalOnClick = link.getAttribute('onclick');
|
|
// Extract the message from confirm('...')
|
|
const match = originalOnClick.match(/confirm\(['"](.+?)['"]\)/);
|
|
const message = match ? match[1] : 'Are you sure?';
|
|
|
|
// Remove the original onclick
|
|
link.removeAttribute('onclick');
|
|
|
|
// Add new click listener
|
|
link.addEventListener('click', function(e) {
|
|
e.preventDefault(); // Prevent default navigation
|
|
|
|
Swal.fire({
|
|
title: 'Are you sure?',
|
|
text: message,
|
|
icon: 'warning',
|
|
showCancelButton: true,
|
|
confirmButtonColor: '#d33',
|
|
cancelButtonColor: '#3085d6',
|
|
confirmButtonText: 'Yes, proceed!'
|
|
}).then((result) => {
|
|
if (result.isConfirmed) {
|
|
window.location.href = this.href;
|
|
}
|
|
});
|
|
});
|
|
});
|
|
|
|
// 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();
|
|
}
|
|
});
|
|
});
|
|
});
|
|
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|