Файл: domm/kombik/mod20.php
Строк: 22
<?
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$lala2 = "SELECT * FROM botan WHERE `strana`='$nik'";
$result2 = mysql_query($lala2);
if(mysql_num_rows($result2)>0){echo"Обучение уже ведётся!<br/>";
}else{
$rob=$_POST['rab'];
$bob=$_POST['bot'];
$rob=round($rob);$bob=round($bob);
$x2=$rob*5;$x5=$rob*5;
if($rob>$re7['rab']){$rob=$re7['rab'];}else{}if($bob>$re7['bot']){$bob=$re7['bot'];}else{}
if($rob<0){$rob=0;}else{}if($bob<0){$bob=0;}else{}
if(empty($rob)){$rob=0;}else{}if(empty($bob)){$bob=0;}else{}
if($rob==0||$bob==0){header("Location: index.php?der=$key&kmb=41");}else{
$e1=$re7['rab']-$rob;$e2=$re7['bot']-$bob;$e3=time();$e4=((4000/$bob)*$rob)/6;$e4=round($e4);$ee=$e4/60;$ee=round($ee);
if($x2>$re7['mineral']||$x5>$re7['dengi']){
echo"Не хватает ресурсов!требуется <br/>камень-$x2.деньги-$x5.<br/>";}else{
$e6=$re7['mineral']-$x2;$e9=$re7['dengi']-$x5;
mysql_query("INSERT INTO botan (strana,rab,bot,time1,time2) VALUES('$nik','$rob','$bob','$e3','$e4')");
mysql_query("UPDATE gos SET mineral='$e6',dengi='$e9',rab='$e1',bot='$e2' WHERE strana='$nik'");
echo"Обучение займёт[$ee мин.]<br/>";
}
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
?>