-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin_dashboard.php
More file actions
29 lines (29 loc) · 851 Bytes
/
admin_dashboard.php
File metadata and controls
29 lines (29 loc) · 851 Bytes
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
<?php
require 'db.php'; require 'auth.php';
if(!is_logged_in() || !is_admin()) header('Location: login.php');
$users = $pdo->query("SELECT * FROM users")->fetchAll();
?>
<!DOCTYPE html>
<html>
<head>
<title>Admin Panel</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.2/dist/css/bootstrap.min.css">
</head>
<body>
<?php include 'navbar.php'; ?>
<div class="container mt-4">
<h2>All Users</h2>
<table class="table">
<tr><th>ID</th><th>Name</th><th>Email</th><th>Type</th></tr>
<?php foreach($users as $u): ?>
<tr>
<td><?=$u['id']?></td>
<td><?=htmlspecialchars($u['name'])?></td>
<td><?=htmlspecialchars($u['email'])?></td>
<td><?=$u['user_type']?></td>
</tr>
<?php endforeach; ?>
</table>
</div>
</body>
</html>