<?

if(isset($_GET['mypool']) && isset($_GET['soil']) && intval($_GET['soil'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_pool` WHERE `id` = '".intval($_GET['soil'])."' AND `id_user` = '$ku[id]' AND (`time_soil` = '$time' OR `time_soil` < '$time' )"),0)!=0)
{
$ground=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_pool` WHERE `id` = '".intval($_GET['soil'])."' AND `id_user` = '$ku[id]'"));

$plant=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_pool_plant` WHERE `id` = '".intval($ground['id_fish'])."'"));
if($ku['fishfooder']>0)$proc=$ku['fishfooder']*10;	else $proc=0;

$rat=$plant['soil_rating'];

$rat_fishfooder_act=0;

if($proc>0)$rat_fishfooder_act=($rat/100)*$proc;
if($ku['labspices']>=1)$labspices=($rat/100)*($ku['labspices']*10); 
if($ku['talent_5']>=1)$talent_51=($rat/100)*($ku['talent_5']*15); 

$rat=double_exp(base_exp($rat)+$rat_fishfooder_act+$labspices+$talent_51);

mysql_query("UPDATE `kolhoz_pool` SET `time_soil` = '".($plant['time_soil']*$incubator_timesoil_act+$time)."', `time` = '".($ground['time']-$plant['time_soil_minus'])."' WHERE `id` = '".intval($_GET['soil'])."' LIMIT 1")or die (mysql_error());
mysql_query("UPDATE `kolhoz_user` SET `rating` = '".($ku['rating']+$rat)."' WHERE `id` = '$ku[id]'");
$_SESSION['rating']=$rat;
update_mc($rat);
header("Location:/mypool/".passgen());
exit;
}
?>