3 /* functions which only ouput html */
5 function display_news()
8 echo "<div class=\"bug\">\n".
9 " Schweinchen should work now (only for new games).<br
11 " If you find more bugs, please list them in the <a href=\"".
12 $wiki."\">wiki</a>.\n</div>\n";
16 function output_link_to_user_page($email,$password)
18 echo "<div class=\"over\">\n";
19 echo "<form action=\"index.php\" method=\"post\">\n";
20 echo " <input type=\"hidden\" name=\"email\" value=\"".$email."\" />\n";
21 echo " <input type=\"hidden\" name=\"password\" value=\"".$password."\" />\n";
22 echo " <input type=\"submit\" value=\"go to my user page\" />\n";
29 function output_register()
31 echo "IMPORTANT: passwords are going over the net as clear text, so pick an easy password. No need to pick anything complicated here ;)<br /><br />";
32 echo "TODO: convert timezone into a menu<br />\n";
33 echo "TODO: figure out a way to handle passwords <br />\n";
35 <form action="index.php" method="post">
37 <legend>Register</legend>
40 <td><label for="Rfullname">Full name:</label></td>
41 <td><input type="text" id="Rfullname" name="Rfullname" size="20" maxsize="30" /> </td>
43 <td><label for="Remail">Email:</label></td>
44 <td><input type="text" id="Remail" name="Remail" size="20" maxsize="30" /></td>
46 <td><label for="Rpassword">Password(will be displayed in cleartext on the next page):</label></td>
47 <td><input type="password" id="Rpassword" name="Rpassword" size="20" maxsize="30" /></td>
49 <td><label for="Rtimezone">Timezone:</label></td>
51 <input type="text" id="Rtimezone" name="Rtimezone" size="4" maxsize="4" value="+1" />
54 <td colspan="2"> <input type="submit" value="register" /></td>
62 function output_ask_for_new_game($playerA,$playerB,$playerC,$playerD,$oldgameid)
66 echo "Do you want to continue playing?(This will start a new game, with the next person as dealer.)\n";
67 echo "<form action=\"index.php\" method=\"post\">\n";
68 echo " <input type=\"hidden\" name=\"PlayerA\" value=\"$playerA\" />\n";
69 echo " <input type=\"hidden\" name=\"PlayerB\" value=\"$playerB\" />\n";
70 echo " <input type=\"hidden\" name=\"PlayerC\" value=\"$playerC\" />\n";
71 echo " <input type=\"hidden\" name=\"PlayerD\" value=\"$playerD\" />\n";
72 echo " <input type=\"hidden\" name=\"dullen\" value=\"".$RULES["dullen"]."\" />\n";
73 echo " <input type=\"hidden\" name=\"schweinchen\" value=\"".$RULES["schweinchen"]."\" />\n";
74 echo " <input type=\"hidden\" name=\"followup\" value=\"$oldgameid\" />\n";
75 echo " <input type=\"submit\" value=\"keep playing\" />\n";
81 function output_form_for_new_game($names)
85 <p>Please select four players (or use the randomly pre-selected names)</p>
86 <form action="index.php" method="post">
88 /* ask for player names */
89 foreach( array("PlayerA","PlayerB","PlayerC","PlayerD") as $player)
91 srand((float) microtime() * 10000000);
92 $randkey = array_rand($names);
93 $rand = $names[$randkey];
94 echo " Name: <select name=\"$player\" size=\"1\" /> \n";
95 foreach($names as $name)
99 echo " <option selected=\"selected\">$name</option>\n";
102 echo " <option>$name</option>\n";
108 <p> Some areas are grayed out which means that the rule is not implemented yet and therefore cannot be selected </p>
111 <li> <input type="radio" name="dullen" value="none" /> just normal non-trump </li>
112 <li> <input type="radio" name="dullen" value="firstwins" /> first ten of hearts wins the trick </li>
113 <li> <input type="radio" name="dullen" value="secondwins" checked="checked" /> second ten of hearts wins the trick </li>
116 <p> schweinchen (both foxes), only in normal games or silent solos:
118 <li> <input type="radio" name="schweinchen" value="none" checked="checked" /> none </li>
119 <li> <input type="radio" name="schweinchen" value="both" />
120 both become highest trump (automatic call at beginning of the game)
122 <li> <input type="radio" name="schweinchen" value="second" />
123 first one normal, second one becomes highest (call during the game) </li>
124 <li> <input type="radio" name="schweinchen" value="secondaftercall" disabled="disabled" />
125 second one become highest only in case re/contra was announced (not working yet)
130 <input type="submit" value="start game" />
135 function display_card($card,$dir="english")
137 /* cards are only availabl for the odd values, e.g. 1.png, 3.png, ...
138 * convert even cards to the matching odd value */
140 if( $card/2 - (int)($card/2) == 0.5)
141 echo "<img src=\"cards/".$dir."/".$card.".png\" alt=\"".card_to_name($card)."\" />\n";
143 echo "<img src=\"cards/".$dir."/".($card-1).".png\" alt=\"".card_to_name($card-1)."\" />\n";
148 function display_link_card($card,$dir="english")
150 if( $card/2 - (int)($card/2) == 0.5)
151 echo "<input type=\"radio\" name=\"card\" value=\"".$card."\" /><img src=\"cards/".$dir."/".$card.".png\" alt=\"\" />\n";
153 echo "<input type=\"radio\" name=\"card\" value=\"".$card."\" /><img src=\"cards/".$dir."/".($card-1).".png\" alt=\"\" />\n";
157 function check_for_sickness($me,$mycards)
160 <p> Solo will work, but the first player will not change. Nothing else implemented. </p>
162 <form action="index.php" method="post">
164 do you want to play solo?
165 <select name="solo" size="1">
166 <option selected="selected">No</option>
167 <option>trumpless</option>
168 <option>trump</option>
169 <option>queen</option>
170 <option>jack</option>
171 <option>club</option>
172 <option>spade</option>
173 <option>heart</option>
180 if(check_wedding($mycards))
182 echo " yes<input type=\"radio\" name=\"wedding\" value=\"yes\" checked=\"checked\" />";
183 echo " no <input type=\"radio\" name=\"wedding\" value=\"no\" /> <br />\n";
187 echo " no <input type=\"hidden\" name=\"wedding\" value=\"no\" /> <br />\n";
190 echo "do you have poverty?";
191 if(count_trump($mycards)<4)
193 echo " yes<input type=\"radio\" name=\"poverty\" value=\"yes\" checked=\"checked\" />";
194 echo " no <input type=\"radio\" name=\"poverty\" value=\"no\" /> <br />\n";
198 echo " no <input type=\"hidden\" name=\"poverty\" value=\"no\" /> <br />\n";
201 echo "do you have too many nines?";
202 if(count_nines($mycards)>4)
204 echo " yes<input type=\"radio\" name=\"nines\" value=\"yes\" checked=\"checked\" />";
205 echo " no <input type=\"radio\" name=\"nines\" value=\"no\" /> <br />\n";
209 echo " no <input type=\"hidden\" name=\"nines\" value=\"no\" /> <br />\n";
212 echo "<input type=\"hidden\" name=\"me\" value=\"$me\" />\n";
213 echo "<input type=\"submit\" value=\"count me in\" />\n";
220 function check_want_to_play($me)
223 <form action="index.php" method="post">
224 Do you want to play a game of DoKo?
225 yes<input type="radio" name="in" value="yes" />
226 no<input type="radio" name="in" value="no" /> <br />
230 Do you want to get an email for every card played or only if it your move?
231 every card<input type="radio" name="update" value="card" />
232 only on my turn<input type="radio" name="update" value="turn" /> <br />
234 echo "<input type=\"hidden\" name=\"me\" value=\"$me\" />\n";
236 echo "<input type=\"submit\" value=\"count me in\" />\n";
242 function output_home_page()
245 <p> If you want to play a game of Doppelkopf, you found the right place ;) </p>
246 <p> Please <a href="index.php?register">register</a>, in case you haven't done yet <br />
247 or login with you email-address or name and password here:
249 <form action="index.php" method="post">
251 <legend>Login</legend>
254 <td><label for="email">Email:</label></td>
255 <td><input type="text" id="email" name="email" size="20" maxlength="30" /> </td>
257 <td><label for="password">Password:</label></td>
258 <td><input type="password" id="password" name="password" size="20" maxlength="30" /></td>
260 <td> <input type="submit" value="login" /></td>
271 function output_header()
275 <!DOCTYPE html PUBLIC
276 "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
277 "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
278 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
280 <title>e-Doko</title>
281 <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" />
282 <link rel="stylesheet" type="text/css" href="css/standard.css" />
283 <script type="text/javascript">
285 if(document.getElementById){
288 if(document.getElementById("trick"+i))
289 document.getElementById("trick"+i).style.display = 'none';
291 document.getElementById("trick"+num).style.display = 'block';
294 function high_last(){
295 if(document.getElementById){
298 if(document.getElementById("trick"+i))
308 <body onload="high_last();">
310 <h1> Welcome to E-Doko </h1>
319 function output_footer()
323 echo "<div class=\"footer\">\n";
324 echo "<p class=\"left\"> copyright 2006-2007 Arun Persaud</p>\n";
325 echo "<p class=\"right\"> Revision: $REV; </p> \n";