Файл: fish/buy.php
Строк: 60
<?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/adm_check.php';
include_once '../sys/inc/user.php';
include_once '../sys/inc/start.php';
$set['title']='Рыбалка онлайн';
include_once '../sys/inc/thead.php';
title();
aut();
if(!isset($user)){
header("Location:/index.php");
exit;
}
include_once 'inc/start.php';
$posts=array();
if(isset($_GET['id']) && isset($_GET['r']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `fish_pod` WHERE `id`='".abs(intval($_GET['id']))."'"),0)!=0){
$al=mysql_fetch_array(mysql_query("SELECT * FROM `fish_pod` WHERE `id`='".abs(intval($_GET['id']))."'"));
if($al['level']>$fish['level'])
msg('У вас низкий уровень!');
else{
if($al['rub']>$fish['rub'])
msg('У вас не хватает рубинов');
else
{
mysql_query("UPDATE `fish_u` SET `rub`=`rub`-$al[rub] WHERE `id_u`='".$user_id."'");
mysql_query("INSERT INTO `fish_i`(`id_u`,`id_i`,`act`,`type`,`kolvo`) VALUES('".$user_id."','".$al['id']."','0','".$al['type']."','".$al['bros']."')");
header("location:inv.php");
}
}}
if(isset($_GET['id']) && isset($_GET['d']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `fish_pod` WHERE `id`='".abs(intval($_GET['id']))."'"),0)!=0){
$al=mysql_fetch_array(mysql_query("SELECT * FROM `fish_pod` WHERE `id`='".abs(intval($_GET['id']))."'"));
if($al['cena']==0 && $al['rub']!=0){
mes('Эту вещь можно купить только за рубины!');
}
else
{
if($al['level']>$fish['level'])
mes('У вас низкий уровень!');
else{
if($al['cena']>$fish['balls'])
mes('У вас не хватает денег');
else
{
mysql_query("UPDATE `fish_u` SET `balls`=`balls`-$al[cena] WHERE `id_u`='".$user_id."'");
mysql_query("INSERT INTO `fish_i`(`id_u`,`id_i`,`act`,`type`,`kolvo`) VALUES('".$user_id."','".$al['id']."','0','".$al['type']."','".$al['bros']."')");
header("location:inv.php");
}}
}}
ret('Назад','shop.php');
include_once '../sys/inc/tfoot.php';
?>