<?
if(isset($_GET['taxi']) && isset($_GET['avto_moyka']) && intval($_GET['avto_moyka'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id` = '".intval($_GET['avto_moyka'])."' AND `id_user` = '$ku[id]' AND `id_plant` = '0' AND (`time` = '$time' OR `time` < '$time') AND `cultivator` = '0'"),0)!=5)
{
$ground=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_ground` WHERE `id` = '".intval($_GET['avto_moyka'])."' AND `id_user` = '$ku[id]' AND `id_plant` = '0' AND (`time` = '$time' OR `time` < '$time') AND `cultivator` = '0'"));
$rat=1;
$rat_drakon_act=2;
$rat_sc_act=2;
$rat_cultivator_act=5;
$rat_school_act=2;
$rat_lib_act=2;
if(isset($sc_act))$rat_sc_act=$rat*20;
if(isset($cultivator_act))$rat_cultivator_act=(($rat/100)*$cultivator_act);
if(isset($drakon_act))$rat_drakon_act=(($rat/100)*300);
if(isset($school_act))$rat_school_act=$rat*20;
if(isset($lib_act))$rat_lib_act=$rat/20;
if(isset($shmel_act))$rat_cultivator_act=$rat_cultivator_act*2;
$ratt=$rat_drakon_act+$rat_sc_act+$rat_cultivator_act+$rat_school_act+$rat_lib_act;
if($ratt==5)$rat=$rat;
else $rat=$ratt;
if(isset($dexp))$rat=$rat*2;
mysql_query("UPDATE `kolhoz_ground` SET `cultivator` = '1' WHERE `id` = '".intval($_GET['avto_moyka'])."' LIMIT 1");
mysql_query("UPDATE `kolhoz_user` SET `rating` = '".($ku['rating']+$rat)."' WHERE `id` = '$ku[id]'");
$_SESSION['rating']=$rat;
update_mc($rat);
header("Location:?taxi&".passgen());
exit;
}
?>