35067-vm/dashboard.php
Flatlogic Bot b200618254 eco-grow
2025-10-20 06:45:18 +00:00

46 lines
1.5 KiB
PHP

<?php
session_start();
// This is the CUSTOMER dashboard.
// Only users with the 'customer' role should be here.
// If user is not logged in, or is not a customer, redirect them.
if (!isset($_SESSION['user_id']) || $_SESSION['user_role'] !== 'customer') {
header("Location: login.php");
exit;
}
$user_name = $_SESSION['user_name'] ?? 'Customer';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Customer Dashboard</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="assets/css/custom.css">
</head>
<body>
<?php include 'includes/header.php'; ?>
<div class="container mt-5">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h2>Customer Dashboard</h2>
</div>
<div class="card-body">
<h1>Welcome, <?php echo htmlspecialchars($user_name); ?>!</h1>
<p>This is your personal dashboard. You can view your orders and manage your account here.</p>
<p><a href="products.php" class="btn btn-primary">Start Shopping</a></p>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>