Spaces:
Running
Running
File size: 2,124 Bytes
052f6c9 | 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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | ```php
<?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>
``` |