summaryrefslogtreecommitdiffstats
path: root/include/functions.php
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2011-11-15 20:56:02 -0800
committerArun Persaud <apersaud@lbl.gov>2011-11-15 20:56:02 -0800
commita1c07dccbae02ae3663cb30bed875cfe904587a6 (patch)
tree6f053f333adaaefd3beef52a58443e21c8d81c53 /include/functions.php
parent34dca92fa9209df27921dcc58b9ea5bfb8f131f0 (diff)
downloade-DoKo-a1c07dccbae02ae3663cb30bed875cfe904587a6.tar.gz
e-DoKo-a1c07dccbae02ae3663cb30bed875cfe904587a6.tar.bz2
e-DoKo-a1c07dccbae02ae3663cb30bed875cfe904587a6.zip
LAYOUT: redone layout of table and cards
scales a lot better now and should be better for mobile devices
Diffstat (limited to 'include/functions.php')
-rw-r--r--include/functions.php65
1 files changed, 53 insertions, 12 deletions
diff --git a/include/functions.php b/include/functions.php
index fc46a61..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 "<div class=\"table\">\n".
- " <img class=\"table\" src=\"pics/table.png\" alt=\"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 "<div class=\"table\">\n";
+ display_single_user($row1);
+ echo "\n<div class=\"middle\">\n";
+ display_single_user($row0);
+ echo " <img class=\"table\" src=\"pics/table.png\" alt=\"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 "</div>\n";
+ display_single_user($row3);
+ echo "</div>\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 " <span class=\"numberoftricks\">";
+ echo " <br /><span class=\"numberoftricks\">";
/* show how many tricks the person made */
switch($wins)
{
@@ -1156,12 +1203,6 @@ function display_table ()
}
echo "</span>\n";
echo " </div>\n";
-
- }
- echo "</div>\n"; /* end output table */
-
-
- return;
}