login}'"); ?> <?php echo $page->sitetitle; ?> topbalk == 1) { include('top.php'); } ?> 5000) { echo ""; exit; } if($_POST['amount'] <= 0 OR !preg_match('/^[0-9]{1,15}$/',$_POST['amount'])) echo ""; elseif($lottery[ticketprice]*$_POST['amount'] > $data->cash) echo ""; elseif($lottery[active] == 0) echo ""; else echo "
Maximaal 5000 per keer kopen
Ongeldige invoer!
Je hebt te weinig geld.
Er is geen actieve loterij!"; else { for($j=0; $j < $_POST['amount']; $j++) { mysql_query("INSERT INTO `lottery-tickets`(`login`,`lotterynr`,`date`,`IP`) VALUES('{$data->login}','{$lottery[id]}',NOW(),'$IP')"); mysql_query("UPDATE `lottery` SET `ticketssold`=`ticketssold`+1, `pot`=`pot`+$lottery[ticketprice] WHERE `id`='{$lottery[id]}'"); } if($_POST['amount'] == 1) echo "
Je hebt 1 lot gekocht.
Je hebt {$_POST['amount']} loten gekocht."; $data->cash -= round($_POST['amount']*$lottery[ticketprice]); $lottery[pot] += round($_POST['amount']*$lottery[ticketprice]); $lottery[ticketssold] += $_POST['amount']; mysql_query("UPDATE `[users]` SET `cash`='{$data->cash}' WHERE `login`='{$data->login}'"); } } $ticketssold = number_format($lottery[ticketssold],0); $ticketprice = number_format($lottery[ticketprice],0); $pot = number_format($lottery[pot],0); $dbres = mysql_query("SELECT * FROM `lottery` WHERE `active`='0' ORDER BY `start` DESC LIMIT 0,1"); $lw = mysql_fetch_assoc($dbres); $winner = $lw[winner]; ?> \n"; $yourtickets = ""; $dbres = mysql_query("SELECT * FROM `lottery-tickets` WHERE `login`='{$data->login}' AND `lotterynr`='{$lottery[id]}'"); while($yourticket = mysql_fetch_assoc($dbres)) { $yourtickets .= "{$yourticket[id]}, "; } $yourtickets = ($yourtickets == '') ? "Je hebt geen loten" : $yourtickets; $yourtickets = (isset($_GET['show'])) ? $yourtickets : "Je hebt momenteel $sql loten,
Klik hier je loten te bekijken"; ?>
Loterij
De Winnaar van de laatste loterij was:
Er zijn al loten verkocht, de jackpot staat nu op
NaamPrijs per lotTrekkingKopen
Iedere Week
x lot
Er is geen actieve loterij!

Loten