X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=index.php;h=76bbc29a55dc115ccc12f7e94f0666c46cea396b;hp=90b91cead33914e4accd08b868de26dd3fc64a8d;hb=e8b56a58ef9b5dabf77273f540d1ec678e604615;hpb=75ad669f06207b8e2813c7ae4f238d46dab25160 diff --git a/index.php b/index.php index 90b91ce..76bbc29 100644 --- a/index.php +++ b/index.php @@ -1,210 +1,96 @@ - - - - Doko via email - - - -

Welcome to E-Doko

- "; - echo " player 1
"; - echo " player 2
"; - echo " player 3
"; - echo " player 4
"; - /* read in random.txt */ - if(file_exists("random.txt")) - $random = file("random.txt"); - else - die("no random file"); - - $randomNR = explode( ":", $random[1] ); - - /* write status into file */ - $output = fopen("status.txt","w"); - if ($output) - { - fwrite($output, "0\n"); - - fwrite($output, "hash1:".$PlayerA.":".$EmailA."::" ); - for($i=0;$i<12;$i++) - fwrite($output,";$randomNR[$i]" ); - fwrite($output,"\n"); - - fwrite($output, "hash2:$PlayerB:$EmailB::" ); - for(;$i<24;$i++) - fwrite($output,";$randomNR[$i]" ); - fwrite($output,"\n"); - - fwrite($output, "hash3:$PlayerC:$EmailC::" ); - for(;$i<36;$i++) - fwrite($output,";$randomNR[$i]" ); - fwrite($output,"\n"); - - fwrite($output, "hash4:$PlayerD:$EmailD::"); - for(;$i<48;$i++) - fwrite($output,";$randomNR[$i]" ); - fwrite($output,"\n"); - - fclose($output); - } - else - echo "can't open file for writing"; -}; - -/* test if a game is running, else output everything for a new game */ -if(sizeof($lines)<2) -{ + $action=""; /* so that we can use a default option below */ + +switch($action) + { + case 'new': + require './include/newgame.php'; + break; + case 'cancel': + require './include/cancelgame.php'; + break; + case 'reminder': + require './include/reminder.php'; + break; + case 'logout': + require './include/logout.php'; + require './include/welcome.php'; + break; + case 'login': + require './include/login.php'; + require './include/user.php'; + break; + case 'register': + require './include/register.php'; + break; + case 'prefs': + require './include/preferences.php'; + break; + case 'game': + require './include/game.php'; + break; + case 'stats': + if(isset($_SESSION["name"])) + require './include/stats.php'; + else + require './include/welcome.php'; + break; + default: + if(isset($_SESSION["name"])) + require './include/user.php'; + else + require './include/welcome.php'; + } + +output_footer(); + +DB_close(); + +/* + *Local Variables: + *mode: php + *mode: hs-minor + *End: + */ ?> -

no game in progress, please input 4 names and email addresses

-
- Name: - Email:
- - Name: - Email:
- Name: - Email:
- - Name: - Email:
- - -
- -
- Do you want to play a game of DoKo? - yes - no
- - Do you want to get an email for every card played or only if it your move? - every card - only on my turn
-\n"; - echo "\n"; - echo "\n"; - echo "
\n"; -} - /* yes? email him his hand, ask for solo, poverty, email every move or every card? */ -if(isset($_REQUEST["b"])) -{ - $b=$_REQUEST["b"]; - echo "hash is $b
"; - if(!isset($_REQUEST["in"])|| !isset($_REQUEST["update"]) ) - { - echo "go back to "; - echo " here and fill out the form
"; - } - else - { /* show the hand */ - echo $player[$b]["cards"]; - $tmp = $player[$b]["cards"]; - $cards = explode( ":",$tmp); - echo "your cards are"; - foreach($cards as $card) echo " $card "; - echo "
\n"; - ?> -
- - do you want to play solo? - yes - no
- - do you have a wedding? - yes - no
- - do you have poverty? - yes - no
- - - - - - -
- - - -