-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdashboard.php
More file actions
32 lines (31 loc) · 1.04 KB
/
dashboard.php
File metadata and controls
32 lines (31 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php include_once("includes/db_connection.php"); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dashboard</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="dashboard-container">
<?php
// Check if user is logged in
session_start();
if(isset($_SESSION['username'])) {
echo "<h2>Welcome, ".$_SESSION['username']."</h2>";
// Display appropriate dashboard based on user type
if($_SESSION['user_type'] == "admin") {
header("Location: admin/admin_dashboard.php");
} elseif($_SESSION['user_type'] == "guide") {
header("Location: guide/guide_dashboard.php");
} elseif($_SESSION['user_type'] == "student") {
header("Location: student/student_dashboard.php");
}
} else {
header("Location: login.php");
}
?>
</div>
</body>
</html>