Файл: neuder/game/bonus.php
Строк: 27
<?php
$cristal = $user['bonus'] * 3;
if(isset($_POST['get'])){
if($user['bonus_time'] > time()) $err ='Ты уже забрал бонус';
if(!isset($err)){
mysql_query("UPDATE `user` SET `cristal` = '".($user['cristal'] + $cristal)."', `bonus_time` = '".(time() + 86000)."', `bonus` = '".($user['bonus'] + 1)."' WHERE `id` = '".$user['id']."'");
$_SESSION['notif'] = 'Начислен бонус '.$cristal.' <img src="/style/spach/cristal.png">';
header('Location: /game/');
die();
}else{
header('Location: /game/');
die();
}
}
if($user['bonus_time'] < time()){
if($user['bonus'] = 0){
mysql_query("UPDATE `user` SET `bonus` = 1 WHERE `id` = '".$user['id']."'");
}
if($user['bonus'] == 9){
mysql_query("UPDATE `user` SET `bonus` = 1 WHERE `id` = '".$user['id']."'");
}
echo ' <div class="block center"> Сегодня ты получаешь '.$cristal.' <img src="/style/spach/cristal.png"></div>
<form class="block center" method="post" action=""><span class="button_on"><input class="button_on" name="get" type="submit" value="Забрать"></span></form>';
}
?>