diff --git a/index.php b/index.php index 0bff4aa..f0af36c 100644 --- a/index.php +++ b/index.php @@ -802,20 +802,29 @@ function confirmLogout(event) { event.preventDefault(); var logoutUrl = event.currentTarget.href; - Swal.fire({ - title: 'Konfirmasi Logout', - text: 'Apakah Anda yakin akan keluar dari sistem?', - icon: 'question', - showCancelButton: true, - confirmButtonColor: '#3085d6', - cancelButtonColor: '#d33', - confirmButtonText: 'Ya, Keluar', - cancelButtonText: 'Batal' - }).then((result) => { - if (result.isConfirmed) { + + // Check if SweetAlert2 is available + if (typeof Swal !== 'undefined' && Swal.fire) { + Swal.fire({ + title: 'Konfirmasi Logout', + text: 'Apakah Anda yakin akan keluar dari sistem?', + icon: 'question', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Ya, Keluar', + cancelButtonText: 'Batal' + }).then((result) => { + if (result.isConfirmed) { + window.location.href = logoutUrl; + } + }); + } else { + // Fallback to standard confirm dialog + if (confirm('Apakah Anda yakin akan keluar dari sistem?')) { window.location.href = logoutUrl; } - }); + } } function zoomIn() {