diff --git a/dashboard.js b/dashboard.js
index 503fd8d..8d1b81c 100644
--- a/dashboard.js
+++ b/dashboard.js
@@ -206,3 +206,30 @@ window.toggleSidebar = () => {
sidebar.style.zIndex = '999';
}
};
+
+// Role-Based UI Filtering (Run on Load)
+document.addEventListener("DOMContentLoaded", () => {
+ const userRole = localStorage.getItem('userRole') || 'OWNER';
+ const userEmail = localStorage.getItem('userEmail') || 'admin@curio.app';
+
+ const roleDisplay = document.querySelector(".user-profile .info strong");
+ const emailDisplay = document.querySelector(".user-profile .info span");
+ if (roleDisplay) roleDisplay.innerText = userRole.charAt(0) + userRole.slice(1).toLowerCase();
+ if (emailDisplay) emailDisplay.innerText = userEmail;
+
+ if (userRole === 'DOCTOR') {
+ document.querySelectorAll('.side-nav a').forEach(link => {
+ if (link.innerText.includes('Billing') || link.innerText.includes('Staff')) {
+ link.style.display = 'none';
+ }
+ });
+ showSection('queue');
+ } else if (userRole === 'RECEPTIONIST') {
+ document.querySelectorAll('.side-nav a').forEach(link => {
+ if (link.innerText.includes('Lab') || link.innerText.includes('Staff')) {
+ link.style.display = 'none';
+ }
+ });
+ showSection('overview');
+ }
+});
diff --git a/login.html b/login.html
index 17ab344..ccee677 100644
--- a/login.html
+++ b/login.html
@@ -41,10 +41,27 @@
const email = e.target.querySelector('input[type="text"]').value;
const password = e.target.querySelector('input[type="password"]').value;
- if (email === 'deepkoluguri@gmail.com' && password === 'password123') {
+ // System Admin
+ if (email === 'admin@curio.app' && password === 'superadmin') {
+ localStorage.setItem('userRole', 'SUPER_ADMIN');
+ window.location.href = 'super-admin.html';
+ return;
+ }
+
+ // Mock Hospital Users
+ const users = {
+ 'owner@sharma.clinic': { role: 'OWNER', pass: 'owner123' },
+ 'doctor@sharma.clinic': { role: 'DOCTOR', pass: 'doc123' },
+ 'rec@sharma.clinic': { role: 'RECEPTIONIST', pass: 'rec123' }
+ };
+
+ const user = users[email];
+ if (user && user.pass === password) {
+ localStorage.setItem('userRole', user.role);
+ localStorage.setItem('userEmail', email);
window.location.href = 'dashboard.html';
} else {
- alert('Invalid credentials. Hint: deepkoluguri@gmail.com / password123');
+ alert('Invalid credentials.\n\nTry:\n- doctor@sharma.clinic / doc123\n- rec@sharma.clinic / rec123\n- admin@curio.app / superadmin');
}
};
diff --git a/super-admin.html b/super-admin.html
new file mode 100644
index 0000000..9726f41
--- /dev/null
+++ b/super-admin.html
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+ Total Active Hospitals
+
12
+ ↑ 2 this month
+
+
+ Total Monthly Revenue
+
₹42,50,000
+ ↑ 14.5% vs Last Mo
+
+
+ Active Patient Profiles
+
85,420
+ Across all tenants
+
+
+ System Health
+
99.98%
+ All Regions Healthy
+
+
+
+
+
+
+
+
+ | Clinic ID |
+ Name |
+ Owner |
+ Plan |
+ Status |
+ Actions |
+
+
+
+
+ | SHARMA-01 |
+ Dr. Sharma's Clinic |
+ Dr. Rahul Sharma |
+ Premium |
+ Active |
+ |
+
+
+ | APOLLO-X |
+ Apollo Life Center |
+ M.K. Rao |
+ Enterprise |
+ Active |
+ |
+
+
+ | LIFE-CARE |
+ LifeCare Hospital |
+ Sanjay Verma |
+ Basic |
+ Suspended |
+ |
+
+
+
+
+
+
+