// Active Link Script 
document.addEventListener('DOMContentLoaded', function () {
    const currentPage = window.location.pathname.split('/').pop();
    const tabs = document.querySelectorAll('.nav-tabs a');

    tabs.forEach(tab => {
        if (tab.getAttribute('href') === currentPage) {
            tab.classList.add('active');
        }
    });
}); 



document.getElementById('logout-link').addEventListener('click', (e) => {
    e.preventDefault();
    showAlert('Are you sure you want to logout?', () => {
        window.location.href = 'api/logout.php';
    }, null, 'Logout', 'Cancel');
});