<?
if(isset($_GET['myfarm']) && isset($_GET['cultivator_all']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id_user` = '$ku[id]' AND `id_plant` = '0' AND (`time` = '$time' OR `time` < '$time') AND `cultivator` = '0'"),0)!=0 && $ku['cultivator']>0)
{

$rat = cr($ku['level']);
$rat_cultivator_act=0;
if(isset($cultivator_act))$rat_cultivator_act=(($rat/100)*$cultivator_act);
if(isset($shmel_act))$rat_cultivator_act=$rat_cultivator_act*2;
$rat=double_exp(base_exp($rat)+$rat_cultivator_act);
$orat=0;
$q=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id_user` = '$ku[id]' AND `id_plant` = '0' AND (`time` = '$time' OR `time` < '$time') AND `cultivator` = '0'"),0);

$orat=$rat*$q;
$ku['rating'] = $ku['rating']+$orat;
mysql_query("UPDATE `kolhoz_user` SET `rating` = '$ku[rating]' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `kolhoz_ground` SET `cultivator` = '1' WHERE `id_user` = '$ku[id]' AND `id_plant` = '0' AND (`time` = '$time' OR `time` < '$time') AND `cultivator` = '0'");

$_SESSION['rating']=$orat;
update_mc($orat);
header("Location:/myfarm/".passgen());
exit;
}
?>