diff options
author | BlueRaja <BlueRaja.admin@gmail.com> | 2013-01-13 00:43:06 -0600 |
---|---|---|
committer | BlueRaja <BlueRaja.admin@gmail.com> | 2013-01-13 00:43:06 -0600 |
commit | f972ce9c56f0bf2201cd302c0055c6ebd06be34b (patch) | |
tree | f157e660070c8100a07f5cbe3c5334d90241ea1d /pages/admin.php | |
parent | 38038e0a1582facb70a47ae3162db6e10ca831f5 (diff) | |
download | pathery-f972ce9c56f0bf2201cd302c0055c6ebd06be34b.tar.xz |
Added code for generating and using champion points, and for recalculating them from scratch in the admin panel. Now just need to add them to the scoreboard and the leadboard pages...
Diffstat (limited to 'pages/admin.php')
-rw-r--r-- | pages/admin.php | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/pages/admin.php b/pages/admin.php index 983c4bc..afac6c4 100644 --- a/pages/admin.php +++ b/pages/admin.php @@ -6,10 +6,11 @@ htmlHeader(); <?php
topbar($Links);
-include('./includes/datas.php');
-include('./includes/maps.php');
-include('./includes/mapoftheday.php');
-include('./includes/db.inc.php');
+include_once('./includes/datas.php');
+include_once('./includes/maps.php');
+include_once('./includes/mapoftheday.php');
+include_once('./includes/db.inc.php');
+include_once('./includes/championPoints.php');
if ($_GET['applyall'] == 'true') {
echo "Apply-All command heard. Executing...";
@@ -26,22 +27,33 @@ if ($_GET['applyall'] == 'true') { echo "Execution complete!";
}
+else if ($_GET['recalcChamp'] == 'true') {
+ echo "Recalculating champion points...";
+
+ recalculateAllPlayersChampionPoints();
+
+ echo "Complete!";
+}
$sql = "SELECT `ID`, `displayName`, `dateJoined`, `dateLogin`, `email`, `isAdmin` FROM `users`";
$result = mysql_query($sql);
-echo "
+echo '
<center>
<h3>Administrators Page</h3>
<p>News:</p>
+<p>Buttons:<br />
+ <input type="button" value="Apply all achievements" onClick="parent.location=\'admin?applyall=true\'">
+ <input type="button" value="Recalculate all champion points" onClick="parent.location=\'admin?recalcChamp=true\'">
+</p>
<p>Hello admins, this is our current userlist.</p>
</center>
-<table style='padding-left:20px;'>
+<table style="padding-left:20px;">
<tr>
<th>ID</th><th>Display name:</th><th>Joined On:</th><th>Last Logon</th><th>Email</th><th>Administrator</th>
</tr>
-";
+';
while (list($CUID, $CUsername, $Joined, $LastLogon, $email, $isAdmin) = mysql_fetch_row($result)) {
|