forked from Lake-Tuggeranong-College/CyberCity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
leaderboard.php
55 lines (43 loc) · 1.27 KB
/
leaderboard.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
48
49
50
51
52
53
<?php include "template.php";
/** @var $conn */
$sec = 5;
$page = $_SERVER['PHP_SELF'];
if (!authorisedAccess(true, true, true)) {
header("Location:index.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="<?php echo $sec ?>;URL='<?php echo $page ?>'">
<title>Cyber City - Leaderboard</title>
</head>
<body>
<h1 class='text-primary'>Leaderboard</h1>
<div class="table-responsive">
<!--<table class="table table-bordered">
<thead>
<tr>
<th>Username</th>
<th>Score</th>
</thead>-->
<div class="container-fluid">
<div class="row">
<div class="col-2 border border border-dark">Username</div>
<div class="col-1 border border border-dark">Score</div>
</div>
</body>
</html>
<?php
$scoreList = $conn->query("SELECT Username, Score FROM Users WHERE AccessLevel=1 AND Enabled=1 ORDER BY Score DESC");
while ($scoreData = $scoreList->fetch()) {
if ($scoreData[1] != 0) {
echo "<div class='row'>";
echo "<div class='col-2 border border border-dark''>" . $scoreData[0] . "</div>";
echo "<div class='col-1 border border border-dark''>" . $scoreData[1] . "</div>";
echo "</div>";
}
}
?>
</div>
<?php echo outputFooter(); ?>