Sindbad~EG File Manager

Current Path : /home/copmadinaarea/thecopmadinaarea.org/conference/admin/
Upload File :
Current File : /home/copmadinaarea/thecopmadinaarea.org/conference/admin/index.php

<?php
require_once '../includes/functions.php';

// Check if user is logged in and has admin privileges
if (!isLoggedIn()) {
    header('Location: ' . BASE_URL . 'login.php');
    exit();
}

$user = getCurrentUser();
if (!in_array($user['role'], ['superuser', 'area_admin', 'district_admin', 'assembly_admin'])) {
    header('Location: ' . BASE_URL . 'dashboard.php');
    exit();
}

$db = new CopMadinaDB();
$conn = $db->getConnection();

// Get statistics based on user role
$stats = [];

if ($user['role'] === 'superuser') {
    // Superuser can see all statistics
    $stmt = executeQuery("SELECT COUNT(*) as count FROM areas WHERE status = 'active'");
    $stats['areas'] = $stmt ? $stmt->fetch()['count'] : 0;
    
    $stmt = executeQuery("SELECT COUNT(*) as count FROM districts WHERE status = 'active'");
    $stats['districts'] = $stmt ? $stmt->fetch()['count'] : 0;
    
    $stmt = executeQuery("SELECT COUNT(*) as count FROM assemblies WHERE status = 'active'");
    $stats['assemblies'] = $stmt ? $stmt->fetch()['count'] : 0;
    
    $stmt = executeQuery("SELECT COUNT(*) as count FROM events WHERE status = 'active'");
    $stats['events'] = $stmt ? $stmt->fetch()['count'] : 0;
    
    $stmt = executeQuery("SELECT COUNT(*) as count FROM users WHERE status = 'active'");
    $stats['users'] = $stmt ? $stmt->fetch()['count'] : 0;
    
    $stmt = executeQuery("SELECT COUNT(*) as count FROM event_registrations");
    $stats['registrations'] = $stmt ? $stmt->fetch()['count'] : 0;
    
    $stmt = executeQuery("SELECT COUNT(*) as count FROM nonmember_registrations");
    $stats['non_member_registrations'] = $stmt ? $stmt->fetch()['count'] : 0;
    
    $stmt = executeQuery("SELECT COUNT(*) as count FROM products WHERE status = 'active'");
    $stats['products'] = $stmt ? $stmt->fetch()['count'] : 0;
    
    $stmt = executeQuery("SELECT COUNT(*) as count FROM ticket_types WHERE status = 'active'");
    $stats['tickets'] = $stmt ? $stmt->fetch()['count'] : 0;
    
    $stmt = executeQuery("SELECT COUNT(*) as count FROM promo_codes WHERE status = 'active' AND valid_until > NOW()");
    $stats['promo_codes'] = $stmt ? $stmt->fetch()['count'] : 0;
} elseif ($user['role'] === 'area_admin') {
    // Area admin can see their area's statistics
    $areaId = $user['area_id'];
    $stmt = executeQuery("SELECT COUNT(*) as count FROM districts WHERE area_id = ? AND status = 'active'", [$areaId]);
    $stats['districts'] = $stmt ? $stmt->fetch()['count'] : 0;
    
    $stmt = executeQuery("SELECT COUNT(*) as count FROM assemblies WHERE district_id IN (SELECT id FROM districts WHERE area_id = ?) AND status = 'active'", [$areaId]);
    $stats['assemblies'] = $stmt ? $stmt->fetch()['count'] : 0;
    
    $stmt = executeQuery("SELECT COUNT(*) as count FROM events WHERE area_id = ? AND status = 'active'", [$areaId]);
    $stats['events'] = $stmt ? $stmt->fetch()['count'] : 0;
} elseif ($user['role'] === 'district_admin') {
    // District admin can see their district's statistics
    $districtId = $user['district_id'];
    $stmt = executeQuery("SELECT COUNT(*) as count FROM assemblies WHERE district_id = ? AND status = 'active'", [$districtId]);
    $stats['assemblies'] = $stmt ? $stmt->fetch()['count'] : 0;
    
    $stmt = executeQuery("SELECT COUNT(*) as count FROM events WHERE district_id = ? AND status = 'active'", [$districtId]);
    $stats['events'] = $stmt ? $stmt->fetch()['count'] : 0;
} elseif ($user['role'] === 'assembly_admin') {
    // Assembly admin can see their assembly's statistics
    $assemblyId = $user['assembly_id'];
    $stmt = executeQuery("SELECT COUNT(*) as count FROM events WHERE assembly_id = ? AND status = 'active'", [$assemblyId]);
    $stats['events'] = $stmt ? $stmt->fetch()['count'] : 0;
}

// Get recent activities
$recent_activities = [];
$activity_query = "
    SELECT 'event' as type, title as name, created_at, 'Created new event' as action
    FROM events 
    WHERE created_at >= DATE_SUB(NOW(), INTERVAL 7 DAY)
    ORDER BY created_at DESC 
    LIMIT 5
";
$stmt = executeQuery($activity_query);
if ($stmt) {
    $recent_activities = $stmt->fetchAll();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Admin Dashboard - COP Madina Conference</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    animation: {
                        'fade-in': 'fadeIn 0.5s ease-in-out',
                        'slide-up': 'slideUp 0.6s ease-out',
                        'pulse-slow': 'pulse 3s infinite',
                    },
                    keyframes: {
                        fadeIn: {
                            '0%': { opacity: '0', transform: 'translateY(10px)' },
                            '100%': { opacity: '1', transform: 'translateY(0)' }
                        },
                        slideUp: {
                            '0%': { opacity: '0', transform: 'translateY(20px)' },
                            '100%': { opacity: '1', transform: 'translateY(0)' }
                        }
                    }
                }
            }
        }
    </script>
</head>
<body class="bg-gradient-to-br from-slate-50 to-blue-50 min-h-screen">
    <div class="flex h-screen">
        <!-- Sidebar -->
        <?php include 'includes/admin_sidebar.php'; ?>
        
        <!-- Main Content -->
        <div class="flex-1 flex flex-col overflow-hidden ml-72">
            <!-- Modern Header -->
            <header class="bg-white/80 backdrop-blur-sm shadow-lg border-b border-slate-200/50">
                <div class="flex items-center justify-between px-8 py-6">
                    <div class="animate-fade-in">
                        <h1 class="text-3xl font-bold bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent">Admin Dashboard</h1>
                        <p class="text-slate-600 mt-1">Welcome back, <span class="font-semibold text-slate-800"><?php echo htmlspecialchars($user['first_name']); ?></span>! 👋</p>
                    </div>
                    <div class="flex items-center space-x-6">
                        <div class="flex items-center space-x-3">
                            <div class="w-2 h-2 bg-green-400 rounded-full animate-pulse"></div>
                            <span class="text-sm font-medium text-slate-600"><?php echo ucfirst(str_replace('_', ' ', $user['role'])); ?></span>
                        </div>
                        <div class="h-8 w-px bg-slate-200"></div>
                        <a href="<?php echo BASE_URL; ?>logout.php" class="flex items-center space-x-2 px-4 py-2 text-red-600 hover:text-red-700 hover:bg-red-50 rounded-lg transition-all duration-200">
                            <i class="fas fa-sign-out-alt"></i>
                            <span class="font-medium">Logout</span>
                        </a>
                    </div>
                </div>
            </header>

            <!-- Content -->
            <main class="flex-1 overflow-y-auto p-8">
                <!-- Modern Statistics Cards -->
                <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
                    <?php if ($user['role'] === 'superuser'): ?>
                    <div class="group bg-white/70 backdrop-blur-sm rounded-2xl shadow-lg hover:shadow-xl transition-all duration-300 p-6 border border-slate-200/50 hover:border-blue-300/50 animate-slide-up">
                        <div class="flex items-center justify-between">
                            <div>
                                <p class="text-sm font-semibold text-slate-600 uppercase tracking-wider">Total Areas</p>
                                <p class="text-3xl font-bold text-slate-800 mt-2"><?php echo $stats['areas']; ?></p>
                                <p class="text-xs text-emerald-600 mt-1 flex items-center">
                                    <i class="fas fa-arrow-up text-xs mr-1"></i>
                                    Active regions
                                </p>
                            </div>
                            <div class="p-4 rounded-2xl bg-gradient-to-br from-blue-500 to-blue-600 shadow-lg group-hover:shadow-blue-500/25 transition-all duration-300">
                                <i class="fas fa-map text-white text-2xl"></i>
                            </div>
                        </div>
                    </div>
                    <?php endif; ?>
                    
                    <?php if (isset($stats['districts'])): ?>
                    <div class="group bg-white/70 backdrop-blur-sm rounded-2xl shadow-lg hover:shadow-xl transition-all duration-300 p-6 border border-slate-200/50 hover:border-emerald-300/50 animate-slide-up" style="animation-delay: 0.1s">
                        <div class="flex items-center justify-between">
                            <div>
                                <p class="text-sm font-semibold text-slate-600 uppercase tracking-wider">Districts</p>
                                <p class="text-3xl font-bold text-slate-800 mt-2"><?php echo $stats['districts']; ?></p>
                                <p class="text-xs text-emerald-600 mt-1 flex items-center">
                                    <i class="fas fa-check-circle text-xs mr-1"></i>
                                    Operational
                                </p>
                            </div>
                            <div class="p-4 rounded-2xl bg-gradient-to-br from-emerald-500 to-emerald-600 shadow-lg group-hover:shadow-emerald-500/25 transition-all duration-300">
                                <i class="fas fa-building text-white text-2xl"></i>
                            </div>
                        </div>
                    </div>
                    <?php endif; ?>
                    
                    <?php if (isset($stats['assemblies'])): ?>
                    <div class="group bg-white/70 backdrop-blur-sm rounded-2xl shadow-lg hover:shadow-xl transition-all duration-300 p-6 border border-slate-200/50 hover:border-purple-300/50 animate-slide-up" style="animation-delay: 0.2s">
                        <div class="flex items-center justify-between">
                            <div>
                                <p class="text-sm font-semibold text-slate-600 uppercase tracking-wider">Assemblies</p>
                                <p class="text-3xl font-bold text-slate-800 mt-2"><?php echo $stats['assemblies']; ?></p>
                                <p class="text-xs text-emerald-600 mt-1 flex items-center">
                                    <i class="fas fa-heart text-xs mr-1"></i>
                                    Communities
                                </p>
                            </div>
                            <div class="p-4 rounded-2xl bg-gradient-to-br from-purple-500 to-purple-600 shadow-lg group-hover:shadow-purple-500/25 transition-all duration-300">
                                <i class="fas fa-church text-white text-2xl"></i>
                            </div>
                        </div>
                    </div>
                    <?php endif; ?>
                    
                    <div class="group bg-white/70 backdrop-blur-sm rounded-2xl shadow-lg hover:shadow-xl transition-all duration-300 p-6 border border-slate-200/50 hover:border-rose-300/50 animate-slide-up" style="animation-delay: 0.3s">
                        <div class="flex items-center justify-between">
                            <div>
                                <p class="text-sm font-semibold text-slate-600 uppercase tracking-wider">Events</p>
                                <p class="text-3xl font-bold text-slate-800 mt-2"><?php echo $stats['events']; ?></p>
                                <p class="text-xs text-emerald-600 mt-1 flex items-center">
                                    <i class="fas fa-calendar-check text-xs mr-1"></i>
                                    Active events
                                </p>
                            </div>
                            <div class="p-4 rounded-2xl bg-gradient-to-br from-rose-500 to-rose-600 shadow-lg group-hover:shadow-rose-500/25 transition-all duration-300">
                                <i class="fas fa-calendar text-white text-2xl"></i>
                            </div>
                        </div>
                    </div>
                    
                    <?php if (isset($stats['registrations'])): ?>
                    <div class="group bg-white/70 backdrop-blur-sm rounded-2xl shadow-lg hover:shadow-xl transition-all duration-300 p-6 border border-slate-200/50 hover:border-indigo-300/50 animate-slide-up" style="animation-delay: 0.4s">
                        <div class="flex items-center justify-between">
                            <div>
                                <p class="text-sm font-semibold text-slate-600 uppercase tracking-wider">Member Registrations</p>
                                <p class="text-3xl font-bold text-slate-800 mt-2"><?php echo $stats['registrations']; ?></p>
                                <p class="text-xs text-emerald-600 mt-1 flex items-center">
                                    <i class="fas fa-users text-xs mr-1"></i>
                                    Registered members
                                </p>
                            </div>
                            <div class="p-4 rounded-2xl bg-gradient-to-br from-indigo-500 to-indigo-600 shadow-lg group-hover:shadow-indigo-500/25 transition-all duration-300">
                                <i class="fas fa-ticket-alt text-white text-2xl"></i>
                            </div>
                        </div>
                    </div>
                    <?php endif; ?>
                    
                    <?php if (isset($stats['non_member_registrations'])): ?>
                    <div class="group bg-white/70 backdrop-blur-sm rounded-2xl shadow-lg hover:shadow-xl transition-all duration-300 p-6 border border-slate-200/50 hover:border-pink-300/50 animate-slide-up" style="animation-delay: 0.5s">
                        <div class="flex items-center justify-between">
                            <div>
                                <p class="text-sm font-semibold text-slate-600 uppercase tracking-wider">Non-Member Registrations</p>
                                <p class="text-3xl font-bold text-slate-800 mt-2"><?php echo $stats['non_member_registrations']; ?></p>
                                <p class="text-xs text-emerald-600 mt-1 flex items-center">
                                    <i class="fas fa-user-plus text-xs mr-1"></i>
                                    Guest registrations
                                </p>
                            </div>
                            <div class="p-4 rounded-2xl bg-gradient-to-br from-pink-500 to-pink-600 shadow-lg group-hover:shadow-pink-500/25 transition-all duration-300">
                                <i class="fas fa-user-plus text-white text-2xl"></i>
                            </div>
                        </div>
                    </div>
                    <?php endif; ?>
                    
                    <?php if (isset($stats['products'])): ?>
                    <div class="group bg-white/70 backdrop-blur-sm rounded-2xl shadow-lg hover:shadow-xl transition-all duration-300 p-6 border border-slate-200/50 hover:border-orange-300/50 animate-slide-up" style="animation-delay: 0.6s">
                        <div class="flex items-center justify-between">
                            <div>
                                <p class="text-sm font-semibold text-slate-600 uppercase tracking-wider">Products</p>
                                <p class="text-3xl font-bold text-slate-800 mt-2"><?php echo $stats['products']; ?></p>
                                <p class="text-xs text-emerald-600 mt-1 flex items-center">
                                    <i class="fas fa-shopping-bag text-xs mr-1"></i>
                                    Active merchandise
                                </p>
                            </div>
                            <div class="p-4 rounded-2xl bg-gradient-to-br from-orange-500 to-orange-600 shadow-lg group-hover:shadow-orange-500/25 transition-all duration-300">
                                <i class="fas fa-shopping-bag text-white text-2xl"></i>
                            </div>
                        </div>
                    </div>
                    <?php endif; ?>
                    
                    <?php if (isset($stats['tickets'])): ?>
                    <div class="group bg-white/70 backdrop-blur-sm rounded-2xl shadow-lg hover:shadow-xl transition-all duration-300 p-6 border border-slate-200/50 hover:border-blue-300/50 animate-slide-up" style="animation-delay: 0.7s">
                        <div class="flex items-center justify-between">
                            <div>
                                <p class="text-sm font-semibold text-slate-600 uppercase tracking-wider">Ticket Types</p>
                                <p class="text-3xl font-bold text-slate-800 mt-2"><?php echo $stats['tickets']; ?></p>
                                <p class="text-xs text-emerald-600 mt-1 flex items-center">
                                    <i class="fas fa-ticket-alt text-xs mr-1"></i>
                                    Active tickets
                                </p>
                            </div>
                            <div class="p-4 rounded-2xl bg-gradient-to-br from-blue-500 to-blue-600 shadow-lg group-hover:shadow-blue-500/25 transition-all duration-300">
                                <i class="fas fa-ticket-alt text-white text-2xl"></i>
                            </div>
                        </div>
                    </div>
                    <?php endif; ?>
                    
                    <?php if (isset($stats['promo_codes'])): ?>
                    <div class="group bg-white/70 backdrop-blur-sm rounded-2xl shadow-lg hover:shadow-xl transition-all duration-300 p-6 border border-slate-200/50 hover:border-green-300/50 animate-slide-up" style="animation-delay: 0.8s">
                        <div class="flex items-center justify-between">
                            <div>
                                <p class="text-sm font-semibold text-slate-600 uppercase tracking-wider">Promo Codes</p>
                                <p class="text-3xl font-bold text-slate-800 mt-2"><?php echo $stats['promo_codes']; ?></p>
                                <p class="text-xs text-emerald-600 mt-1 flex items-center">
                                    <i class="fas fa-tags text-xs mr-1"></i>
                                    Active codes
                                </p>
                            </div>
                            <div class="p-4 rounded-2xl bg-gradient-to-br from-green-500 to-green-600 shadow-lg group-hover:shadow-green-500/25 transition-all duration-300">
                                <i class="fas fa-tags text-white text-2xl"></i>
                            </div>
                        </div>
                    </div>
                    <?php endif; ?>
                </div>

                <!-- Modern Quick Actions -->
                <div class="grid grid-cols-1 lg:grid-cols-2 gap-8 mb-8">
                    <!-- Management Actions -->
                    <div class="bg-white/70 backdrop-blur-sm rounded-2xl shadow-lg p-8 border border-slate-200/50 animate-slide-up" style="animation-delay: 0.6s">
                        <h2 class="text-2xl font-bold text-slate-800 mb-6 flex items-center">
                            <div class="p-2 rounded-xl bg-gradient-to-br from-blue-500 to-purple-600 mr-3">
                                <i class="fas fa-cogs text-white"></i>
                            </div>
                            Management Actions
                        </h2>
                        
                        <div class="grid grid-cols-1 gap-4">
                            <?php if ($user['role'] === 'superuser'): ?>
                            <a href="areas.php" class="group bg-gradient-to-r from-blue-50 to-blue-100 hover:from-blue-100 hover:to-blue-200 border border-blue-200 rounded-xl p-4 transition-all duration-300 hover:shadow-lg">
                                <div class="flex items-center">
                                    <div class="p-3 rounded-xl bg-blue-500 text-white group-hover:bg-blue-600 transition-colors">
                                        <i class="fas fa-map text-lg"></i>
                                    </div>
                                    <div class="ml-4">
                                        <h3 class="font-bold text-slate-800">Manage Areas</h3>
                                        <p class="text-sm text-slate-600">Add, edit, or remove areas</p>
                                    </div>
                                    <i class="fas fa-chevron-right text-blue-500 ml-auto group-hover:translate-x-1 transition-transform"></i>
                                </div>
                            </a>
                            <?php endif; ?>

                            <?php if (in_array($user['role'], ['superuser', 'area_admin'])): ?>
                            <a href="districts.php" class="group bg-gradient-to-r from-emerald-50 to-emerald-100 hover:from-emerald-100 hover:to-emerald-200 border border-emerald-200 rounded-xl p-4 transition-all duration-300 hover:shadow-lg">
                                <div class="flex items-center">
                                    <div class="p-3 rounded-xl bg-emerald-500 text-white group-hover:bg-emerald-600 transition-colors">
                                        <i class="fas fa-building text-lg"></i>
                                    </div>
                                    <div class="ml-4">
                                        <h3 class="font-bold text-slate-800">Manage Districts</h3>
                                        <p class="text-sm text-slate-600">Add, edit, or remove districts</p>
                                    </div>
                                    <i class="fas fa-chevron-right text-emerald-500 ml-auto group-hover:translate-x-1 transition-transform"></i>
                                </div>
                            </a>
                            <?php endif; ?>

                            <?php if (in_array($user['role'], ['superuser', 'area_admin', 'district_admin'])): ?>
                            <a href="assemblies.php" class="group bg-gradient-to-r from-purple-50 to-purple-100 hover:from-purple-100 hover:to-purple-200 border border-purple-200 rounded-xl p-4 transition-all duration-300 hover:shadow-lg">
                                <div class="flex items-center">
                                    <div class="p-3 rounded-xl bg-purple-500 text-white group-hover:bg-purple-600 transition-colors">
                                        <i class="fas fa-church text-lg"></i>
                                    </div>
                                    <div class="ml-4">
                                        <h3 class="font-bold text-slate-800">Manage Assemblies</h3>
                                        <p class="text-sm text-slate-600">Add, edit, or remove assemblies</p>
                                    </div>
                                    <i class="fas fa-chevron-right text-purple-500 ml-auto group-hover:translate-x-1 transition-transform"></i>
                                </div>
                            </a>
                            <?php endif; ?>

                            <a href="events.php" class="group bg-gradient-to-r from-rose-50 to-rose-100 hover:from-rose-100 hover:to-rose-200 border border-rose-200 rounded-xl p-4 transition-all duration-300 hover:shadow-lg">
                                <div class="flex items-center">
                                    <div class="p-3 rounded-xl bg-rose-500 text-white group-hover:bg-rose-600 transition-colors">
                                        <i class="fas fa-calendar text-lg"></i>
                                    </div>
                                    <div class="ml-4">
                                        <h3 class="font-bold text-slate-800">Manage Events</h3>
                                        <p class="text-sm text-slate-600">Create and manage events</p>
                                    </div>
                                    <i class="fas fa-chevron-right text-rose-500 ml-auto group-hover:translate-x-1 transition-transform"></i>
                                </div>
                            </a>

                            <a href="merchandise.php" class="group bg-gradient-to-r from-orange-50 to-orange-100 hover:from-orange-100 hover:to-orange-200 border border-orange-200 rounded-xl p-4 transition-all duration-300 hover:shadow-lg">
                                <div class="flex items-center">
                                    <div class="p-3 rounded-xl bg-orange-500 text-white group-hover:bg-orange-600 transition-colors">
                                        <i class="fas fa-shopping-bag text-lg"></i>
                                    </div>
                                    <div class="ml-4">
                                        <h3 class="font-bold text-slate-800">Manage Merchandise</h3>
                                        <p class="text-sm text-slate-600">Add and manage event products</p>
                                    </div>
                                    <i class="fas fa-chevron-right text-orange-500 ml-auto group-hover:translate-x-1 transition-transform"></i>
                                </div>
                            </a>

                            <a href="tickets.php" class="group bg-gradient-to-r from-blue-50 to-blue-100 hover:from-blue-100 hover:to-blue-200 border border-blue-200 rounded-xl p-4 transition-all duration-300 hover:shadow-lg">
                                <div class="flex items-center">
                                    <div class="p-3 rounded-xl bg-blue-500 text-white group-hover:bg-blue-600 transition-colors">
                                        <i class="fas fa-ticket-alt text-lg"></i>
                                    </div>
                                    <div class="ml-4">
                                        <h3 class="font-bold text-slate-800">Manage Tickets</h3>
                                        <p class="text-sm text-slate-600">Create and manage ticket types</p>
                                    </div>
                                    <i class="fas fa-chevron-right text-blue-500 ml-auto group-hover:translate-x-1 transition-transform"></i>
                                </div>
                            </a>

                            <a href="promo-codes.php" class="group bg-gradient-to-r from-green-50 to-green-100 hover:from-green-100 hover:to-green-200 border border-green-200 rounded-xl p-4 transition-all duration-300 hover:shadow-lg">
                                <div class="flex items-center">
                                    <div class="p-3 rounded-xl bg-green-500 text-white group-hover:bg-green-600 transition-colors">
                                        <i class="fas fa-tags text-lg"></i>
                                    </div>
                                    <div class="ml-4">
                                        <h3 class="font-bold text-slate-800">Manage Promo Codes</h3>
                                        <p class="text-sm text-slate-600">Create discount codes for events</p>
                                    </div>
                                    <i class="fas fa-chevron-right text-green-500 ml-auto group-hover:translate-x-1 transition-transform"></i>
                                </div>
                            </a>

                            <a href="check-in.php" class="group bg-gradient-to-r from-indigo-50 to-indigo-100 hover:from-indigo-100 hover:to-indigo-200 border border-indigo-200 rounded-xl p-4 transition-all duration-300 hover:shadow-lg">
                                <div class="flex items-center">
                                    <div class="p-3 rounded-xl bg-indigo-500 text-white group-hover:bg-indigo-600 transition-colors">
                                        <i class="fas fa-sign-in-alt text-lg"></i>
                                    </div>
                                    <div class="ml-4">
                                        <h3 class="font-bold text-slate-800">Event Check-In</h3>
                                        <p class="text-sm text-slate-600">Manage attendee check-in/out</p>
                                    </div>
                                    <i class="fas fa-chevron-right text-indigo-500 ml-auto group-hover:translate-x-1 transition-transform"></i>
                                </div>
                            </a>
                        </div>
                    </div>

                    <!-- Recent Activity -->
                    <div class="bg-white/70 backdrop-blur-sm rounded-2xl shadow-lg p-8 border border-slate-200/50 animate-slide-up" style="animation-delay: 0.7s">
                        <h2 class="text-2xl font-bold text-slate-800 mb-6 flex items-center">
                            <div class="p-2 rounded-xl bg-gradient-to-br from-indigo-500 to-cyan-600 mr-3">
                                <i class="fas fa-clock text-white"></i>
                            </div>
                            Recent Activity
                        </h2>
                        
                        <div class="space-y-4">
                            <?php if (!empty($recent_activities)): ?>
                                <?php foreach ($recent_activities as $activity): ?>
                                <div class="flex items-center p-4 bg-slate-50 rounded-xl border border-slate-200">
                                    <div class="p-2 rounded-lg bg-blue-100">
                                        <i class="fas fa-calendar text-blue-600"></i>
                                    </div>
                                    <div class="ml-4 flex-1">
                                        <p class="font-medium text-slate-800"><?php echo htmlspecialchars($activity['action']); ?></p>
                                        <p class="text-sm text-slate-600"><?php echo htmlspecialchars($activity['name']); ?> - <?php echo date('M j, Y', strtotime($activity['created_at'])); ?></p>
                                    </div>
                                </div>
                                <?php endforeach; ?>
                            <?php else: ?>
                            <div class="text-center py-8">
                                <i class="fas fa-clock text-4xl text-slate-300 mb-4"></i>
                                <p class="text-slate-500">No recent activity</p>
                            </div>
                            <?php endif; ?>
                        </div>
                        
                        <div class="mt-6">
                            <a href="reports.php" class="flex items-center justify-center w-full px-4 py-3 bg-gradient-to-r from-indigo-500 to-cyan-600 text-white rounded-xl hover:from-indigo-600 hover:to-cyan-700 transition-all duration-300 font-medium">
                                <i class="fas fa-chart-line mr-2"></i>
                                View Full Reports
                            </a>
                        </div>
                    </div>
                </div>
            </main>
        </div>
    </div>
</body>
</html>

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists