40 lines
1.2 KiB
PHP
40 lines
1.2 KiB
PHP
<?php
|
|
if (session_status() === PHP_SESSION_NONE) {
|
|
session_start();
|
|
}
|
|
|
|
// Ensure user is logged in and is an admin
|
|
if (!isset($_SESSION['user_id']) || $_SESSION['user_role'] !== 'admin') {
|
|
header("Location: login.php");
|
|
exit;
|
|
}
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Admin 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="d-flex justify-content-between align-items-center">
|
|
<h1>Admin Dashboard</h1>
|
|
<a href="logout.php" class="btn btn-danger">Logout</a>
|
|
</div>
|
|
<hr>
|
|
<p>Welcome, <?php echo htmlspecialchars($_SESSION['user_name']); ?>!</p>
|
|
<p>This is the admin dashboard. You can manage users, products, and site settings from here.</p>
|
|
|
|
<!-- Add Admin-specific content here -->
|
|
|
|
</div>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
|
</body>
|
|
</html>
|