<?
$mypool=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_pool` WHERE `id_user` = '$ku[id]'"),0);
$cena=1000;
$step=1000;
if($mypool>=25)$cena=5000;
if($mypool>=35)$cena=10000;
$prise=$cena+$step*$mypool;
if(isset($_GET['new_pool']) && isset($_GET['ok']) && ($mypool<25 || ($ku['level']>=50 && $mypool<35) || ($ku['level']>=60 && $mypool<40)))
{
if(!empty($id_action) AND ($id_action==1 OR $id_action==3))$cena=round($cena/2);
$prise=$cena+$step*$mypool;
if($ku['rubies']>=$prise)
{
mysql_query("INSERT INTO `kolhoz_pool` SET `id_user` = '$ku[id]'");
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']-$prise)."' WHERE `id` = '$ku[id]'");
}
else
{
$rm=$prise-$ku['rubies'];
$_SESSION['no_rubies']=$rm;
}
header("Location:/mypool/".passgen());
}
elseif(isset($_GET['new_pool']) && ($mypool<25 || ($ku['level']>=50 && $mypool<35) || ($ku['level']>=60 && $mypool<40)))
{
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="images/icons/tick.png"> <a href="/mypool/new_pool/ok"><span>
Да, подтверждаю</span></a></li><li><img alt="" width="16" height="16" src="images/icons/cross.png"> <a href="/mypool"><span>
Нет, отказываюсь</span></a></li></ul></div>';
include_once 'inc/foot.php';
}
?>