-
Notifications
You must be signed in to change notification settings - Fork 1
/
admins.php
47 lines (47 loc) · 1.55 KB
/
admins.php
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
<?php
session_start();
require "config/config.php";
if (!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true) {
header("location: login.php?redirect_link=admins.php");
exit;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height">
<title>Admins</title>
<link rel="shortcut icon" href="logos/logo.png" type="image/x-icon">
<link rel="stylesheet" href="css/general2.css?v=<?php echo time(); ?>">
</head>
<body>
<?php require_once("header.php"); ?>
<div style="margin: 20px;">
<h1>Admins</h1>
<?php
$admins = 0;
if (isset($_SESSION['username'])) {
$sql = "SELECT * FROM `users` WHERE admin=1";
$query = mysqli_query($link, $sql);
if (mysqli_num_rows($query) > 0) {
while ($row = mysqli_fetch_assoc($query)) {
$file = $row['file'];
$id = $row['id'];
$username = $row['username'];
echo "
<div class='boxes'>
<img id='image' src='$file' alt='Profile'>
<a id='link-profile' href='profile.php?id=$id'>$username</a>
</div><br>
";
$admins ++;
}
}
}
echo "<div class='boxes'><span style='color: black;'>Total admins: $admins</span></div>";
?>
</div>
</body>
</html>