<?
$kmb = qw("SELECT * FROM botan  WHERE strana='$re1[strana]'");
while($army = mysql_fetch_array($kmb)){
$time=time();$tim=$time-$army[time];
if($tim>0){
$rab=$army[bot]+$army[rab];
$a2="Обучено $army[rab] учёных";
$dt1=date("d");$dt2=date("m");$dt3=date("H");$dt4=date("i");
mysql_query("INSERT INTO logistik (vid,data,strana,text) VALUES('21','[$dt1:$dt2]($dt3:$dt4)','$re1[strana]','$a2 ($army[rab])')");
qw("INSERT INTO mess (komu,kto,data,st,tip,text) VALUES('$re1[strana]','@','$time','0','0','$a2')");
qw("UPDATE gos2 SET bot=bot+'$rab' WHERE strana='$re1[strana]'");
qw("DELETE FROM botan WHERE id='$army[id]'");
header("Location:game.php?der=$key");
}
}
?>