<?
if(isset($_GET['mycellar']) && isset($_GET['cultivator2']) && intval($_GET['cultivator2'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_polka2` WHERE `id` = '".intval($_GET['cultivator2'])."' AND `id_user` = '$ku[id]' AND `id_plant2` = '0' AND (`time` = '$time' OR `time` < '$time') AND `cultivator2` = '0'"),0)!=0)
{
$polka2=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_polka2` WHERE `id` = '".intval($_GET['cultivator2'])."' AND `id_user` = '$ku[id]' AND `id_plant2` = '0' AND (`time` = '$time' OR `time` < '$time') AND `cultivator2` = '0'"));
$rat=c2r($ku['level']);

$rat_cultivator2_act=0;

if(isset($cultivator2_act))$rat_cultivator2_act=(($rat/100)*$cultivator2_act);
if(isset($shmel_act))$rat_cultivator2_act=$rat_cultivator2_act*2;

$rat=double_exp(base_exp($rat)+$rat_cultivator2_act);
mysql_query("UPDATE `kolhoz_polka2` SET `cultivator2` = '1' WHERE `id` = '".intval($_GET['cultivator2'])."' LIMIT 1");
mysql_query("UPDATE `kolhoz_user` SET `rating` = '".($ku['rating']+$rat)."' WHERE `id` = '$ku[id]'");
$_SESSION['rating']=$rat;
update_mc($rat);
header("Location:/mycellar/".passgen());
exit;
}
?>