<?php
#Made By: ENK
#URL: http://wap-mast.su
#ICQ: net
#Mail: dcms7@spaces.ru
#Скрипт запрещено продавать, раздавать, менять, выкладывать, переписывать!
#Все права на скрипт принадлежат мне!
#Приду и снесу сайт
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';
$set['title']='Колесо фортуны';
include_once '../sys/inc/thead.php';
title();
aut();

if(!isset($user)){
header("Location:/aut.php");
break;
}
$arr=mysql_fetch_array(mysql_query("SELECT * FROM `kol_far` WHERE `ids`='$user[id]'"));

$ss=rand(1,18);

$bals=10; // Отвечает за снятие баллов за то чтоб крутить барабан
$bals2=9;
if (isset($user) & $user['balls']<=$bals2)
{
echo "<div class='err'>У вас не хватает баллов!</div>\n";
}
else
{
##
if ($ss==1) {
//              Начисление +1 рейтинг          \\
mysql_query("UPDATE `user` SET `rating` = '".($user['rating']+1)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("INSERT INTO `user_voice2` (`rating`, `id_user`, `id_kont`) VALUES ('1','0','$user[id]')");
####
mysql_query("UPDATE `user` SET `balls`=`balls`-'$bals' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `user` SET `balls`=`balls`+'1' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `ydacha`=`ydacha`+'1' WHERE `ids`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `proigral`=`proigral`+'$bals' WHERE `ids`='".$user['id']."'");
echo '<center><table width="162" height="162" style="color: white; background-image: url(fon.jpg);" border="0">';
echo "<td valign='bottom'><img src='18/1.jpg' alt='kf'/><br /><b>+1 РЕЙТИНГ</b><br /></td></table></center>";
}
##
if ($ss==2) {
mysql_query("UPDATE `user` SET `balls`=`balls`-'$bals' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `user` SET `balls`=`balls`+'2' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `ydacha`=`ydacha`+'2' WHERE `ids`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `proigral`=`proigral`+'$bals' WHERE `ids`='".$user['id']."'");
echo '<center><table width="162" height="162" style="color: white; background-image: url(fon.jpg);" border="0">';
echo "<td valign='bottom'><img src='18/2.jpg' alt='kf'/><br /><br /></td></table></center>";
}
##
if ($ss==3) {
mysql_query("UPDATE `user` SET `balls`=`balls`-'$bals' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `user` SET `balls`=`balls`+'3' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `ydacha`=`ydacha`+'3' WHERE `ids`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `proigral`=`proigral`+'$bals' WHERE `ids`='".$user['id']."'");
echo '<center><table width="162" height="162" style="color: white; background-image: url(fon.jpg);" border="0">';
echo "<td valign='bottom'><img src='18/3.jpg' alt='kf'/><br /><br /></td></table></center>";
}
##
if ($ss==4) {
mysql_query("UPDATE `user` SET `balls`=`balls`-'$bals' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `user` SET `balls`=`balls`+'4' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `ydacha`=`ydacha`+'4' WHERE `ids`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `proigral`=`proigral`+'$bals' WHERE `ids`='".$user['id']."'");
echo '<center><table width="162" height="162" style="color: white; background-image: url(fon.jpg);" border="0">';
echo "<td valign='bottom'><img src='18/4.jpg' alt='kf'/><br /><br /></td></table></center>";
}
##
if ($ss==5) {
mysql_query("UPDATE `user` SET `balls`=`balls`-'$bals' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `user` SET `balls`=`balls`+'5' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `ydacha`=`ydacha`+'5' WHERE `ids`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `proigral`=`proigral`+'$bals' WHERE `ids`='".$user['id']."'");
echo '<center><table width="162" height="162" style="color: white; background-image: url(fon.jpg);" border="0">';
echo "<td valign='bottom'><img src='18/5.jpg' alt='kf'/><br /><br /></td></table></center>";
}
##
if ($ss==6) {
mysql_query("UPDATE `user` SET `balls`=`balls`-'$bals' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `user` SET `balls`=`balls`+'6' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `ydacha`=`ydacha`+'6' WHERE `ids`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `proigral`=`proigral`+'$bals' WHERE `ids`='".$user['id']."'");
echo '<center><table width="162" height="162" style="color: white; background-image: url(fon.jpg);" border="0">';
echo "<td valign='bottom'><img src='18/6.jpg' alt='kf'/><br /><br /></td></table></center>";
}
##
if ($ss==7) {
mysql_query("UPDATE `user` SET `balls`=`balls`-'$bals' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `user` SET `balls`=`balls`+'7' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `ydacha`=`ydacha`+'7' WHERE `ids`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `proigral`=`proigral`+'$bals' WHERE `ids`='".$user['id']."'");
echo '<center><table width="162" height="162" style="color: white; background-image: url(fon.jpg);" border="0">';
echo "<td valign='bottom'><img src='18/7.jpg' alt='kf'/><br /><br /></td></table></center>";
}
##
if ($ss==8) {
mysql_query("UPDATE `user` SET `balls`=`balls`-'$bals' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `user` SET `balls`=`balls`+'8' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `ydacha`=`ydacha`+'8' WHERE `ids`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `proigral`=`proigral`+'$bals' WHERE `ids`='".$user['id']."'");
echo '<center><table width="162" height="162" style="color: white; background-image: url(fon.jpg);" border="0">';
echo "<td valign='bottom'><img src='18/8.jpg' alt='kf'/><br /><br /></td></table></center>";
}
##
if ($ss==9) {
mysql_query("UPDATE `user` SET `balls`=`balls`-'$bals' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `user` SET `balls`=`balls`+'9' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `ydacha`=`ydacha`+'9' WHERE `ids`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `proigral`=`proigral`+'$bals' WHERE `ids`='".$user['id']."'");
echo '<center><table width="162" height="162" style="color: white; background-image: url(fon.jpg);" border="0">';
echo "<td valign='bottom'><img src='18/9.jpg' alt='Морт'/><br /><br /></td></table></center>";
}
##
if ($ss==10) {
mysql_query("UPDATE `user` SET `balls`=`balls`-'$bals' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `user` SET `balls`=`balls`+'10' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `ydacha`=`ydacha`+'10' WHERE `ids`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `proigral`=`proigral`+'$bals' WHERE `ids`='".$user['id']."'");
echo '<center><table width="162" height="162" style="color: white; background-image: url(fon.jpg);" border="0">';
echo "<td valign='bottom'><img src='18/10.jpg' alt='kf'/><br /><br /></td></table></center>";
}
##
if ($ss==11) {
mysql_query("UPDATE `user` SET `balls`=`balls`-'$bals' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `user` SET `balls`=`balls`+'11' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `ydacha`=`ydacha`+'11' WHERE `ids`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `proigral`=`proigral`+'$bals' WHERE `ids`='".$user['id']."'");
echo '<center><table width="162" height="162" style="color: white; background-image: url(fon.jpg);" border="0">';
echo "<td valign='bottom'><img src='18/11.jpg' alt='kf'/><br /><br /></td></table></center>";
}
##
if ($ss==12) {
mysql_query("UPDATE `user` SET `balls`=`balls`-'$bals' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `user` SET `balls`=`balls`+'12' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `ydacha`=`ydacha`+'12' WHERE `ids`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `proigral`=`proigral`+'$bals' WHERE `ids`='".$user['id']."'");
echo '<center><table width="162" height="162" style="color: white; background-image: url(fon.jpg);" border="0">';
echo "<td valign='bottom'><img src='18/12.jpg' alt='kf'/><br /><br /></td></table></center>";
}
##
if ($ss==13) {
mysql_query("UPDATE `user` SET `balls`=`balls`-'$bals' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `user` SET `balls`=`balls`+'13' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `ydacha`=`ydacha`+'13' WHERE `ids`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `proigral`=`proigral`+'$bals' WHERE `ids`='".$user['id']."'");
echo '<center><table width="162" height="162" style="color: white; background-image: url(fon.jpg);" border="0">';
echo "<td valign='bottom'><img src='18/13.jpg' alt='kf'/><br /><br /></td></table></center>";
}
##
if ($ss==14) {
mysql_query("UPDATE `user` SET `balls`=`balls`-'$bals' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `user` SET `balls`=`balls`+'14' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `ydacha`=`ydacha`+'14' WHERE `ids`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `proigral`=`proigral`+'$bals' WHERE `ids`='".$user['id']."'");
echo '<center><table width="162" height="162" style="color: white; background-image: url(fon.jpg);" border="0">';
echo "<td valign='bottom'><img src='18/14.jpg' alt='kf'/><br /><br /></td></table></center>";
}
##
if ($ss==15) {
mysql_query("UPDATE `user` SET `balls`=`balls`-'$bals' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `user` SET `balls`=`balls`+'15' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `ydacha`=`ydacha`+'15' WHERE `ids`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `proigral`=`proigral`+'$bals' WHERE `ids`='".$user['id']."'");
echo '<center><table width="162" height="162" style="color: white; background-image: url(fon.jpg);" border="0">';
echo "<td valign='bottom'><img src='18/15.jpg' alt='kf'/><br /><br /></td></table></center>";
}
##
if ($ss==16) {
mysql_query("UPDATE `user` SET `balls`=`balls`-'$bals' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `user` SET `balls`=`balls`+'16' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `ydacha`=`ydacha`+'16' WHERE `ids`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `proigral`=`proigral`+'$bals' WHERE `ids`='".$user['id']."'");
echo '<center><table width="162" height="162" style="color: white; background-image: url(fon.jpg);" border="0">';
echo "<td valign='bottom'><img src='18/16.jpg' alt='kf'/><br /><br /></td></table></center>";
}
##
if ($ss==17) {
mysql_query("UPDATE `user` SET `balls`=`balls`-'$bals' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `user` SET `balls`=`balls`+'17' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `ydacha`=`ydacha`+'17' WHERE `ids`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `proigral`=`proigral`+'$bals' WHERE `ids`='".$user['id']."'");
echo '<center><table width="162" height="162" style="color: white; background-image: url(fon.jpg);" border="0">';
echo "<td valign='bottom'><img src='18/17.jpg' alt='kf'/><br /><br /></td></table></center>";
}
##
if ($ss==18) {
mysql_query("UPDATE `user` SET `balls`=`balls`-'$bals' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `user` SET `balls`=`balls`+'18' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `ydacha`=`ydacha`+'18' WHERE `ids`='".$user['id']."'");
mysql_query("UPDATE `kol_far` SET `proigral`=`proigral`+'$bals' WHERE `ids`='".$user['id']."'");
echo '<center><table width="162" height="162" style="color: white; background-image: url(fon.jpg);" border="0">';
echo "<td valign='bottom'><img src='18/18.jpg' alt='kf'/><br /><br /></td></table></center>";
}
##
echo '<form action="?" method="POST"><input type="submit" name="" value="Крутить барабан" /></form>';

}
echo "<div class='aut'><a href='index.php?id=$user[id]'>Назад</a></div>";
###########################################
include_once '../sys/inc/tfoot.php';
?>