summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--functions.php1
-rw-r--r--index.php19
2 files changed, 10 insertions, 10 deletions
diff --git a/functions.php b/functions.php
index e4f7c60..ec7dfac 100644
--- a/functions.php
+++ b/functions.php
@@ -156,7 +156,6 @@ function get_winner($p,$mode)
$c3 = $p[3];
$c4 = $p[4];
-
/* first card is better than all the rest */
if( compare_cards($c1,$c2,$mode) && compare_cards($c1,$c3,$mode) && compare_cards($c1,$c4,$mode) )
return 1;
diff --git a/index.php b/index.php
index 605a94b..36b59ef 100644
--- a/index.php
+++ b/index.php
@@ -152,15 +152,16 @@ else if(myisset("me"))
{
if($_REQUEST["in"] == "no")
{
- echo "TODO: email everyone that the game has been canceled.<br />";
- /*something like need to modify for DB backend
- for($i=0;$i<4;$i++)
- {
- $message = "Hello ".$player[$hash[$i]]["name"].",\n\n".
- "the game has been canceled due to the request of one of the players.\n";
- mymail($player[$hash[$i]]["email"],"[DoKo-Debug] the game has been canceled",$message);
- }
- */
+ $message = "Hello, \n\n".
+ "the game has been canceled due to the request of one of the players.\n";
+
+ $userids = DB_get_all_userid_by_gameid($gameid);
+ foreach($userids as $user)
+ {
+ $To = DB_get_email_by_userid($user);
+ mymail($To,"[DoKo] game over",$message);
+ }
+
/* delete everything from the dB */
DB_cancel_game($me);
}