<?
require'../sys/conf.php';
$time=time();
$pus=rand(111111,999999);$time2=$time+1;
$strana='{Оазис}';
mysql_query("INSERT INTO gos (login,strana,datareg,datanal,datavor,dataver,datasab,datawpk) VALUES('K','$strana $pus','$time','$time','$time','$time','$time','$time'),
('K','Пустыня $strana $pus','$time2','$time2','$time2','$time2','$time2','$time2')");
$v1=rand(700,1300);$v2=rand(100,700);$v3=4000;
$v11=rand(700,1300);$v21=rand(100,700);$v31=4000;
mysql_query("INSERT INTO gos2 (strana,gora,lesa,land) VALUES('$strana $pus','$v1','$v2','$v3'),('Пустыня $strana $pus','$v11','$v21','$v31')");
mysql_query("INSERT INTO domik (strana,domik5) VALUES ('$strana $pus','1'),('Пустыня $strana $pus','1')");
/////////////////////////////////////////////////////////////////////
$mon = mysql_query("SELECT login,strana FROM gos WHERE datareg<'$time' ORDER BY datareg DESC, datareg asc LIMIT 0,4");
while($arr = mysql_fetch_array($mon)){
$dat=time();
mysql_query("INSERT INTO sosed (strana1,strana2) VALUES('$strana $pus','$arr[strana]')");
if($arr[login]!='K'){
mysql_query("INSERT INTO mess (komu,kto,data,st,tip,text) VALUES('$arr[strana]','@','$dat','0','0','Новое соседнее гос-во $strana $pus')");
}}
$mon = mysql_query("SELECT login,strana FROM gos WHERE datareg<'$time2' ORDER BY datareg DESC, datareg asc LIMIT 0,4");
while($arr = mysql_fetch_array($mon)){
$dat=time();
mysql_query("INSERT INTO sosed (strana1,strana2) VALUES('Пустыня $strana $pus','$arr[strana]')");
if($arr[login]!='K'){
mysql_query("INSERT INTO mess (komu,kto,data,st,tip,text) VALUES('$arr[strana]','@','$dat','0','0','Новое соседнее гос-во Пустыня $strana $pus')");
}}
mysql_close();
?>