Public paste
Undefined
By: Guest | Date: Jan 19 2009 19:11 | Format: PHP | Expires: never | Size: 27.96 KB | Hits: 1304

  1. <?php /* ------------------------- */
  2.  
  3.   include("_include-config.php");
  4.   if(! check_login()) {
  5.     header("Location: login.php");
  6.     exit;
  7.   }
  8.   mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'");
  9.  
  10.  
  11.  
  12.  
  13.  
  14. /* ------------------------- */ ?>
  15. <html>
  16.  
  17.  
  18.  
  19. <head>
  20. <title></title>
  21.  
  22. <link rel="stylesheet" type="text/css" href="css-v1.css">
  23. </head>
  24.  
  25.  
  26.  
  27. <table width=100% align=center>
  28.     <td class="subTitle" colspan=2><b>Blackjack</b></td></tr>
  29. <?PHP
  30.  
  31.        
  32.         $casino       = mysql_query("SELECT * FROM `[casinoo]` WHERE `spel`='3' AND `land`='$data->land'");
  33.         $casino       = mysql_fetch_object($casino);
  34.  
  35. if($casino->vw > 0){
  36. $vw = number_format($casino->vw,0,",",".");
  37. $bjwinst = "<font color=green>$$vw</font>";
  38. }
  39. if($casino->vw == 0){
  40. $vw = number_format($vw,0,",",".");
  41. $bjwinst = "$$casino->vw";
  42. }
  43. if($casino->vw < 0){
  44. $vw = number_format($casino->vw,0,",",".");
  45. $bjwinst = "<font color=red>$$vw</font>";
  46. }
  47. if($casino->owner ==$data->login){
  48. print"</table>";
  49. }
  50. if($casino->owner == ""){
  51. print " <tr><td class="mainTxt" align="center">Deze blackjack is door niemand in bezit!<br><b><a href="koop.php?spel=2">Klik hier</a></b> als je het casino wilt kopen voor $1.000.000.</td></tr>";
  52. }
  53. else{
  54.  
  55. if($data->login == $casino->owner){
  56.  
  57. if(isset($_POST['VA'])){
  58. echo "<table width="100%">";
  59. if($_POST['inzet'] <1000)
  60. {
  61. print "<tr><td class="mainTxt" width="100%">Het maximum bod moet minimaal $1.000 zijn.</td></tr>";
  62. }
  63. elseif($_POST['inzet'] >10000000)
  64. {
  65. print"<tr><td class="mainTxt" width="100%">Deze inzet is te hoog, het maximum is $10.000.000</td></tr>";
  66. }
  67. else
  68. {
  69. $inzet    = $_POST['inzet'];
  70. mysql_query("UPDATE `[casinoo]` SET `maximum`='$inzet' WHERE `land`='$data->land' AND `spel`='3'");
  71. $inzett = number_format($inzet,0,",",".");
  72. print "<tr><td class="mainTxt" width="100%">De maximum inzet is verandert naar $$inzett.</td></tr>";
  73. }
  74. }
  75.  
  76. $winst = number_format($casino->vw, 0, ",", ".");
  77. $casinobank = number_format($casino->casinobank, 0, ",", ".");
  78.  
  79. if(!isset($_POST['stort']) && !isset($_POST['afhalen']) ){
  80. print <<<ENDHTML
  81.   <table width=100%>
  82. <tr><td class="mainTxt"  width="48%">
  83. <form method="POST">
  84. Je hebt $bjwinst Winst gemaakt met je Blackjack-Tafel.<br><br>
  85. Geld in de Casino-Bank: $$casinobank <br>
  86. Geld op zak : $$cashhh<br><br>
  87.  
  88. <form action=blackjack.php method=post>
  89. <input type=hidden name=casino value=>Maximum inzet <input type=text name=inzet value=$casino->maximum><input type=submit name=VA value="Update!"></form>
  90. <font color=red>Let erop als er geen geld meer op de casinobank staat zul je hem verliezen!</font><br><br>
  91. <form action=blackjack.php method=post>
  92.  Stuur geld naar de casinobank:<br>$ <input type=text name=bedrag><br><Br>
  93. <input type=submit name=stort value="Stort op de casinobank"><input type=submit name=afhalen value="Haal geld van de casinobank"></form>
  94. ENDHTML;
  95. }
  96.  
  97.  
  98. if(isset($_POST['stort'])){
  99. if(! preg_match('/^[0-9]{0,15}$/',$_POST['bedrag'])){
  100. print "<tr><td class="mainTxt"><font color=red>Onjuiste invoer</td></tr>";
  101. }
  102.   $geld = $_POST['bedrag'];
  103.   if($geld >$data->cash){
  104.   print"  <table width=100%><tr><td class=mainTxt>Je hebt niet zoveel geld.</td></tr>";
  105.   }elseif($geld <1){
  106.   print"  <table width=100%><tr><td class=mainTxt>Voer alles <i>Normaal</I> in.</td></tr>";
  107.   }elseif($geld >1111111111111111){
  108.   $helft = $geld/2;
  109.   print"<tr><td class=mainTxt><br>Sorry, dit getal is te groot, probeer anders 2x $$helft te storten.</td></tr>";
  110.   }else{
  111.   mysql_query("UPDATE `[users]` SET `cash`=`cash`-'$geld' WHERE `login`='$data->login'");
  112.   mysql_query("UPDATE `[casinoo]` SET `casinobank`=`casinobank`+'$geld' WHERE `owner`='$data->login' AND `land`='$data->land' AND `spel`='3'");
  113.   $casinobank4 = $casino->casinobank+$bedrag;
  114.   $casinobank4 = number_format($casinobank4, 0, ",", ".");
  115. $geld2 = number_format($geld,0,",",".");
  116.     print <<<ENDHTML
  117.   <table width=100%>
  118. <tr><td class=mainTxt>Je hebt $$geld2 op de casinobank gestort.</td></tr>
  119. <tr><td class="mainTxt"  width="48%">
  120. <form method="POST">
  121. Je hebt $bjwinst Winst gemaakt met je Blackjack-Tafel.<br><br>
  122. Geld in de Casino-Bank: $$casinobank <br>
  123. Geld op zak : $$cashhh<br><br>
  124.  
  125. <form action=blackjack.php method=post>
  126. <input type=hidden name=casino value=>Maximum inzet <input type=text name=inzet value=$casino->maximum><input type=submit name=VA value="Update!"></form>
  127. <font color=red>Let erop als er geen geld meer op de casinobank staat zul je hem verliezen!</font><br><br>
  128. <form action=blackjack.php method=post>
  129.  Stuur geld naar de casinobank:<br>$ <input type=text name=bedrag><br><br>
  130. <input type=submit name=stort value="Stort op de casinobank"><input type=submit name=afhalen value="Haal geld van de casinobank">
  131. ENDHTML;
  132.    unset($_POST['stort']);
  133.  
  134.   }
  135.   }
  136.   if(isset($_POST['afhalen'])) {
  137.   $geld = $_POST['bedrag'];
  138. if(! preg_match('/^[0-9]{0,15}$/',$_POST['bedrag'])){
  139. print "<tr><td class="mainTxt"><font color=red>Onjuiste invoer</td></tr>";
  140. }
  141.   elseif($geld >$casino->casinobank){
  142.   print" <table width=100%><tr><td class=mainTxt>Zoveel geld heb je niet op de casinobank staan.</td></tr>";
  143.   }elseif($geld <1){
  144.   print" <table width=100%><tr><td class=mainTxt>Voer alles <i>Normaal</I> in.</td></tr>";
  145.   }else{
  146.   $geld = $_POST['bedrag'];
  147.   mysql_query("UPDATE `[users]` SET `cash`=`cash`+'$geld' WHERE `login`='$data->login'");
  148.   mysql_query("UPDATE `[casinoo]` SET `casinobank`=`casinobank`-'$geld' WHERE `owner`='$data->login' AND `land`='$data->land' AND `spel`='3'");
  149.   $casinobank3 = $casino->casinobank-$bedrag;
  150.   $casinobank3 = number_format($casinobank3, 0, ",", ".");
  151. $geld2 = number_format($geld,0,",",".");
  152.   print <<<ENDHTML
  153.   <table width=100%>
  154. <tr><td class=maintxt>Je hebt $$geld2 van de casinobank afgehaald</td></tr>
  155. <tr><td class="mainTxt" width="48%">
  156. <form method="POST">
  157. Je hebt $bjwinst Winst gemaakt met je Blackjack-Tafel.<br><br>
  158. Geld in de Casino-Bank: $$casinobank <br>
  159. Geld op zak : $$cashhh<br><br>
  160.  
  161. <form action=blackjack.php method=post>
  162. <input type=hidden name=casino value=>Maximum inzet <input type=text name=inzet value=$casino->maximum><input type=submit name=VA value="Update!"></form>
  163. <font color=red>Let erop als er geen geld meer op de casinobank staat zul je hem verliezen!</font><br><br>
  164. <form action=blackjack.php method=post>
  165.  Stuur geld naar de casinobank:<br>$ <input type=text name=bedrag><br><br>
  166. <input type=submit name=stort value="Stort op de casinobank"><input type=submit name=afhalen value="Haal geld van de casinobank"></form>
  167. ENDHTML;
  168.   unset($_POST['afhalen']);
  169.   print"</td></tr>"; }
  170. }}else{
  171.  
  172. if(isset($_POST['start'])){
  173. if(! preg_match('/^[0-9]{0,15}$/',$_POST['inzet'])){
  174. print"<font color=red>Onjuiste invoer</font>";
  175. }
  176. }
  177.  
  178. $geldover =$data->cash+$inzet;
  179. $eigenaar =ucfirst($casino->owner);
  180. if($eigenaar =="Veiling"){
  181. print"<tr><td class=mainTxt>Deze blackjack staat op Obay!</td></tr>";
  182. }
  183. else{
  184.   $dbres                                = mysql_query("SELECT maximum FROM `[casinoo]` WHERE `land`='$data->land' AND `spel`='3'");
  185.   $max                          = mysql_fetch_object($dbres);
  186. $inzett = number_format($inzet,0,",",".");
  187. $maximum = number_format($max->maximum,0,",",".");
  188. if($inzet > $max->maximum){print"<tr><td class=mainTxt>Je wilde $$inzett inzetten terwijl het maximum $$maximum is.</td></tr>";
  189. exit();}
  190.  
  191. $inzet = $_POST['inzet'];
  192.  
  193. $picurl = "http://crimepaleis.nl/images/blackjack/"; //zet hier je url met / op het einde
  194. $ext = ".jpg"; // zet hier de extensie (.jpg bij de afbeeldingen die ik gebruik
  195. if(isset($_POST['start']) && preg_match('/[0-9]{1,15}/',$_POST['inzet'])) {
  196. $_POST['inzet'] = str_replace('+',"impossible",$_POST['inzet']);
  197. $_POST['inzet'] = str_replace('-',"impossible",$_POST['inzet']);
  198. if(! preg_match('/^[0-9]{0,15}$/',$_POST['inzet'])){ print"<tr><td class=mainTxt><font color=red>Onjuiste invoer</font>"; exit();}
  199. else{$inzet = $_POST['inzet'];
  200. if($inzet >$data->cash){ print"<tr><td class=mainTxt>Je hebt te weinig geld</td></tr>"; exit; }
  201. mysql_query("UPDATE `[users]` SET `cash`=`cash`-'$inzet' WHERE `login`='$data->login'");
  202. mysql_query("UPDATE `[casinoo]` SET `casinobank`=`casinobank`+'$inzet' WHERE `land`='$data->land' AND `spel`='3'");
  203. mysql_query("UPDATE `[casinoo]` SET `vw`=`vw`+'$inzet' WHERE `spel`='3' AND `land`='$data->land'");
  204. mysql_query("DELETE FROM `blackjack` WHERE `login`='data->login'");
  205.         $winst = ($inzet * 3);
  206.         $getal = rand(1,13);
  207.         $soort = rand(1,4);
  208.         $getal2 = rand(1,13);
  209.         $soort2 = rand(1,4);
  210.         if($soort == 1) {$soort = "harten";}
  211.         if($soort == 2) {$soort = "schoppen";}
  212.         if($soort == 3) {$soort = "ruiten";}
  213.         if($soort == 4) {$soort = "klaveren";}
  214.         if($soort2 == 1) {$soort2 = "harten";}
  215.         if($soort2 == 2) {$soort2 = "schoppen";}
  216.         if($soort2 == 3) {$soort2 = "ruiten";}
  217.         if($soort2 == 4) {$soort2 = "klaveren";}
  218.         $geta = $getal;
  219.         $geta2 = $getal2;
  220.         if($getal == 11) {$geta = "boer"; $getal = 10;}
  221.         if($getal == 12) {$geta = "vrouw"; $getal = 10;}
  222.         if($getal == 13) {$geta = "koning"; $getal = 10;}
  223.         if($getal == 1) {$geta = "aas"; $getal = 11; $aas = 1;}
  224.         if($getal2 == 11) {$geta2 = "boer"; $getal2 = 10;}
  225.         if($getal2 == 12) {$geta2 = "vrouw"; $getal2 = 10;}
  226.         if($getal2 == 13) {$geta2 = "koning"; $getal2 = 10;}
  227.         if($getal2 == 1) {$geta2 = "aas"; $getal2 = 11; $aas = ($aas + 1);}
  228.         $picture = "<img src=".$picurl.$soort.$geta.$ext.">";
  229.         $picture2 = "<img src=".$picurl.$soort2.$geta2.$ext.">";
  230.         $pictures = $picture." &nbsp;&nbsp; ".$picture2;
  231.         $pictured = "<img src=".$picurl.$soortd.$getad.$ext.">";
  232. $winsttt = number_format($winst,0,",",".");
  233.     $dealer = $vorige->dealer;
  234.         if(($getal + $getal2) == 21) {
  235.         $som = ($getal + $getal2);
  236.                 mysql_query("UPDATE `[users]` SET `cash`=`cash`+'$winst'+'$inzet' WHERE `login`='$data->login'");      
  237.                   mysql_query("UPDATE `[casinoo]` SET `casinobank`=`casinobank`-'$winst'-'$inzet' WHERE `land`='$data->land' AND `spel`='3'"); 
  238.                   mysql_query("UPDATE `[casinoo]` SET `vw`=`vw`-'$winst'-'$inzet' WHERE `spel`='3' AND `land`='$data->land'");
  239. echo "<tr><td colspan=3 height=1 bgcolor=black class=maintxt></td></tr> <tr><td width=100 align=center valign=top class=maintxt>Computer<br>($dealer)</td><td colspan=2 align=left class=maintxt>$pictured
  240. </td></tr>
  241. <tr><td width=100 align=center valign=top class=maintxt>Jij<b> 1 :</b> <br>($som)</td><td colspan=2 align=left class=maintxt>$pictures &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  242. </td></tr>
  243. <tr><td height=1 bgcolor=black colspan=3 class=maintxt></td></tr><tr><td colspan=3 align=center class=maintxt>Je hebt een $soort $geta en een $soort2 $geta2. Blackjack! Je hebt $$winsttt gewonnen.</td></tr><tr><td colspan=3 align=cente class=maintxt>Geld op zak : $$cashhh</td></tr></table></form>
  244. </body>";
  245. }
  246.         else {
  247.         $som = ($getal + $getal2);
  248.         if($aas > 0) {$som2 = $som-10;}
  249.         $getald = rand(1,13);
  250.         $soortd = rand(1,4);
  251.         if($soortd == 1) {$soortd = "harten";}
  252.         if($soortd == 2) {$soortd = "schoppen";}
  253.         if($soortd == 3) {$soortd = "ruiten";}
  254.         if($soortd == 4) {$soortd = "klaveren";}
  255.         $getad = $getald;
  256.         if($getald == 11) {$getad = "boer"; $getald = 10;}
  257.         if($getald == 12) {$getad = "vrouw"; $getald = 10;}
  258.         if($getald == 13) {$getad = "koning"; $getald = 10;}
  259.         if($getald == 1) {$getad = "aas"; $getald = 11;}
  260.         $pictured = "<img src=".$picurl.$soortd.$getad.$ext.">";
  261.         mysql_query("INSERT INTO `blackjack`(`login`,`inzet`,`kaart`,`kaartpic`,`aas`,`dealer`,`dealerpic`) values('$data->login','{$inzet}','{$som}','{$pictures}','{$aas}','{$getald}','{$pictured}')") or die (mysql_error());
  262.         if($aas > 0) {
  263. echo "<tr>
  264.                 <tr><td colspan=3 height=1 bgcolor=black class=maintxt></td></tr>       <tr><td width=100 align=center valign=top class=maintxt>Computer<br>(?)</td><td colspan=2 align=left class=maintxt><img src='images/cards/closed.gif'>&nbsp;&nbsp;&nbsp;&nbsp;<img src='images/cards/closed.gif'>
  265. </td></tr>
  266. <tr><td width=100 align=center valign=top class=maintxt>Jij<b> 1 :</b> <br>($som)</td><td colspan=2 align=left class=maintxt>$pictures &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  267. </td></tr>
  268. <tr><td height=1 bgcolor=black colspan=3 class=maintxt></td></tr><tr><td colspan=3 align=center class=maintxt>Je hebt eeen Aas getrokken welke waarde geef je eraan?<br><form method='post'><input type='submit' name='aas' value='1'> &nbsp;&nbsp; <input type='submit' name='aas2' value='11'></form></td></tr></table></form>
  269. </body>";
  270.  exit;}
  271. echo "<tr><td colspan=3 height=1 bgcolor=black class=maintxt></td></tr> <tr><td width=100 align=center valign=top class=maintxt>Computer<br>(?)</td><td colspan=2 align=left class=maintxt><img src='images/cards/closed.gif'>&nbsp;&nbsp;&nbsp;&nbsp;<img src='images/cards/closed.gif'>
  272. </td></tr>
  273. <tr><td width=100 align=center valign=top class=maintxt>Jij<b> 1 :</b> <br>($som)</td><td colspan=2 align=left class=maintxt>$pictures &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  274. </td></tr>
  275. <tr><td height=1 bgcolor=black colspan=3 class=maintxt></td></tr><tr><td colspan=3 align=center class=maintxt><form method='post'><input type='submit' name='nieuw' value='Nog een kaart'> &nbsp;&nbsp; <input type='submit' name='stop' value='Stop'></td></tr><tr><td colspan=3 align=center class=maintxt>Geld op zak : $$cashhh</td></tr></table></form>
  276. </body>";
  277.  
  278.        } }
  279. }
  280. elseif($_POST['nieuw']) {
  281.     $dbres = mysql_query("SELECT * FROM `blackjack` WHERE `login`='$data->login'") or die (mysql_error());
  282.     $vorige = mysql_fetch_object($dbres);
  283.     $winst = (2*$vorige->inzet);
  284.     $inzet = $vorige->inzet;
  285.     $getal = rand(1,13);
  286.     $soort = rand(1,4);
  287.     if($soort == 1) {$soort = "harten";}
  288.     if($soort == 2) {$soort = "schoppen";}
  289.     if($soort == 3) {$soort = "ruiten";}
  290.     if($soort == 4) {$soort = "klaveren";}
  291.     $geta = $getal;
  292.     if($getal == 11) {$geta = "boer"; $getal = 10;}
  293.     if($getal == 12) {$geta = "vrouw"; $getal = 10;}
  294.     if($getal == 13) {$geta = "koning"; $getal = 10;}
  295.     if($getal == 1) {$geta = "aas"; $getal = 11; $aas = 1;}
  296.     $som = ($vorige->kaart + $getal);
  297.     $so = ($vorige->kaart + 1);
  298.     $picture = "<img src=".$picurl.$soort.$geta.$ext.">";
  299.     $pictures = $vorige->kaartpic." &nbsp;&nbsp; ".$picture;
  300.     $pictured = $vorige->dealerpic;
  301.     if($getal == 11) {$som2 = "of $so";}
  302.     mysql_query("UPDATE `blackjack` SET `aas`='{$aas}',`kaart`='{$som}',`kaartpic`='{$pictures}' WHERE `login`='$data->login'") or die (mysql_error());
  303.     if($aas > 0) {
  304. echo "<tr>
  305.                 <tr><td colspan=3 height=1 bgcolor=black class=maintxt></td></tr>       <tr><td width=100 align=center valign=top class=maintxt>Computer<br>(?)</td><td colspan=2 align=left class=maintxt><img src='images/cards/closed.gif'>&nbsp;&nbsp;&nbsp;&nbsp;<img src='images/cards/closed.gif'>
  306. </td></tr>
  307. <tr><td width=100 align=center valign=top class=maintxt>Jij<b> 1 :</b> <br>($som)</td><td colspan=2 align=left class=maintxt>$pictures &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  308. </td></tr>
  309. <tr><td height=1 bgcolor=black colspan=3 class=maintxt></td></tr><tr><td colspan=3 align=center class=maintxt>Je hebt eeen Aas getrokken welke waarde geef je eraan?<form method='post'><input type='submit' name='aas' value='1'> &nbsp;&nbsp; <input type='submit' name='aas2' value='11'></form></td></tr></table></form>
  310. </body>";
  311. }
  312.     if($som > 21) {
  313.     $dealer = $vorige->dealer;
  314. $inzett = number_format($vorige->inzet,0,",",".");
  315. echo "<tr>
  316.                 <tr><td colspan=3 height=1 bgcolor=black class=maintxt></td></tr>       <tr><td width=100 align=center valign=top class=maintxt>Computer<br>($dealer)</td><td colspan=2 align=left class=maintxt>$pictured
  317. </td></tr>
  318. <tr><td width=100 align=center valign=top class=maintxt>Jij<b> 1 :</b> <br>($som)</td><td colspan=2 align=left class=maintxt>$pictures &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  319. </td></tr>
  320. <tr><td height=1 bgcolor=black colspan=3 class=maintxt></td></tr><tr><td colspan=3 align=center class=maintxt>Je hebt nu een score van $som. Je hebt verloren. Je hebt $$inzett verloren.<br><br><a href=blackjack.php>Speel opnieuw</a></td></tr></table></form>
  321. </body>";
  322.     mysql_query("DELETE FROM `blackjack` WHERE `login`='$data->login'");
  323.     exit;
  324.     }
  325. echo "<tr><td colspan=3 height=1 bgcolor=black class=maintxt></td></tr> <tr><td width=100 align=center valign=top class=maintxt>Computer<br>(?)</td><td colspan=2 align=left class=maintxt><img src='images/cards/closed.gif'>&nbsp;&nbsp;&nbsp;&nbsp;<img src='images/cards/closed.gif'>
  326. </td></tr>
  327. <tr><td width=100 align=center valign=top class=maintxt>Jij<b> 1 :</b> <br>($som)</td><td colspan=2 align=left class=maintxt>$pictures &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  328. </td></tr>
  329. <tr><td height=1 bgcolor=black colspan=3 class=maintxt></td></tr><tr><td colspan=3 align=center class=maintxt><form method='post'><input type='submit' name='nieuw' value='Nog een kaart'> &nbsp;&nbsp; <input type='submit' name='stop' value='Stop'></td></tr><tr><td colspan=3 align=center class=maintxt>Geld op zak : $$cashhh</td></tr></table></form>
  330. </body>";
  331. }
  332. elseif($_POST['aas']) {
  333.     $dbres = mysql_query("SELECT * FROM `blackjack` WHERE `login`='$data->login'") or die (mysql_error());
  334.     $vorige = mysql_fetch_object($dbres);
  335.     $pictures = $vorige->kaartpic;
  336.     $pictured = $vorige->dealerpic;
  337.     $i=0;
  338.     while ($i < $vorige->aas){
  339.     $som = ($vorige->kaart - 10);
  340.     $i++;
  341.     }
  342.     mysql_query("UPDATE `blackjack` SET `aas`='0',`kaart`='{$som}' WHERE `login`='$data->login'") or die (mysql_error());
  343. echo "<tr><td colspan=3 height=1 bgcolor=black class=maintxt></td></tr> <tr><td width=100 align=center valign=top class=maintxt>Computer<br>(?)</td><td colspan=2 align=left class=maintxt><img src='images/cards/closed.gif'>&nbsp;&nbsp;&nbsp;&nbsp;<img src='images/cards/closed.gif'>
  344. </td></tr>
  345. <tr><td width=100 align=center valign=top class=maintxt>Jij<b> 1 :</b> <br>($som)</td><td colspan=2 align=left class=maintxt>$pictures &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  346. </td></tr>
  347. <tr><td height=1 bgcolor=black colspan=3 class=maintxt></td></tr><tr><td colspan=3 align=center class=maintxt><form method='post'><input type='submit' name='nieuw' value='Nog een kaart'> &nbsp;&nbsp; <input type='submit' name='stop' value='Stop'></td></tr><tr><td colspan=3 align=center class=maintxtr>Geld op zak : $$cashhh</td></tr></table></form>
  348. </body>";
  349. }
  350. elseif($_POST['aas2']) {
  351.     $dbres = mysql_query("SELECT * FROM `blackjack` WHERE `login`='$data->login'") or die (mysql_error());
  352.     $vorige = mysql_fetch_object($dbres);
  353.     $som = $vorige->kaart;
  354.     $pictures = $vorige->kaartpic;
  355.     $pictured = $vorige->dealerpic;
  356.     mysql_query("UPDATE `blackjack` SET `aas`='0' WHERE `login`='$data->login'") or die (mysql_error());
  357. echo "  <tr><td colspan=3 height=1 bgcolor=black class=maintxt></td></tr>       <tr><td width=100 align=center valign=top class=maintxt>Computer<br>(?)</td><td colspan=2 align=left class=maintxt><img src='images/cards/closed.gif'>&nbsp;&nbsp;&nbsp;&nbsp;<img src='images/cards/closed.gif'>
  358. </td></tr>
  359. <tr><td width=100 align=center valign=top class=maintxt>Jij<b> 1 :</b> <br>($som)</td><td colspan=2 align=left class=maintxt>$pictures &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  360. </td></tr>
  361. <tr><td height=1 bgcolor=black colspan=3 class=maintxt></td></tr><tr><td colspan=3 align=center class=maintxt><form method='post'><input type='submit' name='nieuw' value='Nog een kaart'> &nbsp;&nbsp; <input type='submit' name='stop' value='Stop'></td></tr><tr><td colspan=3 align=center class=maintxt>Geld op zak : $$cashhh</td></tr></table></form>
  362. </body>";
  363. }
  364. elseif($_POST['stop']) {
  365.     $dbres = mysql_query("SELECT * FROM `blackjack` WHERE `login`='$data->login'") or die (mysql_error());
  366.     $vorige = mysql_fetch_object($dbres);
  367.     $som = $vorige->kaart;
  368.     $pictures = $vorige->kaartpic;
  369.     $pictured = $vorige->dealerpic;
  370.     $dealer = $vorige->dealer;
  371.     if($som > 21) {
  372. $inzett = number_format($vorige->inzet,0,",",".");
  373. echo "  <tr>
  374.                 <tr><td colspan=3 height=1 bgcolor=black class=maintxt></td></tr>       <tr><td width=100 align=center valign=top class=maintxt>Computer<br>($dealer)</td><td colspan=2 align=left class=maintxt>$pictured
  375. </td></tr>
  376. <tr><td width=100 align=center valign=top class=maintxt>Jij<b> 1 :</b> <br>($som)</td><td colspan=2 align=left class=maintxt>$pictures &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  377. </td></tr>
  378. <tr><td height=1 bgcolor=black colspan=3 class=maintxt></td></tr><tr><td colspan=3 align=center class=maintxt><br>Je hebt verloren. Je inzet $$inzett is voor het casino.<br><br><a href=blackjack.php>Speel opnieuw</a></table></form>
  379. </body>";
  380.     mysql_query("DELETE FROM `blackjack` WHERE `login`='$data->login'");
  381.     exit;
  382.     }
  383.     $dealer = $vorige->dealer;
  384.     $getal = rand(1,13);
  385.     $soort = rand(1,4);
  386.     if($soort == 1) {$soort = "harten";}
  387.     if($soort == 2) {$soort = "schoppen";}
  388.     if($soort == 3) {$soort = "ruiten";}
  389.     if($soort == 4) {$soort = "klaveren";}
  390.     $geta = $getal;
  391.     if($getal == 11) {$geta = "boer"; $getal = 10;}
  392.     if($getal == 12) {$geta = "vrouw"; $getal = 10;}
  393.     if($getal == 13) {$geta = "koning"; $getal = 10;}
  394.     if($getal == 1) {$geta = "aas"; $getal = 11; $aas = 1;}
  395.     $picture = "<img src=".$picurl.$soort.$geta.$ext.">";
  396.     $pictured = $pictured." &nbsp;&nbsp; ".$picture;
  397.     $somd = ($dealer + $getal);
  398.     if($somd > 21 && $aas == 1) {$dealer = ($dealer + 1); $aas = 0;}
  399.     else {$dealer = $somd;}
  400.     while ($dealer < $som){
  401.     $getal = rand(1,13);
  402.     $soort = rand(1,4);
  403.     if($soort == 1) {$soort = "harten";}
  404.     if($soort == 2) {$soort = "schoppen";}
  405.     if($soort == 3) {$soort = "ruiten";}
  406.     if($soort == 4) {$soort = "klaveren";}
  407.     $geta = $getal;
  408.     if($getal == 11) {$geta = "boer"; $getal = 10;}
  409.     if($getal == 12) {$geta = "vrouw"; $getal = 10;}
  410.     if($getal == 13) {$geta = "koning"; $getal = 10;}
  411.     if($getal == 1) {$geta = "aas"; $getal = 11; $aas = 1;}
  412.     $picture = "<img src=".$picurl.$soort.$geta.$ext.">";
  413.     $pictured = $pictured." &nbsp;&nbsp; ".$picture;
  414.     $somd = ($dealer + $getal);
  415.     if($somd > 21 && $aas == 1) {$dealer = ($dealer + 1); $aas = 0;}
  416.     else {$dealer = $somd;}
  417.     }
  418.     $winst = (2*$vorige->inzet);
  419. $inzett = number_format($vorige->inzet,0,",",".");
  420.     $inzet = ($vorige->inzet);
  421.     if($dealer > 21){
  422.         if($casino->casinobank-$inzet <0){
  423. mysql_query("UPDATE `[casinoo]` SET `casinobank`='0' WHERE `spel`='3' AND `land`='$data->land'");
  424. mysql_query("UPDATE `[casinoo]` SET `vw`='0' WHERE `spel`='3' AND `land`='$data->land'");
  425. mysql_query("UPDATE `[casinoo]` SET `maximum`='0' WHERE `spel`='3' AND `land`='$data->land'");
  426. mysql_query("UPDATE `[casinoo]` SET `owner`='$data->login' WHERE `land`='$data->land' AND `spel`='3'");
  427. print "<tr><td class=mainTxt align=center>De eigenaar van dit casino kon je niet uitbetalen! Daarom is zijn casino nu van jou!</td></tr>";
  428. exit();}
  429.         mysql_query("UPDATE `[users]` SET `cash`=`cash`+'$inzet'+'$inzet' WHERE `login`='$data->login'");
  430.         mysql_query("UPDATE `[casinoo]` SET `casinobank`=`casinobank`-'$inzet'-'$inzet'  WHERE `land`='$data->land' AND `spel`='3'");  
  431.         mysql_query("UPDATE `[casinoo]` SET `vw`=`vw`-'$inzet'-'$inzet'  WHERE `spel`='3' AND `land`='$data->land'");
  432. echo "  <tr>
  433.                 <tr><td width=100 align=center valign=top class=maintxt>Computer<br>($dealer)</td><td colspan=2 align=left class=maintxt>$pictured
  434. </td></tr>
  435. <tr><td width=100 align=center valign=top class=maintxt>Jij<b> 1 :</b> <br>($som)</td><td colspan=2 align=left class=maintxt>$pictures &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  436. </td></tr>
  437. <tr><td height=1 bgcolor=black colspan=3 class=maintxt></td></tr><tr><td colspan=3 align=center class=maintxt><br>Je hebt gewonnen! Je hebt $$inzett gewonnen.<br><br><a href=blackjack.php>Speel opnieuw</a></table></form>
  438. </body>";
  439. }
  440.     elseif($dealer < $som) {mysql_query("UPDATE `[users]` SET `cash`=`cash`+'$inzet'+'$inzet'  WHERE `login`='$data->login'");
  441.           mysql_query("UPDATE `[casinoo]` SET `casinobank`=`casinobank`-'$inzet'-'$inzet'  WHERE `land`='$data->land' AND `spel`='3'");
  442.           mysql_query("UPDATE `[casinoo]` SET `vw`=`vw`-'$inzet'-'$inzet'  WHERE `spel`='3' AND `land`='$data->land'");
  443. echo "  <tr>
  444.                 <tr><td width=100 align=center valign=top class=maintxt>Computer<br>($dealer)</td><td colspan=2 align=left class=maintxt>$pictured
  445. </td></tr>
  446. <tr><td width=100 align=center valign=top class=maintxt>Jij<b> 1 :</b> <br>($som)</td><td colspan=2 align=left class=maintxt>$pictures &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  447. </td></tr>
  448. <tr><td height=1 bgcolor=black colspan=3 class=maintxt></td></tr><tr><td colspan=3 align=center class=maintxt><br>Je hebt gewonnen! Je hebt $$inzett gewonnen.<br><br><a href=blackjack.php>Speel opnieuw</a></table></form>
  449. </body>";
  450.  }
  451.     elseif($dealer > $som){ echo "  <tr>
  452.                 <tr><td width=100 align=center valign=top class=maintxt>Computer<br>($dealer)</td><td colspan=2 align=left class=maintxt>$pictured
  453. </td></tr>
  454. <tr><td width=100 align=center valign=top class=maintxt>Jij<b> 1 :</b> <br>($som)</td><td colspan=2 align=left class=maintxt>$pictures &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  455. </td></tr>
  456. <tr><td height=1 bgcolor=black colspan=3 class=maintxt></td></tr><tr><td colspan=3 align=center class=maintxt><br>Je hebt verloren. Je inzet $$inzett is voor het casino.<br><br><a href=blackjack.php>Speel opnieuw</a></table></form>
  457. </body>";}
  458.     elseif($dealer == $som){
  459.         mysql_query("UPDATE `[users]` SET `cash`=`cash`+'$inzet' WHERE `login`='$data->login'");
  460.         mysql_query("UPDATE `[casinoo]` SET `casinobank`=`casinobank`-'$inzet'  WHERE `land`='$data->land' AND `spel`='3'");   
  461.         mysql_query("UPDATE `[casinoo]` SET `vw`=`vw`-'$inzet'  WHERE `spel`='3' AND `land`='$data->land'");
  462. echo "  <tr>
  463.                 <tr><td width=100 align=center valign=top class=maintxt>Computer<br>($dealer)</td><td colspan=2 align=left class=maintxt>$pictured
  464. </td></tr>
  465. <tr><td width=100 align=center valign=top class=maintxt>Jij<b> 1 :</b> <br>($som)</td><td colspan=2 align=left class=maintxt>$pictures &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  466. </td></tr>
  467. <tr><td height=1 bgcolor=black colspan=3 class=maintxt></td></tr><tr><td colspan=3 align=center class=maintxt><br>Je hebt evenveel als de dealer. Je hebt niets gewonnen, maar ook niets verloren.<br><br><a href=blackjack.php>Speel opnieuw</a></table></form>
  468. </body>";
  469. }
  470.     mysql_query("DELETE FROM `blackjack` WHERE `login`='$data->login'");
  471. }
  472. else {$cas = mysql_query("SELECT * FROM `[casinoo]` WHERE `spel`='3' AND `land`='$data->land'");
  473. $cas = mysql_fetch_object($cas);
  474. $owner = ucfirst($cas->owner);
  475. $cas->maximum = number_format($cas->maximum, 0, ",", ".");
  476.     echo         "  <tr>
  477.                 <td class=mainTxt>
  478.         Deze blackjack is van $owner en hij/zij heeft een maximum inzet van $$cas->maximum.<br><form method='post'>
  479.    Zet hier geld in om blackjack te spelen. <br>
  480.         Let op: Bij gelijke stand krijg je je inzet terug!<br><br>
  481.    Inzet: <input type='text' name='inzet'><br><br>
  482.    <input type='submit' name='start' value='Start!'>
  483.    </form>";
  484. echo "<tr><td class=subTitle><b>Uitleg</b></td></tr>
  485.  <tr><td class=mainTxt>
  486. Je moet bij blackjack zo dicht mogelijk bij 21 komen.<br>
  487.  
  488. Als je over de 21 gaat heb je automatisch verloren.<br>
  489. Als je op Nieuwe kaart drukt krijg je een nieuwe kaart, als je op Stop drukt dan is het de dealer zijn beurt.<br>
  490. Als jij hoger hebt dan de dealer, of de dealer gaat over 21, heb je gewonnen, als je wint krijg je 2x je inzet terug.<br>
  491. Als je bij je eerste 2 kaarten 21 hebt, heb je een blackjack en win je je inzet x3,0.<br>
  492. Veel plezier!
  493.  </td></tr>";
  494. }}}}
  495. ?></font></center></body>
  496. </table>
  497. <table align="center" width=100%><tr><td class="mainTxt" align="center"><a href="blackjackstats.php">Blackjack Statistieken</a></td></tr></table>
  498.  
  499. </html>