<?
if(isset($_GET['ozero']) && isset($_GET['spond']) && intval($_GET['spond'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_pond` WHERE `id` = '".intval($_GET['spond'])."' AND `id_user` = '$ku[id]' AND `id_plant` = '0' AND (`time` = '$time' OR `time` < '$time') AND `cultivator` = '0'"),0)!=0)
{
$ground=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_pond` WHERE `id` = '".intval($_GET['spond'])."' AND `id_user` = '$ku[id]' AND `id_plant` = '0' AND (`time` = '$time' OR `time` < '$time') AND `cultivator` = '0'"));
if($ku['level']>=1 and $ku['level']<=9)$rat=1;
else if($ku['level']>=10 and $ku['level']<=19)$rat=5;
else if($ku['level']>=20 and $ku['level']<=39)$rat=50;
else if($ku['level']>=40 and $ku['level']<=49)$rat=500;
else if($ku['level']>=50 and $ku['level']<=60)$rat=5000;
else if($ku['level']>=61 and $ku['level']<=70)$rat=50000;


$rat_cultivator_act=0;

if(isset($sponder_act))$rat_cultivator_act=(($rat/100)*$sponder_act);
if(isset($shmel_act))$rat_cultivator_act=$rat_cultivator_act*2;
$rat=double_exp(base_exp($rat)+$rat_cultivator_act);
mysql_query("UPDATE `kolhoz_pond` SET `cultivator` = '1' WHERE `id` = '".intval($_GET['spond'])."' LIMIT 1");
mysql_query("UPDATE `kolhoz_user` SET `rating` = '".($ku['rating']+$rat)."' WHERE `id` = '$ku[id]'");
$_SESSION['rating']=$rat;
update_mc($rat);
header("Location:/ozero/".passgen());
exit;
}
?>