171 lines
12 KiB
PHP
171 lines
12 KiB
PHP
<?php
|
|
session_start();
|
|
$isLoggedIn = isset($_SESSION['user_id']);
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title><?php echo $_SERVER['PROJECT_NAME'] ?? 'MedicalLink'; ?> - Secure Clinical Chat</title>
|
|
<meta name="description" content="Secure internal communication for healthcare professionals.">
|
|
|
|
<!-- Bootstrap 5 CDN -->
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<!-- Custom CSS -->
|
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
|
<!-- Inter Font -->
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
|
|
</head>
|
|
<body class="<?php echo $isLoggedIn ? 'bg-white' : 'bg-light'; ?>">
|
|
|
|
<?php if (!$isLoggedIn): ?>
|
|
<div class="container">
|
|
<div class="row min-vh-100 align-items-center justify-content-center py-5">
|
|
<div class="col-12 col-md-8 col-lg-5">
|
|
<div class="login-card p-4 p-md-5">
|
|
<div class="hospital-logo mb-4">
|
|
<div class="logo-icon">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"/></svg>
|
|
</div>
|
|
<span class="ms-2 h4 mb-0 fw-bold">MedicalLink</span>
|
|
</div>
|
|
|
|
<h2 class="h4 mb-1 fw-bold">Clinical Access</h2>
|
|
<p class="text-muted small mb-4">Sign in with your clinical credentials.</p>
|
|
|
|
<div id="loginAlert" class="alert alert-danger d-none"></div>
|
|
|
|
<form id="loginForm">
|
|
<div class="mb-3">
|
|
<label for="email" class="form-label small fw-semibold">Clinical Email</label>
|
|
<input type="email" class="form-control" id="email" name="email" placeholder="name@medlink.com" required>
|
|
</div>
|
|
<div class="mb-4">
|
|
<div class="d-flex justify-content-between">
|
|
<label for="password" class="form-label small fw-semibold">Password</label>
|
|
<a href="#" class="small text-decoration-none">Forgot?</a>
|
|
</div>
|
|
<input type="password" class="form-control" id="password" name="password" placeholder="••••••••" required>
|
|
</div>
|
|
<button type="submit" class="btn btn-primary w-100 py-2 fw-semibold">Sign In</button>
|
|
</form>
|
|
|
|
<div class="mt-5">
|
|
<div class="d-flex align-items-center mb-3">
|
|
<hr class="flex-grow-1 text-muted opacity-25">
|
|
<span class="mx-3 text-muted small fw-medium uppercase">Demo Accounts</span>
|
|
<hr class="flex-grow-1 text-muted opacity-25">
|
|
</div>
|
|
<div class="row g-2" id="demoAccounts">
|
|
<div class="col-6">
|
|
<button class="btn btn-outline-light text-dark border w-100 py-2 small demo-btn"
|
|
data-email="sarah.mitchell@medlink.com" data-pass="password">
|
|
Dr. Mitchell
|
|
</button>
|
|
</div>
|
|
<div class="col-6">
|
|
<button class="btn btn-outline-light text-dark border w-100 py-2 small demo-btn"
|
|
data-email="james.wilson@medlink.com" data-pass="password">
|
|
Nurse Wilson
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php else: ?>
|
|
<div class="dashboard-layout">
|
|
<aside class="sidebar">
|
|
<div class="sidebar-header p-3 border-bottom d-flex align-items-center justify-content-between">
|
|
<div class="hospital-logo mb-0">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"/></svg>
|
|
<span class="fw-bold ms-1">MedicalLink</span>
|
|
</div>
|
|
</div>
|
|
<div class="p-3">
|
|
<div class="text-muted small mb-3 text-uppercase fw-bold" style="font-size: 10px; letter-spacing: 0.05em;">Channels & Staff</div>
|
|
<div class="list-group list-group-flush gap-1">
|
|
<a href="#" class="list-group-item list-group-item-action rounded border-0 py-2 px-3 active">
|
|
<span class="small fw-medium"># General Ward</span>
|
|
</a>
|
|
<a href="#" class="list-group-item list-group-item-action rounded border-0 py-2 px-3">
|
|
<span class="small fw-medium"># Emergency Room</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</aside>
|
|
|
|
<main class="main-content d-flex flex-column">
|
|
<header class="main-header p-3 border-bottom d-flex align-items-center justify-content-between bg-white sticky-top">
|
|
<div class="d-flex align-items-center gap-2">
|
|
<div class="bg-primary bg-opacity-10 text-primary rounded-circle p-2 d-flex align-items-center justify-content-center" style="width: 36px; height: 36px;">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="9" cy="7" r="4"></circle><path d="M23 21v-2a4 4 0 0 0-3-3.87"></path><path d="M16 3.13a4 4 0 0 1 0 7.75"></path></svg>
|
|
</div>
|
|
<div>
|
|
<h6 class="mb-0 fw-bold">General Ward</h6>
|
|
<span class="text-success small d-flex align-items-center gap-1">
|
|
<span class="bg-success rounded-circle" style="width: 6px; height: 6px;"></span>
|
|
12 Active Staff
|
|
</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="d-flex align-items-center gap-3">
|
|
<div class="text-end d-none d-sm-block">
|
|
<div class="fw-bold small"><?php echo htmlspecialchars($_SESSION['user_name']); ?></div>
|
|
<div class="text-muted" style="font-size: 11px;"><?php echo ucwords(str_replace('_', ' ', $_SESSION['user_role'])); ?></div>
|
|
</div>
|
|
<div class="dropdown">
|
|
<button class="btn btn-link p-0 text-dark dropdown-toggle no-caret" data-bs-toggle="dropdown">
|
|
<div class="bg-light rounded-circle border d-flex align-items-center justify-content-center fw-bold text-primary" style="width: 36px; height: 36px; font-size: 14px;">
|
|
<?php
|
|
$names = explode(' ', $_SESSION['user_name']);
|
|
echo strtoupper(substr($names[0], 0, 1) . (isset($names[1]) ? substr($names[1], 0, 1) : ''));
|
|
?>
|
|
</div>
|
|
</button>
|
|
<ul class="dropdown-menu dropdown-menu-end shadow-sm border-0">
|
|
<li><a class="dropdown-item py-2 small" href="#"><svg class="me-2" xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg> Profile</a></li>
|
|
<li><hr class="dropdown-divider opacity-50"></li>
|
|
<li><a class="dropdown-item py-2 small text-danger" href="auth.php?action=logout"><svg class="me-2" xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line></svg> Sign Out</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<div class="flex-grow-1 overflow-auto p-4 d-flex align-items-center justify-content-center bg-light bg-opacity-50">
|
|
<div class="text-center" style="max-width: 400px;">
|
|
<div class="mb-4 bg-white p-4 rounded-circle shadow-sm d-inline-block">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="#3b82f6" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>
|
|
</div>
|
|
<h3 class="fw-bold">Seamless Collaboration</h3>
|
|
<p class="text-muted">Select a colleague or channel from the sidebar to start sharing clinical updates and patient data securely.</p>
|
|
<button class="btn btn-primary mt-3 px-4 py-2 fw-semibold shadow-sm">Start New Thread</button>
|
|
</div>
|
|
</div>
|
|
|
|
<footer class="p-3 border-top bg-white">
|
|
<div class="d-flex align-items-center gap-2">
|
|
<button class="btn btn-light rounded-circle p-2 d-flex align-items-center justify-content-center" style="width: 40px; height: 40px;">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>
|
|
</button>
|
|
<input type="text" class="form-control border-0 bg-light py-2 px-3" placeholder="Type a message to General Ward...">
|
|
<button class="btn btn-primary rounded-circle p-2 d-flex align-items-center justify-content-center" style="width: 40px; height: 40px;">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg>
|
|
</button>
|
|
</div>
|
|
</footer>
|
|
</main>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<!-- Bootstrap Bundle with Popper -->
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
<!-- Custom JS -->
|
|
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
|
</body>
|
|
</html>
|