Файл: inc/petfarm/new_petground.php
Строк: 37
<?
$title='Покупка загона';
include_once '../system/config.php';
if(isset($_GET['new_petground']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]'"),0)<40)
{
if(isset($_GET['ok']))
{
$cena=cpg(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]'"),0));
if($ku['rubies']>=$cena)
{
mysql_query("INSERT INTO `kolhoz_petground` SET `id_user` = '$ku[id]'");
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']-$cena)."' WHERE `id` = '$ku[id]'");
mysql_query("INSERT INTO `info_user` SET `id_user` = '$ku[id]', `status` = '-', `many` = '$cena', `kuda` = 'покупка загона', `time` = '$time'");
}
else
{
$rm=$cena-$ku['rubies'];
$_SESSION['no_rubies']=$rm;
}
header("Location:/barnyard");
exit;
}
else
{
echo"<div class='rzd2'></div><div class='menuin2'>";
echo '<div class="title">Подтверждение</h2></div><div class="content"><ul class="div"><li><span >Вы уверены?</span></li><li class="pt"><img alt="" src="/img/icons/tick.png"> <a href="/barnyard/NewFold/ok"><span>Да, подтверждаю</span></a></li><li><img alt="" src="/img/icons/cross.png"> <a href="/barnyard"><span>
Нет, отказываюсь</span></a></li></ul>';
echo"</div></div><div class='rzd2'></div>";
include_once '../system/foot.php';
}
}
?>