room['file']=='kareta') { $cs = ''; $sos = ''; $car = mysql_fetch_array(mysql_query('SELECT * FROM `vokzal` WHERE `name` = "'.$u->room['name'].'" LIMIT 1')); if(isset($car['id'])) { $sp = mysql_query('SELECT * FROM `vokzal` WHERE `city` = "'.$u->info['city'].'" OR `tocity` = "'.$u->info['city'].'"'); while($pl = mysql_fetch_array($sp)) { $vz1 = mysql_fetch_array(mysql_query('SELECT * FROM `room` WHERE `name` = "Вокзал" AND `city` = "'.$pl['city'].'" LIMIT 1')); $vz2 = mysql_fetch_array(mysql_query('SELECT * FROM `room` WHERE `name` = "Вокзал" AND `city` = "'.$pl['tocity'].'" LIMIT 1')); $crm = mysql_fetch_array(mysql_query('SELECT * FROM `room` WHERE `name` = "'.$pl['name'].'" LIMIT 1')); //period 0 - прибытие в город (стоянка), 1 - движение, 3 - прибытие в другой город (стоянка), 4 - движение (из tocity) if($pl['time_start_go']==0) { //Это новая карета обновляем данные mysql_query('UPDATE `vokzal` SET `time_start_go` = "'.(time()+$pl['timeStop']*60).'",`time_finish_go` = "'.(time()+$pl['timeStop']*60+$pl['time_go']*60).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); $pl['time_start_go'] = time()+$pl['timeStop']*60; $pl['time_finish_go'] = $pl['time_start_go']+$pl['time_go']*60; } $see = 0; if($u->info['admin']>0) { $see = 1; } $plc = $pl['tocity']; if($pl['time_start_go']-600time()) { //можно знанимать места в карете if(isset($crm['id'])) { $sr = mysql_query('SELECT `uid`,`id` FROM `items_users` WHERE `secret_id` = "'.$pl['time_start_go'].'_b'.$pl['id'].'" AND `delete` = "0" LIMIT 100'); while($pr = mysql_fetch_array($sr)) { $upd1 = mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$pr['id'].'" LIMIT 1'); if($upd1) { mysql_query('UPDATE `users` SET `room` = "'.$crm['id'].'" WHERE `online` > '.(time()-120).' AND `id` = "'.$pr['uid'].'" LIMIT 1'); } } } } //отправляем карету в другой город if($pl['time_finish_go']'.$re.''; } ?>
room['name']; ?>
'.$error.''; ?>
Место отбытия:
city_name[$u->info['city']]; ?>
Место прибытия:
city_name[$car['citygo']]; ?>
Прибытие:
4,2=>4,3=>1,4=>1,5=>1,6=>2,7=>2,8=>2,9=>3,10=>3,11=>3,12=>4); $imgo = array(1=>1,2=>5,3=>7,4=>3); $outimg = $imgo[$outimg[round(date('m',time()))]]; if(date('H',time())<22 && date('H',time())>6) { $outimg++; } ?>