From cfb7c888c30e08e04c83dd818dea1dbd4274d303 Mon Sep 17 00:00:00 2001 From: arun Date: Fri, 26 Jan 2007 11:59:05 +0000 Subject: [PATCH] started work on canceling games --- index.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 6353f34..38879e9 100644 --- a/index.php +++ b/index.php @@ -141,6 +141,9 @@ else if(myisset("me")) $mystatus = DB_get_status_by_hash($me); $mypos = DB_get_pos_by_hash($me); + if(myisset("cancle")) + echo "

canceling a game is not implemented at the moment, but will be soon...

"; + switch($mystatus) { case 'start': @@ -762,11 +765,19 @@ else if(myisset("me")) DB_update_user_timestamp($uid); echo "

these are the games you are playing in:
\n"; - $result = mysql_query("SELECT hash,game_id from Hand WHERE user_id='$uid' AND status<>'gameover'" ); + $result = mysql_query("SELECT Hand.hash,Hand.game_id,Game.mod_date from Hand". + " LEFT JOIN Game On Hand.game_id=Game.id". + " WHERE Hand.user_id='$uid' AND Game.status<>'gameover'" ); while( $r = mysql_fetch_array($result,MYSQL_NUM)) - echo "game #".$r[1]."
"; + { + echo "game #".$r[1]." "; + if(time()-strtotime($r[2]) > 60*60*24*30) + echo " The game has been running for over a month. Do you want to cancel it? yes"; + echo "
"; + } echo "

\n"; + echo "

and these are your games that are already done:
\n"; $result = mysql_query("SELECT hash,game_id from Hand WHERE user_id='$uid' AND status='gameover'" ); while( $r = mysql_fetch_array($result,MYSQL_NUM)) -- 2.25.1