NEW FEATURE: show Vorbehalte in each game
authorArun Persaud <arun@nubati.net>
Sat, 5 Jan 2008 21:08:17 +0000 (22:08 +0100)
committerArun Persaud <arun@nubati.net>
Sat, 5 Jan 2008 22:21:26 +0000 (23:21 +0100)
Vorbehalte are now shown in the same list as tricks and the score, so that players
can go back and have a look at who said what
Signed-off-by: Arun Persaud <arun@nubati.net>
index.php

index 20fc5734688d49c42f5bb6407e32e319162e6be5..6729d5688c0058cc226cbb0dd3998a2f5fb981f0 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1154,6 +1154,31 @@ else if(myisset("me"))
       echo "\n<ul class=\"tricks\">\n";
       echo "  <li class=\"nohighlight\"> Game ".DB_format_gameid($gameid).": </li>\n";
 
       echo "\n<ul class=\"tricks\">\n";
       echo "  <li class=\"nohighlight\"> Game ".DB_format_gameid($gameid).": </li>\n";
 
+      /* output vorbehalte */
+      $mygametype =  DB_get_gametype_by_gameid($gameid);
+      if($mygametype != "normal") /* only show when needed */
+       {
+         echo "  <li onclick=\"hl('0');\" class=\"current\"><a href=\"#\">Pre</a>\n".
+           "    <div class=\"trick\" id=\"trick0\">\n";
+         $show = 1;
+         for($mypos=1;$mypos<5;$mypos++)
+           {
+             $usersick = DB_get_sickness_by_pos_and_gameid($mypos,$gameid);
+             if($usersick!=NULL)
+               {
+                 echo "      <div class=\"vorbehalt".($mypos-1)."\"> Vorbehalt <br />";
+                 if($show)
+                   echo " $usersick <br />";
+                 echo  " </div>\n";
+
+                 if($mygametype == $usersick)
+                   $show = 0;
+               }
+           }
+         echo "    </div>\n  </li>\n";  /* end div trick, end li trick */
+       }
+
+      /* output tricks */
       while($r = mysql_fetch_array($result,MYSQL_NUM))
        {
          $pos     = $r[1];
       while($r = mysql_fetch_array($result,MYSQL_NUM))
        {
          $pos     = $r[1];