3 /* functions which only ouput html */
5 function output_user_settings($email,$password)
9 echo "<div class=\"useroptions\">\n";
10 echo "<h4> Settings </h4>\n";
11 echo "<a href=\"index.php?passwd=ask\">change password</a><br /";
13 if( $PREF["cardset"] == "english" )
14 echo "<a href=\"index.php?setpref=germancards\">use german cards</a><br />";
16 echo "<a href=\"index.php?setpref=englishcards\">use english cards</a> <br />";
23 function output_ask_for_new_game($playerA,$playerB,$playerC,$playerD,$oldgameid)
27 echo "Do you want to continue playing?(This will start a new game, with the next person as dealer.)\n";
28 echo "<form action=\"index.php\" method=\"post\">\n";
29 echo " <input type=\"hidden\" name=\"PlayerA\" value=\"$playerA\" />\n";
30 echo " <input type=\"hidden\" name=\"PlayerB\" value=\"$playerB\" />\n";
31 echo " <input type=\"hidden\" name=\"PlayerC\" value=\"$playerC\" />\n";
32 echo " <input type=\"hidden\" name=\"PlayerD\" value=\"$playerD\" />\n";
33 echo " <input type=\"hidden\" name=\"dullen\" value=\"".$RULES["dullen"]."\" />\n";
34 echo " <input type=\"hidden\" name=\"schweinchen\" value=\"".$RULES["schweinchen"]."\" />\n";
35 echo " <input type=\"hidden\" name=\"call\" value=\"".$RULES["call"]."\" />\n";
36 echo " <input type=\"hidden\" name=\"followup\" value=\"$oldgameid\" />\n";
37 echo " <input type=\"submit\" value=\"keep playing\" />\n";
43 function output_form_for_new_game($names)
47 <p>Please select four players (or use the randomly pre-selected names)</p>
48 <form action="index.php" method="post">
50 /* ask for player names */
51 foreach( array("PlayerA","PlayerB","PlayerC","PlayerD") as $player)
53 srand((float) microtime() * 10000000);
54 $randkey = array_rand($names);
55 $rand = $names[$randkey];
56 echo " Name: <select name=\"$player\" size=\"1\" /> \n";
57 foreach($names as $name)
61 echo " <option selected=\"selected\">$name</option>\n";
64 echo " <option>$name</option>\n";
70 <p> Some areas are grayed out which means that the rule is not implemented yet and therefore cannot be selected </p>
73 <li> <input type="radio" name="dullen" value="none" /> just normal non-trump </li>
74 <li> <input type="radio" name="dullen" value="firstwins" /> first ten of hearts wins the trick </li>
75 <li> <input type="radio" name="dullen" value="secondwins" checked="checked" /> second ten of hearts wins the trick </li>
78 <p> schweinchen (both foxes), only in normal games or silent solos:
80 <li> <input type="radio" name="schweinchen" value="none" checked="checked" /> none </li>
81 <li> <input type="radio" name="schweinchen" value="both" />
82 both become highest trump (automatic call at beginning of the game)
84 <li> <input type="radio" name="schweinchen" value="second" />
85 first one normal, second one becomes highest (call during the game) </li>
86 <li> <input type="radio" name="schweinchen" value="secondaftercall" disabled="disabled" />
87 second one become highest only in case re/contra was announced (not working yet)
91 <p> Call Re/Contra, etc.:
93 <li><input type="radio" name="call" value="1st-own-card" checked="checked" />
94 Can call re/contra on the first <strong>own</strong> card played, 90 on the second, etc.</li>
95 <li><input type="radio" name="call" value="5th-card" />
96 Can call re/contra until 5th card is played, 90 until 9th card is played, etc.</li>
97 <li><input type="radio" name="call" value="9-cards" />
98 Can call re/contra until 5th card is played, 90 if player still has 9 cards, etc.</li>
101 <input type="submit" value="start game" />
106 function display_card($card,$dir="english")
108 /* cards are only availabl for the odd values, e.g. 1.png, 3.png, ...
109 * convert even cards to the matching odd value */
111 if( $card/2 - (int)($card/2) == 0.5)
112 echo "<img src=\"cards/".$dir."/".$card.".png\" alt=\"".DB_get_card_name($card)."\" />\n";
114 echo "<img src=\"cards/".$dir."/".($card-1).".png\" alt=\"".DB_get_card_name($card-1)."\" />\n";
119 function display_link_card($card,$dir="english",$type="card")
121 if( $card/2 - (int)($card/2) == 0.5)
122 echo "<div class=\"cardinput\"><input type=\"radio\" name=\"".$type."\" value=\"".$card."\" /><img src=\"cards/".$dir."/".$card.".png\" alt=\"".DB_get_card_name($card)."\" /></div>\n";
124 echo "<div class=\"cardinput\" ><input type=\"radio\" name=\"".$type."\" value=\"".$card."\" /><img src=\"cards/".$dir."/".($card-1).".png\" alt=\"".DB_get_card_name($card-1)."\" /></div>\n";
128 function output_check_for_sickness($me,$mycards)
131 <div class="sickness"> Thanks for joining the game...<br />
133 do you want to play solo?
134 <select name="solo" size="1">
135 <option selected="selected">No</option>
136 <option>trumpless</option>
137 <option>trump</option>
138 <option>queen</option>
139 <option>jack</option>
140 <option>club</option>
141 <option>spade</option>
142 <option>heart</option>
149 if(check_wedding($mycards))
151 echo " yes<input type=\"radio\" name=\"wedding\" value=\"yes\" checked=\"checked\" />";
152 echo " no <input type=\"radio\" name=\"wedding\" value=\"no\" /> <br />\n";
156 echo " no <input type=\"hidden\" name=\"wedding\" value=\"no\" /> <br />\n";
159 echo "Do you have poverty?";
160 if(count_trump($mycards)<4)
162 echo " yes<input type=\"radio\" name=\"poverty\" value=\"yes\" checked=\"checked\" />";
163 echo " no <input type=\"radio\" name=\"poverty\" value=\"no\" /> <br />\n";
167 echo " no <input type=\"hidden\" name=\"poverty\" value=\"no\" /> <br />\n";
170 echo "Do you have too many nines?";
171 if(count_nines($mycards)>4)
173 echo " yes<input type=\"radio\" name=\"nines\" value=\"yes\" checked=\"checked\" />";
174 echo " no <input type=\"radio\" name=\"nines\" value=\"no\" /> <br />\n";
178 echo " no <input type=\"hidden\" name=\"nines\" value=\"no\" /> <br />\n";
181 echo "<input type=\"hidden\" name=\"me\" value=\"$me\" />\n";
182 echo "<input type=\"submit\" value=\"count me in\" />\n";
189 function output_form_calls($me)
191 if( can_call(120,$me) )
192 echo " re/contra (120):".
193 " <input type=\"radio\" name=\"call120\" value=\"yes\" /> <br />";
194 if( can_call(90,$me) )
196 " <input type=\"radio\" name=\"call90\" value=\"yes\" /> <br />";
197 if( can_call(60,$me) )
199 " <input type=\"radio\" name=\"call60\" value=\"yes\" /> <br />";
200 if( can_call(30,$me) )
202 " <input type=\"radio\" name=\"call30\" value=\"yes\" /> <br />";
203 if( can_call(0,$me) )
205 " <input type=\"radio\" name=\"call0\" value=\"yes\" /> <br />".
207 " <input type=\"radio\" name=\"call0\" value=\"no\" /> <br />";
211 function output_check_want_to_play($me)
214 <div class="joingame">
215 Do you want to play a game of DoKo? <br />
216 yes<input type="radio" name="in" value="yes" />
217 no<input type="radio" name="in" value="no" /> <br />
219 echo "<input type=\"hidden\" name=\"me\" value=\"$me\" />\n";
221 echo "<input type=\"submit\" value=\"submit\" />\n";
227 function output_home_page($pre,$game,$done,$avgtime)
230 <p> If you want to play a game of Doppelkopf, you found the right place ;) </p>
233 echo "<p> At the moment there are no games that are being started ";
235 echo "<p> At the moment there is one games that is being started ";
237 echo "<p> At the moment there are $pre games that are being started ";
242 echo "zero games that are ongoing. ";
244 echo "one game that is ongoing. ";
246 echo "$game games that are ongoing. ";
251 echo "No game has been completed on this server. </p>";
253 echo "One game has been completed on this server. </p>";
255 echo "$done games have been completed on this server. Average time of a game: $avgtime days</p>";
258 <p> Please <a href="register.php">register</a>, in case you haven't done that yet <br />
259 or login with you email-address or name and password here:
261 <form action="index.php" method="post">
263 <legend>Login</legend>
266 <td><label for="email">Email:</label></td>
267 <td><input type="text" id="email" name="email" size="20" maxlength="30" /> </td>
269 <td><label for="password">Password:</label></td>
270 <td><input type="password" id="password" name="password" size="20" maxlength="30" /></td>
272 <td> <input type="submit" class="submitbutton" name="login" value="login" /></td>
273 <td> <input type="submit" class="submitbutton" name="forgot" value="Forgot your password?" /></td>
283 function output_header()
287 <!DOCTYPE html PUBLIC
288 "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
289 "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
290 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
292 <title>e-Doko</title>
293 <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" />
294 <link rel="stylesheet" type="text/css" href="css/standard.css" />
295 <script type="text/javascript">
297 if(document.getElementById){
300 if(document.getElementById("trick"+i))
301 document.getElementById("trick"+i).style.display = 'none';
303 document.getElementById("trick"+num).style.display = 'block';
306 function high_last(){
307 if(document.getElementById){
310 if(document.getElementById("trick"+i))
320 <body onload="high_last();">
322 <h1> Welcome to E-Doko <sup style="color:#888;">(beta)</sup> </h1>
329 function output_footer()
334 echo "<div class=\"footer\">\n";
335 echo "<p class=\"left\"> copyright 2006-2007 Arun Persaud <br />\n".
336 "Verwendung der [deutschen] Kartenbilder mit Genehmigung <br />der Spielkartenfabrik Altenburg GmbH,(c) ASS Altenburger <br />".
337 "- ASS Altenburger Spielkarten - Spielkartenfabrik Altenburg GmbH <br />".
338 "a Carta Mundi Company Email: info@spielkarten.com Internet: www.spielkarten.com</p>\n";
339 echo "<p class=\"right\"> See the latest changes <a href=\"http://nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=summary\">".
340 "via git </a> <br />or download the source via <br />'git clone http://nubati.net/git/e-DoKo.git' <br />".
341 "<a href=\"http://www.dreamhost.com/green.cgi\">".
342 "<img border=\"0\" alt=\"Green Web Hosting! This site hosted by DreamHost.\"".
343 "src=\"https://secure.newdream.net/green1.gif\" height=\"32\" width=\"100\" /></a>".
354 function output_status($name)
356 echo "<div class=\"status\">\n";
358 echo " <a href=\"index.php?logout=1\">logout</a>\n";
365 function output_password_recovery($email,$password)
368 <form action="index.php" method="post">
370 echo " <input type=\"hidden\" name=\"email\" value=\"".$email."\" />\n";
371 echo " <input type=\"hidden\" name=\"password\" value=\"".$password."\" />\n";
372 echo " <input type=\"hidden\" name=\"passwd\" value=\"set\" />\n";
375 <legend>Password recovery</legend>
378 <td><label for="email">Old password:</label></td>
379 <td><input type="password" id="password0" name="password0" size="20" maxlength="30" /> </td>
381 <td><label for="password">New password:</label></td>
382 <td><input type="password" id="password1" name="password1" size="20" maxlength="30" /></td>
384 <td><label for="password">Retype:</label></td>
385 <td><input type="password" id="password2" name="password2" size="20" maxlength="30" /></td>
388 <td> <input type="submit" class="submitbutton" name="passwd" value="set" /></td>