summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2008-03-11 22:21:09 -0700
committerArun Persaud <arun@nubati.net>2008-03-11 22:21:09 -0700
commit3eb71d1ca10d4dc4b06ef84eaa410862ce8d7df9 (patch)
tree38c8b54eedd2f71864c20faa2d4403511f8eba4d /index.php
parentcdee8a3e86f57ac0ace7fad8612b0b809b9d08a4 (diff)
downloade-DoKo-3eb71d1ca10d4dc4b06ef84eaa410862ce8d7df9.tar.gz
e-DoKo-3eb71d1ca10d4dc4b06ef84eaa410862ce8d7df9.tar.bz2
e-DoKo-3eb71d1ca10d4dc4b06ef84eaa410862ce8d7df9.zip
NEW FEATURE: Ability to add personal notes for each game
In case a player is involed in too many games it can get quite confusing with whom your playing, etc. so now the player can add notes on the side that only show up on his/her screen. Signed-off-by: Arun Persaud <arun@nubati.net>
Diffstat (limited to 'index.php')
-rw-r--r--index.php26
1 files changed, 25 insertions, 1 deletions
diff --git a/index.php b/index.php
index d0d9eef..80a732f 100644
--- a/index.php
+++ b/index.php
@@ -1179,6 +1179,16 @@ else if(myisset("me"))
DB_insert_comment($comment,$playid,$myid);
};
+ /* handle notes in case player didn't play a card, allow notes only during a game */
+ if( (!myisset("card") && $mystatus=='play') )
+ if(myisset("note"))
+ {
+ $note = $_REQUEST["note"];
+
+ if($note != "")
+ DB_insert_note($note,$gameid,$myid);
+ };
+
/* get everything relevant to display the tricks */
$result = mysql_query("SELECT Hand_Card.card_id as card,".
" Hand.position as position,".
@@ -1477,6 +1487,14 @@ else if(myisset("me"))
DB_insert_comment($comment,$playid,$myid);
};
+ /* check for note */
+ if(myisset("note"))
+ {
+ $note = $_REQUEST["note"];
+ if($note != "")
+ DB_insert_note($note,$gameid,$myid);
+ };
+
/* display played card */
$pos = DB_get_pos_by_hash($me);
if($sequence==1)
@@ -1837,6 +1855,13 @@ else if(myisset("me"))
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";
@@ -2014,7 +2039,6 @@ else if(myisset("me"))
echo "</div>\n";
-
echo "</form>\n";
output_footer();
DB_close();