<?
include '../config.php';
include '../func.php';
head();
aut();
ban();
####################Запись онлайна##################
mysql_query("UPDATE `profile` SET `online` = 'enter' WHERE `id` = '".$id_session."'");
####################################################

echo head . '<b>Комнаты чата:</b></div>';
if ( $config['status_chat'] == 0) {
    echo head . "Чат" . div;
    echo link1 . 'Чат отключен' . div;
    navig();
    foot();
    exit();
}

echo link2;
$room_kol = mysql_result(mysql_query("SELECT count(*) FROM `room`"), 0);
if($room_kol>0)
{
$result = mysql_query("SELECT * FROM room");
while($room = mysql_fetch_assoc($result)){
    
    $rid = $room['id'];
    $query = mysql_query("SELECT COUNT(*) FROM `profile` WHERE `online` = 'room".$rid."' AND `time` > '".(time()-600)."' ORDER BY `time`");
    $inroom = mysql_result($query, 0);
    
echo "<img src='../style/vesna/2.png' alt='' /> <a href=\"chat.php?room=".$room['id']."\">".$room['room']."</a> [".$inroom."]<br/>";
}
}else{ echo 'Комнат нет...';}
echo div;





navig();
foot();
?>