NEW FEATURE: provide an RSS feed for each user showing in which games it's his turn
[e-DoKo.git] / include / output.php
1 <?php
2 /* make sure that we are not called from outside the scripts,
3  * use a variable defined in config.php to check this
4  */
5 if(!isset($HOST))
6   exit;
7
8 /* functions which only ouput html  */
9
10 function output_ask_for_new_game($playerA,$playerB,$playerC,$playerD,$oldgameid)
11 {
12   global $RULES;
13
14   echo "<div class=\"message\">\n<form action=\"index.php?action=new\" method=\"post\">\n";
15   echo "Do you want to continue playing?(This will start a new game, with $playerD as dealer.)\n";
16   echo "  <input type=\"hidden\" name=\"PlayerA\" value=\"$playerA\" />\n";
17   echo "  <input type=\"hidden\" name=\"PlayerB\" value=\"$playerB\" />\n";
18   echo "  <input type=\"hidden\" name=\"PlayerC\" value=\"$playerC\" />\n";
19   echo "  <input type=\"hidden\" name=\"PlayerD\" value=\"$playerD\" />\n";
20   echo "  <input type=\"hidden\" name=\"dullen\"  value=\"".$RULES["dullen"]."\" />\n";
21   echo "  <input type=\"hidden\" name=\"schweinchen\" value=\"".$RULES["schweinchen"]."\" />\n";
22   echo "  <input type=\"hidden\" name=\"callrule\" value=\"".$RULES["call"]."\" />\n";
23   echo "  <input type=\"hidden\" name=\"followup\" value=\"$oldgameid\" />\n";
24   echo "  <input type=\"submit\" value=\"keep playing\" />\n";
25   echo "</form>\n</div>";
26   return;
27 }
28
29 function output_form_for_new_game($names)
30 {
31   $copy_names = $names; /* local copy, so that we can delete names from it
32                          * after we selected them to make sure that each name
33                          * only shows up once
34                          */
35 ?>
36   <form action="index.php?action=new" method="post">
37     <h2> Select players (Remember: you need to be one of the players) </h2>
38
39    <div class="table">
40      <img class="table" src="pics/table.png" alt="table" />
41 <?php
42
43   /* ask player for names */
44
45   $i=0;
46
47   /* delete players name, since he will be on position D anyway */
48   unset($copy_names[array_search($_SESSION["name"],$copy_names)]);
49
50   srand((float) microtime() * 10000000);
51   foreach( array("PlayerA","PlayerB","PlayerC","PlayerD") as $player)
52     {
53       /* pick 3 names at random and put the players name on position D*/
54       if($i<3)
55         {
56           $randkey = array_rand($copy_names);
57           $rand = $copy_names[$randkey];
58           /* delete this name from the list of possible names */
59           unset($copy_names[$randkey]);
60         }
61       else
62         {
63           $rand = $_SESSION["name"];
64         }
65
66       echo  "     <div class=\"table".$i."\">\n";
67       $i++;
68       echo "       <select name=\"$player\" size=\"1\">  \n";
69       foreach($names as $name)
70         {
71           if($name==$rand)
72             {
73               echo "         <option selected=\"selected\">$name</option>\n";
74             }
75           else
76             echo "         <option>$name</option>\n";
77         }
78       echo "       </select>\n     </div>\n";
79     }
80 ?>
81     </div>
82
83      <h2 class="rules">Rules</h2>
84      <h3>Gameplay-related</h3>
85      <h4>Ten of hearts:</h4>
86      <p>
87        <select name="dullen">
88          <option value="none"> just normal non-trump  </option>
89          <option value="firstwins"> first ten of hearts wins the trick </option>
90          <option value="secondwins" selected="selected"> second ten of hearts wins the trick </option>
91        </select>
92      </p>
93      <h4>Schweinchen (both foxes), only in normal games or silent solos:</h4>
94      <p>
95        <select name="schweinchen">
96          <option value="none" selected="selected"> none </option>
97          <option value="both"> both become highest trump (automatic call at beginning of the game)   </option>
98          <option value="second"> first one normal, second one becomes highest (call during the game) </option>
99          <option value="secondaftercall">  second one become highest only in case re/contra was announced
100          </option>
101        </select>
102      </p>
103      <h4>Call Re/Contra, etc.:</h4>
104      <p>
105        <select name="callrule">
106          <option value="1st-own-card" selected="selected">  Can call re/contra on the first <strong>own</strong> card played, 90 on the second, etc.</option>
107          <option value="5th-card">  Can call re/contra until 5th card is played, 90 until 9th card is played, etc.</option>
108          <option value="9-cards" > Can call re/contra until 5th card is played, 90 if player still has 9 cards, etc.</option>
109        </select>
110      </p>
111      <h3>Scoring-related</h3>
112      <h4>(not yet implemented)</h4>
113      <p><input type="submit" value="start game"></p>
114      </form>
115 <?php
116 }
117
118 function output_table($data,$caption="",$class="",$id="")
119 {
120
121   $HTML  = "\n<table";
122
123   if($class!="")
124     $HTML.= " class=\"$class\"";
125   if($id!="")
126     $HTML.= " id=\"$id\"";
127
128   $HTML.=">\n";
129
130   $i=0;
131
132   if($caption!="")
133     $HTML .= "  <caption> $caption </caption>\n";
134
135   foreach($data as $record)
136     {
137       if(!$i)
138         $HTML .= "  <thead>\n  <tr>\n";
139       else
140         {
141           if($i==1) $HTML .= "  <tbody>\n";
142           $HTML .= "  <tr>  ";
143         }
144       foreach($record as $point)
145         {
146           if($i)
147             $HTML .= "    <td>$point</td> ";
148           else
149             $HTML .= "    <th>$point</th> ";
150         }
151
152       if(!$i)
153         $HTML .= "  </tr>\n  </thead>\n";
154       else
155         {
156           $HTML .= "  </tr>\n";
157         }
158       $i++;
159     }
160   $HTML .= "  </tbody>\n</table>\n";
161
162   return $HTML;
163 }
164
165 function display_card($card,$dir="english")
166 {
167   /* cards are only availabl for the odd values, e.g. 1.png, 3.png, ...
168    * convert even cards to the matching odd value */
169
170   if( $card/2 - (int)($card/2) == 0.5 || $card == 0)
171     echo "<img src=\"cards/".$dir."/".$card.".png\"  alt=\"".DB_get_card_name($card)."\" />\n";
172   else
173     echo "<img src=\"cards/".$dir."/".($card-1).".png\"  alt=\"".DB_get_card_name($card-1)."\" />\n";
174
175   return;
176 }
177
178 function display_link_card($card,$dir="english",$type="card")
179 {
180   if( $card/2 - (int)($card/2) == 0.5)
181     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";
182   else
183     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";
184   return;
185 }
186
187 function output_check_for_sickness($me,$mycards)
188 {
189  ?>
190   <div class="sickness"> Thanks for joining the game...<br />
191
192     do you want to play solo?
193     <select name="solo" size="1">
194       <option selected="selected">No</option>
195       <option>trumpless</option>
196       <option>trump</option>
197       <option>queen</option>
198       <option>jack</option>
199       <option>club</option>
200       <option>spade</option>
201       <option>heart</option>
202     </select>
203     <br />
204
205  <?php
206
207   echo "Wedding?";
208   if(check_wedding($mycards))
209      {
210        echo " yes<input type=\"radio\" name=\"wedding\" value=\"yes\" checked=\"checked\" />";
211        echo " no <input type=\"radio\" name=\"wedding\" value=\"no\" /> <br />\n";
212      }
213    else
214      {
215        echo " no <input type=\"hidden\" name=\"wedding\" value=\"no\" /> <br />\n";
216      };
217
218   echo "Do you have poverty?";
219   if(count_trump($mycards)<4)
220     {
221       echo " yes<input type=\"radio\" name=\"poverty\" value=\"yes\" checked=\"checked\" />";
222       echo " no <input type=\"radio\" name=\"poverty\" value=\"no\" /> <br />\n";
223     }
224   else
225     {
226       echo " no <input type=\"hidden\" name=\"poverty\" value=\"no\" /> <br />\n";
227     };
228
229    echo "Do you have too many nines?";
230   if(count_nines($mycards)>4)
231      {
232        echo " yes<input type=\"radio\" name=\"nines\" value=\"yes\" checked=\"checked\" />";
233        echo " no <input type=\"radio\" name=\"nines\" value=\"no\" /> <br />\n";
234      }
235    else
236      {
237        echo " no <input type=\"hidden\" name=\"nines\" value=\"no\" /> <br />\n";
238      };
239
240    echo "<input type=\"hidden\" name=\"me\" value=\"$me\" />\n";
241    echo "<input type=\"submit\" value=\"count me in\" />\n";
242
243    echo "</div>\n";
244
245   return;
246 }
247
248 function output_form_calls($me,$myparty)
249 {
250   $highstart = "<span class=\"highcall\">";
251   $highend   = "</span>";
252
253   $tmp = can_call(120,$me);
254   if( $tmp )
255     {
256       if($tmp==2) echo $highstart;
257       if($myparty=='re')
258         echo "re (120):";
259       else if ($myparty=='contra')
260         echo "contra (120):";
261       else
262         echo " re/contra (120):";
263       echo " <input type=\"radio\" name=\"call\" value=\"120\" />";
264       if($tmp==2) echo $highend;
265       echo "<br />\n";
266     }
267   $tmp =  can_call(90,$me);
268   if( $tmp )
269     {
270       if($tmp==2) echo $highstart;
271       echo " 90:".
272         " <input type=\"radio\" name=\"call\" value=\"90\" />";
273       if($tmp==2) echo $highend;
274       echo "<br />\n";
275     }
276   $tmp = can_call(60,$me);
277   if( $tmp )
278     {
279       if($tmp==2) echo $highstart;
280       echo " 60:".
281         " <input type=\"radio\" name=\"call\" value=\"60\" />";
282       if($tmp==2) echo $highend;
283       echo "<br />\n";
284     }
285   $tmp = can_call(30,$me);
286   if( $tmp )
287     {
288       if($tmp==2) echo $highstart;
289       echo " 30:".
290         " <input type=\"radio\" name=\"call\" value=\"30\" />";
291       if($tmp==2) echo $highend;
292       echo "<br />\n";
293     }
294   $tmp = can_call(0,$me);
295   if( $tmp )
296     {
297       if($tmp==2) echo $highstart;
298       echo " 0:".
299         " <input type=\"radio\" name=\"call\" value=\"0\" />";
300       if($tmp==2) echo $highend;
301       echo "<br />\n".
302         " no call:".
303         " <input type=\"radio\" name=\"call\" value=\"no\" /> <br />";
304     }
305 }
306
307 function output_check_want_to_play($me)
308 {
309    ?>
310  <div class="joingame">
311    Do you want to play a game of DoKo? <br />
312    yes<input type="radio" name="in" value="yes" />
313    no<input type="radio" name="in" value="no" /> <br />
314 <?php
315   echo "<input type=\"hidden\" name=\"me\" value=\"$me\" />\n";
316   echo "\n";
317   echo "<input type=\"submit\" value=\"submit\" />\n";
318   echo " </div>\n";
319
320   return;
321 }
322
323 function output_header()
324 {
325    global $REV;
326 ?>
327 <!DOCTYPE html PUBLIC
328     "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
329     "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
330 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
331   <head>
332      <title>e-Doko</title>
333      <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" />
334      <link rel="shortcut icon" type="image/x-icon" href="pics/edoko-favicon.png" />
335      <link rel="stylesheet" type="text/css" href="css/standard023.css" />
336      <script type="text/javascript" src="include/game.js"> </script>
337      <script type="text/javascript" src="include/jquery.js"> </script>
338      <script type="text/javascript" src="include/jquery.tablesorter.js"></script>
339      <script type="text/javascript">
340         $(document).ready(function()
341            {
342               $("#ScoreTable").tablesorter({ widgets: ['zebra']});
343            });
344      </script>
345   </head>
346 <body onload="high_last();">
347 <div class="header">
348 <h1> Welcome to E-Doko </h1>
349 </div>
350 <?php
351
352   echo "<div class=\"main\">";
353   return;
354 }
355
356 function output_footer()
357 {
358   global $REV,$PREF;
359
360   echo "</div>\n\n";
361   echo "<div class=\"footer\">\n";
362   echo "  <p class=\"left\"> copyright 2006-2009 Arun Persaud, Lance Thornton(graphics), Jeff Zerger(database support) <br />\n".
363     "  Verwendung der [deutschen] Kartenbilder mit Genehmigung <br />der Spielkartenfabrik Altenburg GmbH,(c) ASS Altenburger <br />\n".
364     "  - ASS Altenburger Spielkarten - Spielkartenfabrik Altenburg GmbH <br />\n".
365     "  a Carta Mundi Company Email: info@spielkarten.com Internet: www.spielkarten.com</p>\n";
366  echo " <p class=\"right\"> See the latest changes <a href=\"http://nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=summary\">\n".
367     "  via git </a> <br />or download the source via <br />\n'git clone http://nubati.net/git/e-DoKo.git' <br />\n".
368     "  <a href=\"http://www.dreamhost.com/green.cgi\">\n".
369     "  <img  border=\"0\" alt=\"Green Web Hosting! This site hosted by DreamHost.\"".
370     "src=\"https://secure.newdream.net/green1.gif\" height=\"32\" width=\"100\" /></a>\n".
371     "  </p> \n";
372   echo "\n";
373   echo "</div>\n";
374
375   echo "</body>\n";
376   echo "</html>\n";
377
378   return;
379 }
380
381 function output_status()
382 {
383   global $defaulttimezone, $INDEX, $WIKI, $RSS;
384
385   if(isset($_SESSION["name"]))
386     {
387       $name = $_SESSION["name"];
388
389       /* last logon time */
390       $myid  = DB_get_userid("name",$name);
391       $zone  = DB_get_user_timezone($myid);
392
393       $time     = DB_get_user_timestamp($myid);
394       date_default_timezone_set($defaulttimezone);
395       $unixtime = strtotime($time);
396       date_default_timezone_set($zone);
397
398       /* rss token */
399       $token = get_user_token($myid);
400
401       /* logout info */
402       echo "\n<div class=\"status\">\n";
403       echo $name,"\n";
404       echo " | <a href=\"".$INDEX."\"> mypage </a>\n";
405       echo " | <a href=\"".$INDEX."?action=prefs\">settings</a>\n";
406       echo " | <a href=\"".$INDEX."?action=new\">new game</a>\n";
407       echo " | <a href=\"".$INDEX."?action=stats\">statistics</a>\n";
408       echo " | <a href=\"".$WIKI."\">wiki</a>\n";
409       echo " | <a href=\"".$RSS."?uid=".$myid."&amp;token=".$token."\">rss</a>\n";
410       echo " |&nbsp;&nbsp;&nbsp; <a href=\"".$INDEX."?action=logout\">logout</a>\n";
411       echo "</div>\n";
412
413       echo "<div class=\"lastlogin\"><span>last login: ".date("r",$unixtime)."</span></div>\n";
414     }
415   else
416     {
417       echo "\n<div class=\"status\">\n";
418       echo "<a href=\"".$INDEX."\">login</a>\n";
419       echo "</div>\n";
420     }
421   return;
422 }
423
424 function output_select_timezone($name,$timezone="")
425 {
426   $Tzone = array ("Pacific/Apia"         => "Apia",                /*UTC-11*/
427                   "Pacific/Honolulu"     => "Honolulu",            /*UTC-10*/
428                   "America/Anchorage"    => "Anchorage",           /*UTC-9*/
429                   "America/Vancouver"    => "Berkeley",            /*UTC-8*/
430                   "America/Phoenix"      => "Phoenix",             /*UTC-7*/
431                   "America/Chicago"      => "Chicago",             /*UTC-6*/
432                   "America/New_York"     => "New York",            /*UTC-5*/
433                   "America/Santiago"     => "Santiago",            /*UTC-4*/
434                   "America/Buenos_Aires" => "Buenos Aires",        /*UTC-3*/
435                   "Atlantic/South_Georgia" => "Fernando de Noronha", /*UTC-2*/
436                   "Atlantic/Azores"       => "Azores",             /*UTC-1"*/
437                   "Europe/London"         => "London",             /*UTC*/
438                   "Europe/Berlin"         => "Berlin",             /*UTC+1*/
439                   "Africa/Cairo"          => "Cairo",              /*UTC+2*/
440                   "Europe/Moscow"         => "Moscow",             /*UTC+3*/
441                   "Asia/Tehran"           => "Tehran",             /*UTC+3:30*/
442                   "Asia/Dubai"            => "Dubai",              /*UTC+4*/
443                   "Asia/Karachi"          => "Karachi",            /*UTC+5*/
444                   "Asia/Calcutta"         => "Delhi",              /*UTC+5:30*/
445                   "Asia/Kathmandu"        => "Kathmandu",          /*UTC+5:45*/
446                   "Asia/Dhaka"            => "Dhaka",              /*UTC+6*/
447                   "Asia/Rangoon"          => "Yangon",             /*UTC+6:30*/
448                   "Asia/Bangkok"          => "Bangkok",            /*UTC+7*/
449                   "Asia/Hong_Kong"        => "Beijing",            /*UTC+8*/
450                   "Asia/Tokyo"            => "Tokyo",              /*UTC+9*/
451                   "Australia/Darwin"      => "Darwin",             /*UTC+9:30*/
452                   "Australia/Sydney"      => "Sydney",             /*UTC+10*/
453                   "Asia/Magadan"          => "Magadan",            /*UTC+11*/
454                   "Pacific/Auckland"      => "Wellington" );       /*UTC+12*/
455
456   echo "  <select id=\"$name\" name=\"$name\" size=\"1\">\n";
457
458   foreach($Tzone as $zone=>$city)
459     {
460       if($timezone==$zone)
461         echo "   <option value=\"$zone\" selected=\"selected\">$city</option>\n";
462       else
463         echo "   <option value=\"$zone\">$city</option>\n";
464     }
465   echo "  </select>\n";
466
467   return;
468 }
469
470 function output_password_recovery($email,$password)
471 {
472 ?>
473    <form action="index.php" method="post">
474 <?php
475   echo "  <input type=\"hidden\" name=\"email\" value=\"".$email."\" />\n";
476   echo "  <input type=\"hidden\" name=\"password\" value=\"".$password."\" />\n";
477   echo "  <input type=\"hidden\" name=\"passwd\"  value=\"set\" />\n";
478 ?>
479      <fieldset>
480        <legend>Password recovery</legend>
481         <table>
482          <tr>
483             <td><label for="email">Old password:</label></td>
484             <td><input type="password" id="password0" name="password0" size="20" maxlength="30" /> </td>
485          </tr><tr>
486             <td><label for="password">New password:</label></td>
487             <td><input type="password" id="password1" name="password1" size="20" maxlength="30" /></td>
488          </tr><tr>
489             <td><label for="password">Retype:</label></td>
490             <td><input type="password" id="password2" name="password2" size="20" maxlength="30" /></td>
491          </tr><tr>
492            <td></td>
493            <td> <input type="submit" class="submitbutton" name="passwd" value="set" /></td>
494          </tr>
495         </table>
496      </fieldset>
497    </form>
498
499 <?php
500 }
501
502 function output_user_notes($userid,$gameid,$userstatus)
503 {
504   echo "<div class=\"notes\"> Personal notes: <br />\n";
505   $notes = DB_get_notes_by_userid_and_gameid($userid,$gameid);
506   foreach($notes as $note)
507     echo "$note <hr />\n";
508   if($userstatus!='gameover')
509     echo "<input name=\"note\" type=\"text\" size=\"15\" maxlength=\"100\" />\n";
510   echo "</div> \n";
511
512   return;
513 }
514
515 function output_robotproof($i)
516 {
517   switch($i)
518     {
519     case 0:
520       return "6*7=";
521     case 1:
522       return "5*7=";
523     case 2:
524       return "4*7=";
525     case 3:
526       return "3*7=";
527     case 4:
528       return "2*7=";
529     }
530 }
531
532 function output_exchanged_cards()
533 {
534   /* in a poverty game this function will output the exchanged cards
535    * players in the team will see the cards, the other team will see
536    * the backside of cards
537    */
538
539   /* need some information about the game */
540   global $gameid,$mygametype, $PREF,$me,$mystatus;
541
542   /* some variables to track where the people with poverty are sitting */
543   $partnerpos1 = 0;
544   $povertypos1 = 0;
545   $partnerpos2 = 0;
546   $povertypos2 = 0;
547
548   /* only need to do it in a poverty game, this might not be needed, but
549    * just to make sure everything is ok
550    */
551   if($mygametype == 'poverty' || $mygametype=='dpoverty')
552     {
553       /* find out who has poverty */
554       for($mypos=1;$mypos<5;$mypos++)
555         {
556           $usersick = DB_get_sickness_by_pos_and_gameid($mypos,$gameid);
557           if($usersick == 'poverty')
558             if($povertypos1)
559               $povertypos2 = $mypos;
560             else
561               $povertypos1 = $mypos;
562         }
563       /* get hash and exchanged cards for all involved */
564       $povertyhash1 = DB_get_hash_from_game_and_pos($gameid,$povertypos1);
565       $partnerhash1 = DB_get_partner_hash_by_hash($povertyhash1);
566
567       $povertycards1 = DB_get_exchanged_cards($povertyhash1);
568       $partnercards1 = DB_get_exchanged_cards($partnerhash1);
569
570       $partnerpos1 = DB_get_pos_by_hash($partnerhash1);
571       if($povertypos2)
572         {
573           $povertyhash2 = DB_get_hash_from_game_and_pos($gameid,$povertypos2);
574           $partnerhash2 = DB_get_partner_hash_by_hash($povertyhash2);
575
576           $povertycards2 = DB_get_exchanged_cards($povertyhash2);
577           $partnercards2 = DB_get_exchanged_cards($partnerhash2);
578
579           $partnerpos2 = DB_get_pos_by_hash($partnerhash2);
580         }
581     }
582
583   /* output the cards
584    * go through all positions, check that position has cards that need to be shown and
585    * show those cards
586    */
587   $show=1;
588   for($mypos=1;$mypos<5;$mypos++)
589     {
590       $usersick = DB_get_sickness_by_pos_and_gameid($mypos,$gameid);
591       if($usersick!=NULL ||
592          $mypos==$povertypos1 || $mypos==$partnerpos1 ||
593          $mypos==$povertypos2 || $mypos==$partnerpos2 )
594         {
595           /* figure out if we gave trump back */
596           $trump_back1=0;
597           if($povertypos2)
598             foreach($povertycards1 as $card)
599               {
600                 if(is_trump($card))
601                   {
602                     $trump_back1=1;
603                     break;
604                   }
605               }
606           $trump_back2=0;
607           if($povertypos2)
608             foreach($povertycards2 as $card)
609               {
610                 if(is_trump($card))
611                   {
612                     $trump_back2=1;
613                     break;
614                   }
615               }
616
617           /* output vorbehalt  */
618           echo "      <div class=\"vorbehalt".($mypos-1)."\"> Vorbehalt <br />\n";
619           if($show)
620             echo "       $usersick <br />\n";
621
622           /* output cards */
623           if($mypos==$partnerpos1)
624             {
625               foreach($partnercards1 as $card)
626                 {
627                   echo '        ';
628                   if($povertyhash1 == $me || $partnerhash1 == $me || $mystatus=='gameover')
629                     display_card($card,$PREF['cardset']);
630                   else
631                     display_card(0,$PREF['cardset']);
632                 }
633               if($trump_back1) echo "        Trump back";
634             }
635           else if($mypos==$povertypos1)
636             {
637               foreach($povertycards1 as $card)
638                 {
639                   echo '        ';
640                   if($povertyhash1 == $me || $partnerhash1 == $me || $mystatus=='gameover')
641                     display_card($card,$PREF['cardset']);
642                   else
643                     display_card(0,$PREF['cardset']);
644               }
645               if($trump_back1) echo "        Trump back";
646             }
647           else if($mypos==$povertypos2)
648             {
649               foreach($povertycards2 as $card)
650                 {
651                   echo '        ';
652                   if($povertyhash2 == $me || $partnerhash2 == $me || $mystatus=='gameover')
653                     display_card($card,$PREF['cardset']);
654                   else
655                     display_card(0,$PREF['cardset']);
656                 }
657               if($trump_back2) echo "        Trump back";
658             }
659           else if($mypos==$partnerpos2)
660             {
661               foreach($partnercards2 as $card)
662                 {
663                   if(is_trump($card)) $trump_back=1;
664                   echo '        ';
665                   if($povertyhash2 == $me || $partnerhash2 == $me || $mystatus=='gameover')
666                     display_card($card,$PREF['cardset']);
667                   else
668                     display_card(0,$PREF['cardset']);
669                 }
670               if($trump_back2) echo "        Trump back";
671             }
672           echo  "      </div>\n";
673         }
674       if($mygametype == $usersick)
675         $show = 0;
676     }
677 }
678
679
680 ?>