Вход Регистрация
Файл: vfermu.ru/sess_cron_ua/darja_cron_new.php
Строк: 305
<?php
$t
=microtime(1);
$time=time();

include 
"../sys/db/conect.php";

$user_select=mysql_query("SELECT * FROM `farm_user` WHERE `darja_time` > '$time'");

WHILE(
$ku=mysql_fetch_array($user_select)){

$ku=mysql_fetch_array(mysql_query("SELECT * FROM `farm_user` WHERE `id` = '$ku[id]'"));
$conf mysql_fetch_array(mysql_query("SELECT * FROM `farm_setting` WHERE `id_user`='$ku[id]'"));
if(
mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_collective_user` WHERE `id_user` = '$ku[id]'"),0)!=0)
{
$mcu=mysql_fetch_array(mysql_query("SELECT * FROM `farm_collective_user` WHERE `id_user` = '$ku[id]'"));
$mc=mysql_fetch_array(mysql_query("SELECT * FROM `farm_collective` WHERE `id` = '$mcu[id_collective]'"));
}
require_once
'../sys/fnc/fnc.php';
include
'../sys/fnc/teh.php';
if(
$ku['expdouble']==date("D"))$dexp=1;
$recpetu=mysql_fetch_array(mysql_query("SELECT * FROM `farm_history_recept` WHERE `id_user` = '$ku[id]' AND `id` = '".($ku['last_recept'])."'"));

///plant start///
if($recpetu['p1']>0){$p1_name=mysql_fetch_array(mysql_query("SELECT * FROM `farm_plant` WHERE `id` = '".($recpetu['p1'])."'"));
$pwu1=mysql_fetch_array(mysql_query("SELECT * FROM `farm_warehouse` WHERE `id_user` = '$ku[id]' AND `id_plant` = '".($recpetu['p1'])."'"),0);}

if(
$recpetu['p2']>0){$p2_name=mysql_fetch_array(mysql_query("SELECT * FROM `farm_plant` WHERE `id` = '".($recpetu['p2'])."'"));
$pwu2=mysql_fetch_array(mysql_query("SELECT * FROM `farm_warehouse` WHERE `id_user` = '$ku[id]' AND `id_plant` = '".($recpetu['p2'])."'"),0);}

if(
$recpetu['p3']>0){$p3_name=mysql_fetch_array(mysql_query("SELECT * FROM `farm_plant` WHERE `id` = '".($recpetu['p3'])."'"));
$pwu3=mysql_fetch_array(mysql_query("SELECT * FROM `farm_warehouse` WHERE `id_user` = '$ku[id]' AND `id_plant` = '".($recpetu['p3'])."'"),0);}

if(
$recpetu['p4']>0){$p4_name=mysql_fetch_array(mysql_query("SELECT * FROM `farm_plant` WHERE `id` = '".($recpetu['p4'])."'"));
$pwu4=mysql_fetch_array(mysql_query("SELECT * FROM `farm_warehouse` WHERE `id_user` = '$ku[id]' AND `id_plant` = '".($recpetu['p4'])."'"),0);}

if(
$recpetu['p5']>0){$p5_name=mysql_fetch_array(mysql_query("SELECT * FROM `farm_plant` WHERE `id` = '".($recpetu['p5'])."'"));
$pwu5=mysql_fetch_array(mysql_query("SELECT * FROM `farm_warehouse` WHERE `id_user` = '$ku[id]' AND `id_plant` = '".($recpetu['p5'])."'"),0);}
///plant end///

///speci start///
if($recpetu['s1']>0){$s1_name=mysql_fetch_array(mysql_query("SELECT * FROM `farm_speci` WHERE `id` = '".($recpetu['s1'])."'"));
$swu1=mysql_fetch_array(mysql_query("SELECT * FROM `farm_my_speci` WHERE `id_user` = '$ku[id]' AND `id_spec` = '".($recpetu['s1'])."'"),0);}

if(
$recpetu['s2']>0){$s2_name=mysql_fetch_array(mysql_query("SELECT * FROM `farm_speci` WHERE `id` = '".($recpetu['s2'])."'"));
$swu2=mysql_fetch_array(mysql_query("SELECT * FROM `farm_my_speci` WHERE `id_user` = '$ku[id]' AND `id_spec` = '".($recpetu['s2'])."'"),0);}

if(
$recpetu['s3']>0){$s3_name=mysql_fetch_array(mysql_query("SELECT * FROM `farm_speci` WHERE `id` = '".($recpetu['s3'])."'"));
$swu3=mysql_fetch_array(mysql_query("SELECT * FROM `farm_my_speci` WHERE `id_user` = '$ku[id]' AND `id_spec` = '".($recpetu['s3'])."'"),0);}

if(
$recpetu['s4']>0){$s4_name=mysql_fetch_array(mysql_query("SELECT * FROM `farm_speci` WHERE `id` = '".($recpetu['s4'])."'"));
$swu4=mysql_fetch_array(mysql_query("SELECT * FROM `farm_my_speci` WHERE `id_user` = '$ku[id]' AND `id_spec` = '".($recpetu['s4'])."'"),0);}

if(
$recpetu['s5']>0){$s5_name=mysql_fetch_array(mysql_query("SELECT * FROM `farm_speci` WHERE `id` = '".($recpetu['s5'])."'"));
$swu5=mysql_fetch_array(mysql_query("SELECT * FROM `farm_my_speci` WHERE `id_user` = '$ku[id]' AND `id_spec` = '".($recpetu['s5'])."'"),0);}
////speci end

////////////////////////////Собрать все////////////
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_sellar` WHERE `id_user` = '$ku[id]' AND (`time` < '$time' OR `time` = '$time') AND `id_rec` != '0'"),0)!=0){
$q=mysql_query("SELECT * FROM `farm_sellar` WHERE `id_user` = '$ku[id]' AND (`time` < '$time' OR `time` = '$time') AND `id_rec` != '0'");
$omon=0;
$orat=0;
$orub=0;
$oname=0;
while(
$post=mysql_fetch_array($q)){
$rus=mysql_fetch_array(mysql_query("SELECT * FROM `farm_history_recept` WHERE `id_user` = '$ku[id]' AND `id` = '$post[id_rec]'"));
$recc=mysql_fetch_array(mysql_query("SELECT * FROM `farm_recept` WHERE `p1`='".($rus['p1'])."' AND `p2` = '".($rus['p2'])."' AND `p3` = '".($rus['p3'])."' AND `p4` = '".($rus['p4'])."' AND `p5` = '".($rus['p5'])."' AND `pc1_min` <= '".($rus['pc1'])."' AND `pc1_max` >= '".($rus['pc1'])."' AND `pc2_min` <= '".($rus['pc2'])."' AND `pc2_max` >= '".($rus['pc2'])."' AND `pc3_min` <= '".($rus['pc3'])."' AND `pc3_max` >= '".($rus['pc3'])."' AND `pc4_min` <= '".($rus['pc4'])."' AND `pc4_max` >= '".($rus['pc4'])."' AND `pc5_min` <= '".($rus['pc5'])."' AND `pc5_max` >= '".($rus['pc5'])."' AND `s1` = '".($rus['s1'])."' AND `s2` = '".($rus['s2'])."' AND `s3` = '".($rus['s3'])."' AND `s4` = '".($rus['s4'])."' AND `s5` = '".($rus['s5'])."' AND `sc1_min` <= '".($rus['sc1'])."' AND `sc1_max` >= '".($rus['sc1'])."' AND `sc2_min` <= '".($rus['sc2'])."' AND `sc2_max` >= '".($rus['sc2'])."' AND `sc3_min` <= '".($rus['sc3'])."' AND `sc3_max` >= '".($rus['sc3'])."' AND `sc4_min` <= '".($rus['sc4'])."' AND `sc4_max` >= '".($rus['sc4'])."' AND `sc5_min` <= '".($rus['sc5'])."' AND `sc5_max` >= '".($rus['sc5'])."' AND `time_min` <= '".($rus['time'])."' AND `time_max` >= '".($rus['time'])."'"));
$reccc=mysql_fetch_array(mysql_query("SELECT * FROM `farm_my_recept` WHERE `id_user` = '$ku[id]' AND `id_rec` = '".($recc['id'])."'"));



if(
$reccc['id']!=0){$rating=$recc['rating'];$money=$recc['money'];$rubies=$recc['rubies'];}else{
$ret rand(100,200); $met rand(100,200);
$rating=$ret;
$money=$met;
$rubies=1;}




$rat_sc_act=0;
$rat_dog_act=0;
$rat_drakon_act=0;
$rat_school_act=0;
$arena_rat=0;
if(isset(
$sc_act))$rat_sc_act=$rating*2;
if(isset(
$dog_type))$rat_dog_act=(($rating/100)*$dog_type);
if(isset(
$drakon_act))$rat_drakon_act=(($rating/100)*300);
if(isset(
$school_act))$rat_school_act=$rating/2;
if(
$ku['arena_rating']>1000)$arena_rat=floor(($rating/100)*(($ku['arena_rating']-1000)/20));
$ratt=$rat_sc_act+$rat_dog_act+$rat_drakon_act+$rat_school_act+$arena_rat+$rating;
if(
$ratt==0)$rating=$rating;
else 
$rating=$ratt;
if(isset(
$adm_dexp)=='1'){if(isset($dexp)){$rating=$rating*2;}}
if(isset(
$adm_dexp)=='2'){$rating=$rating*2;}
if(isset(
$adm_dexp)=='3'){$rating=$rating*3;}
$orat=$orat+$rating;
$omon=$omon+$money;
$orub=$orub+$rubies;
mysql_query("UPDATE `farm_sellar` SET `id_rec` = '0' WHERE `id` = '$post[id]' LIMIT 1");
}
$ku['money']=plus_money($omon);
$ku['rubies']=plus_rubies($orub);
$ku['rating']=plus_rating($orat);
}




$collu mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_sellar` WHERE `id_user` = '$ku[id]'"),0);
$count1 "".($recpetu['p1']>0?"".($pwu1['count']/$recpetu['pc1'])."":"10000")."";
$count2 "".($recpetu['p2']>0?"".($pwu2['count']/$recpetu['pc2'])."":"10000")."";
$count3 "".($recpetu['p3']>0?"".($pwu3['count']/$recpetu['pc3'])."":"10000")."";
$count4 "".($recpetu['p4']>0?"".($pwu4['count']/$recpetu['pc4'])."":"10000")."";
$count5 "".($recpetu['p5']>0?"".($pwu5['count']/$recpetu['pc5'])."":"10000")."";
$count6 "".($recpetu['s1']>0?"".($swu1['count']/$recpetu['sc1'])."":"10000")."";
$count7 "".($recpetu['s2']>0?"".($swu2['count']/$recpetu['sc2'])."":"10000")."";
$count8 "".($recpetu['s3']>0?"".($swu3['count']/$recpetu['sc3'])."":"10000")."";
$count9 "".($recpetu['s4']>0?"".($swu4['count']/$recpetu['sc4'])."":"10000")."";
$count10 "".($recpetu['s5']>0?"".($swu5['count']/$recpetu['sc5'])."":"10000")."";
$counu floor(min($count1,$count2,$count3,$count4,$count5,$count6,$count7,$count8,$count9,$count10));
///start cena
$collnu $collu-$counu;


if(
$recpetu['p1']>0){if($pwu1['count']>=$recpetu['pc1']*$collnu){$erruu1=1;}}
if(
$recpetu['p2']>0){if($pwu2['count']>=$recpetu['pc2']*$collnu){$erruu2=1;}}
if(
$recpetu['p3']>0){if($pwu3['count']>=$recpetu['pc3']*$collnu){$erruu3=1;}}
if(
$recpetu['p4']>0){if($pwu4['count']>=$recpetu['pc4']*$collnu){$erruu4=1;}}
if(
$recpetu['p5']>0){if($pwu5['count']>=$recpetu['pc5']*$collnu){$erruu5=1;}}
if(
$recpetu['s1']>0){if($swu1['count']>=$recpetu['sc1']*$collnu){$erruu6=1;}}
if(
$recpetu['s2']>0){if($swu2['count']>=$recpetu['sc2']*$collnu){$erruu7=1;}}
if(
$recpetu['s3']>0){if($swu3['count']>=$recpetu['sc3']*$collnu){$erruu8=1;}}
if(
$recpetu['s4']>0){if($swu4['count']>=$recpetu['sc4']*$collnu){$erruu9=1;}}
if(
$recpetu['s5']>0){if($swu5['count']>=$recpetu['sc5']*$collnu){$erruu10=1;}}



if(
$recpetu['p1']>0){if(!isset($erruu1)){$err_zuu=1;}else{}}
////buy 2
if($recpetu['p2']>0){if(!isset($erruu2)){$err_zuu=1;}else{}}
////buy3
if($recpetu['p3']>0){if(!isset($erruu3)){$err_zuu=1;}else{}}
////buy4
if($recpetu['p4']>0){if(!isset($erruu4)){$err_zuu=1;}else{}}
////buy5
if($recpetu['p5']>0){if(!isset($erruu5)){$err_zuu=1;}else{}}
///buy6
if($recpetu['s1']>0){if(!isset($erruu6)){$err_zuu=1;}else{}}
///buy7
if($recpetu['s2']>0){if(!isset($erruu7)){$err_zuu=1;}else{}}
///buy8
if($recpetu['s3']>0){if(!isset($erruu8)){$err_zuu=1;}else{}}
///buy9
if($recpetu['s4']>0){if(!isset($erruu9)){$err_zuu=1;}else{}}
///buy10
if($recpetu['s5']>0){if(!isset($erruu10)){$err_zuu=1;}else{}}





if(
mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_sellar` WHERE `id_user` = '$ku[id]' AND `id_rec` = '0'"),0)!=0){

if(isset(
$err_zuu)){
if(
$counu<$collu){
$cenau1 "".($recpetu['p1']>0?"".($p1_name['cena']*($recpetu['pc1']*$collnu))."":"0")."";
$cenau2 "".($recpetu['p2']>0?"".($p2_name['cena']*($recpetu['pc2']*$collnu))."":"0")."";
$cenau3 "".($recpetu['p3']>0?"".($p3_name['cena']*($recpetu['pc3']*$collnu))."":"0")."";
$cenau4 "".($recpetu['p4']>0?"".($p4_name['cena']*($recpetu['pc4']*$collnu))."":"0")."";
$cenau5 "".($recpetu['p5']>0?"".($p5_name['cena']*($recpetu['pc5']*$collnu))."":"0")."";

$cenau6 "".($recpetu['s1']>0?"".(($s1_name['money']/100)*($recpetu['sc1']*$collnu))."":"0")."";
$cenau7 "".($recpetu['s2']>0?"".(($s2_name['money']/100)*($recpetu['sc2']*$collnu))."":"0")."";
$cenau8 "".($recpetu['s3']>0?"".(($s3_name['money']/100)*($recpetu['sc3']*$collnu))."":"0")."";
$cenau9 "".($recpetu['s4']>0?"".(($s4_name['money']/100)*($recpetu['sc4']*$collnu))."":"0")."";
$cenau10 "".($recpetu['s5']>0?"".(($s5_name['money']/100)*($recpetu['sc5']*$collnu))."":"0")."";
$obcuu $cenau1+$cenau2+$cenau3+$cenau4+$cenau5+$cenau6+$cenau7+$cenau8+$cenau9+$cenau10;

$cenu1 "".($recpetu['s1']>0?"".(($s1_name['rubies']/100)*($recpetu['sc1']*$collnu))."":"0")."";
$cenu2 "".($recpetu['s2']>0?"".(($s2_name['rubies']/100)*($recpetu['sc2']*$collnu))."":"0")."";
$cenu3 "".($recpetu['s3']>0?"".(($s3_name['rubies']/100)*($recpetu['sc3']*$collnu))."":"0")."";
$cenu4 "".($recpetu['s4']>0?"".(($s4_name['rubies']/100)*($recpetu['sc4']*$collnu))."":"0")."";
$cenu5 "".($recpetu['s5']>0?"".(($s5_name['rubies']/100)*($recpetu['sc5']*$collnu))."":"0")."";
$obcuu2 $cenu1+$cenu2+$cenu3+$cenu4+$cenu5;
////end cena
if($obcuu<=$ku['money']){
if(
$obcuu2<=$ku['rubies']){

////buy1
if($recpetu['p1']>0){
if(
mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_warehouse` WHERE `id_user` = '$ku[id]' AND `id_plant` = '".($recpetu['p1'])."'"),0)!=0){
mysql_query("UPDATE `farm_warehouse` SET `count` = '".($pwu1['count']+($recpetu['pc1']*$collnu))."' WHERE `id` = '".($pwu1['id'])."'");}else{
mysql_query("INSERT INTO `farm_warehouse` SET `id_plant` = '".($recpetu['p1'])."', `id_user`  = '$ku[id]', `count` = '".($recpetu['pc1']*$collnu)."'");}}
////buy 2
if($recpetu['p2']>0){
if(
mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_warehouse` WHERE `id_user` = '$ku[id]' AND `id_plant` = '".($recpetu['p2'])."'"),0)!=0){
mysql_query("UPDATE `farm_warehouse` SET `count` = '".($pwu2['count']+($recpetu['pc2']*$collnu))."' WHERE `id` = '".($pwu2['id'])."'");}else{
mysql_query("INSERT INTO `farm_warehouse` SET `id_plant` = '".($recpetu['p2'])."', `id_user`  = '$ku[id]', `count` = '".($recpetu['pc2']*$collnu)."'");}}
////buy3
if($recpetu['p3']>0){
if(
mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_warehouse` WHERE `id_user` = '$ku[id]' AND `id_plant` = '".($recpetu['p3'])."'"),0)!=0){
mysql_query("UPDATE `farm_warehouse` SET `count` = '".($pwu3['count']+($recpetu['pc3']*$collnu))."' WHERE `id` = '".($pwu3['id'])."'");}else{
mysql_query("INSERT INTO `farm_warehouse` SET `id_plant` = '".($recpetu['p3'])."', `id_user`  = '$ku[id]', `count` = '".($recpetu['pc3']*$collnu)."'");}}
////buy4
if($recpetu['p4']>0){
if(
mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_warehouse` WHERE `id_user` = '$ku[id]' AND `id_plant` = '".($recpetu['p4'])."'"),0)!=0){
mysql_query("UPDATE `farm_warehouse` SET `count` = '".($pwu4['count']+($recpetu['pc4']*$collnu))."' WHERE `id` = '".($pwu4['id'])."'");}else{
mysql_query("INSERT INTO `farm_warehouse` SET `id_plant` = '".($recpetu['p4'])."', `id_user`  = '$ku[id]', `count` = '".($recpetu['pc4']*$collnu)."'");}}
////buy5
if($recpetu['p5']>0){
if(
mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_warehouse` WHERE `id_user` = '$ku[id]' AND `id_plant` = '".($recpetu['p5'])."'"),0)!=0){
mysql_query("UPDATE `farm_warehouse` SET `count` = '".($pwu5['count']+($recpetu['pc5']*$collnu))."' WHERE `id` = '".($pwu5['id'])."'");}else{
mysql_query("INSERT INTO `farm_warehouse` SET `id_plant` = '".($recpetu['p5'])."', `id_user`  = '$ku[id]', `count` = '".($recpetu['pc5']*$collnu)."'");}}
///buy6
if($recpetu['s1']>0){
if(
mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_my_speci` WHERE `id_user` = '$ku[id]' AND `id_spec` = '".($recpetu['s1'])."'"),0)!=0){
mysql_query("UPDATE `farm_my_speci` SET `count` = '".($swu1['count']+($recpetu['sc1']*$collnu))."' WHERE `id` = '".($swu1['id'])."'");}else{
mysql_query("INSERT INTO `farm_my_speci` SET `id_spec` = '".($recpetu['s1'])."', `id_user`  = '$ku[id]', `count` = '".($recpetu['sc1']*$collnu)."'");}}
///buy7
if($recpetu['s2']>0){
if(
mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_my_speci` WHERE `id_user` = '$ku[id]' AND `id_spec` = '".($recpetu['s2'])."'"),0)!=0){
mysql_query("UPDATE `farm_my_speci` SET `count` = '".($swu2['count']+($recpetu['sc2']*$collnu))."' WHERE `id` = '".($swu2['id'])."'");}else{
mysql_query("INSERT INTO `farm_my_speci` SET `id_spec` = '".($recpetu['s2'])."', `id_user`  = '$ku[id]', `count` = '".($recpetu['sc2']*$collnu)."'");}}
///buy8
if($recpetu['s3']>0){
if(
mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_my_speci` WHERE `id_user` = '$ku[id]' AND `id_spec` = '".($recpetu['s3'])."'"),0)!=0){
mysql_query("UPDATE `farm_my_speci` SET `count` = '".($swu3['count']+($recpetu['sc3']*$collnu))."' WHERE `id` = '".($swu3['id'])."'");}else{
mysql_query("INSERT INTO `farm_my_speci` SET `id_spec` = '".($recpetu['s3'])."', `id_user`  = '$ku[id]', `count` = '".($recpetu['sc3']*$collnu)."'");}}
///buy9
if($recpetu['s4']>0){
if(
mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_my_speci` WHERE `id_user` = '$ku[id]' AND `id_spec` = '".($recpetu['s4'])."'"),0)!=0){
mysql_query("UPDATE `farm_my_speci` SET `count` = '".($swu4['count']+($recpetu['sc4']*$collnu))."' WHERE `id` = '".($swu4['id'])."'");}else{
mysql_query("INSERT INTO `farm_my_speci` SET `id_spec` = '".($recpetu['s4'])."', `id_user`  = '$ku[id]', `count` = '".($recpetu['sc4']*$collnu)."'");}}
///buy10
if($recpetu['s5']>0){
if(
mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_my_speci` WHERE `id_user` = '$ku[id]' AND `id_spec` = '".($recpetu['s5'])."'"),0)!=0){
mysql_query("UPDATE `farm_my_speci` SET `count` = '".($swu5['count']+($recpetu['sc5']*$collnu))."' WHERE `id` = '".($swu5['id'])."'");}else{
mysql_query("INSERT INTO `farm_my_speci` SET `id_spec` = '".($recpetu['s5'])."', `id_user`  = '$ku[id]', `count` = '".($recpetu['sc5']*$collnu)."'");}}
$ku['money']=minus_money($obcuu);
$ku['rubies']=minus_rubies($obcuu2);}}}} //end



if(!isset($err_zuu)){
$collper mysql_result(mysql_query("SELECT COUNT(*) FROM `farm_sellar` WHERE `id_user` = '$ku[id]' AND `id_rec` = '0'"),0);

$q2=mysql_query("SELECT * FROM `farm_sellar` WHERE `id_user` = '$ku[id]' AND `id_rec` = '0' LIMIT $collper");
while(
$post2=mysql_fetch_array($q2)){
mysql_query("UPDATE `farm_sellar` SET `id_rec` = '".($recpetu['id'])."',`time` = '".($recpetu['time']+$time)."' WHERE `id` = '".($post2['id'])."' LIMIT 1");

if(
$recpetu['p1']>0){mysql_query("UPDATE `farm_warehouse` SET `count` = '".($pwu1['count']-$recpetu['pc1']*$collper)."' WHERE `id` = '".($pwu1['id'])."'LIMIT 1");}

if(
$recpetu['p2']>0){mysql_query("UPDATE `farm_warehouse` SET `count` = '".($pwu2['count']-$recpetu['pc2']*$collper)."' WHERE `id` = '".($pwu2['id'])."' LIMIT 1");}

if(
$recpetu['p3']>0){mysql_query("UPDATE `farm_warehouse` SET `count` = '".($pwu3['count']-$recpetu['pc3']*$collper)."' WHERE `id` = '".($pwu3['id'])."' LIMIT 1");}

if(
$recpetu['p4']>0){mysql_query("UPDATE `farm_warehouse` SET `count` = '".($pwu4['count']-$recpetu['pc4']*$collper)."' WHERE `id` = '".($pwu4['id'])."' LIMIT 1");}

if(
$recpetu['p5']>0){mysql_query("UPDATE `farm_warehouse` SET `count` = '".($pwu5['count']-$recpetu['pc5']*$collper)."' WHERE `id` = '".($pwu5['id'])."' LIMIT 1");}

if(
$recpetu['s1']>0){mysql_query("UPDATE `farm_my_speci` SET `count` = '".($swu1['count']-$recpetu['sc1']*$collper)."' WHERE `id` = '".($swu1['id'])."' LIMIT 1");}

if(
$recpetu['s2']>0){mysql_query("UPDATE `farm_my_speci` SET `count` = '".($swu2['count']-$recpetu['sc2']*$collper)."' WHERE `id` = '".($swu2['id'])."' LIMIT 1");}

if(
$recpetu['s3']>0){mysql_query("UPDATE `farm_my_speci` SET `count` = '".($swu3['count']-$recpetu['sc3']*$collper)."' WHERE `id` = '".($swu3['id'])."' LIMIT 1");}

if(
$recpetu['s4']>0){mysql_query("UPDATE `farm_my_speci` SET `count` = '".($swu4['count']-$recpetu['sc4']*$collper)."' WHERE `id` = '".($swu4['id'])."' LIMIT 1");}

if(
$recpetu['s5']>0){mysql_query("UPDATE `farm_my_speci` SET `count` = '".($swu5['count']-$recpetu['sc5']*$collper)."' WHERE `id` = '".($swu5['id'])."' LIMIT 1");}
}
//end



}

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