summaryrefslogtreecommitdiffstats
path: root/pages/admin.php
diff options
context:
space:
mode:
Diffstat (limited to 'pages/admin.php')
-rw-r--r--pages/admin.php26
1 files changed, 19 insertions, 7 deletions
diff --git a/pages/admin.php b/pages/admin.php
index 983c4bc..0f54285 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/sqlEmbedded.php');
+include_once('./includes/playerStats.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['recalcStats'] == 'true') {
+ echo "Recalculating all player stats...";
+
+ recalculateStatsForAllPlayers();
+
+ 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 player stats" onClick="parent.location=\'admin?recalcStats=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)) {