| Server IP : 127.0.0.1 / Your IP : 216.73.216.48 Web Server : Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12 System : Windows NT DESKTOP-3H4FHQJ 10.0 build 19045 (Windows 10) AMD64 User : win 10 ( 0) PHP Version : 8.2.12 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : D:/xampp/htdocs-coblaa/Cinevaa/ |
Upload File : |
<?php
session_start();
include('db.php');
// Security Check
if (!isset($_SESSION['my_id'])) {
header("Location: login.php");
exit();
}
// Fetch Statistics
$total_admins = mysqli_fetch_assoc(mysqli_query($con, "SELECT COUNT(*) as total FROM admins"))['total'];
$total_editors = mysqli_fetch_assoc(mysqli_query($con, "SELECT COUNT(*) as total FROM admins WHERE role='editor'"))['total'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<title>Admin Dashboard</title>
</head>
<body class="bg-light">
<div class="container mt-4">
<h2 class="mb-4">System Overview</h2>
<div class="row">
<div class="col-md-4">
<div class="card text-white bg-primary mb-3 shadow">
<div class="card-body text-center">
<h5 class="card-title">Total Staff</h5>
<p class="display-4 font-weight-bold"><?php echo $total_admins; ?></p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card text-white bg-info mb-3 shadow">
<div class="card-body text-center">
<h5 class="card-title">Active Editors</h5>
<p class="display-4 font-weight-bold"><?php echo $total_editors; ?></p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card text-white bg-success mb-3 shadow">
<div class="card-body text-center">
<h5 class="card-title">System Status</h5>
<p class="h4 mt-3">Online</p>
<small>XAMPP / PHP 8.x</small>
</div>
</div>
</div>
</div>
<div class="row mt-4">
<div class="col-md-12">
<div class="card shadow-sm">
<div class="card-header bg-white"><strong>Quick Links</strong></div>
<div class="card-body">
<a href="admin_temp" class="btn btn-outline-dark">Manage Admins</a>
<a href="add_admin" class="btn btn-outline-dark">Add New User</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>