35 lines
1.2 KiB
PHP
35 lines
1.2 KiB
PHP
</div><!-- end page-body -->
|
||
</div><!-- end #main -->
|
||
|
||
<script>
|
||
// Toast utility
|
||
function toast(msg, type) {
|
||
var icons = { success:'✅', error:'❌', info:'ℹ️', warning:'⚠️' };
|
||
var el = document.createElement('div');
|
||
el.className = 'toast ' + (type||'');
|
||
el.innerHTML = '<span>' + (icons[type]||'ℹ️') + '</span> ' + msg;
|
||
document.getElementById('toast-wrap').appendChild(el);
|
||
setTimeout(() => { el.style.opacity='0'; el.style.transition='.3s'; setTimeout(()=>el.remove(),300); }, 3500);
|
||
}
|
||
|
||
// Modal helpers
|
||
function openModal(id) { document.getElementById(id).classList.add('show'); }
|
||
function closeModal(id) { document.getElementById(id).classList.remove('show'); }
|
||
|
||
// Close modal on overlay click
|
||
document.querySelectorAll('.modal-overlay').forEach(el => {
|
||
el.addEventListener('click', function(e) {
|
||
if (e.target === this) this.classList.remove('show');
|
||
});
|
||
});
|
||
|
||
<?php if (isset($_GET['success'])): ?>
|
||
toast('<?= htmlspecialchars($_GET['success']) ?>', 'success');
|
||
<?php endif; ?>
|
||
<?php if (isset($_GET['error'])): ?>
|
||
toast('<?= htmlspecialchars($_GET['error']) ?>', 'error');
|
||
<?php endif; ?>
|
||
</script>
|
||
<?= $extraScript ?? '' ?>
|
||
</body>
|
||
</html>
|