function renderHeader() { const headerDiv = document.getElementById("header"); if (window.location.pathname.endsWith("/")) { localStorage.removeItem("userRole"); headerDiv.innerHTML = `
Hospital CRM Logo Hospital CMS
`; return; } const role = localStorage.getItem("userRole"); const token = localStorage.getItem("TOKEN"); let headerContent = `
Hospital CRM Logo Hospital CMS
'; headerDiv.innerHTML = headerContent; attachHeaderButtonListeners(); } function attachHeaderButtonListeners() { const login = document.getElementById("patientLogin"); if (login) { login.addEventListener('click', () => { openModal('patientLogin'); }); } const signup = document.getElementById("patientSignup"); if (signup) { signup.addEventListener('click', () => { openModal('patientSignup'); }); } } function logout() { localStorage.removeItem("userRole"); localStorage.removeItem("TOKEN"); window.location.href = "/"; } function logoutPatient() { localStorage.removeItem("userRole"); selectRole('patient'); window.location.href='/pages/loggedPatientDashboard.html'; }