+
+/******************************************************************************
+ * Output menu for selecting tricks
+ ******************************************************************************/
+
+switch($mystatus)
+ {
+ case 'start':
+ break;
+ case 'init':
+ case 'check':
+ /* output sickness of other playes, in case they already selected and are sitting in front of the current player */
+ echo "\n<ul class=\"tricks\">\n";
+ echo " <li onclick=\"hl('0');\" class=\"current\"><a href=\"#\">Pre</a>\n".
+ " <div class=\"trick\" id=\"trick0\">\n";
+
+ for($pos=1;$pos<5;$pos++)
+ {
+ $usersick = DB_get_sickness_by_pos_and_gameid($pos,$gameid);
+ $userid = DB_get_userid('gameid-position',$gameid,$pos);
+ $userstatus = DB_get_hand_status_by_userid_and_gameid($userid,$gameid);
+
+ if($userstatus=='start' || $userstatus=='init')
+ echo " <div class=\"vorbehalt".($pos-1)."\"> still needs <br />to decide </div>\n"; /* show this to everyone */
+ else
+ if($usersick!=NULL) /* in the init-phase we only showed players with $pos<$mypos, now we can show all */
+ echo " <div class=\"vorbehalt".($pos-1)."\"> sick </div>\n";
+ else
+ echo " <div class=\"vorbehalt".($pos-1)."\"> healthy </div>\n";
+ }
+ echo " </div>\n </li>\n</ul>\n"; /* end div trick, end li trick , end tricks*/
+ /* end displaying sickness */
+ break;
+ case 'poverty':
+ /* output pre-game trick in case user reloads,
+ * only needs to be done when a team has been formed */
+ if($myparty=='re' || $myparty=='contra')
+ {
+ echo "\n<ul class=\"tricks\">\n";
+
+ $mygametype = DB_get_gametype_by_gameid($gameid);
+
+ echo " <li onclick=\"hl('0');\" class=\"current\"><a href=\"#\">Pre</a>\n".
+ " <div class=\"trick\" id=\"trick0\">\n";
+
+ /* get information so show the cards that have been handed over in a poverty game */
+ output_exchanged_cards();
+
+ echo " </div>\n </li>\n</ul>\n\n"; /* end div trick, end li trick , end ul tricks */
+ }
+ /* end output pre-game trick */
+ break;
+ case 'play':
+ case 'gameover':
+
+ echo "\n<ul class=\"tricks\">\n";
+
+ /* output vorbehalte */
+ $mygametype = DB_get_gametype_by_gameid($gameid);
+ $mygamesolo = DB_get_solo_by_gameid($gameid);
+ if($mygametype != 'normal') /* only show when needed */
+ if(!( $mygametype == 'solo' && $mygamesolo == 'silent') )
+ echo " <li onclick=\"hl('0');\" class=\"old\"><a href=\"#\">Pre</a></li>\n";
+
+ $result = DB_query("SELECT Trick.id ".
+ "FROM Trick ".
+ "WHERE Trick.game_id='".$gameid."' ".
+ "GROUP BY Trick.id ".
+ "ORDER BY Trick.id ASC");
+ $trickNR = 1;
+ $lasttrick = DB_get_max_trickid($gameid);
+
+ /* output tricks */
+ while($r = DB_fetch_array($result))
+ {
+ if($trick!=$lasttrick)
+ echo " <li onclick=\"hl('$trickNR');\" class=\"old\"><a href=\"#\">"._('Trick')." $trickNR</a></li>\n";
+ else if($trick==$lasttrick)
+ echo " <li onclick=\"hl('$trickNR');\" class=\"current\"><a href=\"#\">"._('Trick')." $trickNR</a></li>\n";
+ $trickNR++;
+ }
+
+ /* if game is over, also output link to Score tab */
+ if($mystatus=='gameover' && DB_get_game_status_by_gameid($gameid)=='gameover' )
+ echo " <li onclick=\"hl('13');\" class=\"current\"><a href=\"#\">"._('Score')."</a></li>\n";
+
+ /* output previous/next buttons */
+ echo " <li onclick=\"hl_prev();\" class=\"old\"><a href=\"#\">"._('prev')."</a></li>\n";
+ echo " <li onclick=\"hl_next();\" class=\"old\"><a href=\"#\">"._('next')."</a></li>\n";
+
+ echo "</ul>\n\n";
+
+ break;
+ default:
+ }
+
+