Add SmartClinicManagementSystem
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
// render.js
|
||||
|
||||
function selectRole(role) {
|
||||
setRole(role);
|
||||
const token = localStorage.getItem('token');
|
||||
if (role === "admin") {
|
||||
if (token) {
|
||||
window.location.href = `/adminDashboard/${token}`;
|
||||
}
|
||||
} if (role === "patient") {
|
||||
window.location.href = "/pages/patientDashboard.html";
|
||||
} else if (role === "doctor") {
|
||||
if (token) {
|
||||
window.location.href = `/doctorDashboard/${token}`;
|
||||
} else if (role === "loggedPatient") {
|
||||
window.location.href = "loggedPatientDashboard.html";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function renderContent() {
|
||||
const role = getRole();
|
||||
if (!role) {
|
||||
window.location.href = "/"; // if no role, send to role selection page
|
||||
return;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user