3 /* functions which only ouput html */
5 function display_links($email,$password)
8 echo "<div class=\"bug\">\n".
9 "Report bugs in the <a href=\"". $wiki."\">wiki</a>.<hr />\n";
10 output_link_to_user_page($email,$password);
15 function output_link_to_user_page($email,$password)
17 echo "<div class=\"over\">\n";
18 echo "<form action=\"index.php\" method=\"post\">\n";
19 echo " <input type=\"hidden\" name=\"email\" value=\"".$email."\" />\n";
20 echo " <input type=\"hidden\" name=\"password\" value=\"".$password."\" />\n";
21 echo " <input type=\"submit\" class=\"submitbutton\" value=\"go to my user page\" />\n";
28 function output_user_settings($email,$password)
32 echo "<div class=\"useroptions\">\n";
33 echo "<h4> Settings </h4>\n";
34 echo "<form action=\"index.php\" method=\"post\">\n";
35 echo " <input type=\"hidden\" name=\"email\" value=\"".$email."\" />\n";
36 echo " <input type=\"hidden\" name=\"password\" value=\"".$password."\" />\n";
37 echo " <input type=\"submit\" class=\"submitbutton\" name=\"passwd\" value=\"change password\" /> <br />\n";
39 echo "<form action=\"index.php\" method=\"post\">\n";
40 echo " <input type=\"hidden\" name=\"email\" value=\"".$email."\" />\n";
41 echo " <input type=\"hidden\" name=\"password\" value=\"".$password."\" />\n";
42 echo " <input type=\"hidden\" name=\"setpref\" value=\"englishcards\" />\n";
43 echo " <input type=\"submit\" class=\"submitbutton\" value=\"use english cards\" /> <br />\n";
45 echo "<form action=\"index.php\" method=\"post\">\n";
46 echo " <input type=\"hidden\" name=\"email\" value=\"".$email."\" />\n";
47 echo " <input type=\"hidden\" name=\"password\" value=\"".$password."\" />\n";
48 echo " <input type=\"hidden\" name=\"setpref\" value=\"germancards\" />\n";
49 echo " <input type=\"submit\" class=\"submitbutton\" value=\"use german cards\" /> <br />\n";
51 echo "<form action=\"index.php\" method=\"post\">\n";
52 echo " <input type=\"hidden\" name=\"email\" value=\"".$email."\" />\n";
53 echo " <input type=\"hidden\" name=\"password\" value=\"".$password."\" />\n";
54 echo " <input type=\"hidden\" name=\"setpref\" value=\"ccemail\" />\n";
55 if($PREF["ccemail"]=="no")
56 echo " <input type=\"submit\" class=\"submitbutton\" value=\"CC me on final email\" /> <br />\n";
58 echo " <input type=\"submit\" class=\"submitbutton\" value=\"don't CC me on final email\" /> <br />\n";
64 function output_register()
66 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 />";
67 echo "TODO: convert timezone into a menu<br />\n";
68 echo "TODO: figure out a way to handle passwords <br />\n";
70 <form action="index.php" method="post">
72 <legend>Register</legend>
75 <td><label for="Rfullname">Full name:</label></td>
76 <td><input type="text" id="Rfullname" name="Rfullname" size="20" maxsize="30" /> </td>
78 <td><label for="Remail">Email:</label></td>
79 <td><input type="text" id="Remail" name="Remail" size="20" maxsize="30" /></td>
81 <td><label for="Rpassword">Password(will be displayed in cleartext on the next page):</label></td>
82 <td><input type="password" id="Rpassword" name="Rpassword" size="20" maxsize="30" /></td>
84 <td><label for="Rtimezone">Timezone:</label></td>
86 <input type="text" id="Rtimezone" name="Rtimezone" size="4" maxsize="4" value="+1" />
89 <td colspan="2"> <input type="submit" value="register" /></td>
97 function output_ask_for_new_game($playerA,$playerB,$playerC,$playerD,$oldgameid)
101 echo "Do you want to continue playing?(This will start a new game, with the next person as dealer.)\n";
102 echo "<form action=\"index.php\" method=\"post\">\n";
103 echo " <input type=\"hidden\" name=\"PlayerA\" value=\"$playerA\" />\n";
104 echo " <input type=\"hidden\" name=\"PlayerB\" value=\"$playerB\" />\n";
105 echo " <input type=\"hidden\" name=\"PlayerC\" value=\"$playerC\" />\n";
106 echo " <input type=\"hidden\" name=\"PlayerD\" value=\"$playerD\" />\n";
107 echo " <input type=\"hidden\" name=\"dullen\" value=\"".$RULES["dullen"]."\" />\n";
108 echo " <input type=\"hidden\" name=\"schweinchen\" value=\"".$RULES["schweinchen"]."\" />\n";
109 echo " <input type=\"hidden\" name=\"call\" value=\"".$RULES["call"]."\" />\n";
110 echo " <input type=\"hidden\" name=\"followup\" value=\"$oldgameid\" />\n";
111 echo " <input type=\"submit\" value=\"keep playing\" />\n";
117 function output_form_for_new_game($names)
121 <p>Please select four players (or use the randomly pre-selected names)</p>
122 <form action="index.php" method="post">
124 /* ask for player names */
125 foreach( array("PlayerA","PlayerB","PlayerC","PlayerD") as $player)
127 srand((float) microtime() * 10000000);
128 $randkey = array_rand($names);
129 $rand = $names[$randkey];
130 echo " Name: <select name=\"$player\" size=\"1\" /> \n";
131 foreach($names as $name)
135 echo " <option selected=\"selected\">$name</option>\n";
138 echo " <option>$name</option>\n";
144 <p> Some areas are grayed out which means that the rule is not implemented yet and therefore cannot be selected </p>
147 <li> <input type="radio" name="dullen" value="none" /> just normal non-trump </li>
148 <li> <input type="radio" name="dullen" value="firstwins" /> first ten of hearts wins the trick </li>
149 <li> <input type="radio" name="dullen" value="secondwins" checked="checked" /> second ten of hearts wins the trick </li>
152 <p> schweinchen (both foxes), only in normal games or silent solos:
154 <li> <input type="radio" name="schweinchen" value="none" checked="checked" /> none </li>
155 <li> <input type="radio" name="schweinchen" value="both" />
156 both become highest trump (automatic call at beginning of the game)
158 <li> <input type="radio" name="schweinchen" value="second" />
159 first one normal, second one becomes highest (call during the game) </li>
160 <li> <input type="radio" name="schweinchen" value="secondaftercall" disabled="disabled" />
161 second one become highest only in case re/contra was announced (not working yet)
165 <p> Call Re/Contra, etc.:
167 <li><input type="radio" name="call" value="1st-own-card" checked="checked" />
168 Can call re/contra on the first <strong>own</strong> card played, 90 on the second, etc.</li>
169 <li><input type="radio" name="call" value="5th-card" />
170 Can call re/contra until 5th card is played, 90 until 9th card is played, etc.</li>
171 <li><input type="radio" name="call" value="9-cards" />
172 Can call re/contra until 5th card is played, 90 if player still has 9 cards, etc.</li>
175 <input type="submit" value="start game" />
180 function display_card($card,$dir="english")
182 /* cards are only availabl for the odd values, e.g. 1.png, 3.png, ...
183 * convert even cards to the matching odd value */
185 if( $card/2 - (int)($card/2) == 0.5)
186 echo "<img src=\"cards/".$dir."/".$card.".png\" alt=\"".card_to_name($card)."\" />\n";
188 echo "<img src=\"cards/".$dir."/".($card-1).".png\" alt=\"".card_to_name($card-1)."\" />\n";
193 function display_link_card($card,$dir="english",$type="card")
195 if( $card/2 - (int)($card/2) == 0.5)
196 echo "<div class=\"cardinput\"><input type=\"radio\" name=\"".$type."\" value=\"".$card."\" /><img src=\"cards/".$dir."/".$card.".png\" alt=\"\" /></div>\n";
198 echo "<div class=\"cardinput\" ><input type=\"radio\" name=\"".$type."\" value=\"".$card."\" /><img src=\"cards/".$dir."/".($card-1).".png\" alt=\"\" /></div>\n";
202 function output_check_for_sickness($me,$mycards)
205 <form action="index.php" method="post">
207 do you want to play solo?
208 <select name="solo" size="1">
209 <option selected="selected">No</option>
210 <option>trumpless</option>
211 <option>trump</option>
212 <option>queen</option>
213 <option>jack</option>
214 <option>club</option>
215 <option>spade</option>
216 <option>heart</option>
223 if(check_wedding($mycards))
225 echo " yes<input type=\"radio\" name=\"wedding\" value=\"yes\" checked=\"checked\" />";
226 echo " no <input type=\"radio\" name=\"wedding\" value=\"no\" /> <br />\n";
230 echo " no <input type=\"hidden\" name=\"wedding\" value=\"no\" /> <br />\n";
233 echo "Do you have poverty?";
234 if(count_trump($mycards)<4)
236 echo " yes<input type=\"radio\" name=\"poverty\" value=\"yes\" checked=\"checked\" />";
237 echo " no <input type=\"radio\" name=\"poverty\" value=\"no\" /> <br />\n";
241 echo " no <input type=\"hidden\" name=\"poverty\" value=\"no\" /> <br />\n";
244 echo "Do you have too many nines?";
245 if(count_nines($mycards)>4)
247 echo " yes<input type=\"radio\" name=\"nines\" value=\"yes\" checked=\"checked\" />";
248 echo " no <input type=\"radio\" name=\"nines\" value=\"no\" /> <br />\n";
252 echo " no <input type=\"hidden\" name=\"nines\" value=\"no\" /> <br />\n";
255 echo "<input type=\"hidden\" name=\"me\" value=\"$me\" />\n";
256 echo "<input type=\"submit\" value=\"count me in\" />\n";
263 function check_want_to_play($me)
266 <form action="index.php" method="post">
267 Do you want to play a game of DoKo?
268 yes<input type="radio" name="in" value="yes" />
269 no<input type="radio" name="in" value="no" /> <br />
273 Do you want to get an email for every card played or only if it your move?
274 every card<input type="radio" name="update" value="card" />
275 only on my turn<input type="radio" name="update" value="turn" /> <br />
277 echo "<input type=\"hidden\" name=\"me\" value=\"$me\" />\n";
279 echo "<input type=\"submit\" value=\"count me in\" />\n";
285 function output_home_page($pre,$game,$done)
288 <p> If you want to play a game of Doppelkopf, you found the right place ;) </p>
291 echo "<p> At the moment there are no games that are being started ";
293 echo "<p> At the moment there is one games that is being started ";
295 echo "<p> At the moment there are $pre games that are being started ";
300 echo " zero games that are ongoing. ";
302 echo " one game that is ongoing. ";
304 echo "$game games that are ongoing. ";
307 echo "No game has been completed on this server. </p>";
309 echo "One game has been completed on this server. </p>";
311 echo "$done games have been completed on this server. </p>";
314 <p> Please <a href="index.php?register">register</a>, in case you haven't done that yet <br />
315 or login with you email-address or name and password here:
317 <form action="index.php" method="post">
319 <legend>Login</legend>
322 <td><label for="email">Email:</label></td>
323 <td><input type="text" id="email" name="email" size="20" maxlength="30" /> </td>
325 <td><label for="password">Password:</label></td>
326 <td><input type="password" id="password" name="password" size="20" maxlength="30" /></td>
328 <td> <input type="submit" class="submitbutton" name="login" value="login" /></td>
329 <td> <input type="submit" class="submitbutton" name="forgot" value="Forgot your password?" /></td>
339 function output_header()
343 <!DOCTYPE html PUBLIC
344 "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
345 "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
346 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
348 <title>e-Doko</title>
349 <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" />
350 <link rel="stylesheet" type="text/css" href="css/standard.css" />
351 <script type="text/javascript">
353 if(document.getElementById){
356 if(document.getElementById("trick"+i))
357 document.getElementById("trick"+i).style.display = 'none';
359 document.getElementById("trick"+num).style.display = 'block';
362 function high_last(){
363 if(document.getElementById){
366 if(document.getElementById("trick"+i))
376 <body onload="high_last();">
378 <h1> Welcome to E-Doko <sup style="color:#888;">(beta)</sup> </h1>
387 function output_footer()
391 echo "<div class=\"footer\">\n";
392 echo "<p class=\"left\"> copyright 2006-2007 Arun Persaud <br />\n".
393 "Verwendung der [deutschen] Kartenbilder mit Genehmigung <br />der Spielkartenfabrik Altenburg GmbH,(c) ASS Altenburger <br />".
394 "- ASS Altenburger Spielkarten - Spielkartenfabrik Altenburg GmbH <br />".
395 "a Carta Mundi Company Email: info@spielkarten.com Internet: www.spielkarten.com</p>\n";
396 echo "<p class=\"right\"> Revision: $REV; <br /><a href=\"http://svn.nubati.net/emaildoko/trunk/\">".
397 "http://svn.nubati.net/emaildoko/trunk/</a> <br />".
398 "<a href=\"http://www.dreamhost.com/green.cgi\">".
399 "<img border=\"0\" alt=\"Green Web Hosting! This site hosted by DreamHost.\"".
400 "src=\"https://secure.newdream.net/green1.gif\" height=\"32\" width=\"100\" /></a>".