Fully working app

This commit is contained in:
2025-11-09 17:33:37 +01:00
parent f1879640c0
commit 66609ab25d
42 changed files with 710 additions and 620 deletions

View File

@@ -14,7 +14,7 @@ function renderHeader() {
}
const role = localStorage.getItem("userRole");
const token = localStorage.getItem("TOKEN");
const token = localStorage.getItem("token");
let headerContent = `<header class="header">
<div class="logo-section">
@@ -30,7 +30,7 @@ function renderHeader() {
return;
} else if (role === "admin") {
headerContent += `
<button id="addDocBtn" class="adminBtn" onclick="openModal('addDoctor')">Add Doctor</button>
<button id="addDocBtn" class="adminBtn">Add Doctor</button>
<a href="#" onclick="logout()">Logout</a>`;
} else if (role === "doctor") {
headerContent += `
@@ -67,12 +67,15 @@ function attachHeaderButtonListeners() {
function logout() {
localStorage.removeItem("userRole");
localStorage.removeItem("TOKEN");
localStorage.removeItem("token");
window.location.href = "/";
}
function logoutPatient() {
localStorage.removeItem("userRole");
selectRole('patient');
window.location.href='/pages/loggedPatientDashboard.html';
}
localStorage.removeItem("token");
setRole('patient')
window.location.href='/pages/patientDashboard.html';
}
renderHeader();