Spaces:
Running
Running
| ```php | |
| session_start(); | |
| require_once 'includes/config.php'; | |
| // Redirect to login if not authenticated | |
| 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 | CommunityPulse Hub</title> | |
| <link rel="stylesheet" href="style.css"> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://unpkg.com/feather-icons"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> | |
| </head> | |
| <body class="bg-gray-50 min-h-screen flex flex-col"> | |
| <custom-navbar></custom-navbar> | |
| <main class="flex-grow container mx-auto px-4 py-8"> | |
| <div class="mb-8 flex justify-between items-center"> | |
| <h1 class="text-2xl font-bold text-gray-800">Admin Dashboard</h1> | |
| <div class="flex gap-4"> | |
| <button class="bg-primary-500 hover:bg-primary-600 text-white px-4 py-2 rounded-md flex items-center gap-2 transition duration-300"> | |
| <i data-feather="plus"></i> | |
| Add Record | |
| </button> | |
| <button class="bg-secondary-500 hover:bg-secondary-600 text-white px-4 py-2 rounded-md flex items-center gap-2 transition duration-300"> | |
| <i data-feather="download"></i> | |
| Export | |
| </button> | |
| </div> | |
| </div> | |
| <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8"> | |
| <!-- Dashboard cards remain the same --> | |
| </div> | |
| <div class="grid grid-cols-1 lg:grid-cols-3 gap-6"> | |
| <!-- Dashboard content remains the same --> | |
| </div> | |
| </main> | |
| <custom-footer></custom-footer> | |
| <script src="components/navbar.js"></script> | |
| <script src="components/footer.js"></script> | |
| <script src="script.js"></script> | |
| <script> | |
| feather.replace(); | |
| </script> | |
| </body> | |
| </html> | |
| ``` |