X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Ffunctions.php;h=0313bede84ae60526667eb898a932a5e96715751;hp=ddac18267dbd111aa59db02007083bb08d62a229;hb=725eee244ea7a03b60ac20998f2dfc8677cdbcf2;hpb=2bd1c94dd7e712bb2cc8e2c16fb317bd0169c59c;ds=sidebyside diff --git a/include/functions.php b/include/functions.php index ddac182..0313bed 100644 --- a/include/functions.php +++ b/include/functions.php @@ -971,7 +971,7 @@ function can_call($what,$hash) return 0; } -function display_table () +function display_table_begin () { global $gameid, $GT, $debug,$INDEX,$defaulttimezone,$session; global $RULES,$GAME,$gametype; @@ -991,10 +991,57 @@ function display_table () "WHERE Hand.game_id='".$gameid."' ". "ORDER BY position ASC"); - echo "
\n". - " \"table\"\n"; - while($r = DB_fetch_array($result)) - { + $row0 = DB_fetch_array($result); + $row1 = DB_fetch_array($result); + $row2 = DB_fetch_array($result); + $row3 = DB_fetch_array($result); + + echo "
\n"; + display_single_user($row1); + echo "\n
\n"; + display_single_user($row0); + echo " \"table\"\n"; + display_single_user($row2); + + return; +} +function display_table_end () +{ + global $gameid, $GT, $debug,$INDEX,$defaulttimezone,$session; + global $RULES,$GAME,$gametype; + + $result = DB_query("SELECT User.fullname as name,". + " Hand.position as position, ". + " User.id, ". + " Hand.party as party, ". + " Hand.sickness as sickness, ". + " Hand.point_call, ". + " User.last_login, ". + " Hand.hash, ". + " User.timezone, ". + " User.email ". + "FROM Hand ". + "LEFT JOIN User ON User.id=Hand.user_id ". + "WHERE Hand.game_id='".$gameid."' ". + "ORDER BY position ASC"); + + $row0 = DB_fetch_array($result); + $row1 = DB_fetch_array($result); + $row2 = DB_fetch_array($result); + $row3 = DB_fetch_array($result); + + echo "
\n"; + display_single_user($row3); + echo "
\n"; + + return; +} + +function display_single_user($r) +{ + global $gameid, $GT, $debug,$INDEX,$defaulttimezone,$session; + global $RULES,$GAME,$gametype; + $name = $r[0]; $pos = $r[1]; $user = $r[2]; @@ -1139,7 +1186,7 @@ function display_table () "title=\"local time: ".date("Y-m-d H:i:s",$timenow). " ". "last login: ".date("Y-m-d H:i:s",$lastlogin)."\" />"; - echo " "; + echo "
"; /* show how many tricks the person made */ switch($wins) { @@ -1156,12 +1203,6 @@ function display_table () } echo "\n"; echo "
\n"; - - } - echo "\n"; /* end output table */ - - - return; } @@ -1181,22 +1222,22 @@ function display_user_menu($id) { if($i==0) { - echo "
\n"; - echo _('It\'s your turn in these games').":
\n"; + echo "\n
\n "; + echo _('It\'s your turn in these games').":\n"; } $i++; - echo "game ".DB_format_gameid($r[1])."
\n"; + echo " game ".DB_format_gameid($r[1])." \n"; if($i>4) { - echo "...
\n"; + echo " ...\n"; break; } } if($i) - echo "
\n"; + echo "
\n\n"; return; }