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