- /* display points in case game is over */
- if($mystatus=='gameover' && DB_get_game_status_by_gameid($gameid)=='gameover' )
- {
- echo " <li onclick=\"hl('13');\" class=\"current\"><a href=\"#\">Score</a>\n".
- " <div class=\"trick\" id=\"trick13\">\n";
- /* add pic for re/contra
- " <img class=\"arrow\" src=\"pics/arrow".($pos-1).".png\" alt=\"table\" />\n";*/
-
- $result = DB_query("SELECT User.fullname, IFNULL(SUM(Card.points),0), Hand.party,Hand.position FROM Hand".
- " LEFT JOIN Trick ON Trick.winner=Hand.position AND Trick.game_id=Hand.game_id".
- " LEFT JOIN User ON User.id=Hand.user_id".
- " LEFT JOIN Play ON Trick.id=Play.trick_id".
- " LEFT JOIN Hand_Card ON Hand_Card.id=Play.hand_card_id".
- " LEFT JOIN Card ON Card.id=Hand_Card.card_id".
- " WHERE Hand.game_id='$gameid'".
- " GROUP BY User.fullname" );
- while( $r = DB_fetch_array($result))
- echo " <div class=\"card".($r[3]-1)."\">\n".
- " <div class=\"score\">".$r[2]."<br /> ".$r[1]."</div>\n".
- " </div>\n";
-
- echo " </div>\n </li>\n"; /* end div trick, end li trick */
- }
-
-
- echo "</ul>\n"; /* end ul tricks*/
-
- echo "<div class=\"notes\"> Personal notes: <br />\n";
- $notes = DB_get_notes_by_userid_and_gameid($myid,$gameid);
- foreach($notes as $note)
- echo "$note <hr \>\n";
- echo "Insert note:<input name=\"note\" type=\"text\" size=\"15\" maxlength=\"100\" />\n";
- echo "</div> \n";
-
- $mycards = DB_get_hand($me);
- $mycards = mysort($mycards,$gametype);
- echo "<div class=\"mycards\">\n";
-
- if($myturn && !myisset("card") && $mystatus=='play' )
- {
- echo "Hello ".$myname.", it's your turn! <br />\n";
- echo "Your cards are: <br />\n";
-
- /* do we have to follow suite? */
- $followsuit = 0;
- if(have_suit($mycards,$firstcard))
- $followsuit = 1;
-
- foreach($mycards as $card)
- {
- if( ($followsuit && !same_type($card,$firstcard)) ||
- ( (int)($card)==19 && ($RULES['schweinchen']=='second'||$RULES['schweinchen']=='secondaftercall')
- && $GAME['schweinchen-who']==$me && !$GAME['schweinchen-first'] )
- )
- display_card($card,$PREF["cardset"]);
- else
- display_link_card($card,$PREF["cardset"]);
- }
- }
- else if($mystatus=='play' )
- {
- echo "Your cards are: <br />\n";
- foreach($mycards as $card)
- display_card($card,$PREF["cardset"]);
- }
- else if($mystatus=='gameover')
- {
- $oldcards = DB_get_all_hand($me);
- $oldcards = mysort($oldcards,$gametype);
- echo "Your cards were: <br />\n";
- foreach($oldcards as $card)
- display_card($card,$PREF["cardset"]);
-
- $userids = DB_get_all_userid_by_gameid($gameid);
- foreach($userids as $user)
- {
- $userhash = DB_get_hash_from_gameid_and_userid($gameid,$user);
-
- if($userhash!=$me)
- {
- echo "<br />";
-
- $name = DB_get_name('userid',$user);
- $oldcards = DB_get_all_hand($userhash);
- $oldcards = mysort($oldcards,$gametype);
- echo "$name's cards were: <br />\n";
- foreach($oldcards as $card)
- display_card($card,$PREF["cardset"]);
- }
- };
- }
- echo "</div>\n";
-
- /* if the game is over do some extra stuff, therefore exit the swtich statement if we are still playing*/
- if($mystatus=='play')
- break;