57b3152c035ea29efc511af39670308606951e23
[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;
384    if(isset($_SESSION["name"]))
385      {
386        $name = $_SESSION["name"];
387
388        /* logout info */
389        echo "\n<div class=\"status\">\n";
390        echo $name,"\n";
391        echo " | <a href=\"".$INDEX."\"> mypage </a>\n";
392        echo " | <a href=\"".$INDEX."?action=prefs\">settings</a>\n";
393        echo " | <a href=\"".$INDEX."?action=new\">new game</a>\n";
394        echo " | <a href=\"".$INDEX."?action=stats\">statistics</a>\n";
395        echo " | <a href=\"".$WIKI."\">wiki</a>\n";
396        echo " |&nbsp;&nbsp;&nbsp; <a href=\"".$INDEX."?action=logout\">logout</a>\n";
397        echo "</div>\n";
398
399        /* last logon time */
400        $myid  = DB_get_userid("name",$name);
401        $zone  = DB_get_user_timezone($myid);
402
403        $time     = DB_get_user_timestamp($myid);
404        date_default_timezone_set($defaulttimezone);
405        $unixtime = strtotime($time);
406        date_default_timezone_set($zone);
407
408        echo "<div class=\"lastlogin\"><span>last login: ".date("r",$unixtime)."</span></div>\n";
409      }
410    else
411      {
412        echo "\n<div class=\"status\">\n";
413        echo "<a href=\"".$INDEX."\">login</a>\n";
414        echo "</div>\n";
415      }
416   return;
417 }
418
419 function output_select_timezone($name,$timezone="")
420 {
421   $Tzone = array ("Pacific/Apia"         => "Apia",                /*UTC-11*/
422                   "Pacific/Honolulu"     => "Honolulu",            /*UTC-10*/
423                   "America/Anchorage"    => "Anchorage",           /*UTC-9*/
424                   "America/Vancouver"    => "Berkeley",            /*UTC-8*/
425                   "America/Phoenix"      => "Phoenix",             /*UTC-7*/
426                   "America/Chicago"      => "Chicago",             /*UTC-6*/
427                   "America/New_York"     => "New York",            /*UTC-5*/
428                   "America/Santiago"     => "Santiago",            /*UTC-4*/
429                   "America/Buenos_Aires" => "Buenos Aires",        /*UTC-3*/
430                   "Atlantic/South_Georgia" => "Fernando de Noronha", /*UTC-2*/
431                   "Atlantic/Azores"       => "Azores",             /*UTC-1"*/
432                   "Europe/London"         => "London",             /*UTC*/
433                   "Europe/Berlin"         => "Berlin",             /*UTC+1*/
434                   "Africa/Cairo"          => "Cairo",              /*UTC+2*/
435                   "Europe/Moscow"         => "Moscow",             /*UTC+3*/
436                   "Asia/Tehran"           => "Tehran",             /*UTC+3:30*/
437                   "Asia/Dubai"            => "Dubai",              /*UTC+4*/
438                   "Asia/Karachi"          => "Karachi",            /*UTC+5*/
439                   "Asia/Calcutta"         => "Delhi",              /*UTC+5:30*/
440                   "Asia/Kathmandu"        => "Kathmandu",          /*UTC+5:45*/
441                   "Asia/Dhaka"            => "Dhaka",              /*UTC+6*/
442                   "Asia/Rangoon"          => "Yangon",             /*UTC+6:30*/
443                   "Asia/Bangkok"          => "Bangkok",            /*UTC+7*/
444                   "Asia/Hong_Kong"        => "Beijing",            /*UTC+8*/
445                   "Asia/Tokyo"            => "Tokyo",              /*UTC+9*/
446                   "Australia/Darwin"      => "Darwin",             /*UTC+9:30*/
447                   "Australia/Sydney"      => "Sydney",             /*UTC+10*/
448                   "Asia/Magadan"          => "Magadan",            /*UTC+11*/
449                   "Pacific/Auckland"      => "Wellington" );       /*UTC+12*/
450
451   echo "  <select id=\"$name\" name=\"$name\" size=\"1\">\n";
452
453   foreach($Tzone as $zone=>$city)
454     {
455       if($timezone==$zone)
456         echo "   <option value=\"$zone\" selected=\"selected\">$city</option>\n";
457       else
458         echo "   <option value=\"$zone\">$city</option>\n";
459     }
460   echo "  </select>\n";
461
462   return;
463 }
464
465 function output_password_recovery($email,$password)
466 {
467 ?>
468    <form action="index.php" method="post">
469 <?php
470   echo "  <input type=\"hidden\" name=\"email\" value=\"".$email."\" />\n";
471   echo "  <input type=\"hidden\" name=\"password\" value=\"".$password."\" />\n";
472   echo "  <input type=\"hidden\" name=\"passwd\"  value=\"set\" />\n";
473 ?>
474      <fieldset>
475        <legend>Password recovery</legend>
476         <table>
477          <tr>
478             <td><label for="email">Old password:</label></td>
479             <td><input type="password" id="password0" name="password0" size="20" maxlength="30" /> </td>
480          </tr><tr>
481             <td><label for="password">New password:</label></td>
482             <td><input type="password" id="password1" name="password1" size="20" maxlength="30" /></td>
483          </tr><tr>
484             <td><label for="password">Retype:</label></td>
485             <td><input type="password" id="password2" name="password2" size="20" maxlength="30" /></td>
486          </tr><tr>
487            <td></td>
488            <td> <input type="submit" class="submitbutton" name="passwd" value="set" /></td>
489          </tr>
490         </table>
491      </fieldset>
492    </form>
493
494 <?php
495 }
496
497 function output_user_notes($userid,$gameid,$userstatus)
498 {
499   echo "<div class=\"notes\"> Personal notes: <br />\n";
500   $notes = DB_get_notes_by_userid_and_gameid($userid,$gameid);
501   foreach($notes as $note)
502     echo "$note <hr />\n";
503   if($userstatus!='gameover')
504     echo "<input name=\"note\" type=\"text\" size=\"15\" maxlength=\"100\" />\n";
505   echo "</div> \n";
506
507   return;
508 }
509
510 function output_robotproof($i)
511 {
512   switch($i)
513     {
514     case 0:
515       return "6*7=";
516     case 1:
517       return "5*7=";
518     case 2:
519       return "4*7=";
520     case 3:
521       return "3*7=";
522     case 4:
523       return "2*7=";
524     }
525 }
526
527 function output_exchanged_cards()
528 {
529   /* in a poverty game this function will output the exchanged cards
530    * players in the team will see the cards, the other team will see
531    * the backside of cards
532    */
533
534   /* need some information about the game */
535   global $gameid,$mygametype, $PREF,$me,$mystatus;
536
537   /* some variables to track where the people with poverty are sitting */
538   $partnerpos1 = 0;
539   $povertypos1 = 0;
540   $partnerpos2 = 0;
541   $povertypos2 = 0;
542
543   /* only need to do it in a poverty game, this might not be needed, but
544    * just to make sure everything is ok
545    */
546   if($mygametype == 'poverty' || $mygametype=='dpoverty')
547     {
548       /* find out who has poverty */
549       for($mypos=1;$mypos<5;$mypos++)
550         {
551           $usersick = DB_get_sickness_by_pos_and_gameid($mypos,$gameid);
552           if($usersick == 'poverty')
553             if($povertypos1)
554               $povertypos2 = $mypos;
555             else
556               $povertypos1 = $mypos;
557         }
558       /* get hash and exchanged cards for all involved */
559       $povertyhash1 = DB_get_hash_from_game_and_pos($gameid,$povertypos1);
560       $partnerhash1 = DB_get_partner_hash_by_hash($povertyhash1);
561
562       $povertycards1 = DB_get_exchanged_cards($povertyhash1);
563       $partnercards1 = DB_get_exchanged_cards($partnerhash1);
564
565       $partnerpos1 = DB_get_pos_by_hash($partnerhash1);
566       if($povertypos2)
567         {
568           $povertyhash2 = DB_get_hash_from_game_and_pos($gameid,$povertypos2);
569           $partnerhash2 = DB_get_partner_hash_by_hash($povertyhash2);
570
571           $povertycards2 = DB_get_exchanged_cards($povertyhash2);
572           $partnercards2 = DB_get_exchanged_cards($partnerhash2);
573
574           $partnerpos2 = DB_get_pos_by_hash($partnerhash2);
575         }
576     }
577
578   /* output the cards
579    * go through all positions, check that position has cards that need to be shown and
580    * show those cards
581    */
582   $show=1;
583   for($mypos=1;$mypos<5;$mypos++)
584     {
585       $usersick = DB_get_sickness_by_pos_and_gameid($mypos,$gameid);
586       if($usersick!=NULL ||
587          $mypos==$povertypos1 || $mypos==$partnerpos1 ||
588          $mypos==$povertypos2 || $mypos==$partnerpos2 )
589         {
590           /* figure out if we gave trump back */
591           $trump_back1=0;
592           if($povertypos2)
593             foreach($povertycards1 as $card)
594               {
595                 if(is_trump($card))
596                   {
597                     $trump_back1=1;
598                     break;
599                   }
600               }
601           $trump_back2=0;
602           if($povertypos2)
603             foreach($povertycards2 as $card)
604               {
605                 if(is_trump($card))
606                   {
607                     $trump_back2=1;
608                     break;
609                   }
610               }
611
612           /* output vorbehalt  */
613           echo "      <div class=\"vorbehalt".($mypos-1)."\"> Vorbehalt <br />\n";
614           if($show)
615             echo "       $usersick <br />\n";
616
617           /* output cards */
618           if($mypos==$partnerpos1)
619             {
620               foreach($partnercards1 as $card)
621                 {
622                   echo '        ';
623                   if($povertyhash1 == $me || $partnerhash1 == $me || $mystatus=='gameover')
624                     display_card($card,$PREF['cardset']);
625                   else
626                     display_card(0,$PREF['cardset']);
627                 }
628               if($trump_back1) echo "        Trump back";
629             }
630           else if($mypos==$povertypos1)
631             {
632               foreach($povertycards1 as $card)
633                 {
634                   echo '        ';
635                   if($povertyhash1 == $me || $partnerhash1 == $me || $mystatus=='gameover')
636                     display_card($card,$PREF['cardset']);
637                   else
638                     display_card(0,$PREF['cardset']);
639               }
640               if($trump_back1) echo "        Trump back";
641             }
642           else if($mypos==$povertypos2)
643             {
644               foreach($povertycards2 as $card)
645                 {
646                   echo '        ';
647                   if($povertyhash2 == $me || $partnerhash2 == $me || $mystatus=='gameover')
648                     display_card($card,$PREF['cardset']);
649                   else
650                     display_card(0,$PREF['cardset']);
651                 }
652               if($trump_back2) echo "        Trump back";
653             }
654           else if($mypos==$partnerpos2)
655             {
656               foreach($partnercards2 as $card)
657                 {
658                   if(is_trump($card)) $trump_back=1;
659                   echo '        ';
660                   if($povertyhash2 == $me || $partnerhash2 == $me || $mystatus=='gameover')
661                     display_card($card,$PREF['cardset']);
662                   else
663                     display_card(0,$PREF['cardset']);
664                 }
665               if($trump_back2) echo "        Trump back";
666             }
667           echo  "      </div>\n";
668         }
669       if($mygametype == $usersick)
670         $show = 0;
671     }
672 }
673
674
675 ?>