new updates
Build Curio HMS / build-and-deploy (push) Successful in 44s Details

This commit is contained in:
Deep Koluguri 2026-05-14 19:13:07 -04:00
parent 4c0958a3c7
commit e0a3daa338
3 changed files with 162 additions and 2 deletions

View File

@ -206,3 +206,30 @@ window.toggleSidebar = () => {
sidebar.style.zIndex = '999'; 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');
}
});

View File

@ -41,10 +41,27 @@
const email = e.target.querySelector('input[type="text"]').value; const email = e.target.querySelector('input[type="text"]').value;
const password = e.target.querySelector('input[type="password"]').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'; window.location.href = 'dashboard.html';
} else { } 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');
} }
}; };
</script> </script>

116
super-admin.html Normal file
View File

@ -0,0 +1,116 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Super Admin | Curio Platform</title>
<link rel="stylesheet" href="index.css">
<link rel="stylesheet" href="dashboard.css">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@600;700&display=swap" rel="stylesheet">
</head>
<body class="dashboard-body">
<aside class="sidebar">
<div class="logo">
<span class="logo-icon" style="background: var(--secondary)">C</span>
<span class="logo-text">Curio Central</span>
</div>
<nav class="side-nav">
<a href="#" class="active"><span>📊</span> Platform Overview</a>
<a href="#"><span>🏥</span> Hospital Tenants</a>
<a href="#"><span>💳</span> Subscription Billing</a>
<a href="#"><span>🛡️</span> Security & Logs</a>
<a href="#"><span>⚙️</span> Global Settings</a>
</nav>
<div class="user-profile">
<div class="avatar">SA</div>
<div class="info">
<strong>Super Admin</strong>
<span>admin@curio.app</span>
</div>
</div>
<a href="login.html" class="logout-btn">🚪 Logout</a>
</aside>
<main class="dashboard-main">
<header class="dash-header">
<div class="welcome">
<h1>Platform Command Center</h1>
<p>Real-time analytics across all 12 registered hospital networks.</p>
</div>
<div class="header-actions">
<button class="btn-primary">+ Add New Hospital</button>
</div>
</header>
<section class="stats-row">
<div class="stat-card">
<span>Total Active Hospitals</span>
<h3>12</h3>
<small class="text-accent">↑ 2 this month</small>
</div>
<div class="stat-card">
<span>Total Monthly Revenue</span>
<h3>₹42,50,000</h3>
<small class="text-accent">↑ 14.5% vs Last Mo</small>
</div>
<div class="stat-card">
<span>Active Patient Profiles</span>
<h3>85,420</h3>
<small>Across all tenants</small>
</div>
<div class="stat-card">
<span>System Health</span>
<h3>99.98%</h3>
<small class="text-accent">All Regions Healthy</small>
</div>
</section>
<section class="section-card" style="margin-top: 2rem;">
<div class="card-header">
<h2>Hospital Tenants</h2>
<div class="search-bar">
<input type="text" placeholder="Search by Clinic ID or Owner..." style="width: 300px; padding: 0.6rem; border-radius: 8px; border: 1px solid var(--border);">
</div>
</div>
<table class="queue-table">
<thead>
<tr>
<th>Clinic ID</th>
<th>Name</th>
<th>Owner</th>
<th>Plan</th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td>SHARMA-01</td>
<td><strong>Dr. Sharma's Clinic</strong></td>
<td>Dr. Rahul Sharma</td>
<td><span class="badge">Premium</span></td>
<td><span class="status-pill in-room">Active</span></td>
<td><button class="btn-small">Manage</button></td>
</tr>
<tr>
<td>APOLLO-X</td>
<td><strong>Apollo Life Center</strong></td>
<td>M.K. Rao</td>
<td><span class="badge">Enterprise</span></td>
<td><span class="status-pill in-room">Active</span></td>
<td><button class="btn-small">Manage</button></td>
</tr>
<tr>
<td>LIFE-CARE</td>
<td><strong>LifeCare Hospital</strong></td>
<td>Sanjay Verma</td>
<td><span class="badge">Basic</span></td>
<td><span class="status-pill waiting">Suspended</span></td>
<td><button class="btn-small secondary">Resume</button></td>
</tr>
</tbody>
</table>
</section>
</main>
</body>
</html>