-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathleaderboard.php
More file actions
226 lines (190 loc) · 10 KB
/
Copy pathleaderboard.php
File metadata and controls
226 lines (190 loc) · 10 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<?php
session_start();
require_once "config.php";
?>
<html>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<head>
<title>Leaderboard | Crypt@trix 21.0</title>
<link href='https://fonts.googleapis.com/css?family=Raleway:400,100,200,300,400italic,500,100italic,700'
rel='stylesheet' type='text/css'>
<script src="js/fontawesome.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Dosis|Open+Sans" rel="stylesheet">
<link href='css/main.css' rel='stylesheet' type='text/css'>
<link href='css/dash.css' rel='stylesheet' type='text/css'>
<link rel="icon" href="images/ordin.png" type="image/png">
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js"
integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous">
</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.min.js"
integrity="sha384-Atwg2Pkwv9vp0ygtn1JAojH0nYbwNJLPhwyoVbhoPwBhjQPR5VtM2+xf0Uwh9KtT" crossorigin="anonymous">
</script>
<script src="https://code.jquery.com/git/jquery-git.min.js" crossorigin="anonymous">
</script>
</head>
<body onload="load()">
<!--- LOADER --->
<div class="load" id="load">
<center>
<div class="loader">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
</div>
</center>
</div>
<div class="mainBod" id="mainBod">
<!--- NAVBAR --->
<div class="navb">
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8">
<a href="index" class="logo-nav"><img src="images/ordin.png"></a>
<a class="button" href="https://discord.gg/jCvpEsCwCD" target="_blank">Join the Discord</a>
</div>
<div class="col-md-2"></div>
</div>
</div>
<!--- HOME --->
<div class="row home">
<div class="col-md-2"></div>
<div class="col-md-8">
<div class="writen center">
<h2>Leaderboard </h2>
<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link button active" id="schools-tab" data-bs-toggle="tab"
data-bs-target="#schools" type="button" role="tab" aria-controls="schools"
aria-selected="true">Schools</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link button" id="students-tab" data-bs-toggle="tab"
data-bs-target="#students" type="button" role="tab" aria-controls="students"
aria-selected="false">Students</button>
</li>
</ul>
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="schools" role="tabpanel"
aria-labelledby="schools-tab">
<div class="table-responsive">
<?php
$result = mysqli_query($link,"SELECT school, lvl, points, timest, MAX(points) AS school_score FROM users GROUP BY school ORDER BY school_score DESC, timest ASC");
echo "
<table class='table leaderboard table-borderless'>
<thead>
<tr>
<th scope='col'>Rank</th>
<th scope='col'>School Name</th>
<th scope='col'>Points</th>
</tr>
</thead>
<tbody>
<tr>
<td scope='row'>0</td>
<td>Pyrotech</td>
<td>∞</td>
</tr> ";
$rowNumber = 0;
while($row = mysqli_fetch_array($result)){
$rowNumber++;
echo "<tr>";
echo "<td scope='row'>" . $rowNumber . "</td>";
echo "<td>" . $row['school'] . "</td>";
echo "<td>". $row['school_score'] . "</td>";
echo "</tr>";
}
echo "
</tbody>
</table>
";
?>
</div>
</div>
<div class="tab-pane fade" id="students" role="tabpanel" aria-labelledby="students-tab">
<div class="table-responsive">
<?php
$result = mysqli_query($link,"SELECT username, lvl, points, timest FROM users ORDER BY points DESC, timest ASC");
echo "
<table class='table leaderboard table-borderless'>
<thead>
<tr>
<th scope='col'>Rank</th>
<th scope='col'>Username</th>
<th scope='col'>Level</th>
<th scope='col'>Points</th>
</tr>
</thead>
<tbody>
<tr>
<td scope='row'>0</td>
<td>Pyrotech</td>
<td>69420</td>
<td>∞</td>
</tr> ";
$rowNumber = 0;
while($row = mysqli_fetch_array($result)){
$rowNumber++;
echo "<tr>";
echo "<td scope='row'>" . $rowNumber . "</td>";
echo "<td>" . $row['username'] . "</td>";
echo "<td>". $row['lvl'] . "</td>";
echo "<td>". $row['points'] . "</td>";
echo "</tr>";
}
echo "
</tbody>
</table>
";
?>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-2"></div>
</div>
<br>
<!--- FOOTER --->
<div id="footer">
<center>
<div class="footer-text">
<a href="https://discord.gg/jCvpEsCwCD" class="page-links discord" target="_blank"><i
class="fab fa-discord"></i></a>
<a href="https://www.facebook.com/Ordinatrix21.0/" class="page-links facebook" target="_blank"><i
class="fab fa-facebook-square"></i></a>
<a href="https://github.com/pyrotechclub/" class="page-links github" target="_blank"><i
class="fab fa-github"></i></a>
<a href="https://www.instagram.com/ordinatrix21.0/" class="page-links instagram" target="_blank"><i
class="fab fa-instagram"></i></a>
<a href="mailto:cryptatrix@gmail.com" class="page-links email" target="_blank"><i
class="fas fa-envelope"></i></a>
<div class="footer-copy font-alt">
<a href="index">Home</a>
|
<a href="leaderboard">Leaderboard</a>
|
<a href="login">Login</a>
|
<a href="register">Register</a>
|
<a href="rules">Rules</a>
|
<a href="play">Play</a>
|
<a href="shop">Shop</a>
</div>
<div class="footer-copy font-alt">
© Pyrotech Club 2021
</div>
</div>
</center>
</div>
</div>
<script src="js/index.js"></script>
</body>
</html>