This repository has been archived by the owner on Oct 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.php
46 lines (41 loc) · 1.67 KB
/
admin.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
<!DOCTYPE html>
<html>
<?php include'resources/head.php'; ?>
<body>
<?php include'resources/navbar.php'; ?>
<div class="container" style="margin-top:100px; background-color: white; border-radius: 5px">
<table class="table table-striped">
<thead>
<tr>
<th>User</th>
<th>Email</th>
<th>Admin</th>
</tr>
</thead>
<tbody>
<?php
include 'config.php';
$con = mysqli_connect($conf['url'], $conf['user'], $conf['password'], $conf['database']);
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con, "SELECT * FROM " . $conf['auth-table']);
while ($row = mysqli_fetch_array($result)) {
echo '<tr>
<td>' . $row['username'] . '</td>
<td>' . $row['email'] . '</td>';
if ($row['admin'] == "1") {
echo'
<td><span class="glyphicon glyphicon-ok" style="color: green"></td>
</tr>';
} else {
echo '<td ><span class="glyphicon glyphicon-remove" style="color: #a94442"></td></tr>';
}
}
?>
</tbody>
</table>
</div>
<?php include 'resources/foot.php'; ?>
</body>
</html>