<?//вскопать все

if(isset($_GET['f_myfarm']) && isset($_GET['cultivator_all']) && mysql_result(mysql_querll("SELECT COUNT(*) FROM `kolhoz_ground_f` WHERE `id_user` = '$ku[id]' AND `id_plant` = '0' AND (`time` = '$time' OR `time` < '$time') AND `cultivator` = '0'"),0)!=0 && $ku['cultivator_f']>0)
{
$rat=1;
$rat_drakon_act=0;
$rat_sc_act=0;
$rat_lib_act=0;
$rat_cultivator_f_act=(($rat/100)*$cultivator_f_act);
if(isset($drakon_act))$rat_drakon_act=((2/100)*300);
if(isset($lib_act))$rat_lib_act=$rat/2;
if(isset($shmel_act))$rat_cultivator_f_act=$rat_cultivator_f_act*2;
$ratt=$rat+$rat_drakon_act+$rat_sc_act+$rat_cultivator_f_act+$rat_school_act+$rat_lib_act;
if($ratt==0)$rat=$rat;
else $rat=$ratt;

$orat=0;

$q=mysql_querll("SELECT * FROM `kolhoz_ground_f` WHERE `id_user` = '$ku[id]' AND `id_plant` = '0' AND (`time` = '$time' OR `time` < '$time') AND `cultivator` = '0'");
while($post=mysql_fetch_array($q))
{
mysql_querll("UPDATE `kolhoz_ground_f` SET `cultivator` = '1' WHERE `id` = '$post[id]' LIMIT 1");
mysql_querll("UPDATE `kolhoz_user` SET `rating` = '".($ku['rating']+$rat)."' WHERE `id` = '$ku[id]'");
$orat=$rat+$orat;
}
$_SESSION['rating']=$orat;

update_mc($orat);
header("Location:?f_myfarm&".passgen());
exit;
}
?>