login}'"); $dbres = mysql_query("SELECT *,UNIX_TIMESTAMP(`signup`) AS `signup`,UNIX_TIMESTAMP(`online`) AS `online` FROM `[users]` WHERE `login`='{$_SESSION['login']}'"); $data = mysql_fetch_object($dbres);?>
Handje drukken | Je zit in de gevangenis
Je word over $verschil seconden vrijgelaten |
ENDHTML;
}
else{
if(isset($_POST['AC'])){
$id = $_POST['id'];
$members1 = mysql_query("SELECT * FROM `[handdruk]` WHERE `id`='$id'");
$members = mysql_fetch_object($members1);
$naam1 = mysql_query("SELECT * FROM `[users]` WHERE `login`='$members->naam'");
$naam = mysql_fetch_object($naam1);
print "
"; if($data->cash < $members->inzet){ print "Je hebt te weinig geld op zak."; } elseif($data->HS == $naam->HS){ $getal = rand(1,2); if($getal == 1){ print "Jij hebt gewonnen."; mysql_query("UPDATE `[users]` SET `cash`=`cash`+'$members->inzet' WHERE `login`='$data->login'"); mysql_query("INSERT INTO `[messages]`(`time`,`from`,`to`,`subject`,`message`) values(NOW(),'{$data->login}','$members->naam','Handje drukken','Je hebt tegen $data->login verloren met handje drukken.')"); mysql_query("DELETE FROM `[handdruk]` WHERE `id`='$id'"); } else{ print "Je tegenstander heeft gewonnen."; mysql_query("UPDATE `[users]` SET `cash`=`cash`+'$members->inzet'*'2' WHERE `login`='$naam->login'"); mysql_query("UPDATE `[users]` SET `cash`=`cash`-'$members->inzet' WHERE `login`='$data->login'"); mysql_query("INSERT INTO `[messages]`(`time`,`from`,`to`,`subject`,`message`) values(NOW(),'{$data->login}','$members->naam','Handje drukken','Je hebt tegen $data->login gewonnen met handje drukken.')"); mysql_query("DELETE FROM `[handdruk]` WHERE `id`='$id'"); } } elseif($data->HS > $naam->HS){ print "Jij hebt gewonnen."; mysql_query("UPDATE `[users]` SET `cash`=`cash`+'$members->inzet' WHERE `login`='$data->login'"); mysql_query("UPDATE `[users]` SET `cash`=`cash`-'$members->inzet' WHERE `login`='$naam->login'"); mysql_query("INSERT INTO `[messages]`(`time`,`from`,`to`,`subject`,`message`) values(NOW(),'{$data->login}','$members->naam','Handje drukken','Je hebt tegen $data->login verloren met handje drukken.')"); mysql_query("DELETE FROM `[handdruk]` WHERE `id`='$id'"); } else{ print "Je tegenstander heeft gewonnen."; mysql_query("UPDATE `[users]` SET `cash`=`cash`+'$members->inzet' WHERE `login`='$naam->login'"); mysql_query("UPDATE `[users]` SET `cash`=`cash`-'$members->inzet' WHERE `login`='$data->login'"); mysql_query("INSERT INTO `[messages]`(`time`,`from`,`to`,`subject`,`message`) values(NOW(),'{$data->login}','$members->naam','Handje drukken','Je hebt tegen $data->login gewonnen met handje drukken.')"); mysql_query("DELETE FROM `[handdruk]` WHERE `id`='$id'"); } print " |
ENDHTML; if(isset($_POST['OK'])){ $inzet = $_POST['Inzet']; if($inzet =="" || $inzet < 1000){ print "Je moet wel hoger dan 1000 inzetten."; } elseif($inzet > $data->cash){ print "Je hebt te weinig geld op zak."; } else{ print "Je bent toegevoegt."; mysql_query("UPDATE `[users]` SET `cash`=`cash`-'$inzet' WHERE `login`='$data->login'"); mysql_query("INSERT INTO `[handdruk]` (naam,inzet,wanneer,land) values('$data->login','$inzet',NOW(),'$data->land')"); } } } } /* ------------------------- */ ?> |