<?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 `oxota` WHERE `ids`='$user[id]'"));
$action=htmlspecialchars(trim($_GET['action']));
switch ($action){
default:
echo "Хмм...";
break;
######
case '1':
if($arr['zver_a']<=49)
{
header ("Location: ?action=error&");
exit;
}else{
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 `oxota` SET `zver_a` = '".($arr['zver_a']-50)."' WHERE `ids` = '$user[id]'");
echo "<div class='msg'>Успешно!</div>";
}
break;
######
case '2':
if($arr['zver_b']<=39)
{
header ("Location: ?action=error&");
exit;
}else{
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 `oxota` SET `zver_b` = '".($arr['zver_b']-40)."' WHERE `ids` = '$user[id]'");
echo "<div class='msg'>Успешно!<br /></div>\n";
}
break;
######
case '3':
if($arr['zver_c']<=9)
{
header ("Location: ?action=error&");
exit;
}else{
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 `oxota` SET `zver_c` = '".($arr['zver_c']-10)."' WHERE `ids` = '$user[id]'");
echo "<div class='msg'>Успешно!</div>\n";
}
break;
######
case '4':
if($arr['zver_d']<=5)
{
header ("Location: ?action=error&");
exit;
}else{
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 `oxota` SET `zver_d` = '".($arr['zver_d']-6)."' WHERE `ids` = '$user[id]'");
echo "<div class='msg'>Успешно!</div>\n";
}
break;
######
case '5':
if($arr['zver_e']<=2)
{
header ("Location: ?action=error&");
exit;
}else{
mysql_query("UPDATE `user` SET `rating` = '".($user['rating']+3)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("INSERT INTO `user_voice2` (`rating`, `id_user`, `id_kont`) VALUES ('3','0','$user[id]')");
mysql_query("UPDATE `oxota` SET `zver_e` = '".($arr['zver_e']-3)."' WHERE `ids` = '$user[id]'");
echo "<div class='msg'>Успешно!</div>\n";
}
break;
###########
case '6':
if($arr['zver_f']<=2)
{
header ("Location: ?action=error&");
exit;
}else{
mysql_query("UPDATE `user` SET `rating` = '".($user['rating']+8)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("INSERT INTO `user_voice2` (`rating`, `id_user`, `id_kont`) VALUES ('8','0','$user[id]')");
mysql_query("UPDATE `oxota` SET `zver_f` = '".($arr['zver_f']-3)."' WHERE `ids` = '$user[id]'");
echo "<div class='msg'>Успешно!</div>\n";
}
break;
###########
case '7':
if($arr['zver_h']<=2)
{
header ("Location: ?action=error&");
exit;
}else{
mysql_query("UPDATE `user` SET `rating` = '".($user['rating']+15)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("INSERT INTO `user_voice2` (`rating`, `id_user`, `id_kont`) VALUES ('15','0','$user[id]')");
mysql_query("UPDATE `oxota` SET `zver_h` = '".($arr['zver_h']-3)."' WHERE `ids` = '$user[id]'");
echo "<div class='msg'>Успешно!</div>\n";
}
break;
###########
case '8':
if($arr['zver_i']<=2)
{
header ("Location: ?action=error&");
exit;
}else{
mysql_query("UPDATE `user` SET `rating` = '".($user['rating']+20)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("INSERT INTO `user_voice2` (`rating`, `id_user`, `id_kont`) VALUES ('20','0','$user[id]')");
mysql_query("UPDATE `oxota` SET `zver_i` = '".($arr['zver_i']-3)."' WHERE `ids` = '$user[id]'");
echo "<div class='msg'>Успешно!</div>\n";
}
break;
case '9':
if($arr['zver_j']<=2)
{
header ("Location: ?action=error&");
exit;
}else{
mysql_query("UPDATE `user` SET `rating` = '".($user['rating']+25)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("INSERT INTO `user_voice2` (`rating`, `id_user`, `id_kont`) VALUES ('25','0','$user[id]')");
mysql_query("UPDATE `oxota` SET `zver_j` = '".($arr['zver_j']-3)."' WHERE `ids` = '$user[id]'");
echo "<div class='msg'>Успешно!</div>\n";
}
break;
#######
case'error':
echo "<div class='err'>У вас не хватает зверей!</div>";
break;
}
#####
echo "<div class='aut'><a href='xran.php'>Назад</a></div>";
#####
include_once '../../sys/inc/tfoot.php';
?>