mirror of
https://github.com/jcreek/Assassins-Mission-Control.git
synced 2026-07-12 18:43:43 +00:00
Added admin tools, provided link to admin page
This commit is contained in:
@@ -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"; ?>
|
||||||
@@ -31,4 +31,5 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
<?php include "return-to-admin-page.php"; ?>
|
||||||
@@ -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"; ?>
|
||||||
@@ -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"; ?>
|
||||||
|
|
||||||
|
|
||||||
@@ -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>';
|
||||||
|
?>
|
||||||
@@ -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"-->
|
||||||
|
|||||||
@@ -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%;'>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 213 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.4 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 404 KiB |
Reference in New Issue
Block a user