query("SELECT COUNT(*) FROM users")->fetchColumn(); $lpas_count = $db->query("SELECT COUNT(*) FROM lpa_applications")->fetchColumn(); // Get all users $users = $db->query("SELECT * FROM users ORDER BY created_at DESC LIMIT 50")->fetchAll(); // Get all LPAs $lpas = $db->query("SELECT * FROM lpa_applications ORDER BY created_at DESC LIMIT 50")->fetchAll(); // Get migration history try { $migration_history = $db->query("SELECT * FROM migration_history ORDER BY executed_at DESC")->fetchAll(); } catch (PDOException $e) { $migration_history = []; } // Get backups from filesystem $backups_dir = __DIR__ . '/backups'; if (is_dir($backups_dir)) { $backup_files = glob($backups_dir . '/backup_*.sql'); foreach ($backup_files as $file) { $backups[] = [ 'filename' => basename($file), 'size' => round(filesize($file) / 1024, 2) . ' KB', 'created_at' => filemtime($file) ]; } // Sort by created_at descending usort($backups, function($a, $b) { return $b['created_at'] - $a['created_at']; }); } } catch (PDOException $e) { error_log($e->getMessage()); } ?> Admin Dashboard — <?php echo htmlspecialchars($project_name); ?>

System Administration

Overview of all users and applications in the system.

Total Users

Total Applications

Recent Users
Name Email Role Credits Verified Actions
Yes No
Recent Applications
0): ?>
Type Donor Progress Status Actions
ID: #
%
PDF
No applications found.
Migration History
0): ?>
File Name Executed At
No migration history found. Run migrations to initialize.
Backups
Last 5 kept
0): ?>
File Name Size Actions
Download
No backups found. Backups are created automatically before migrations.