3 /* functions which only ouput html */
5 function display_status($gametype)
7 echo "<div class=\"info\">";
8 echo " Gametype: $gametype";
14 function display_news()
17 echo "<div class=\"bug\">\n".
18 " Please hit <strong>shift+reload</strong>.<br /><hr />\n".
19 " The server now keeps score... (only from now on) <br /><hr />".
20 " If you find more bugs, please list them in the <a href=\"".
21 $wiki."\">wiki</a>.\n</div>\n";
25 function output_link_to_user_page($email,$password)
27 echo "<div class=\"over\">\n";
28 echo "<form action=\"index.php\" method=\"post\">\n";
29 echo " <input type=\"hidden\" name=\"email\" value=\"".$email."\" />\n";
30 echo " <input type=\"hidden\" name=\"password\" value=\"".$password."\" />\n";
31 echo " <input type=\"submit\" value=\"go to my user page\" />\n";
38 function output_register()
40 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 />";
41 echo "TODO: convert timezone into a menu<br />\n";
42 echo "TODO: figure out a way to handle passwrods <br />\n";
44 <form action="index.php" method="post">
46 <legend>Register</legend>
49 <td><label for="Rfullname">Full name:</label></td>
50 <td><input type="text" id="Rfullname" name="Rfullname" size="20" maxsize="30" /> </td>
52 <td><label for="Remail">Email:</label></td>
53 <td><input type="text" id="Remail" name="Remail" size="20" maxsize="30" /></td>
55 <td><label for="Rpassword">Password(will be displayed in cleartext on the next page):</label></td>
56 <td><input type="password" id="Rpassword" name="Rpassword" size="20" maxsize="30" /></td>
58 <td><label for="Rtimezone">Timezone:</label></td>
60 <input type="text" id="Rtimezone" name="Rtimezone" size="4" maxsize="4" value="+1" />
63 <td colspan="2"> <input type="submit" value="register" /></td>
71 function output_ask_for_new_game($playerA,$playerB,$playerC,$playerD,$oldgameid)
73 echo "Do you want to continue playing?(This will start a new game, with the next person as dealer.)\n";
74 echo "<form action=\"index.php\" method=\"post\">\n";
75 echo " <input type=\"hidden\" name=\"PlayerA\" value=\"$playerA\" />\n";
76 echo " <input type=\"hidden\" name=\"PlayerB\" value=\"$playerB\" />\n";
77 echo " <input type=\"hidden\" name=\"PlayerC\" value=\"$playerC\" />\n";
78 echo " <input type=\"hidden\" name=\"PlayerD\" value=\"$playerD\" />\n";
79 echo " <input type=\"hidden\" name=\"followup\" value=\"$oldgameid\" />\n";
80 echo " <input type=\"submit\" value=\"keep playing\" />\n";
86 function output_form_for_new_game($names)
89 <p>Please select four players </p>
90 <form action="index.php" method="post">
92 foreach( array("PlayerA","PlayerB","PlayerC","PlayerD") as $player)
94 echo " Name: <select name=\"$player\" size=\"1\" /> \n";
95 foreach($names as $name)
96 echo " <option>$name</option>\n";
101 <input type="submit" value="start game" />
106 function display_card($card)
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/".$card.".png\" alt=\"".card_to_name($card)."\" />\n";
114 echo "<img src=\"cards/".($card-1).".png\" alt=\"".card_to_name($card-1)."\" />\n";
119 function display_link_card($card)
121 if( $card/2 - (int)($card/2) == 0.5)
122 echo "<input type=\"radio\" name=\"card\" value=\"".$card."\" /><img src=\"cards/".$card.".png\" alt=\"\" />\n";
124 echo "<input type=\"radio\" name=\"card\" value=\"".$card."\" /><img src=\"cards/".($card-1).".png\" alt=\"\" />\n";
128 function check_for_sickness($me,$mycards)
131 <p> Solo will work, but the first player will not change. Nothing else implemented. </p>
133 <form action="index.php" method="post">
135 do you want to play solo?
136 <select name="solo" size="1">
137 <option selected="selected">No</option>
138 <option>trumpless</option>
139 <option>trump</option>
140 <option>queen</option>
141 <option>jack</option>
142 <option>club</option>
143 <option>spade</option>
144 <option>heart</option>
151 if(check_wedding($mycards))
153 echo " yes<input type=\"radio\" name=\"wedding\" value=\"yes\" checked=\"checked\" />";
154 echo " no <input type=\"radio\" name=\"wedding\" value=\"no\" /> <br />\n";
158 echo " no <input type=\"hidden\" name=\"wedding\" value=\"no\" /> <br />\n";
161 echo "do you have poverty?";
162 if(count_trump($mycards)<4)
164 echo " yes<input type=\"radio\" name=\"poverty\" value=\"yes\" checked=\"checked\" />";
165 echo " no <input type=\"radio\" name=\"poverty\" value=\"no\" /> <br />\n";
169 echo " no <input type=\"hidden\" name=\"poverty\" value=\"no\" /> <br />\n";
172 echo "do you have too many nines?";
173 if(count_nines($mycards)>4)
175 echo " yes<input type=\"radio\" name=\"nines\" value=\"yes\" checked=\"checked\" />";
176 echo " no <input type=\"radio\" name=\"nines\" value=\"no\" /> <br />\n";
180 echo " no <input type=\"hidden\" name=\"nines\" value=\"no\" /> <br />\n";
183 echo "<input type=\"hidden\" name=\"me\" value=\"$me\" />\n";
184 echo "<input type=\"submit\" value=\"count me in\" />\n";
191 function check_want_to_play($me)
194 <form action="index.php" method="post">
195 Do you want to play a game of DoKo?
196 yes<input type="radio" name="in" value="yes" />
197 no<input type="radio" name="in" value="no" /> <br />
199 Do you want to get an email for every card played or only if it your move?
200 every card<input type="radio" name="update" value="card" />
201 only on my turn<input type="radio" name="update" value="turn" /> <br />
203 echo "<input type=\"hidden\" name=\"me\" value=\"$me\" />\n";
205 echo "<input type=\"submit\" value=\"count me in\" />\n";
211 function output_home_page()
214 <p> If you want to play a game of Doppelkopf, you found the right place ;) </p>
215 <p> Please <a href="index.php?register">register</a>, in case you haven't done yet <br />
216 or login with you email-address or name and password here:
218 <form action="index.php" method="post">
220 <legend>Login</legend>
223 <td><label for="email">Email:</label></td><td><input type="text" id="email" name="email" size="20" maxlength="30" /> </td>
225 <td><label for="password">Password:</label></td><td><input type="password" id="password" name="password" size="20" maxlength="30" /></td>
227 <td> <input type="submit" value="login" /></td>
236 function output_header()
240 <!DOCTYPE html PUBLIC
241 "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
242 "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
243 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
245 <title>e-Doko</title>
246 <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" />
247 <link rel="stylesheet" type="text/css" href="css/standard.css" />
248 <script type="text/javascript">
250 if(document.getElementById){
253 if(document.getElementById("trick"+i))
254 document.getElementById("trick"+i).style.display = 'none';
256 document.getElementById("trick"+num).style.display = 'block';
259 function high_last(){
260 if(document.getElementById){
263 if(document.getElementById("trick"+i))
273 <body onload="high_last();">
275 <h1> Welcome to E-Doko </h1>
276 <p> Revision: <?php echo "$REV"; ?></p>
285 function output_footer()