36694-vm/dashboard.php
Flatlogic Bot c12628e2d9 v2
2025-12-05 21:07:12 +00:00

65 lines
2.1 KiB
PHP

<?php
session_start();
// Check if user is logged in
if (!isset($_SESSION['user_id'])) {
header("Location: login.php");
exit;
}
$user_type = $_SESSION['user_type'];
$page_title = ucfirst($user_type) . " Dashboard";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?= htmlspecialchars($page_title) ?> - Organ Donation</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="assets/css/custom.css">
</head>
<body>
<header class="header bg-primary text-white text-center py-4">
<div class="container">
<h1 class="display-4">Organ Donation Management</h1>
<nav class="nav justify-content-center">
<a class="nav-link text-white" href="dashboard.php">Dashboard</a>
<?php if ($user_type === 'donor'): ?>
<a class="nav-link text-white" href="edit_donor_profile.php">Edit Profile</a>
<?php endif; ?>
<a class="nav-link text-white" href="logout.php">Logout</a>
</nav>
</div>
</header>
<main class="container my-5">
<?php
switch ($user_type) {
case 'donor':
include 'donor_dashboard_content.php';
break;
case 'hospital':
include 'hospital_dashboard_content.php';
break;
case 'admin':
echo '<h2 class="text-center">Welcome, Admin!</h2>';
break;
default:
echo '<p class="text-center">Invalid user type.</p>';
break;
}
?>
</main>
<footer class="footer bg-light text-center py-3 mt-5">
<div class="container">
<p class="mb-0">&copy; <?= date("Y") ?> Organ Donation Management System. All Rights Reserved.</p>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>