BUGIFX: notes are now available during every phase of the game
authorArun Persaud <arun@nubati.net>
Sun, 8 Jun 2008 17:29:20 +0000 (10:29 -0700)
committerArun Persaud <arun@nubati.net>
Sun, 8 Jun 2008 17:29:20 +0000 (10:29 -0700)
you can now take notes also during the pre-game phase.

Signed-off-by: Arun Persaud <arun@nubati.net>
css/standard008.css
include/game.php
include/output.php

index efae67415bee82e84d30824ad1065032d238ce49..46b738c8743f5114ceb24ce069685c1e1b548955 100644 (file)
@@ -440,6 +440,7 @@ table.score {
 
   height:10em;
   overflow: auto;
+  z-index:50;
 }
 
 .user { margin-left:25%;margin-right:5%; }
index 3a015662f50a437f0f87f9231b08d62199199a83..8d59103707e20d9166ef976a9a0b084fcc046f70 100644 (file)
@@ -107,7 +107,16 @@ set_gametype('normal');
 /* put everyting in a form */
 echo "<form action=\"index.php?action=game&amp;me=$me\" method=\"post\">\n";
 
-/* output game */
+/* handle user notes (only possible while game is running)*/
+if( $mystatus!='gameover'  )
+  if(myisset("note"))
+{
+  $note = $_REQUEST['note'];
+  
+  if($note != "")
+    DB_insert_note($note,$gameid,$myid);
+};
+output_user_notes($myid,$gameid,$mystatus);
 
 /* output extra division in case this game is part of a session */
 if($session)
@@ -1027,16 +1036,6 @@ switch($mystatus)
            DB_insert_comment($comment,$playid,$myid);
        };
 
-    /* handle notes in case player didn't play a card, allow notes only during a game */
-    if( (!myisset("card") && $mystatus=='play')  )
-      if(myisset("note"))
-       {
-         $note = $_REQUEST["note"];
-
-         if($note != "")
-           DB_insert_note($note,$gameid,$myid);
-       };
-
     /* get everything relevant to display the tricks */
     $result = DB_query("SELECT Hand_Card.card_id as card,".
                       "       Hand.position as position,".
@@ -1726,13 +1725,6 @@ switch($mystatus)
       echo "  <li onclick=\"hl_next();\" class=\"old\"><a href=\"#\">next</a></li>\n";
       echo "</ul>\n"; /* end ul tricks*/
 
-      echo "<div class=\"notes\"> Personal notes: <br />\n";
-      $notes = DB_get_notes_by_userid_and_gameid($myid,$gameid);
-      foreach($notes as $note)
-       echo "$note <hr />\n";
-      echo "<input name=\"note\" type=\"text\" size=\"15\" maxlength=\"100\" />\n";
-      echo "</div> \n";
-
       $mycards = DB_get_hand($me);
       $mycards = mysort($mycards,$gametype);
       echo "<div class=\"mycards\">\n";
@@ -1903,7 +1895,6 @@ switch($mystatus)
          }
       }
 
-
     output_footer();
     DB_close();
     exit();
index e57ed04cad615c53a182cab0170086ffad5578ff..2f846be70badcabaf4b5eb930efc2c4e168f141e 100644 (file)
@@ -428,4 +428,18 @@ function output_password_recovery($email,$password)
 
 <?php
 }
+
+function output_user_notes($userid,$gameid,$userstatus)
+{
+  echo "<div class=\"notes\"> Personal notes: <br />\n";
+  $notes = DB_get_notes_by_userid_and_gameid($userid,$gameid);
+  foreach($notes as $note)
+    echo "$note <hr />\n";
+  if($userstatus!='gameover')
+    echo "<input name=\"note\" type=\"text\" size=\"15\" maxlength=\"100\" />\n";
+  echo "</div> \n";
+
+  return;
+}
+    
 ?>
\ No newline at end of file