feature request: show complete hand for completed games
authorarun <arun@nubati.net>
Tue, 6 Feb 2007 02:03:39 +0000 (02:03 +0000)
committerarun <arun>
Tue, 6 Feb 2007 02:03:39 +0000 (02:03 +0000)
db.php
index.php

diff --git a/db.php b/db.php
index 38b788cd70d6c41bce8aa6d013b55be06e555ca9..8feb186682843156f20ce9217335dc838718b18c 100644 (file)
--- a/db.php
+++ b/db.php
@@ -303,6 +303,19 @@ function DB_get_hand($me)
   return $cards;
 }
 
+function DB_get_all_hand($me)
+{
+  $cards = array();
+
+  $handid = DB_get_handid_by_hash($me);
+
+  $result = mysql_query("SELECT card_id FROM Hand_Card WHERE hand_id=".DB_quote_smart($handid));
+  while($r = mysql_fetch_array($result,MYSQL_NUM))
+    $cards[]=$r[0];
+
+  return $cards;
+}
+
 function DB_get_cards_by_trick($id)
 {
   $cards = array();
index 40fc4122cac2c5565fffafd716e8e4f32d7365df..84ce6f01708deb3f5cd1e11cdc33571d0397556c 100644 (file)
--- a/index.php
+++ b/index.php
@@ -769,6 +769,14 @@ else if(myisset("me"))
          foreach($mycards as $card) 
            display_card($card);
        }
+      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);
+       }
       echo "</div>\n";
       
       /* check if we need to set status to 'gameover' is done during playing of the card */