<?
if(isset($_GET['sh_new_ground']) && isset($_GET['ok']) && mysql_result(mysql_querll("SELECT COUNT(*) FROM `kolhoz_ground_sh` WHERE `id_user` = '$ku[id]'"),0)<200)
{
$cena=cpsh(mysql_result(mysql_querll("SELECT COUNT(*) FROM `kolhoz_ground_sh` WHERE `id_user` = '$ku[id]'"),0));
if($ku['rubies']>=$cena)
{
mysql_querll("INSERT INTO `kolhoz_ground_sh` SET `id_user` = '$ku[id]'");
mysql_querll("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']-$cena)."' WHERE `id` = '$ku[id]'");
}
else
{
$rm=$cena-$ku['rubies'];
$_SESSION['no_rubies']=$rm;
}
header("Location:?sh_myfarm&page=end");
}
elseif(isset($_GET['sh_new_ground']) && mysql_result(mysql_querll("SELECT COUNT(*) FROM `kolhoz_ground_sh` WHERE `id_user` = '$ku[id]'"),0)<200)
{
echo '<div class="event"><h1>Подтверждение</h1></div><div class="content"><div class="block"><ul class="block"><li><span class="title">Вы уверены?</span></li><li class="pt"><img alt="" width="16" height="16" src="img/icons/tick.png"> <a href="?sh_myfarm&sh_new_ground&ok"><span>
Да, подтверждаю</span></a></li><li><img alt="" width="16" height="16" src="img/icons/cross.png"> <a href="?sh_myfarm"><span>
Нет, отказываюсь</span></a></li></ul></div>';
include_once 'inc/foot.php';
}
?>