46 lines
1.5 KiB
PHP
46 lines
1.5 KiB
PHP
</main>
|
|
|
|
<!-- Toast Container -->
|
|
<div class="position-fixed bottom-0 end-0 p-3" style="z-index: 11">
|
|
<div id="notificationToast" class="toast hide" role="alert" aria-live="assertive" aria-atomic="true">
|
|
<div class="toast-header">
|
|
<strong class="me-auto" id="toastTitle"></strong>
|
|
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
|
|
</div>
|
|
<div class="toast-body" id="toastBody">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- Bootstrap 5 JS Bundle -->
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
const urlParams = new URLSearchParams(window.location.search);
|
|
const status = urlParams.get('status');
|
|
const msg = urlParams.get('msg');
|
|
|
|
if (status && msg) {
|
|
const toastEl = document.getElementById('notificationToast');
|
|
const toastTitleEl = document.getElementById('toastTitle');
|
|
const toastBodyEl = document.getElementById('toastBody');
|
|
|
|
toastTitleEl.textContent = status === 'success' ? 'Success' : 'Error';
|
|
toastBodyEl.textContent = decodeURIComponent(msg);
|
|
toastEl.classList.remove('hide');
|
|
toastEl.classList.add('show');
|
|
if(status === 'success') {
|
|
toastEl.classList.add('bg-success-subtle');
|
|
} else {
|
|
toastEl.classList.add('bg-danger-subtle');
|
|
}
|
|
|
|
const toast = new bootstrap.Toast(toastEl);
|
|
toast.show();
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|