Roulette probleem
en bij roullete zegt ie niks hij reload pagina maar dan blijft me geld en is gwn weer normaal of ik net ga gokken..
Code (php)
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
<?php
include("config.php");
$dbres = mysql_query("SELECT *,UNIX_TIMESTAMP(`pc`) AS `pc`,UNIX_TIMESTAMP(`transport`) AS `transport`,UNIX_TIMESTAMP(`bc`) AS `bc`,UNIX_TIMESTAMP(`slaap`) AS `slaap`,UNIX_TIMESTAMP(`kc`) AS `kc`,UNIX_TIMESTAMP(`start`) AS `start`,UNIX_TIMESTAMP(`crime`) AS `crime`,UNIX_TIMESTAMP(`ac`) AS `ac` FROM `users` WHERE `login`='{$_SESSION['login']}'");
$data = mysql_fetch_object($dbres);
if(! check_login()) {
header('Location: login.php');
exit;
}
if ($jisin == 1) { header('Location: jisin.php'); }
?>
include("config.php");
$dbres = mysql_query("SELECT *,UNIX_TIMESTAMP(`pc`) AS `pc`,UNIX_TIMESTAMP(`transport`) AS `transport`,UNIX_TIMESTAMP(`bc`) AS `bc`,UNIX_TIMESTAMP(`slaap`) AS `slaap`,UNIX_TIMESTAMP(`kc`) AS `kc`,UNIX_TIMESTAMP(`start`) AS `start`,UNIX_TIMESTAMP(`crime`) AS `crime`,UNIX_TIMESTAMP(`ac`) AS `ac` FROM `users` WHERE `login`='{$_SESSION['login']}'");
$data = mysql_fetch_object($dbres);
if(! check_login()) {
header('Location: login.php');
exit;
}
if ($jisin == 1) { header('Location: jisin.php'); }
?>
<html>
<head>
<title>Vendetta</title>
<link rel="stylesheet" type="text/css" href="style.css">
<meta name="keywords" content="Vendetta,Crimegame,crimegame,vendetta">
<meta name="language" content="english">
<META name="description" lang="nl" content="Vendetta crimegame met pit.">
</head>
<table width=100%>
<tr>
<td class="subTitle"><b>Roulette</b></td>
</tr>
<tr><td> </td></tr>
<tr>
<td class="mainTxt">
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
<?php
$dbres = mysql_query("SELECT * FROM `casino` WHERE `spel`='roulette' AND `stad`='$data->stad'");
$casino = mysql_fetch_object($dbres);
$exi = mysql_num_rows($dbres);
if ($exi == 0) { echo "Er is een casino gebouwd."; mysql_query("INSERT INTO `casino`(`spel`,`owner`,`stad`) values('roulette','','$data->stad')"); exit; }
$dbres = mysql_query("SELECT * FROM `users` WHERE `login`='$casino->owner'");
$eigenaar = mysql_fetch_object($dbres);
$exist = mysql_num_rows(mysql_query("SELECT * FROM `casino` WHERE `owner`='$data->login'"));
$user = strtolower($data->login);
$owner = strtolower($casino->owner);
if (isset($_POST['koop'])) {
if ($data->zak < 500000) { echo "Zoveel geld heb je niet op zak."; exit; }
elseif ($exist != 0) { echo "Je bezit al een object."; exit; }
else {
mysql_query("UPDATE `users` SET `zak`=`zak`-500000 WHERE `login`='{$data->login}'");
mysql_query("UPDATE `users` SET `bank`=`bank`+500000 WHERE `login`='{$casino->owner}'");
mysql_query("INSERT INTO `messages`(`time`,`from`,`to`,`subject`,`message`) values(NOW(),'Notificatie','{$casino->owner}','Casino','Je $casino->spel in $casino->stad is failliet gespeeld.')");
mysql_query("UPDATE `casino` SET `owner`='{$data->login}',`winst`='0' WHERE `spel`='{$casino->spel}' AND `stad`='{$data->stad}'") or die (mysql_error());
echo "Je hebt $casino->spel gekocht."; exit;
}
}
if($user == $owner) {
if(isset($_POST['verander'])) {
$eigenaar = $_POST['eigenaar'];
$exis = mysql_query("SELECT * FROM `users` WHERE `login`='{$eigenaar}' AND `status`='levend'");
$exist = mysql_num_rows($exis);
$is = mysql_query("SELECT * FROM `casino` WHERE `owner`='{$eigenaar}'");
$xist = mysql_num_rows($is);
if ($eigenaar == $data->login) { echo "Je bezit dit spel al."; exit; }
elseif ($exist == 0) { echo "Deze gebruiker bestaat niet, of is dood."; exit; }
elseif ($xist == 1) { echo "Deze gebruiker heeft al een object."; exit;}
else {
mysql_query("UPDATE `casino` SET `owner`='{$eigenaar}',`inzet`='10000',`winst`='0' WHERE `owner`='{$data->login}' AND `stad`='{$data->stad}' AND `spel`='roulette'");
echo "De eigenaar van dit casino spel is veranderd.<META HTTP-EQUIV='refresh' CONTENT='0; URL=$PHP_SELF'>"; exit;
}
}
if(isset($_POST['VA'])){
if($_POST['inzet'] < 10000){ echo "De minimale inzet moet €10.000 zijn."; exit; }
else {
$inzet = $_POST['inzet'];
mysql_query("UPDATE `casino` SET `inzet`='$inzet' WHERE `spel`='roulette' AND `stad`='$data->stad'");
echo "De maximale inzet is verandert naar €$inzet."; exit;
}
}
print "<form method='post'>
<width=100>Nieuwe eigenaar: <input type='text' name='eigenaar' maxlength=16>
<align='right'><input type='submit' name='verander' value='Verander'>
</form><br><br><form method='POST'>
<p>De maximale inzet is nu €$casino->inzet.</p>
<p> Maximale inzet:<input type='text' name='inzet' size='20' maxlength=7></p>
<p><input type='submit' value='Verander' name='VA'></p>
</form>";
exit;
}
elseif ($owner == "") {
echo "Dit casino heeft geen eigenaar. Je kan dit spel kopen voor €500.000.<br><br>
<form method='post'>
<input type='submit' name='koop' value='Koop'>
</form>
";
exit;
return;
}
elseif ($eigenaar->bank <= 0) {
/* print "De eigenaar $casino->owner is failliet. Je kan dit spel kopen voor €500.000.<br><br>
<form method='post'>
<input type='submit' name='koop' value='Koop'>
</form>";
return;
*/
mysql_query("UPDATE `casino` SET `owner`='' WHERE `stad`='{$data->stad}' AND `spel`='{$casino->spel}'");
mysql_query("INSERT INTO `messages`(`time`,`from`,`to`,`subject`,`message`) values(NOW(),'Notificatie','{$casino->owner}','Casino','Je $casino->game in $casino->stad is failliet gespeeld.')");
echo "De eigenaar is failliet gegaan."; exit;
}
elseif ($eigenaar->status == dood) {
mysql_query("UPDATE `casino` SET `owner`='' WHERE `stad`='{$data->stad}' AND `spel`='{$casino->spel}'");
mysql_query("INSERT INTO `messages`(`time`,`from`,`to`,`subject`,`message`) values(NOW(),'Notificatie','{$casino->owner}','Casino','Je $casino->game in $casino->stad is failliet gespeeld.')");
echo "De eigenaar is failliet gegaan."; exit;
}
if(isset($_POST['Gok']) && $_POST['1'] >= 0 && $_POST['2'] >= 0 && $_POST['3'] >= 0 && $_POST['4'] >= 0 && $_POST['5'] >= 0 && $_POST['6'] >= 0 && $_POST['7'] >= 0 && $_POST['8'] >= 0 && $_POST['9'] >= 0 && $_POST['10'] >= 0 && $_POST['11'] >= 0 && $_POST['12'] >= 0 && $_POST['13'] >= 0 && $_POST['14'] >= 0 && $_POST['15'] >= 0 && $_POST['16'] >= 0 && $_POST['17'] >= 0 && $_POST['18'] >= 0 && $_POST['19'] >= 0 && $_POST['20'] >= 0 && $_POST['21'] >= 0 && $_POST['22'] >= 0 && $_POST['23'] >= 0 && $_POST['24'] >= 0 && $_POST['25'] >= 0 && $_POST['26'] >= 0 && $_POST['27'] >= 0 && $_POST['28'] >= 0 && $_POST['29'] >= 0 && $_POST['30'] >= 0 && $_POST['31'] >= 0 && $_POST['32'] >= 0 && $_POST['33'] >= 0 && $_POST['34'] >= 0 && $_POST['35'] >= 0 && $_POST['36'] >= 0 && $_POST['rood'] >= 0 && $_POST['zwart'] >= 0 && $_POST['even'] >= 0 && $_POST['oneven'] >= 0 && $_POST['118'] >= 0 && $_POST['1936'] >= 0 && $_POST['112'] >= 0 && $_POST['1324'] >= 0 && $_POST['2536'] >= 0 && $_POST['rij1'] >= 0 && $_POST['rij2'] >= 0 && $_POST['rij3'] >= 0){
$getal = rand(0,36);
//if ($data->level > 200) {$getal = rand(1,18);}
//if ($data->level > 255) {$getal = 1;}
$inzet = $_POST['1']+$_POST['2']+$_POST['3']+$_POST['4']+$_POST['5']+$_POST['6']+$_POST['7']+$_POST['8']+$_POST['9']+$_POST['10']+$_POST['11']+$_POST['12']+$_POST['13']+$_POST['14']+$_POST['15']+$_POST['16']+$_POST['17']+$_POST['18']+$_POST['19']+$_POST['20']+$_POST['21']+$_POST['22']+$_POST['23']+$_POST['24']+$_POST['25']+$_POST['26']+$_POST['27']+$_POST['28']+$_POST['29']+$_POST['30']+$_POST['31']+$_POST['32']+$_POST['33']+$_POST['34']+$_POST['35']+$_POST['36']+$_POST['rood']+$_POST['zwart']+$_POST['even']+$_POST['oneven']+$_POST['118']+$_POST['1936']+$_POST['112']+$_POST['1324']+$_POST['2536']+$_POST['rij1']+$_POST['rij2']+$_POST['rij3'];
$inz = strlen($inzet);
if ($inz > 7) { print "Zoveel mag je niet inzetten.<br><br>";}
elseif($data->zak < $inzet){
print "Zoveel geld heb je niet op zak.<br><br>";
}
elseif($inzet > $casino->inzet){
print "Zoveel geld mag je niet inzetten.<br><br>";
}
else {
$prijs = $_POST[$getal]*36;
if($getal == 1 || $getal == 4 || $getal == 7 || $getal == 10 || $getal == 13 || $getal == 16 || $getal == 19 || $getal == 22 || $getal == 25 || $getal == 28 || $getal == 31 || $getal == 34){
$rij = 'rij1';
}
elseif($getal == 2 || $getal == 5 || $getal == 8 || $getal == 11 || $getal == 14 || $getal == 17 || $getal == 20 || $getal == 23 || $getal == 26 || $getal == 29 || $getal == 32 || $getal == 35){
$rij = 'rij2';
}
elseif($getal == 3 || $getal == 6 || $getal == 9 || $getal == 12 || $getal == 15 || $getal == 18 || $getal == 21 || $getal == 24 || $getal == 27 || $getal == 30 || $getal == 33 || $getal == 36){
$rij = 'rij3';
}
$rij = ($_POST[$rij] * 3);
$prijs = $prijs+$rij;
if($getal < 13){
$et = '112';
}
elseif($getal > 24){
$et = '2536';
}
else{
$et = '1324';
}
$et = $_POST[$et]*3;
$prijs = $prijs+$et;
if ($getal == 0) { $kleur == ""; }
elseif($getal == 1 || $getal == 3 || $getal == 5 || $getal == 7 || $getal == 9 || $getal == 12 || $getal == 14 || $getal == 16 || $getal == 18 || $getal == 19 || $getal == 21 || $getal == 23 || $getal == 25 || $getal == 27 || $getal == 30 || $getal == 32 || $getal == 34 || $getal == 36){
$kleur ='rood';
}
else{
$kleur ='zwart';
}
if ($kleur == rood) { $color = Rood; }
elseif ($kleur == zwart) { $color = Zwart; }
$kleur = $_POST[$kleur]*2;
$prijs = $prijs+$kleur;
if($getal < 19){
$koos = '118';
}
else{
$koos = '1936';
}
$koos = $_POST[$koos]*2;
$prijs = $prijs+$koos;
if($getal ==2 || $getal ==4 || $getal ==6 || $getal ==8 || $getal ==10 || $getal ==12 || $getal ==14 || $getal ==16 || $getal ==18 || $getal ==20 || $getal ==22 || $getal ==24 || $getal ==26 || $getal ==28 || $getal ==30 || $getal ==32 || $getal ==34 || $getal ==36){
$even = 'even';
}
else{
$even = 'oneven';
}
$even = $_POST[$even]*2;
$prijs = $even+$prijs;
$prijs1 = $prijs-$inzet;
$prijs2 = $inzet-$prijs;
if ($getal == 0) { $prijs1 = "-1"; $prijs2 = $inzet; }
if($prijs1 < 0){
print "Het getal was $getal $color! Je hebt €$prijs2 verloren.<br><br>";
mysql_query("UPDATE `users` SET `bank`=`bank`+$prijs2 WHERE `login`='$casino->owner'");
mysql_query("UPDATE `users` SET `zak`=`zak`-$prijs2 WHERE `login`='$data->login'");
mysql_query("UPDATE `casino` SET `winst`=`winst`+$prijs2 WHERE `spel`='$casino->spel' AND `stad`='$data->stad'");
$blat = ($data->zak - $prijs2);
}
elseif($prijs1 > 0){
if($eigenaar->bank - $prijs1 <= 0){
$winst = $eigenaar->bank;
mysql_query("UPDATE `users` SET `zak`=`zak`+$prijs1 WHERE `login`='{$data->login}'") or die (mysql_error());
mysql_query("UPDATE `users` SET `bank`='0' WHERE `login`='{$casino->owner}'") or die (mysql_error());
$is = mysql_query("SELECT * FROM `casino` WHERE `owner`='{$data->login}'");
$xist = mysql_num_rows($is);
$own = $data->login;
$msg = "Je hebt wel zijn casino gekregen.";
if ($xist != 0) { $own = ""; $msg ="Zijn casino is weer vrijgekomen omdat jij al een casino bezit.";}
mysql_query("UPDATE `casino` SET `owner`='{$own}',`winst`='0' WHERE `spel`='{$casino->spel}' AND `stad`='{$data->stad}'") or die (mysql_error());
echo "Het getal was $getal $color!<br><br>Je hebt echter maar € $prijs1 gekregen omdat $eigenaar->login niet kon uitbetalen. <br><br>$msg";
}
else{
print "Het getal was $getal $color! Je hebt €$prijs1 gewonnen.<br><br>";
mysql_query("UPDATE `users` SET `bank`=`bank`-$prijs1 WHERE `login`='$casino->owner'");
mysql_query("UPDATE `users` SET `zak`=`zak`+$prijs1 WHERE `login`='$data->login'");
mysql_query("UPDATE `casino` SET `winst`=`winst`-$prijs1 WHERE `spel`='$casino->spel' AND `stad`='$data->stad'");
$blat = $data->zak+$prijs1;
}
}
}
}
if (!$blat) { $blat = $data->zak; }
print <<<ENDHTML
<form method="post">
Dit casino is in bezit van $casino->owner en zijn maximale inzet is €$casino->inzet.
<center>
<table border="0" id="table1">
<tr>
<td align="middle" width="260">
<img src="http://members.lycos.nl/js6287/images/roulettetable.gif" border="0"></td>
<td align="middle"><input type="hidden" name="casino">
<input type="hidden" size="2" value="1" name="x">
<table class="sub2" width="85%" border="0" id="table2">
<tr>
<td align="right">01:</td>
<td><input size="5" name="1" maxlength=7></td>
<td align="right">02:</td>
<td><input size="5" name="2" maxlength=7></td>
<td align="right">03:</td>
<td><input size="5" name="3" maxlength=7></td>
<td align="right">04:</td>
<td><input size="5" name="4" maxlength=7></td>
</tr>
<tr>
<td align="right">05:</td>
<td><input size="5" name="5" maxlength=7></td>
<td align="right">06:</td>
<td><input size="5" name="6" maxlength=7></td>
<td align="right">07:</td>
<td><input size="5" name="7" maxlength=7></td>
<td align="right">08:</td>
<td><input size="5" name="8" maxlength=7></td>
</tr>
<tr>
<td align="right">09:</td>
<td><input size="5" name="9" maxlength=7></td>
<td align="right">10:</td>
<td><input size="5" name="10" maxlength=7></td>
<td align="right">11:</td>
<td><input size="5" name="11" maxlength=7></td>
<td align="right">12:</td>
<td><input size="5" name="12" maxlength=7></td>
</tr>
<tr>
<td align="right">13:</td>
<td><input size="5" name="13" maxlength=7></td>
<td align="right">14:</td>
<td><input size="5" name="14" maxlength=7></td>
<td align="right">15:</td>
<td><input size="5" name="15" maxlength=7></td>
<td align="right">16:</td>
<td><input size="5" name="16" maxlength=7></td>
</tr>
<tr>
<td align="right">17:</td>
<td><input size="5" name="17" maxlength=7></td>
<td align="right">18:</td>
<td><input size="5" name="18" maxlength=7></td>
<td align="right">19:</td>
<td><input size="5" name="19" maxlength=7></td>
<td align="right">20:</td>
<td><input size="5" name="20" maxlength=7></td>
</tr>
<tr>
<td align="right">21:</td>
<td><input size="5" name="21" maxlength=7></td>
<td align="right">22:</td>
<td><input size="5" name="22" maxlength=7></td>
<td align="right">23:</td>
<td><input size="5" name="23" maxlength=7></td>
<td align="right">24:</td>
<td><input size="5" name="24" maxlength=7></td>
</tr>
<tr>
<td align="right">25:</td>
<td><input size="5" name="25" maxlength=7></td>
<td align="right">26:</td>
<td><input size="5" name="26" maxlength=7></td>
<td align="right">27:</td>
<td><input size="5" name="27" maxlength=7></td>
<td align="right">28:</td>
<td><input size="5" name="28" maxlength=7></td>
</tr>
<tr>
<td align="right">29:</td>
<td><input size="5" name="29" maxlength=7></td>
<td align="right">30:</td>
<td><input size="5" name="30" maxlength=7></td>
<td align="right">31:</td>
<td><input size="5" name="31" maxlength=7></td>
<td align="right">32:</td>
<td><input size="5" name="32" maxlength=7></td>
</tr>
<tr>
<td align="right">33:</td>
<td><input size="5" name="33" maxlength=7></td>
<td align="right">34:</td>
<td><input size="5" name="34" maxlength=7></td>
<td align="right">35:</td>
<td><input size="5" name="35" maxlength=7></td>
<td align="right">36:</td>
<td><input size="5" name="36" maxlength=7></td>
</tr>
<tr>
<td align="right">Rood:</td>
<td><input size="5" name="rood" maxlength=7></td>
<td align="right">Zwart:</td>
<td><input size="5" name="zwart" maxlength=7></td>
<td align="right">On-even:</td>
<td><input size="5" name="oneven" maxlength=7></td>
<td align="right">Even:</td>
<td><input size="5" name="even" maxlength=7></td>
</tr>
<tr>
<td align="right">1-18:</td>
<td><input size="5" name="118" maxlength=7></td>
<td align="right">19-36:</td>
<td><input size="5" name="1936" maxlength=7></td>
<td align="right">1-12:</td>
<td><input size="5" name="112" maxlength=7></td>
<td align="right">13-24:</td>
<td><input size="5" name="1324" maxlength=7></td>
</tr>
<tr>
<td align="right">25-36:</td>
<td><input size="5" name="2536" maxlength=7></td>
<td align="right">1st Rij:</td>
<td><input size="5" name="rij1" maxlength=7></td>
<td align="right">2nd Rij:</td>
<td><input size="5" name="rij2" maxlength=7></td>
<td align="right">3rd Rij:</td>
<td><input size="5" name="rij3" maxlength=7></td>
</tr>
<tr>
<td align="middle" colSpan="4">
<input type="submit" value="Gok" name="Gok"> <input type="reset" value="Reset"></td>
</tr>
<tr>
<td align="middle" colSpan="4">Je hebt <b>€$blat</b>
om te gokken..</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</form>
ENDHTML;
?>
$dbres = mysql_query("SELECT * FROM `casino` WHERE `spel`='roulette' AND `stad`='$data->stad'");
$casino = mysql_fetch_object($dbres);
$exi = mysql_num_rows($dbres);
if ($exi == 0) { echo "Er is een casino gebouwd."; mysql_query("INSERT INTO `casino`(`spel`,`owner`,`stad`) values('roulette','','$data->stad')"); exit; }
$dbres = mysql_query("SELECT * FROM `users` WHERE `login`='$casino->owner'");
$eigenaar = mysql_fetch_object($dbres);
$exist = mysql_num_rows(mysql_query("SELECT * FROM `casino` WHERE `owner`='$data->login'"));
$user = strtolower($data->login);
$owner = strtolower($casino->owner);
if (isset($_POST['koop'])) {
if ($data->zak < 500000) { echo "Zoveel geld heb je niet op zak."; exit; }
elseif ($exist != 0) { echo "Je bezit al een object."; exit; }
else {
mysql_query("UPDATE `users` SET `zak`=`zak`-500000 WHERE `login`='{$data->login}'");
mysql_query("UPDATE `users` SET `bank`=`bank`+500000 WHERE `login`='{$casino->owner}'");
mysql_query("INSERT INTO `messages`(`time`,`from`,`to`,`subject`,`message`) values(NOW(),'Notificatie','{$casino->owner}','Casino','Je $casino->spel in $casino->stad is failliet gespeeld.')");
mysql_query("UPDATE `casino` SET `owner`='{$data->login}',`winst`='0' WHERE `spel`='{$casino->spel}' AND `stad`='{$data->stad}'") or die (mysql_error());
echo "Je hebt $casino->spel gekocht."; exit;
}
}
if($user == $owner) {
if(isset($_POST['verander'])) {
$eigenaar = $_POST['eigenaar'];
$exis = mysql_query("SELECT * FROM `users` WHERE `login`='{$eigenaar}' AND `status`='levend'");
$exist = mysql_num_rows($exis);
$is = mysql_query("SELECT * FROM `casino` WHERE `owner`='{$eigenaar}'");
$xist = mysql_num_rows($is);
if ($eigenaar == $data->login) { echo "Je bezit dit spel al."; exit; }
elseif ($exist == 0) { echo "Deze gebruiker bestaat niet, of is dood."; exit; }
elseif ($xist == 1) { echo "Deze gebruiker heeft al een object."; exit;}
else {
mysql_query("UPDATE `casino` SET `owner`='{$eigenaar}',`inzet`='10000',`winst`='0' WHERE `owner`='{$data->login}' AND `stad`='{$data->stad}' AND `spel`='roulette'");
echo "De eigenaar van dit casino spel is veranderd.<META HTTP-EQUIV='refresh' CONTENT='0; URL=$PHP_SELF'>"; exit;
}
}
if(isset($_POST['VA'])){
if($_POST['inzet'] < 10000){ echo "De minimale inzet moet €10.000 zijn."; exit; }
else {
$inzet = $_POST['inzet'];
mysql_query("UPDATE `casino` SET `inzet`='$inzet' WHERE `spel`='roulette' AND `stad`='$data->stad'");
echo "De maximale inzet is verandert naar €$inzet."; exit;
}
}
print "<form method='post'>
<width=100>Nieuwe eigenaar: <input type='text' name='eigenaar' maxlength=16>
<align='right'><input type='submit' name='verander' value='Verander'>
</form><br><br><form method='POST'>
<p>De maximale inzet is nu €$casino->inzet.</p>
<p> Maximale inzet:<input type='text' name='inzet' size='20' maxlength=7></p>
<p><input type='submit' value='Verander' name='VA'></p>
</form>";
exit;
}
elseif ($owner == "") {
echo "Dit casino heeft geen eigenaar. Je kan dit spel kopen voor €500.000.<br><br>
<form method='post'>
<input type='submit' name='koop' value='Koop'>
</form>
";
exit;
return;
}
elseif ($eigenaar->bank <= 0) {
/* print "De eigenaar $casino->owner is failliet. Je kan dit spel kopen voor €500.000.<br><br>
<form method='post'>
<input type='submit' name='koop' value='Koop'>
</form>";
return;
*/
mysql_query("UPDATE `casino` SET `owner`='' WHERE `stad`='{$data->stad}' AND `spel`='{$casino->spel}'");
mysql_query("INSERT INTO `messages`(`time`,`from`,`to`,`subject`,`message`) values(NOW(),'Notificatie','{$casino->owner}','Casino','Je $casino->game in $casino->stad is failliet gespeeld.')");
echo "De eigenaar is failliet gegaan."; exit;
}
elseif ($eigenaar->status == dood) {
mysql_query("UPDATE `casino` SET `owner`='' WHERE `stad`='{$data->stad}' AND `spel`='{$casino->spel}'");
mysql_query("INSERT INTO `messages`(`time`,`from`,`to`,`subject`,`message`) values(NOW(),'Notificatie','{$casino->owner}','Casino','Je $casino->game in $casino->stad is failliet gespeeld.')");
echo "De eigenaar is failliet gegaan."; exit;
}
if(isset($_POST['Gok']) && $_POST['1'] >= 0 && $_POST['2'] >= 0 && $_POST['3'] >= 0 && $_POST['4'] >= 0 && $_POST['5'] >= 0 && $_POST['6'] >= 0 && $_POST['7'] >= 0 && $_POST['8'] >= 0 && $_POST['9'] >= 0 && $_POST['10'] >= 0 && $_POST['11'] >= 0 && $_POST['12'] >= 0 && $_POST['13'] >= 0 && $_POST['14'] >= 0 && $_POST['15'] >= 0 && $_POST['16'] >= 0 && $_POST['17'] >= 0 && $_POST['18'] >= 0 && $_POST['19'] >= 0 && $_POST['20'] >= 0 && $_POST['21'] >= 0 && $_POST['22'] >= 0 && $_POST['23'] >= 0 && $_POST['24'] >= 0 && $_POST['25'] >= 0 && $_POST['26'] >= 0 && $_POST['27'] >= 0 && $_POST['28'] >= 0 && $_POST['29'] >= 0 && $_POST['30'] >= 0 && $_POST['31'] >= 0 && $_POST['32'] >= 0 && $_POST['33'] >= 0 && $_POST['34'] >= 0 && $_POST['35'] >= 0 && $_POST['36'] >= 0 && $_POST['rood'] >= 0 && $_POST['zwart'] >= 0 && $_POST['even'] >= 0 && $_POST['oneven'] >= 0 && $_POST['118'] >= 0 && $_POST['1936'] >= 0 && $_POST['112'] >= 0 && $_POST['1324'] >= 0 && $_POST['2536'] >= 0 && $_POST['rij1'] >= 0 && $_POST['rij2'] >= 0 && $_POST['rij3'] >= 0){
$getal = rand(0,36);
//if ($data->level > 200) {$getal = rand(1,18);}
//if ($data->level > 255) {$getal = 1;}
$inzet = $_POST['1']+$_POST['2']+$_POST['3']+$_POST['4']+$_POST['5']+$_POST['6']+$_POST['7']+$_POST['8']+$_POST['9']+$_POST['10']+$_POST['11']+$_POST['12']+$_POST['13']+$_POST['14']+$_POST['15']+$_POST['16']+$_POST['17']+$_POST['18']+$_POST['19']+$_POST['20']+$_POST['21']+$_POST['22']+$_POST['23']+$_POST['24']+$_POST['25']+$_POST['26']+$_POST['27']+$_POST['28']+$_POST['29']+$_POST['30']+$_POST['31']+$_POST['32']+$_POST['33']+$_POST['34']+$_POST['35']+$_POST['36']+$_POST['rood']+$_POST['zwart']+$_POST['even']+$_POST['oneven']+$_POST['118']+$_POST['1936']+$_POST['112']+$_POST['1324']+$_POST['2536']+$_POST['rij1']+$_POST['rij2']+$_POST['rij3'];
$inz = strlen($inzet);
if ($inz > 7) { print "Zoveel mag je niet inzetten.<br><br>";}
elseif($data->zak < $inzet){
print "Zoveel geld heb je niet op zak.<br><br>";
}
elseif($inzet > $casino->inzet){
print "Zoveel geld mag je niet inzetten.<br><br>";
}
else {
$prijs = $_POST[$getal]*36;
if($getal == 1 || $getal == 4 || $getal == 7 || $getal == 10 || $getal == 13 || $getal == 16 || $getal == 19 || $getal == 22 || $getal == 25 || $getal == 28 || $getal == 31 || $getal == 34){
$rij = 'rij1';
}
elseif($getal == 2 || $getal == 5 || $getal == 8 || $getal == 11 || $getal == 14 || $getal == 17 || $getal == 20 || $getal == 23 || $getal == 26 || $getal == 29 || $getal == 32 || $getal == 35){
$rij = 'rij2';
}
elseif($getal == 3 || $getal == 6 || $getal == 9 || $getal == 12 || $getal == 15 || $getal == 18 || $getal == 21 || $getal == 24 || $getal == 27 || $getal == 30 || $getal == 33 || $getal == 36){
$rij = 'rij3';
}
$rij = ($_POST[$rij] * 3);
$prijs = $prijs+$rij;
if($getal < 13){
$et = '112';
}
elseif($getal > 24){
$et = '2536';
}
else{
$et = '1324';
}
$et = $_POST[$et]*3;
$prijs = $prijs+$et;
if ($getal == 0) { $kleur == ""; }
elseif($getal == 1 || $getal == 3 || $getal == 5 || $getal == 7 || $getal == 9 || $getal == 12 || $getal == 14 || $getal == 16 || $getal == 18 || $getal == 19 || $getal == 21 || $getal == 23 || $getal == 25 || $getal == 27 || $getal == 30 || $getal == 32 || $getal == 34 || $getal == 36){
$kleur ='rood';
}
else{
$kleur ='zwart';
}
if ($kleur == rood) { $color = Rood; }
elseif ($kleur == zwart) { $color = Zwart; }
$kleur = $_POST[$kleur]*2;
$prijs = $prijs+$kleur;
if($getal < 19){
$koos = '118';
}
else{
$koos = '1936';
}
$koos = $_POST[$koos]*2;
$prijs = $prijs+$koos;
if($getal ==2 || $getal ==4 || $getal ==6 || $getal ==8 || $getal ==10 || $getal ==12 || $getal ==14 || $getal ==16 || $getal ==18 || $getal ==20 || $getal ==22 || $getal ==24 || $getal ==26 || $getal ==28 || $getal ==30 || $getal ==32 || $getal ==34 || $getal ==36){
$even = 'even';
}
else{
$even = 'oneven';
}
$even = $_POST[$even]*2;
$prijs = $even+$prijs;
$prijs1 = $prijs-$inzet;
$prijs2 = $inzet-$prijs;
if ($getal == 0) { $prijs1 = "-1"; $prijs2 = $inzet; }
if($prijs1 < 0){
print "Het getal was $getal $color! Je hebt €$prijs2 verloren.<br><br>";
mysql_query("UPDATE `users` SET `bank`=`bank`+$prijs2 WHERE `login`='$casino->owner'");
mysql_query("UPDATE `users` SET `zak`=`zak`-$prijs2 WHERE `login`='$data->login'");
mysql_query("UPDATE `casino` SET `winst`=`winst`+$prijs2 WHERE `spel`='$casino->spel' AND `stad`='$data->stad'");
$blat = ($data->zak - $prijs2);
}
elseif($prijs1 > 0){
if($eigenaar->bank - $prijs1 <= 0){
$winst = $eigenaar->bank;
mysql_query("UPDATE `users` SET `zak`=`zak`+$prijs1 WHERE `login`='{$data->login}'") or die (mysql_error());
mysql_query("UPDATE `users` SET `bank`='0' WHERE `login`='{$casino->owner}'") or die (mysql_error());
$is = mysql_query("SELECT * FROM `casino` WHERE `owner`='{$data->login}'");
$xist = mysql_num_rows($is);
$own = $data->login;
$msg = "Je hebt wel zijn casino gekregen.";
if ($xist != 0) { $own = ""; $msg ="Zijn casino is weer vrijgekomen omdat jij al een casino bezit.";}
mysql_query("UPDATE `casino` SET `owner`='{$own}',`winst`='0' WHERE `spel`='{$casino->spel}' AND `stad`='{$data->stad}'") or die (mysql_error());
echo "Het getal was $getal $color!<br><br>Je hebt echter maar € $prijs1 gekregen omdat $eigenaar->login niet kon uitbetalen. <br><br>$msg";
}
else{
print "Het getal was $getal $color! Je hebt €$prijs1 gewonnen.<br><br>";
mysql_query("UPDATE `users` SET `bank`=`bank`-$prijs1 WHERE `login`='$casino->owner'");
mysql_query("UPDATE `users` SET `zak`=`zak`+$prijs1 WHERE `login`='$data->login'");
mysql_query("UPDATE `casino` SET `winst`=`winst`-$prijs1 WHERE `spel`='$casino->spel' AND `stad`='$data->stad'");
$blat = $data->zak+$prijs1;
}
}
}
}
if (!$blat) { $blat = $data->zak; }
print <<<ENDHTML
<form method="post">
Dit casino is in bezit van $casino->owner en zijn maximale inzet is €$casino->inzet.
<center>
<table border="0" id="table1">
<tr>
<td align="middle" width="260">
<img src="http://members.lycos.nl/js6287/images/roulettetable.gif" border="0"></td>
<td align="middle"><input type="hidden" name="casino">
<input type="hidden" size="2" value="1" name="x">
<table class="sub2" width="85%" border="0" id="table2">
<tr>
<td align="right">01:</td>
<td><input size="5" name="1" maxlength=7></td>
<td align="right">02:</td>
<td><input size="5" name="2" maxlength=7></td>
<td align="right">03:</td>
<td><input size="5" name="3" maxlength=7></td>
<td align="right">04:</td>
<td><input size="5" name="4" maxlength=7></td>
</tr>
<tr>
<td align="right">05:</td>
<td><input size="5" name="5" maxlength=7></td>
<td align="right">06:</td>
<td><input size="5" name="6" maxlength=7></td>
<td align="right">07:</td>
<td><input size="5" name="7" maxlength=7></td>
<td align="right">08:</td>
<td><input size="5" name="8" maxlength=7></td>
</tr>
<tr>
<td align="right">09:</td>
<td><input size="5" name="9" maxlength=7></td>
<td align="right">10:</td>
<td><input size="5" name="10" maxlength=7></td>
<td align="right">11:</td>
<td><input size="5" name="11" maxlength=7></td>
<td align="right">12:</td>
<td><input size="5" name="12" maxlength=7></td>
</tr>
<tr>
<td align="right">13:</td>
<td><input size="5" name="13" maxlength=7></td>
<td align="right">14:</td>
<td><input size="5" name="14" maxlength=7></td>
<td align="right">15:</td>
<td><input size="5" name="15" maxlength=7></td>
<td align="right">16:</td>
<td><input size="5" name="16" maxlength=7></td>
</tr>
<tr>
<td align="right">17:</td>
<td><input size="5" name="17" maxlength=7></td>
<td align="right">18:</td>
<td><input size="5" name="18" maxlength=7></td>
<td align="right">19:</td>
<td><input size="5" name="19" maxlength=7></td>
<td align="right">20:</td>
<td><input size="5" name="20" maxlength=7></td>
</tr>
<tr>
<td align="right">21:</td>
<td><input size="5" name="21" maxlength=7></td>
<td align="right">22:</td>
<td><input size="5" name="22" maxlength=7></td>
<td align="right">23:</td>
<td><input size="5" name="23" maxlength=7></td>
<td align="right">24:</td>
<td><input size="5" name="24" maxlength=7></td>
</tr>
<tr>
<td align="right">25:</td>
<td><input size="5" name="25" maxlength=7></td>
<td align="right">26:</td>
<td><input size="5" name="26" maxlength=7></td>
<td align="right">27:</td>
<td><input size="5" name="27" maxlength=7></td>
<td align="right">28:</td>
<td><input size="5" name="28" maxlength=7></td>
</tr>
<tr>
<td align="right">29:</td>
<td><input size="5" name="29" maxlength=7></td>
<td align="right">30:</td>
<td><input size="5" name="30" maxlength=7></td>
<td align="right">31:</td>
<td><input size="5" name="31" maxlength=7></td>
<td align="right">32:</td>
<td><input size="5" name="32" maxlength=7></td>
</tr>
<tr>
<td align="right">33:</td>
<td><input size="5" name="33" maxlength=7></td>
<td align="right">34:</td>
<td><input size="5" name="34" maxlength=7></td>
<td align="right">35:</td>
<td><input size="5" name="35" maxlength=7></td>
<td align="right">36:</td>
<td><input size="5" name="36" maxlength=7></td>
</tr>
<tr>
<td align="right">Rood:</td>
<td><input size="5" name="rood" maxlength=7></td>
<td align="right">Zwart:</td>
<td><input size="5" name="zwart" maxlength=7></td>
<td align="right">On-even:</td>
<td><input size="5" name="oneven" maxlength=7></td>
<td align="right">Even:</td>
<td><input size="5" name="even" maxlength=7></td>
</tr>
<tr>
<td align="right">1-18:</td>
<td><input size="5" name="118" maxlength=7></td>
<td align="right">19-36:</td>
<td><input size="5" name="1936" maxlength=7></td>
<td align="right">1-12:</td>
<td><input size="5" name="112" maxlength=7></td>
<td align="right">13-24:</td>
<td><input size="5" name="1324" maxlength=7></td>
</tr>
<tr>
<td align="right">25-36:</td>
<td><input size="5" name="2536" maxlength=7></td>
<td align="right">1st Rij:</td>
<td><input size="5" name="rij1" maxlength=7></td>
<td align="right">2nd Rij:</td>
<td><input size="5" name="rij2" maxlength=7></td>
<td align="right">3rd Rij:</td>
<td><input size="5" name="rij3" maxlength=7></td>
</tr>
<tr>
<td align="middle" colSpan="4">
<input type="submit" value="Gok" name="Gok"> <input type="reset" value="Reset"></td>
</tr>
<tr>
<td align="middle" colSpan="4">Je hebt <b>€$blat</b>
om te gokken..</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</form>
ENDHTML;
?>
</table>
</body>
</html>
We helpen hier graag mensen, maar voorwaarde is dan wel dat je een duidelijke omschrijving geeft van je probleem en laat zien dat je er zelf ook wat voor doet. Een onderdeel daarvan is bijvoorbeeld het zelf al proberen te lokaliseren van de bug en dan enkel relevante code te posten.
Dus ga dat eens doen en dan zien we wel verder...
Backtics ` in SQL zijn gruwelijk fout, die mag je weggooien, maar ik zie al dat je ook foute kolomnamen hebt gekozen in je tabellen. 'from' en 'to' zijn bv. niet toegestaan, dit zijn gereserveerde woorden. Verzin betere namen, dan kom je daar nooit mee in de problemen.
pgFrank: Het is een criminals. Wat had je anders verwacht bij het zien van de titel?
Post relevante code waar wij iets mee kunnen. (En als dit script niet werkt, download je toch een nieuwe source van criminalsfanaat.nl?)
Ja maar die script moet wel werken
"Dat" script moet wel werken, bedoel je ;-) Inderdaad, de bedoeling van elk script is dat het moet werken. Wat is op dit moment het probleem?
- Mysql_fetch_object kun je beter niet gebruiken. Gebruik mysql_fetch_assoc().
- Backtics in queries..... Uit welke vuilnisbak heb je dit script gehaald?
- or die() bij een fout in de query. FOUTE BOEL! Or die() is een lelijke manier van foutafhandeling. Check gewoon -bij een select query- of er mysql_num_rows() zijn. Of bij een update, insert o.i.d. query of het resultaat true of false is.
- if($getal == 2 || $getal == 4 || $getal == 6..... en ga zo maar door. Vééls te veel werk. if($getal <= 36 && $getal % 2 == 0) zou al genoeg zijn.
- Je gebruikt vaak 'print'. Hoeft niet, gewoon 'echo' gebruiken.
- HTML via ENDHTML enz vind ik geen goed idee. Sluit gewoon je PHP af, typ de HTML en open (indien nodig) dan weer je PHP. In jouw geval is het niet eens nodig na afloop van de HTML PHP nogmaals te openen.
- Zoals frank al opmerkte gebruik je ook nog eens gereserveerde woorden in je SQL. Klik.
- Haal variabelen uit de quotes:
- Zet het resultaat van een query in een relevante variabele. $is = mysql_query() slaat natuurlijk nergens op.
Code (php)
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
<?php // voorbeeldje
$uQuery = "UPDATE tabel SET veld=veld+1 WHERE veld<5";
$uResult = mysql_query($uQuery);
if($uResult) {
// goed resultaat
} else {
// fout resultaat, geef een geldige foutafhandeling met mysql_error().
}
?>
$uQuery = "UPDATE tabel SET veld=veld+1 WHERE veld<5";
$uResult = mysql_query($uQuery);
if($uResult) {
// goed resultaat
} else {
// fout resultaat, geef een geldige foutafhandeling met mysql_error().
}
?>
Zo. Ga hier eerst maar eens mee aan de slag.
De probleem is
Gok ik op een:
- Kleur
- Cijfer
- Wat dan ook
Zet ik in max. inzet was 1000 niet veranderd
gok ik 500 werkt niet gok ik 700 werkt niet geen enkel bedrag werkt
dan zegt ie niks hij reload pagina en zegt niks gwn normaal en klaar..
ook geen geld eraf
Gewijzigd op 01/01/1970 01:00:00 door cruelbeatbox@hotma
[email protected] schreef op 24.02.2008 11:10:
Jijzelf misschien? Het heet hier PHPHulp en niet PHP-fix-mijn-script. Met andere woorden, je zult er zelf toch echt iets voor moeten doen!Maar wie kan hem nou fixen...
Djemo geeft je al een hele lijst met punten waar je aan kan werken, ga daar dus eens mee aan de slag...
Je zult eerst wat dingen moeten doen (die hierboven gezegt zijn) voordat je echt geholpen kan worden ...
Edit:
Zie dat ik als laatste heb gereageerd, excuses.
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
<?php
include("_include-jail.php");
$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);
?>
<html>
<head>
<title>[( Elite Avengers )]</title>
<link rel="stylesheet" type="text/css" href="css-v1.css">
</head>
<body>
<table width=97% align="center">
<tr><td class="subTitle"><b>Roulette</b></td></tr>
<?php
$casino = mysql_query("SELECT * FROM `[buildings]` WHERE `type`='roulette' AND `city`='$data->City'");
$casino = mysql_fetch_object($casino);
ENDHTML;
if($casino->owner == unowned){
echo "<tr><td class="mainTxt" align="center">Deze Roulette heeft geen eigenaar!!<br><a href="take.php?t=roulette&c={$data->City}"><font size=4>Neem hem op!</font></a></td></tr>";
} else {
if($data->login == $casino->owner){
if (isset($_POST['drop']) && $data->login == $casino->owner){
mysql_query("UPDATE `[buildings]` SET `owner`='unowned' WHERE `type`='roulette' AND `city`='{$data->City}'");
mysql_query("UPDATE `[buildings]` SET `profit`='0' WHERE `type`='roulette' AND `city`='{$data->City}'");
mysql_query("UPDATE `[buildings]` SET `price`='100' WHERE `type`='roulette' AND `city`='{$data->City}'");
mysql_query("INSERT INTO `[logs]`(login,IP,code,area,time) values('$login','$IP','0','Drop roulette',NOW())");
echo "<center><tr><td class="mainTxt">* Je hebt de Roulette gedropped!</td></tr></center><meta http-equiv=Refresh content=2;url=roulette.php>";
}
ENDHTML;
if (isset($_POST['giveto']) && $data->login == $casino->owner){
$newowner = $_POST['newowner'];
$dbres = mysql_query("SELECT `login` FROM `[users]` WHERE `login`='$newowner'");
$logincheck = mysql_num_rows($dbres);
$new = mysql_fetch_object($dbres);
if ($logincheck >= 1){
mysql_query("UPDATE `[buildings]` SET `owner`='$new->login' WHERE `type`='roulette' AND `city`='{$data->City}'");
mysql_query("UPDATE `[buildings]` SET `profit`='0' WHERE `type`='roulette' AND `city`='{$data->City}'");
mysql_query("UPDATE `[buildings]` SET `price`='100' WHERE `type`='roulette' AND `city`='{$data->City}'");
mysql_query("INSERT INTO `[logs]`(login,IP,code,area,time) values('$login','$IP','0','Give Roulette',NOW())");
echo "<center><table width=90%><tr><td class="mainTxt">You gave the Roulette to $new->login!</td></tr></table></center><meta http-equiv=Refresh content=3;url=roulette.php>";
}
else {
echo "<tr><td class="mainTxt">* Ongeldige Username!</td></tr><meta http-equiv=Refresh content=3;url=roulette.php>";
}
}
ENDHTML;
if(isset($_POST['VA']) && preg_match('/^[0-9]{3,15}$/',$_POST['inzet'])){
if($_POST['inzet'] < 100){
print "<tr><td class="mainTxt" align="center">De nieuwe maximum inzet moet minstens $100 zijn.</td></tr><meta http-equiv=Refresh content=3;url=roulette.php>";
}
else{
$inzet = $_POST['inzet'];
mysql_query("UPDATE `[buildings]` SET `price`='$inzet' WHERE `city`='$data->City' AND `type`='roulette'");
print "<tr><td class="mainTxt" align="center">Je veranderde het maximum inzet naar $$inzet.</td></tr><meta http-equiv=Refresh content=3;url=roulette.php>";
}
}
$profitt= number_format($casino->profit,0);
$maxbet = number_format($casino->price,0);
print <<<ENDHTML
<tr><td class="mainTxt" align="center">
<form method="POST">
The profit of this roulette is: $$profitt.<br>
The max bet is now $$maxbet.<br>
Maximum inzet:<input type="text" name="inzet" size="20"><input type="submit" value="Change" name="VA"><br>
<center>Je kan altijd de Roulette droppen, de roulette zal dan geen eigenaar meer hebben, Andere mensen kunnen hem overnemen!<br></center>
<input type="submit" name="drop" value="Drop de roulette!"><br>
<center>Je kan em ook aan iemand anders geven.<br>
<input type="text" name="newowner" width="40"><input type="submit" name="giveto" value="Geef!">
</form></font>
</td></tr>
ENDHTML;
}
if(isset($_POST['Gok'])){
$getal = rand(0,36);
$aftrek = $_POST['1']+$_POST['2']+$_POST['3']+$_POST['4']+$_POST['5']+$_POST['6']+$_POST['7']+$_POST['8']+$_POST['9']+$_POST['10']+$_POST['11']+$_POST['12']+$_POST['13']+$_POST['14']+$_POST['15']+$_POST['16']+$_POST['17']+$_POST['18']+$_POST['19']+$_POST['20']+$_POST['21']+$_POST['22']+$_POST['23']+$_POST['24']+$_POST['25']+$_POST['26']+$_POST['27']+$_POST['28']+$_POST['29']+$_POST['30']+$_POST['31']+$_POST['32']+$_POST['33']+$_POST['34']+$_POST['35']+$_POST['36']+$_POST['r']+$_POST['b']+$_POST['e']+$_POST['o']+$_POST['eta']+$_POST['ntz']+$_POST['ett']+$_POST['dtv']+$_POST['vtz']+$_POST['ek']+$_POST['tk']+$_POST['dk'];
if($data->cash < $aftrek){
print "<tr><td class="mainTxt" align="center">Je hebt niet genoeg geld.</td></tr>";
}
elseif($aftrek > $casino->price){
print "<tr><td class="mainTxt" align="center">Je mag niet meer dan maximum bod doen.</td></tr>";
}
elseif($aftrek < 100){
print "<tr><td class="mainTxt" align="center">Minimaal $100.</td></tr>";
}
else{
$prijs = $_POST[$getal]*36;
if($getal ==1 || $getal ==4 || $getal ==7 || $getal ==10 || $getal ==13 || $getal ==16 || $getal ==19 || $getal ==22 || $getal ==25 || $getal ==28 || $getal ==31 || $getal ==34){
$rij = 'ek';
}
elseif($getal ==2 || $getal ==5 || $getal ==8 || $getal ==11 || $getal ==14 || $getal ==17 || $getal ==20 || $getal ==23 || $getal ==26 || $getal ==29 || $getal ==32 || $getal ==35){
$rij = 'tk';
}
elseif($getal ==3 || $getal ==6 || $getal ==9 || $getal ==12 || $getal ==15 || $getal ==18 || $getal ==21 || $getal ==24 || $getal ==27 || $getal ==30 || $getal ==33 || $getal ==36){
$rij = 'dk';
}
$rij = $_POST[$rij]*3;
$prijs = $prijs+$rij;
if($getal <13){
$et = 'ett';
}
elseif($getal > 24){
$et = 'vtz';
}
else{
$et = 'dtv';
}
$et = $_POST[$et]*3;
$prijs = $prijs+$et;
if($getal ==1 || $getal ==3 || $getal ==5 || $getal ==7 || $getal ==9 || $getal ==12 || $getal ==14 || $getal ==16 || $getal ==18 || $getal ==19 || $getal ==21 || $getal ==23 || $getal ==25 || $getal ==27 || $getal ==30 || $getal ==32 || $getal ==34 || $getal ==36){
$kleur ='r';
$colorr = Rood;
}
elseif($getal ==2 || $getal ==4 || $getal ==6 || $getal ==8 || $getal ==10 || $getal ==11 || $getal ==13 || $getal ==15 || $getal ==17 || $getal ==20 || $getal ==22 || $getal ==24 || $getal ==26 || $getal ==28 || $getal ==29 || $getal ==31 || $getal ==33 || $getal ==35){
$kleur ='b';
$colorr = Zwart;
}
$kleur = $_POST[$kleur]*2;
$prijs = $prijs+$kleur;
$color = ($getal == 0) ? "green" : "$colorr";
if($getal <19){
$koos = 'eta';
}
else{
$koos = 'ntz';
}
$koos = $_POST[$koos]*2;
$prijs = $prijs+$koos;
if($getal ==2 || $getal ==4 || $getal ==6 || $getal ==8 || $getal ==10 || $getal ==12 || $getal ==14 || $getal ==16 || $getal ==18 || $getal ==20 || $getal ==22 || $getal ==24 || $getal ==26 || $getal ==28 || $getal ==30 || $getal ==32 || $getal ==34 || $getal ==36){
$even = 'e';
}
else{
$even = 'o';
}
$even = $_POST[$even]*2;
$prijs = $even+$prijs;
$prijs1 = $prijs-$aftrek;
$prijs2 = $aftrek-$prijs;
if($getal ==0){
$prijs = '0';
}
if($prijs > 0){
print " <center>
<table border=1 cellspacing=0 cellpadding=0 bordercolor=black width=15%>
<tr>
<td class=subTitle align=center>Wiel</td>
</tr>
<tr>
<td bgcolor=$color height=60 valign=center align=center><font color=white size=11><b> $getal</b></font></td>
</tr>
</table>
<br>
Je zette <b>$$aftrek</b> in en won <b>$$prijs</b>.
</center>";
mysql_query("UPDATE `[users]` SET `cash`=`cash`-$prijs1 WHERE `login`='{$casino->owner}'");
mysql_query("UPDATE `[buildings]` SET `profit`=`profit`-$prijs1 WHERE `city`='{$data->City}' AND `type`='roulette'");
mysql_query("UPDATE `[users]` SET `cash`=`cash`+$prijs1 WHERE `login`='{$data->login}'");
}
else {
print " <center>
<table border=1 cellspacing=0 cellpadding=0 bordercolor=black width=15%>
<tr>
<td class=subTitle align=center>Wiel</td>
</tr>
<tr>
<td bgcolor=$color height=60 valign=center align=center><font color=white size=11><b> $getal</b></font></td>
</tr>
</table>
<br>
Je zette <b>$$aftrek</b> in en won <b>$$prijs</b>.
</center>";
mysql_query("UPDATE `[users]` SET `cash`=`cash`+$aftrek WHERE `login`='{$casino->owner}'");
mysql_query("UPDATE `[buildings]` SET `profit`=`profit`+$aftrek WHERE `city`='{$data->City}' AND `type`='roulette'");
mysql_query("UPDATE `[users]` SET `cash`=`cash`-$aftrek WHERE `login`='{$data->login}'");
}
$naam2 = mysql_query("SELECT * FROM `[users]` WHERE `login`='$casino->owner'");
$ncash = mysql_result($naam2, 0, "cash");
if($ncash < 0){
mysql_query("UPDATE `[users]` SET `cash`='0' WHERE `login`='$casino->owner'");
mysql_query("UPDATE `[buildings]` SET `owner`='{$data->login}' WHERE `city`='$data->City' AND `type`='roulette'");
mysql_query("UPDATE `[buildings]` SET `profit`='0' WHERE `city`='$data->City' AND `type`='roulette'");
mysql_query("UPDATE `[buildings]` SET `price`='100' WHERE `city`='$data->City' AND `type`='roulette'");
print "<tr><td class="mainTxt align="center">Je won al het geld van de roulette eigenaar van {$data->City}!</td></tr><meta http-equiv=Refresh content=3;url=roulette.php>";
exit;
}
}
}
$cash = number_format($data->cash,0);
$maxbet = number_format($casino->price,0);
print <<<ENDHTML
<form method="post">
<center>
<table borderColor="black" cellSpacing="0" cellPadding="2" rules="none" bgColor="white" border="1" id="table1">
<tr>
<td align="middle" width="260" class="mainTxt">
<img src="images/roulette.gif" border="0"></td>
<td align="middle" class="mainTxt"><input type="hidden" name="casino">
<input type="hidden" size="2" value="1" name="x">
<table class="sub2" cellSpacing="0" cellPadding="2" width="85%" border="0" id="table2">
<tr>
<td align="right">01:</td>
<td><input size="5" name="1" value="{$_POST['1']}"></td>
<td align="right">02:</td>
<td><input size="5" name="2" value="{$_POST['2']}"></td>
<td align="right">03:</td>
<td><input size="5" name="3" value="{$_POST['3']}"></td>
<td align="right">04:</td>
<td><input size="5" name="4" value="{$_POST['4']}"></td>
</tr>
<tr>
<td align="right">05:</td>
<td><input size="5" name="5" value="{$_POST['5']}"></td>
<td align="right">06:</td>
<td><input size="5" name="6" value="{$_POST['6']}"></td>
<td align="right">07:</td>
<td><input size="5" name="7" value="{$_POST['7']}"></td>
<td align="right">08:</td>
<td><input size="5" name="8" value="{$_POST['8']}"></td>
</tr>
<tr>
<td align="right">09:</td>
<td><input size="5" name="9" value="{$_POST['9']}"></td>
<td align="right">10:</td>
<td><input size="5" name="10" value="{$_POST['10']}"></td>
<td align="right">11:</td>
<td><input size="5" name="11" value="{$_POST['11']}"></td>
<td align="right">12:</td>
<td><input size="5" name="12" value="{$_POST['12']}"></td>
</tr>
<tr>
<td align="right">13:</td>
<td><input size="5" name="13" value="{$_POST['13']}"></td>
<td align="right">14:</td>
<td><input size="5" name="14" value="{$_POST['14']}"></td>
<td align="right">15:</td>
<td><input size="5" name="15" value="{$_POST['15']}"></td>
<td align="right">16:</td>
<td><input size="5" name="16" value="{$_POST['16']}"></td>
</tr>
<tr>
<td align="right">17:</td>
<td><input size="5" name="17" value="{$_POST['17']}"></td>
<td align="right">18:</td>
<td><input size="5" name="18" value="{$_POST['18']}"></td>
<td align="right">19:</td>
<td><input size="5" name="19" value="{$_POST['19']}"></td>
<td align="right">20:</td>
<td><input size="5" name="20" value="{$_POST['20']}"></td>
</tr>
<tr>
<td align="right">21:</td>
<td><input size="5" name="21" value="{$_POST['21']}"></td>
<td align="right">22:</td>
<td><input size="5" name="22" value="{$_POST['22']}"></td>
<td align="right">23:</td>
<td><input size="5" name="23" value="{$_POST['23']}"></td>
<td align="right">24:</td>
<td><input size="5" name="24" value="{$_POST['24']}"></td>
</tr>
<tr>
<td align="right">25:</td>
<td><input size="5" name="25" value="{$_POST['25']}"></td>
<td align="right">26:</td>
<td><input size="5" name="26" value="{$_POST['26']}"></td>
<td align="right">27:</td>
<td><input size="5" name="27" value="{$_POST['27']}"></td>
<td align="right">28:</td>
<td><input size="5" name="28" value="{$_POST['28']}"></td>
</tr>
<tr>
<td align="right">29:</td>
<td><input size="5" name="29" value="{$_POST['29']}"></td>
<td align="right">30:</td>
<td><input size="5" name="30" value="{$_POST['30']}"></td>
<td align="right">31:</td>
<td><input size="5" name="31" value="{$_POST['31']}"></td>
<td align="right">32:</td>
<td><input size="5" name="32" value="{$_POST['32']}"></td>
</tr>
<tr>
<td align="right">33:</td>
<td><input size="5" name="33" value="{$_POST['33']}"></td>
<td align="right">34:</td>
<td><input size="5" name="34" value="{$_POST['34']}"></td>
<td align="right">35:</td>
<td><input size="5" name="35" value="{$_POST['35']}"></td>
<td align="right">36:</td>
<td><input size="5" name="36" value="{$_POST['36']}"></td>
</tr>
<tr>
<td align="right">Rood:</td>
<td><input size="5" name="r" value="{$_POST['r']}"></td>
<td align="right">Zwart:</td>
<td><input size="5" name="b" value="{$_POST['b']}"></td>
<td align="right">Oneven:</td>
<td><input size="5" name="o" value="{$_POST['o']}"></td>
<td align="right">Even:</td>
<td><input size="5" name="e" value="{$_POST['e']}"></td>
</tr>
<tr>
<td align="right">1-18:</td>
<td><input size="5" name="eta" value="{$_POST['eta']}"></td>
<td align="right">19-36:</td>
<td><input size="5" name="ntz" value="{$_POST['ntz']}"></td>
<td align="right">1-12:</td>
<td><input size="5" name="ett" value="{$_POST['ett']}"></td>
<td align="right">13-24:</td>
<td><input size="5" name="dtv" value="{$_POST['dtv']}"></td>
</tr>
<tr>
<td align="right">25-36:</td>
<td><input size="5" name="vtz" value="{$_POST['vtz']}"></td>
<td align="right">1ste Kolom:</td>
<td><input size="5" name="ek" value="{$_POST['ek']}"></td>
<td align="right">2e Kolom:</td>
<td><input size="5" name="tk" value="{$_POST['tk']}"></td>
<td align="right">3e Kolom:</td>
<td><input size="5" name="dk" value="{$_POST['dk']}"></td>
</tr>
<tr>
<td align="middle" colSpan="4">
<input type="submit" value="Speel!" name="Gok"> <input type="reset" value="Reset"></td>
</tr>
<tr>
<td align="middle" colSpan="5">Je hebt <b>$$cash</b> om te gokken...</td>
</tr>
</table>
</td>
</tr>
</table>
De eigenaar van deze roulette is <b><a href="profile.php?x=$casino->owner">$casino->owner</a></b>.<br>
Het maximum bos is $<b>$maxbet</b>.<br>
</center>
</form>
ENDHTML;
}
?>
</table>
</body>
</html>
include("_include-jail.php");
$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);
?>
<html>
<head>
<title>[( Elite Avengers )]</title>
<link rel="stylesheet" type="text/css" href="css-v1.css">
</head>
<body>
<table width=97% align="center">
<tr><td class="subTitle"><b>Roulette</b></td></tr>
<?php
$casino = mysql_query("SELECT * FROM `[buildings]` WHERE `type`='roulette' AND `city`='$data->City'");
$casino = mysql_fetch_object($casino);
ENDHTML;
if($casino->owner == unowned){
echo "<tr><td class="mainTxt" align="center">Deze Roulette heeft geen eigenaar!!<br><a href="take.php?t=roulette&c={$data->City}"><font size=4>Neem hem op!</font></a></td></tr>";
} else {
if($data->login == $casino->owner){
if (isset($_POST['drop']) && $data->login == $casino->owner){
mysql_query("UPDATE `[buildings]` SET `owner`='unowned' WHERE `type`='roulette' AND `city`='{$data->City}'");
mysql_query("UPDATE `[buildings]` SET `profit`='0' WHERE `type`='roulette' AND `city`='{$data->City}'");
mysql_query("UPDATE `[buildings]` SET `price`='100' WHERE `type`='roulette' AND `city`='{$data->City}'");
mysql_query("INSERT INTO `[logs]`(login,IP,code,area,time) values('$login','$IP','0','Drop roulette',NOW())");
echo "<center><tr><td class="mainTxt">* Je hebt de Roulette gedropped!</td></tr></center><meta http-equiv=Refresh content=2;url=roulette.php>";
}
ENDHTML;
if (isset($_POST['giveto']) && $data->login == $casino->owner){
$newowner = $_POST['newowner'];
$dbres = mysql_query("SELECT `login` FROM `[users]` WHERE `login`='$newowner'");
$logincheck = mysql_num_rows($dbres);
$new = mysql_fetch_object($dbres);
if ($logincheck >= 1){
mysql_query("UPDATE `[buildings]` SET `owner`='$new->login' WHERE `type`='roulette' AND `city`='{$data->City}'");
mysql_query("UPDATE `[buildings]` SET `profit`='0' WHERE `type`='roulette' AND `city`='{$data->City}'");
mysql_query("UPDATE `[buildings]` SET `price`='100' WHERE `type`='roulette' AND `city`='{$data->City}'");
mysql_query("INSERT INTO `[logs]`(login,IP,code,area,time) values('$login','$IP','0','Give Roulette',NOW())");
echo "<center><table width=90%><tr><td class="mainTxt">You gave the Roulette to $new->login!</td></tr></table></center><meta http-equiv=Refresh content=3;url=roulette.php>";
}
else {
echo "<tr><td class="mainTxt">* Ongeldige Username!</td></tr><meta http-equiv=Refresh content=3;url=roulette.php>";
}
}
ENDHTML;
if(isset($_POST['VA']) && preg_match('/^[0-9]{3,15}$/',$_POST['inzet'])){
if($_POST['inzet'] < 100){
print "<tr><td class="mainTxt" align="center">De nieuwe maximum inzet moet minstens $100 zijn.</td></tr><meta http-equiv=Refresh content=3;url=roulette.php>";
}
else{
$inzet = $_POST['inzet'];
mysql_query("UPDATE `[buildings]` SET `price`='$inzet' WHERE `city`='$data->City' AND `type`='roulette'");
print "<tr><td class="mainTxt" align="center">Je veranderde het maximum inzet naar $$inzet.</td></tr><meta http-equiv=Refresh content=3;url=roulette.php>";
}
}
$profitt= number_format($casino->profit,0);
$maxbet = number_format($casino->price,0);
print <<<ENDHTML
<tr><td class="mainTxt" align="center">
<form method="POST">
The profit of this roulette is: $$profitt.<br>
The max bet is now $$maxbet.<br>
Maximum inzet:<input type="text" name="inzet" size="20"><input type="submit" value="Change" name="VA"><br>
<center>Je kan altijd de Roulette droppen, de roulette zal dan geen eigenaar meer hebben, Andere mensen kunnen hem overnemen!<br></center>
<input type="submit" name="drop" value="Drop de roulette!"><br>
<center>Je kan em ook aan iemand anders geven.<br>
<input type="text" name="newowner" width="40"><input type="submit" name="giveto" value="Geef!">
</form></font>
</td></tr>
ENDHTML;
}
if(isset($_POST['Gok'])){
$getal = rand(0,36);
$aftrek = $_POST['1']+$_POST['2']+$_POST['3']+$_POST['4']+$_POST['5']+$_POST['6']+$_POST['7']+$_POST['8']+$_POST['9']+$_POST['10']+$_POST['11']+$_POST['12']+$_POST['13']+$_POST['14']+$_POST['15']+$_POST['16']+$_POST['17']+$_POST['18']+$_POST['19']+$_POST['20']+$_POST['21']+$_POST['22']+$_POST['23']+$_POST['24']+$_POST['25']+$_POST['26']+$_POST['27']+$_POST['28']+$_POST['29']+$_POST['30']+$_POST['31']+$_POST['32']+$_POST['33']+$_POST['34']+$_POST['35']+$_POST['36']+$_POST['r']+$_POST['b']+$_POST['e']+$_POST['o']+$_POST['eta']+$_POST['ntz']+$_POST['ett']+$_POST['dtv']+$_POST['vtz']+$_POST['ek']+$_POST['tk']+$_POST['dk'];
if($data->cash < $aftrek){
print "<tr><td class="mainTxt" align="center">Je hebt niet genoeg geld.</td></tr>";
}
elseif($aftrek > $casino->price){
print "<tr><td class="mainTxt" align="center">Je mag niet meer dan maximum bod doen.</td></tr>";
}
elseif($aftrek < 100){
print "<tr><td class="mainTxt" align="center">Minimaal $100.</td></tr>";
}
else{
$prijs = $_POST[$getal]*36;
if($getal ==1 || $getal ==4 || $getal ==7 || $getal ==10 || $getal ==13 || $getal ==16 || $getal ==19 || $getal ==22 || $getal ==25 || $getal ==28 || $getal ==31 || $getal ==34){
$rij = 'ek';
}
elseif($getal ==2 || $getal ==5 || $getal ==8 || $getal ==11 || $getal ==14 || $getal ==17 || $getal ==20 || $getal ==23 || $getal ==26 || $getal ==29 || $getal ==32 || $getal ==35){
$rij = 'tk';
}
elseif($getal ==3 || $getal ==6 || $getal ==9 || $getal ==12 || $getal ==15 || $getal ==18 || $getal ==21 || $getal ==24 || $getal ==27 || $getal ==30 || $getal ==33 || $getal ==36){
$rij = 'dk';
}
$rij = $_POST[$rij]*3;
$prijs = $prijs+$rij;
if($getal <13){
$et = 'ett';
}
elseif($getal > 24){
$et = 'vtz';
}
else{
$et = 'dtv';
}
$et = $_POST[$et]*3;
$prijs = $prijs+$et;
if($getal ==1 || $getal ==3 || $getal ==5 || $getal ==7 || $getal ==9 || $getal ==12 || $getal ==14 || $getal ==16 || $getal ==18 || $getal ==19 || $getal ==21 || $getal ==23 || $getal ==25 || $getal ==27 || $getal ==30 || $getal ==32 || $getal ==34 || $getal ==36){
$kleur ='r';
$colorr = Rood;
}
elseif($getal ==2 || $getal ==4 || $getal ==6 || $getal ==8 || $getal ==10 || $getal ==11 || $getal ==13 || $getal ==15 || $getal ==17 || $getal ==20 || $getal ==22 || $getal ==24 || $getal ==26 || $getal ==28 || $getal ==29 || $getal ==31 || $getal ==33 || $getal ==35){
$kleur ='b';
$colorr = Zwart;
}
$kleur = $_POST[$kleur]*2;
$prijs = $prijs+$kleur;
$color = ($getal == 0) ? "green" : "$colorr";
if($getal <19){
$koos = 'eta';
}
else{
$koos = 'ntz';
}
$koos = $_POST[$koos]*2;
$prijs = $prijs+$koos;
if($getal ==2 || $getal ==4 || $getal ==6 || $getal ==8 || $getal ==10 || $getal ==12 || $getal ==14 || $getal ==16 || $getal ==18 || $getal ==20 || $getal ==22 || $getal ==24 || $getal ==26 || $getal ==28 || $getal ==30 || $getal ==32 || $getal ==34 || $getal ==36){
$even = 'e';
}
else{
$even = 'o';
}
$even = $_POST[$even]*2;
$prijs = $even+$prijs;
$prijs1 = $prijs-$aftrek;
$prijs2 = $aftrek-$prijs;
if($getal ==0){
$prijs = '0';
}
if($prijs > 0){
print " <center>
<table border=1 cellspacing=0 cellpadding=0 bordercolor=black width=15%>
<tr>
<td class=subTitle align=center>Wiel</td>
</tr>
<tr>
<td bgcolor=$color height=60 valign=center align=center><font color=white size=11><b> $getal</b></font></td>
</tr>
</table>
<br>
Je zette <b>$$aftrek</b> in en won <b>$$prijs</b>.
</center>";
mysql_query("UPDATE `[users]` SET `cash`=`cash`-$prijs1 WHERE `login`='{$casino->owner}'");
mysql_query("UPDATE `[buildings]` SET `profit`=`profit`-$prijs1 WHERE `city`='{$data->City}' AND `type`='roulette'");
mysql_query("UPDATE `[users]` SET `cash`=`cash`+$prijs1 WHERE `login`='{$data->login}'");
}
else {
print " <center>
<table border=1 cellspacing=0 cellpadding=0 bordercolor=black width=15%>
<tr>
<td class=subTitle align=center>Wiel</td>
</tr>
<tr>
<td bgcolor=$color height=60 valign=center align=center><font color=white size=11><b> $getal</b></font></td>
</tr>
</table>
<br>
Je zette <b>$$aftrek</b> in en won <b>$$prijs</b>.
</center>";
mysql_query("UPDATE `[users]` SET `cash`=`cash`+$aftrek WHERE `login`='{$casino->owner}'");
mysql_query("UPDATE `[buildings]` SET `profit`=`profit`+$aftrek WHERE `city`='{$data->City}' AND `type`='roulette'");
mysql_query("UPDATE `[users]` SET `cash`=`cash`-$aftrek WHERE `login`='{$data->login}'");
}
$naam2 = mysql_query("SELECT * FROM `[users]` WHERE `login`='$casino->owner'");
$ncash = mysql_result($naam2, 0, "cash");
if($ncash < 0){
mysql_query("UPDATE `[users]` SET `cash`='0' WHERE `login`='$casino->owner'");
mysql_query("UPDATE `[buildings]` SET `owner`='{$data->login}' WHERE `city`='$data->City' AND `type`='roulette'");
mysql_query("UPDATE `[buildings]` SET `profit`='0' WHERE `city`='$data->City' AND `type`='roulette'");
mysql_query("UPDATE `[buildings]` SET `price`='100' WHERE `city`='$data->City' AND `type`='roulette'");
print "<tr><td class="mainTxt align="center">Je won al het geld van de roulette eigenaar van {$data->City}!</td></tr><meta http-equiv=Refresh content=3;url=roulette.php>";
exit;
}
}
}
$cash = number_format($data->cash,0);
$maxbet = number_format($casino->price,0);
print <<<ENDHTML
<form method="post">
<center>
<table borderColor="black" cellSpacing="0" cellPadding="2" rules="none" bgColor="white" border="1" id="table1">
<tr>
<td align="middle" width="260" class="mainTxt">
<img src="images/roulette.gif" border="0"></td>
<td align="middle" class="mainTxt"><input type="hidden" name="casino">
<input type="hidden" size="2" value="1" name="x">
<table class="sub2" cellSpacing="0" cellPadding="2" width="85%" border="0" id="table2">
<tr>
<td align="right">01:</td>
<td><input size="5" name="1" value="{$_POST['1']}"></td>
<td align="right">02:</td>
<td><input size="5" name="2" value="{$_POST['2']}"></td>
<td align="right">03:</td>
<td><input size="5" name="3" value="{$_POST['3']}"></td>
<td align="right">04:</td>
<td><input size="5" name="4" value="{$_POST['4']}"></td>
</tr>
<tr>
<td align="right">05:</td>
<td><input size="5" name="5" value="{$_POST['5']}"></td>
<td align="right">06:</td>
<td><input size="5" name="6" value="{$_POST['6']}"></td>
<td align="right">07:</td>
<td><input size="5" name="7" value="{$_POST['7']}"></td>
<td align="right">08:</td>
<td><input size="5" name="8" value="{$_POST['8']}"></td>
</tr>
<tr>
<td align="right">09:</td>
<td><input size="5" name="9" value="{$_POST['9']}"></td>
<td align="right">10:</td>
<td><input size="5" name="10" value="{$_POST['10']}"></td>
<td align="right">11:</td>
<td><input size="5" name="11" value="{$_POST['11']}"></td>
<td align="right">12:</td>
<td><input size="5" name="12" value="{$_POST['12']}"></td>
</tr>
<tr>
<td align="right">13:</td>
<td><input size="5" name="13" value="{$_POST['13']}"></td>
<td align="right">14:</td>
<td><input size="5" name="14" value="{$_POST['14']}"></td>
<td align="right">15:</td>
<td><input size="5" name="15" value="{$_POST['15']}"></td>
<td align="right">16:</td>
<td><input size="5" name="16" value="{$_POST['16']}"></td>
</tr>
<tr>
<td align="right">17:</td>
<td><input size="5" name="17" value="{$_POST['17']}"></td>
<td align="right">18:</td>
<td><input size="5" name="18" value="{$_POST['18']}"></td>
<td align="right">19:</td>
<td><input size="5" name="19" value="{$_POST['19']}"></td>
<td align="right">20:</td>
<td><input size="5" name="20" value="{$_POST['20']}"></td>
</tr>
<tr>
<td align="right">21:</td>
<td><input size="5" name="21" value="{$_POST['21']}"></td>
<td align="right">22:</td>
<td><input size="5" name="22" value="{$_POST['22']}"></td>
<td align="right">23:</td>
<td><input size="5" name="23" value="{$_POST['23']}"></td>
<td align="right">24:</td>
<td><input size="5" name="24" value="{$_POST['24']}"></td>
</tr>
<tr>
<td align="right">25:</td>
<td><input size="5" name="25" value="{$_POST['25']}"></td>
<td align="right">26:</td>
<td><input size="5" name="26" value="{$_POST['26']}"></td>
<td align="right">27:</td>
<td><input size="5" name="27" value="{$_POST['27']}"></td>
<td align="right">28:</td>
<td><input size="5" name="28" value="{$_POST['28']}"></td>
</tr>
<tr>
<td align="right">29:</td>
<td><input size="5" name="29" value="{$_POST['29']}"></td>
<td align="right">30:</td>
<td><input size="5" name="30" value="{$_POST['30']}"></td>
<td align="right">31:</td>
<td><input size="5" name="31" value="{$_POST['31']}"></td>
<td align="right">32:</td>
<td><input size="5" name="32" value="{$_POST['32']}"></td>
</tr>
<tr>
<td align="right">33:</td>
<td><input size="5" name="33" value="{$_POST['33']}"></td>
<td align="right">34:</td>
<td><input size="5" name="34" value="{$_POST['34']}"></td>
<td align="right">35:</td>
<td><input size="5" name="35" value="{$_POST['35']}"></td>
<td align="right">36:</td>
<td><input size="5" name="36" value="{$_POST['36']}"></td>
</tr>
<tr>
<td align="right">Rood:</td>
<td><input size="5" name="r" value="{$_POST['r']}"></td>
<td align="right">Zwart:</td>
<td><input size="5" name="b" value="{$_POST['b']}"></td>
<td align="right">Oneven:</td>
<td><input size="5" name="o" value="{$_POST['o']}"></td>
<td align="right">Even:</td>
<td><input size="5" name="e" value="{$_POST['e']}"></td>
</tr>
<tr>
<td align="right">1-18:</td>
<td><input size="5" name="eta" value="{$_POST['eta']}"></td>
<td align="right">19-36:</td>
<td><input size="5" name="ntz" value="{$_POST['ntz']}"></td>
<td align="right">1-12:</td>
<td><input size="5" name="ett" value="{$_POST['ett']}"></td>
<td align="right">13-24:</td>
<td><input size="5" name="dtv" value="{$_POST['dtv']}"></td>
</tr>
<tr>
<td align="right">25-36:</td>
<td><input size="5" name="vtz" value="{$_POST['vtz']}"></td>
<td align="right">1ste Kolom:</td>
<td><input size="5" name="ek" value="{$_POST['ek']}"></td>
<td align="right">2e Kolom:</td>
<td><input size="5" name="tk" value="{$_POST['tk']}"></td>
<td align="right">3e Kolom:</td>
<td><input size="5" name="dk" value="{$_POST['dk']}"></td>
</tr>
<tr>
<td align="middle" colSpan="4">
<input type="submit" value="Speel!" name="Gok"> <input type="reset" value="Reset"></td>
</tr>
<tr>
<td align="middle" colSpan="5">Je hebt <b>$$cash</b> om te gokken...</td>
</tr>
</table>
</td>
</tr>
</table>
De eigenaar van deze roulette is <b><a href="profile.php?x=$casino->owner">$casino->owner</a></b>.<br>
Het maximum bos is $<b>$maxbet</b>.<br>
</center>
</form>
ENDHTML;
}
?>
</table>
</body>
</html>
Gewijzigd op 01/01/1970 01:00:00 door - -
Aan de kleurtjes te zien gaat er iets toch nog niet helemaal goed.
Lol, zie jij mij al "print endhtml:" gebruiken? lol. gewoon zo'n script van criminalsfanaat.
Nee dat dacht ik al inderdaad, maar dat je zo'n script durft te posten vind ik al heel moedig. Ik zou het niet kunnen ;-)
@cruelbeatbox: Check mijn post van 9:13 uur hierboven. Fix de daarin aangegeven punten in je script en je zult waarschijnlijk al een boel minder fouten krijgen : ).