<?php
require'config.php';
$align=$set['alignpr'];
$title='Чат-'.date("H:i", $time);
aut();
head();
echo menu.'<b>Комнаты:</b>'.div;

$rooms = $db->sql_query("SELECT * FROM `rooms` ORDER BY `pos` ASC");
if($db->sql_numrows($rooms)!=0){
while($room = $db->sql_fetchrow($rooms)){

if ($room['sartir']==1)echo '<a href="room?rm='.$room['rm'].'&amp;sartir">'.$room['name'].'</a>('.$db->sql_fetchfield($db->sql_query('SELECT COUNT(*) FROM `who` WHERE `room` = "room" and `rm` = "'.$room['rm'].'"'),0).')<br />';
else if ($room['intim']==1)echo '<a href="room?rm='.$room['rm'].'&amp;intim">'.$room['name'].'</a>('.$db->sql_fetchfield($db->sql_query('SELECT COUNT(*) FROM `who` WHERE `room` = "room" and `rm` = "'.$room['rm'].'"'),0).')<br />';
else if ($room['level']<=$user['level'])echo '<a href="room?rm='.$room['rm'].'">'.$room['name'].'</a>('.$db->sql_fetchfield($db->sql_query('SELECT COUNT(*) FROM `who` WHERE `room` = "room" and `rm` = "'.$room['rm'].'"'),0).')<br />';}

}else{
echo 'Комнат нет пока...<br />';
}
foot();
?>