
<?php

require_once 'core/system.php';


head('Ежедневный Бонус');




reg();


$dop = $dbc->query("SELECT * FROM `dop` WHERE `user` = '".$user['id']."' LIMIT 1")->fetch_assoc(); 



?><div class="b-panel-new dblue-panel bordered mt2">
<div class="panel-inner-2"><div class="font-small text-italic c-verygray">

<span class="iSuperior"> Понедельник </span><img src="img/stat/sera.png">1000 </br>







<span class="iSuperior"> Вторник </span><img src="img/stat/sera.png">3000 </br>






<span class="iEpic"> Среда </span><img src="img/stat/sera.png">5000 </br>





<span class="iEpic"> Четверг </span><img src="img/money/money.png">5 </br>






<span class="iEpic"> Пятница </span><img src="img/money/money.png">5 </br>





<span class="iLegendary"> Суббота </span><img src="img/money/money.png">10 </br>






<span class="iLegendary"> Воскресенье </span><img src="img/money/money.png">15 </br>



















</div></div></div><?



if($dop['bon']==0){


?><center><a href="day_bon.php?link"><input class="btn big" type="submit" value="Получить Бонус"></a></center><? }


$ned = 1;

if(date("l")==Monday){ $ned=1;}

if(date("l")==Tuesday){ $ned=2;}

if(date("l")==Wednesday){ $ned=3;}

if(date("l")==Thursday){ $ned=4;}

if(date("l")==Friday){ $ned=5;}

if(date("l")==Saturday){ $ned=6;}

if(date("l")==Sunday){ $ned=7;}



 if(isset($_GET['link'])){
                if ($dop['bon'] == 1) {   

header('location:index.php');exit;}



if($ned==1){ 

$dbc->query("UPDATE `users` SET `serebro`=`serebro`+1000  WHERE `id`='".$user['id']."'");} 






if($ned==2){ 

$dbc->query("UPDATE `users` SET `serebro`=`serebro`+3000  WHERE `id`='".$user['id']."'");} 






if($ned==3){ 

$dbc->query("UPDATE `users` SET `serebro`=`serebro`+5000  WHERE `id`='".$user['id']."'");} 




if($ned==4){ 

$dbc->query("UPDATE `users` SET `gold`=`gold`+5  WHERE `id`='".$user['id']."'");} 



if($ned==5){ 

$dbc->query("UPDATE `users` SET `gold`=`gold`+5  WHERE `id`='".$user['id']."'");} 



if($ned==6){ 

$dbc->query("UPDATE `users` SET `gold`=`gold`+10  WHERE `id`='".$user['id']."'");} 




if($ned==7){ 

$dbc->query("UPDATE `users` SET `gold`=`gold`+15 WHERE `id`='".$user['id']."'");} 





$dbc->query("UPDATE `dop` SET `bon`=1 WHERE `user`='".$user['id']."'");

$dbc->query("UPDATE `rang` SET  `bonus`=`bonus`+1 WHERE `user`='".$user['id']."'");

$_SESSION['message']='Бонус Получен';
header('location:day_bon.php');exit;























}








foot();
