BUGFIX: couldn't unclick no90 call
authorArun Persaud <arun@nubati.net>
Wed, 16 Apr 2008 23:28:00 +0000 (16:28 -0700)
committerArun Persaud <apersaud@lbl.gov>
Fri, 18 Apr 2008 16:30:25 +0000 (09:30 -0700)
radio buttons for calling "no 120", "no 90", etc. had all different names and
therefore clicking a second one, didn't unclick the first one.

Signed-off-by: Arun Persaud <apersaud@lbl.gov>
index.php
output.php

index f0a8e7451d185a1a28e45021b574282073293040..f6d0c681b09fadbdcf6bce66c5bc217205dad803 100644 (file)
--- a/index.php
+++ b/index.php
@@ -65,7 +65,7 @@ else if(myisset("new"))
       }
   }
 /*check if everything is ready to set up a new game */
-else if( myisset("PlayerA", "PlayerB","PlayerC","PlayerD","dullen","schweinchen","call" ))
+else if( myisset("PlayerA", "PlayerB","PlayerC","PlayerD","dullen","schweinchen","callrule" ))
   {
     output_status();
     /* user needs to be logged in */
@@ -96,7 +96,7 @@ else if( myisset("PlayerA", "PlayerB","PlayerC","PlayerD","dullen","schweinchen"
        /* what rules were selected */
        $dullen      = $_REQUEST["dullen"];
        $schweinchen = $_REQUEST["schweinchen"];
-       $call        = $_REQUEST["call"];
+       $call        = $_REQUEST["callrule"];
 
        /* get the emails addresses of the players */
        $EmailA  = DB_get_email('name',$PlayerA);
@@ -1364,15 +1364,15 @@ else if(myisset("me"))
              DB_update_game_timestamp($gameid);
 
              /* check if a call was made, must do this before we set the card status to played */
-             if(myisset("call120") && $_REQUEST["call120"] == "yes" && can_call(120,$me))
+             if(myisset("call")  && $_REQUEST["call"]  == "120" && can_call(120,$me))
                $result = mysql_query("UPDATE Hand SET point_call='120' WHERE hash='$me' ");
-             if(myisset("call90")  && $_REQUEST["call90"]  == "yes" && can_call(90,$me))
+             if(myisset("call")  && $_REQUEST["call"]  == "90" && can_call(90,$me))
                $result = mysql_query("UPDATE Hand SET point_call='90'  WHERE hash='$me' ");
-             if(myisset("call60")  && $_REQUEST["call60"]  == "yes" && can_call(60,$me))
+             if(myisset("call")  && $_REQUEST["call"]  == "60" && can_call(60,$me))
                $result = mysql_query("UPDATE Hand SET point_call='60'  WHERE hash='$me' ");
-             if(myisset("call30")  && $_REQUEST["call30"]  == "yes" && can_call(30,$me))
+             if(myisset("call")  && $_REQUEST["call"]  == "30" && can_call(30,$me))
                $result = mysql_query("UPDATE Hand SET point_call='30'  WHERE hash='$me' ");
-             if(myisset("call0")   && $_REQUEST["call0"]   == "yes" && can_call(0,$me))
+             if(myisset("call")  && $_REQUEST["call"]  == "0" && can_call(0,$me))
                $result = mysql_query("UPDATE Hand SET point_call='0'   WHERE hash='$me' ");
 
              /* mark card as played */
index b257345a44bc12fc1632c4c4c6434565a85ce734..2540492939d0d1c113ca6f910b35d73d624bf6ec 100644 (file)
@@ -38,7 +38,7 @@ function output_ask_for_new_game($playerA,$playerB,$playerC,$playerD,$oldgameid)
   echo "  <input type=\"hidden\" name=\"PlayerD\" value=\"$playerD\" />\n";
   echo "  <input type=\"hidden\" name=\"dullen\"  value=\"".$RULES["dullen"]."\" />\n";
   echo "  <input type=\"hidden\" name=\"schweinchen\" value=\"".$RULES["schweinchen"]."\" />\n";
-  echo "  <input type=\"hidden\" name=\"call\" value=\"".$RULES["call"]."\" />\n";
+  echo "  <input type=\"hidden\" name=\"callrule\" value=\"".$RULES["call"]."\" />\n";
   echo "  <input type=\"hidden\" name=\"followup\" value=\"$oldgameid\" />\n";
   echo "  <input type=\"submit\" value=\"keep playing\" />\n";
 
@@ -103,11 +103,11 @@ function output_form_for_new_game($names)
       </p>
       <p> Call Re/Contra, etc.:
         <ul>
-           <li><input type="radio" name="call" value="1st-own-card" checked="checked" />
+           <li><input type="radio" name="callrule" value="1st-own-card" checked="checked" />
                 Can call re/contra on the first <strong>own</strong> card played, 90 on the second, etc.</li>
-           <li><input type="radio" name="call" value="5th-card" />
+           <li><input type="radio" name="callrule" value="5th-card" />
                 Can call re/contra until 5th card is played, 90 until 9th card is played, etc.</li>
-           <li><input type="radio" name="call" value="9-cards"  />
+           <li><input type="radio" name="callrule" value="9-cards"  />
                 Can call re/contra until 5th card is played, 90 if player still has 9 cards, etc.</li>
         </ul>
       </p>
@@ -203,21 +203,21 @@ function output_form_calls($me)
 {
   if( can_call(120,$me) )
     echo " re/contra (120):".
-      " <input type=\"radio\" name=\"call120\" value=\"yes\" /> <br />";
+      " <input type=\"radio\" name=\"call\" value=\"120\" /> <br />";
   if( can_call(90,$me) )
     echo " 90:".
-      " <input type=\"radio\" name=\"call90\" value=\"yes\" /> <br />";
+      " <input type=\"radio\" name=\"call\" value=\"90\" /> <br />";
   if( can_call(60,$me) )
     echo " 60:".
-      " <input type=\"radio\" name=\"call60\" value=\"yes\" /> <br />";
+      " <input type=\"radio\" name=\"call\" value=\"60\" /> <br />";
   if( can_call(30,$me) )
     echo " 30:".
-      " <input type=\"radio\" name=\"call30\" value=\"yes\" /> <br />";
+      " <input type=\"radio\" name=\"call\" value=\"30\" /> <br />";
   if( can_call(0,$me) )
     echo " 0:".
-      " <input type=\"radio\" name=\"call0\" value=\"yes\" /> <br />".
+      " <input type=\"radio\" name=\"call\" value=\"0\" /> <br />".
       " no call:".
-      " <input type=\"radio\" name=\"call0\" value=\"no\" /> <br />";
+      " <input type=\"radio\" name=\"call\" value=\"no\" /> <br />";
 }