diff --git a/README.md b/README.md index 2b8be1f..b15de92 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,19 @@ Assassins-Mission-Control ========================= The web app for running a semi-automated game of Assassins. + + +>>Install Instructions +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + +1) Mission Control requires PHP and MySQL to run. Make sure you've got those installed on your web server. +2) In base.php you need to set your own database details. +3) Using the admin tools in admin.php, create the users table. +4) Your users can now begin to register using register.php - I'd recommend sending out a direct link using a URL shortener, although on the main page there is a link to registering just above the login box. + +------------------------------------- +Once all your users have registered +------------------------------------- + +5) At this point you do not want anyone else to register so, as I haven't thought of a way to prevent adding any more data to an SQL table, you're going to duplicate the users table to a table called usersfinal which won't get edited by the registration form, thereby preventing anyone else from signing up. To do this head over to the admin tools in admin.php and close the registration. +6) Once you are ready to begin the game you need to go to admin.php and assign all players their targets by starting the game. diff --git a/admin-tools/close-registration.php b/admin-tools/close-registration.php new file mode 100644 index 0000000..5c00d12 --- /dev/null +++ b/admin-tools/close-registration.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/admin-tools/create-users-table.php b/admin-tools/create-users-table.php new file mode 100644 index 0000000..f5e6e39 --- /dev/null +++ b/admin-tools/create-users-table.php @@ -0,0 +1,34 @@ + \ No newline at end of file diff --git a/admin-tools/startgame.php b/admin-tools/startgame.php new file mode 100644 index 0000000..7871f22 --- /dev/null +++ b/admin-tools/startgame.php @@ -0,0 +1,81 @@ +num_rows; +return $total; +} +//call that stuff to do what I want +$numberofrows = GetNumberOfRows(); //*THIS WORKS +$IDarray = UniqueRandomNumbersWithinRange(1,$numberofrows,$numberofrows); + +echo "Here begins the tempIDs output by the for loop:" ; +echo "
" ; +//print_r ($IDarray); +for ($counter = 1; $counter <= $numberofrows; $counter += 1) { //*THIS WORKS + $assassinID = $IDarray[$counter - 1] ; //*THIS WORKS + if ($assassinID == $numberofrows) { + $targetID = 1 ; + } + else { + $targetID = $assassinID + 1 ; + } + + echo "a: " ; + echo $assassinID ; + echo "
" ; + echo "t: " ; + echo $targetID ; + echo "
" ; + + + //set tempID as the assassinID of the user in the row $counter + + //set tempID+1 as the target ID of the user in the row $counter + //mysql_query( "NSERT INTO users (AssassinID, TargetID) VALUES ($assassinID, $targetID)" ); + echo "Start AssassinSQL " ; + //UPDATE Users SET weight = 160, desiredWeight = 145 WHERE id = 1; + mysql_query( "UPDATE usersfinal SET AssassinID = $assassinID WHERE UserID = $counter" ) ; + echo $counter ; + echo "
" ; + echo "Start TargetSQL " ; + //UPDATE Users SET weight = 160, desiredWeight = 145 WHERE id = 1; + mysql_query( "UPDATE usersfinal SET TargetID = $targetID WHERE UserID = $counter" ) ; + echo $counter ; + echo "
" ; + + mysql_query( "UPDATE usersfinal SET Status = 'Alive' WHERE UserID = $counter" ) ; + mysql_query( "UPDATE usersfinal SET Kills = 0 WHERE UserID = $counter" ) ; + + } + +?> + + + + + \ No newline at end of file diff --git a/admin.php b/admin.php index 56b2d3b..2ca2a82 100644 --- a/admin.php +++ b/admin.php @@ -9,11 +9,24 @@
-
+
- +
+ +
+
+ +
+
+ +
+
+ +
+
+ diff --git a/base.php b/base.php index 8e11b30..b264101 100644 --- a/base.php +++ b/base.php @@ -1,11 +1,12 @@ - \ No newline at end of file