<?
$mygarden=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_garden` WHERE `id_user` = '$ku[id]'"),0);
if(isset($_GET['new_garden']) && ($mygarden<20 || ($ku['level']>=30 && $mygarden<25) || ($ku['level']>=50 && $mygarden<35) || ($ku['level']>=60 && $mygarden<40)))
{
if(isset($_GET['ok']))
{
$cena=cpm(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_garden` WHERE `id_user` = '$ku[id]'"),0));

if($ku['money']>=$cena)
{
mysql_query("INSERT INTO `kolhoz_garden` SET `id_user` = '$ku[id]'");
mysql_query("UPDATE `kolhoz_user` SET `money` = '".($ku['money']-$cena)."' WHERE `id` = '$ku[id]'");
}
else
{
$rm=$cena-$ku['money'];
$_SESSION['no_money']=$rm;
}
header("Location:/mygarden/".passgen());
exit;
}
else
{
echo '<div class="event"><h1>Подтверждение</h1></div><div class="content"><ul class="block"><li><span class="title">Вы уверены?</span></li><li class="pt"><img alt="" width="16" height="16" src="images/icons/tick.png"> <a href="/mygarden/new_garden/ok"><span>Да, подтверждаю</span></a></li><li><img alt="" width="16" height="16" src="images/icons/cross.png"> <a href="/mygarden"><span>
Нет, отказываюсь</span></a></li></ul>';
include_once 'inc/foot.php';
}
}
?>