View file bonus/bonus/index.php

File size: 4.96Kb
<?php

include_once '../../sys/inc/start.php';
include_once '../../sys/inc/compress.php';
include_once '../../sys/inc/sess.php';
include_once '../../sys/inc/home.php';
include_once '../../sys/inc/settings.php';
include_once '../../sys/inc/db_connect.php';
include_once '../../sys/inc/ipua.php';
include_once '../../sys/inc/fnc.php';
include_once '../../sys/inc/user.php';

only_reg();
$set['title'] = 'Daily Bonuses Tnchat.Net';
include_once '../../sys/inc/thead.php';
title();
aut();

echo "<div class='mess'>In This Bonus You Can Every Day (1 Every 24 Hours) Get 1 Gift In This Bonus Offer.</div>";

if(isset($_GET['wizcas']) && $user['time_wizcas']<=$time){
$rand = rand(1,9);
if($rand==1){
mysql_query("UPDATE `user` SET `balls` = `balls` + '300' WHERE `id`='$user[id]' ");
mysql_query("INSERT INTO `wizcas_free` (`id_user`, `type`, `time`) values('$user[id]', 'Received".($user['pol'] == 1 ? '' : 'а')." +300 Points', '$time')");
msg('Congratulations! You get 300 points.');
} elseif($rand==2) {
mysql_query("UPDATE `user` SET `rating` = `rating` + '2' WHERE `id`='$user[id]' ");
mysql_query("INSERT INTO `wizcas_free` (`id_user`, `type`, `time`) values('$user[id]', 'Received".($user['pol'] == 1 ? '' : 'а')." +20 Rating', '$time')");
msg('Congratulations! You got 2 ranking.');
} elseif($rand==3) {
mysql_query("UPDATE `user` SET `money` = `money` + '10' WHERE `id`='$user[id]' ");
mysql_query("INSERT INTO `wizcas_free` (`id_user`, `type`, `time`) values('$user[id]', 'Received".($user['pol'] == 1 ? '' : 'а')." +10 Coins', '$time')");
msg('Congratulations! You got 10 coins.');
} elseif($rand==4) {
mysql_query("UPDATE `user` SET `rating` = `rating` + '1' WHERE `id`='$user[id]' ");
mysql_query("INSERT INTO `wizcas_free` (`id_user`, `type`, `time`) values('$user[id]', 'Received".($user['pol'] == 1 ? '' : 'а')." +10 Rating', '$time')");
msg('Congratulations! You got 1 ranking.');
} elseif($rand==5) {
mysql_query("UPDATE `user` SET `money` = `money` + '5' WHERE `id`='$user[id]' ");
mysql_query("INSERT INTO `wizcas_free` (`id_user`, `type`, `time`) values('$user[id]', 'Received".($user['pol'] == 1 ? '' : 'а')." +5 Coins', '$time')");
msg('Congratulations! You Received 5 Coins.');
} elseif($rand==6) {
mysql_query("UPDATE `user` SET `balls` = `balls` + '500' WHERE `id`='$user[id]' ");
mysql_query("INSERT INTO `wizcas_free` (`id_user`, `type`, `time`) values('$user[id]', 'Received".($user['pol'] == 1 ? '' : 'а')." +500 Points', '$time')");
msg('Congratulations! You Received +500 Points.');
} elseif($rand==7) {
mysql_query("INSERT INTO `wizcas_user` (`id_user`, `id_ank`, `id_wizcas`, `coment`, `time`) values('1', '$user[id]', '1', 'Daily gift!', '$time')");
$id_wizcas = mysql_insert_id();
mysql_query("INSERT INTO `notification` (`avtor`, `id_user`, `id_object`, `type`, `time`) VALUES ('1', '$user[id]', '$id_wizcas', 'new_wizcas', '$time')");
mysql_query("INSERT INTO `wizcas_free` (`id_user`, `type`, `time`) values('$user[id]', 'Received".($user['pol'] == 1 ? '' : 'а')." Free Gift', '$time')");
msg('Congratulations! You Received Free Gift.');
}  elseif($rand==8) {
mysql_query("INSERT INTO `liders` (`id_user`, `stav`, `msg`, `time`) values('$user[id]', '1', 'Daily Gift!', '".($time+86400)."')");
mysql_query("INSERT INTO `wizcas_free` (`id_user`, `type`, `time`) values('$user[id]', 'Received".($user['pol'] == 1 ? '' : 'а')." 1 Day Leader', '$time')");
msg('Congratulations! You got one day Leader.');
}  elseif($rand==9) {
mysql_query("UPDATE `user_set` SET `ocenka` = '".($time+86400)."' WHERE `id_user` = '$user[id]'");
mysql_query("INSERT INTO `wizcas_free` (`id_user`, `type`, `time`) values('$user[id]', 'Received".($user['pol'] == 1 ? '' : 'а')." 1 day evaluation 5+', '$time')");
msg('Congratulations! You got one day of evaluation day 5+');
}
mysql_query("UPDATE `user` SET `time_wizcas` = '".($time+86400)."' WHERE `id`='$user[id]' ");
}
if($user['time_wizcas']>=$time)msg('Today You Already Got Gift, Come Back Tomorrow.');

echo "<div class='nav1'><a href='?wizcas'><img src='1.png'></a></div>";
echo "<div class='mess'>For Gift, Click On The Piggy Box To Win Yourself A Gift.</div>";


echo "<div class='title'>Recent Winners</div>";




$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `wizcas_free` "),0);

$k_page = k_page($k_post,$set['p_str']);
$page = page($k_page);
$start = $set['p_str']*$page-$set['p_str'];



if ($k_post==0) {
echo "   <div class='mess'>\n";
echo "List is empty\n";
echo "  </div>\n";
}

$q = mysql_query("SELECT * FROM `wizcas_free` ORDER BY `id` DESC LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_assoc($q)) {
$ank=get_user($post['id_user']);

if ($num==0){echo '<div class="nav1">';$num=1;}
elseif ($num==1){echo '<div class="nav2">';$num=0;}

echo status($ank['id'])." ".group($ank['id'])."";
echo "<a href='/info.php?id=$ank[id]'>$ank[nick]</a>\n";
echo "".medal($ank['id'])." ".online($ank['id'])." ";
echo " </br>";

echo output_text($post['type']);

echo "</div>\n";
}
if ($k_page>1)str("?",$k_page,$page); // Вывод страниц

include_once '../../sys/inc/tfoot.php';
?>