Вход Регистрация
Файл: vkolhoze.com/kop/sellar/harvest2.php
Строк: 63
<?

if(isset($_GET['mycellar']) && isset($_GET['harvest2']) && intval($_GET['harvest2'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_polka2` WHERE `id` = '".intval($_GET['harvest2'])."' AND `id_user` = '$ku[id]' AND `id_plant2` != '0'"),0)!=0)

{

$polka2=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_polka2` WHERE `id` = '".intval($_GET['harvest2'])."' AND `id_user` = '$ku[id]' AND `id_plant2` != '0'"));

$plant2=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_plant2` WHERE `id` = '$polka2[id_plant2]'"));

if(
$polka2['time']<=$time)

{

if(
$plant2['id']==$gos['id_plant2'] && isset($mc))

{

$harv=(isset($harvester2_act)?$harvester2_act/100:0);

$hawk=(isset($yastreb2_act)?3:0);

$exp=$plant2['time_soil2']+($plant2['time_soil2']*$harv)+($plant2['time_soil2']*$hawk);

if(
$gos['type']=='harvest2')$exp=$exp*2;

mysql_query("INSERT INTO `kolhoz_collective_rating_gos` SET `id_user` = '$ku[id]', `id_collective` = '$mc[id]', `count` = '$exp', `time` = '$time'");

}

$count=$plant2['count'];

$count_harvester2_act=0;

$count_yastreb2_act=0;
$count_cellar_act=0;
if(isset(
$harvester2_act))$count_harvester2_act=floor(($count/100)*$harvester2_act);
//if(isset($yastreb2_act))$count_yastreb2_act=(($count/100)*300);
if(isset($cellar_act))$count_cellar_act=(($count/100)*$cellar_ps);
//$count=$count_harvester2_act+$count_yastreb2_act+$count+$count_greenhouse_act;
$count=$count_harvester2_act+$count_cellar_act+$count;
$count=floor($count);

//if($gos['id_plant2']==$plant2['id'] && $gos['type']=='harvest2' && isset($mc))$count=$count*2;

if($pw=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_market` WHERE `id_user` = '$ku[id]' AND `id_plant2` = '$plant2[id]' AND `arena` = '0'")))

{

mysql_query("UPDATE `kolhoz_market` SET `count` = '".($pw['count']+$count)."' WHERE `id` = '$pw[id]'");

}

else 
mysql_query("INSERT INTO `kolhoz_market` SET `id_plant2` = '$plant2[id]', `id_user`  = '$ku[id]', `count` = '$count', `arena` = '0'");

$_SESSION['harvest2']=$count;

mysql_query("UPDATE `kolhoz_user` SET `sadovod` = '".($ku['sadovod']+$count)."' WHERE `id` = '$ku[id]'");

mysql_query("UPDATE `kolhoz_polka2` SET `id_plant2` = '0', `soil2` = '0', `cultivator2` = '0' WHERE `id` = '".intval($_GET['harvest2'])."' LIMIT 1");

header("Location:?mycellar&".passgen());

}

else 
header("Location:?mycellar&".passgen());

exit;

}

?>
Онлайн: 0
Реклама