From ee59b6b39abc3691431b027785341aa308d1313c Mon Sep 17 00:00:00 2001 From: arun Date: Sun, 8 Apr 2007 19:49:22 +0000 Subject: cleaned up the interface a bit --- index.php | 65 ++++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 35 insertions(+), 30 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 6d43ddb..a4ace5c 100644 --- a/index.php +++ b/index.php @@ -218,19 +218,33 @@ else if(myisset("me")) $mystatus = DB_get_status_by_hash($me); $mypos = DB_get_pos_by_hash($me); - /* display the game number */ - echo "

Game $gameid

\n"; /* display rule set */ - echo "
\n Rules:
"; + echo "
\n"; $result = mysql_query("SELECT * FROM Rulesets LEFT JOIN Game ON Game.ruleset=Rulesets.id WHERE Game.id='$gameid'" ); $r = mysql_fetch_array($result,MYSQL_NUM); $RULES["dullen"]=$r[2]; $RULES["schweinchen"]=$r[3]; - - echo "10ofhearts : ".$r[2]."
"; - echo "schweinchen: ".$r[3]."
"; + + /* get some infos about the game */ + $gametype = DB_get_gametype_by_gameid($gameid); + $gamestatus = DB_get_game_status_by_gameid($gameid); + $GT = $gametype; + if($gametype=="solo") + { + $gametype = DB_get_solo_by_gameid($gameid); + $GT = $gametype." ".$GT; + } + else + $gametype="normal"; + + if($gamestatus != 'pre') + echo " Gametype: $GT
\n"; + + echo "Rules:
\n"; + echo "10ofhearts : ".$r[2]."
\n"; + echo "schweinchen: ".$r[3]."
\n"; echo "
\n"; /* does anyone have both foxes */ @@ -245,7 +259,6 @@ else if(myisset("me")) $GAME["schweinchen-who"]=$hash; } }; - /* mystatus gets the player through the different stages of a game. * start: yes/no @@ -607,24 +620,6 @@ else if(myisset("me")) /* display useful things in divs */ - /* display local time */ - echo "
\n Local times:"; - $users = array(); - $users = DB_get_all_userid_by_gameid($gameid); - foreach($users as $user) - { - $offset = DB_get_user_timezone($user); - $zone = return_timezone($offset); - date_default_timezone_set($zone); - $name = DB_get_name_by_userid($user); - - echo "\n"; - }; - echo "
$name ".date("Y-m-d H:i:s")."
\n
\n"; - - if($gamestatus != 'pre') - display_status($GT); - /* display links to the users status page */ $result = mysql_query("SELECT email,password from User WHERE id='$myid'" ); $r = mysql_fetch_array($result,MYSQL_NUM); @@ -644,7 +639,8 @@ else if(myisset("me")) /* display the table and the names */ $result = mysql_query("SELECT User.fullname as name,". - " Hand.position as position ". + " Hand.position as position, ". + " User.id ". "FROM Hand ". "LEFT JOIN User ON User.id=Hand.user_id ". "WHERE Hand.game_id='".$gameid."' ". @@ -656,11 +652,20 @@ else if(myisset("me")) { $name = $r[0]; $pos = $r[1]; - - echo " $name\n"; + $user = $r[2]; + + $offset = DB_get_user_timezone($user); + $zone = return_timezone($offset); + date_default_timezone_set($zone); + + echo " \n"; + echo " $name
\n"; + echo " local time: ".date("Y-m-d H:i:s")."\n"; + echo "
\n"; + } echo "
\n"; - + /* get everything relevant to display the tricks */ $result = mysql_query("SELECT Hand_Card.card_id as card,". " Hand.position as position,". @@ -684,7 +689,7 @@ else if(myisset("me")) $firstcard = ""; /* first card in a trick */ echo "\n