From e0a3daa338ec749fc4de57f6d9e9562429b21662 Mon Sep 17 00:00:00 2001 From: Deep Koluguri Date: Thu, 14 May 2026 19:13:07 -0400 Subject: [PATCH] new updates --- dashboard.js | 27 +++++++++++ login.html | 21 ++++++++- super-admin.html | 116 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 162 insertions(+), 2 deletions(-) create mode 100644 super-admin.html 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 @@ + + + + + + Super Admin | Curio Platform + + + + + + + +
+
+
+

Platform Command Center

+

Real-time analytics across all 12 registered hospital networks.

+
+
+ +
+
+ +
+
+ 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 +
+
+ +
+
+

Hospital Tenants

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Clinic IDNameOwnerPlanStatusActions
SHARMA-01Dr. Sharma's ClinicDr. Rahul SharmaPremiumActive
APOLLO-XApollo Life CenterM.K. RaoEnterpriseActive
LIFE-CARELifeCare HospitalSanjay VermaBasicSuspended
+
+
+ +