Added admin tools, provided link to admin page

This commit is contained in:
jcreek
2014-08-22 17:21:19 +01:00
parent 8a2f8b629a
commit ddefa3a171
13 changed files with 54 additions and 8 deletions
+2 -1
View File
@@ -8,4 +8,5 @@
mysql_query("CREATE TABLE usersfinal SELECT * FROM users"); mysql_query("CREATE TABLE usersfinal SELECT * FROM users");
?> ?>
<?php include "return-to-admin-page.php"; ?>
+2 -1
View File
@@ -31,4 +31,5 @@ else
} }
?> ?>
<?php include "return-to-admin-page.php"; ?>
View File
+5
View File
@@ -0,0 +1,5 @@
<?php
//rename the addresses-not-released file to addresses-released
rename("addresses-not-released","addresses-released");
?>
<?php include "return-to-admin-page.php"; ?>
+27 -5
View File
@@ -12,7 +12,7 @@ if ($_POST['txtPassword'] != $password) {
<h1>Confirm Assassins Game Reset</h1> <h1>Confirm Assassins Game Reset</h1>
<p>First you must download a copy of the game results</p> <p>First you must download a copy of the game results</p>
<p><a href="export-csv.php">Export CSV</a></p> <p><a href="export-csv.php">Export CSV</a></p> <?php// export the contents of the usersfinal table just in case it was an accident or the results are needed again?>
<form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<p>If you are certain that you want to reset the game then enter the following password in the box below: <p>If you are certain that you want to reset the game then enter the following password in the box below:
@@ -33,15 +33,37 @@ else { // here is where the actual reset code happens following login
// rename the game-begun file to game-not-started // rename the game-begun file to game-not-started
rename("game-begun","game-not-started"); rename("game-begun","game-not-started");
// export the contents of the usersfinal table just in case it was an accident or the results are needed again //rename the addresses-released file to addresses-not-released
rename("addresses-released","addresses-not-released");
// delete the two users tables
$retval1 = mysql_query("DROP TABLE users");
if(! $retval1 )
{
die('Could not delete users table: ' . mysql_error());
}
echo "Users table deleted successfully\n";
$retval2 = mysql_query("DROP TABLE usersfinal");
if(! $retval2 )
{
die('Could not delete usersfinal table: ' . mysql_error());
}
echo "Usersfinal table deleted successfully\n";
// empty the upload folder of all user photos
$files = glob('../upload/*'); // get all file names
foreach($files as $file){ // iterate files
if(is_file($file))
unlink($file); // delete file
}
} }
Echo "<br>"
Echo "End of the reset page reached. Unless there are error messages above everything is reset!"
?> ?>
<?php include "return-to-admin-page.php"; ?>
+5
View File
@@ -0,0 +1,5 @@
<?php
echo "<h1>Admin Task Completed</h1>";
echo "<p>Click below to return to the admin tools page.</p>";
echo '<a href="../admin.php">Return to admin tools page</a>';
?>
+1
View File
@@ -62,6 +62,7 @@ for ($counter = 1; $counter <= $numberofrows; $counter += 1) { //*THIS WORKS
} }
?> ?>
<?php include "return-to-admin-page.php"; ?>
<!--meta content="3;index.php" http-equiv="refresh"--> <!--meta content="3;index.php" http-equiv="refresh"-->
+3
View File
@@ -15,6 +15,9 @@
<p><a href="admin-tools/close-registration.php">Close registration</a></p> <p><a href="admin-tools/close-registration.php">Close registration</a></p>
<p><a href="admin-tools/startgame.php">Start the game</a></p> <p><a href="admin-tools/startgame.php">Start the game</a></p>
<p><a href="admin-tools/release-addresses.php">Release addresses</a></p>
</div> </div>
<div style='float:right; border-style: dotted; padding: 2%; width: 20%;'> <div style='float:right; border-style: dotted; padding: 2%; width: 20%;'>
+9 -1
View File
@@ -106,13 +106,21 @@ function GetNumberOfRows() {
echo "<li><img src='"."upload/".$_SESSION['Usernamet'].'.'.'png'."' class='targetphoto'></li>"; echo "<li><img src='"."upload/".$_SESSION['Usernamet'].'.'.'png'."' class='targetphoto'></li>";
} }
?> ?>
<?php
if(file_exists("admin-tools/addresses-released"))
{
?>
<li><h2>They live at: <b><?=$_SESSION['Addresst']?></b></h2></li>
<?php
}
?>
<li>Full name: <b><?=$_SESSION['FullNamet']?></b></li> <li>Full name: <b><?=$_SESSION['FullNamet']?></b></li>
<li>Year group: <b><?=$_SESSION['YearGroupt']?></b></li> <li>Year group: <b><?=$_SESSION['YearGroupt']?></b></li>
<li>Email Address: <b><?=$_SESSION['Usernamet']?>@exeter.ac.uk</b></li> <li>Email Address: <b><?=$_SESSION['Usernamet']?>@exeter.ac.uk</b></li>
<li>Subject Studied: <b><?=$_SESSION['Subjectt']?></b></li> <li>Subject Studied: <b><?=$_SESSION['Subjectt']?></b></li>
<li>Societies: <b><?=$_SESSION['Societiest']?></b></li> <li>Societies: <b><?=$_SESSION['Societiest']?></b></li>
<li>Regular Haunts: <b><?=$_SESSION['RegularHauntst']?></b></li> <li>Regular Haunts: <b><?=$_SESSION['RegularHauntst']?></b></li>
<li>They live at: <b><?=$_SESSION['Addresst']?></b></li>
<li>Ninjaness Score <b><?=$_SESSION['Ninjanesst']?>/10</b></li> <li>Ninjaness Score <b><?=$_SESSION['Ninjanesst']?>/10</b></li>
<li>They have made <b><?=$_SESSION['Killst']?> kills</b></li> <li>They have made <b><?=$_SESSION['Killst']?> kills</b></li>
</ul> </ul>
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 404 KiB