68 lines
1.9 KiB
PHP
68 lines
1.9 KiB
PHP
<?php
|
|
session_start();
|
|
|
|
// If user is not logged in, redirect to login page
|
|
if (!isset($_SESSION['user_id'])) {
|
|
header('Location: login.php');
|
|
exit;
|
|
}
|
|
|
|
$userName = $_SESSION['user_fullName'] ?? 'User';
|
|
$userRole = $_SESSION['user_role'] ?? 'Role';
|
|
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Dashboard - Coho Connect</title>
|
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
|
</head>
|
|
<body>
|
|
<div class="sidebar">
|
|
<h2>Coho Connect</h2>
|
|
<nav>
|
|
<ul>
|
|
<li class="active"><a href="index.php">Dashboard</a></li>
|
|
<li><a href="orders.php">Orders</a></li>
|
|
<li><a href="hubs.php">Hubs</a></li>
|
|
<li><a href="staff.php">Staff</a></li>
|
|
<li><a href="riders.php">Riders</a></li>
|
|
<li><a href="reports.php">Reports</a></li>
|
|
</ul>
|
|
</nav>
|
|
<div class="profile-area">
|
|
<p><?php echo htmlspecialchars($userName); ?></p>
|
|
<span><?php echo htmlspecialchars($userRole); ?></span>
|
|
<a href="logout.php">Logout</a>
|
|
</div>
|
|
</div>
|
|
<div class="main-content">
|
|
<header>
|
|
<h1>Dashboard</h1>
|
|
</header>
|
|
<main>
|
|
<div class="cards-container">
|
|
<div class="card">
|
|
<h3>Total Orders</h3>
|
|
<p>0</p>
|
|
</div>
|
|
<div class="card">
|
|
<h3>Completed</h3>
|
|
<p>0</p>
|
|
</div>
|
|
<div class="card">
|
|
<h3>Pending</h3>
|
|
<p>0</p>
|
|
</div>
|
|
<div class="card">
|
|
<h3>Riders Online</h3>
|
|
<p>0</p>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
</body>
|
|
</html>
|