<?php

header("Cache-Control: no-cache"); 
if ($ver=="wml")header ("Content-type:text/vnd.wap.wml; charset=utf-8");
else header("Content-Type:text/html; charset=UTF-8");

require("inc.php");
$link = connect_db();
list($row, $id, $ps, $fsize1, $fsize2) = check_login($link);
require("version.php");

if ($ver=="wml"){
echo $xml;
echo $dtd;
echo "<wml>\n";
echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>\n";
echo "<card id=\"results\" title=\"Поиск модеров\">\n";
echo "<p align=\"left\">\n";
}else{
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
echo "<head><link rel=\"stylesheet\" type=\"text/css\" href=\"css/css.css\"/>";
echo "<title>Поиск модеров</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>";
echo "<div align=\"left\">";
}
echo $fsize1;
$r = mysql_query("SELECT id,user,onl,room FROM users WHERE level >= '4'");
if (mysql_affected_rows() == 0) {
echo "Модеров сейчас нет<br/>\n";
} else {
$a = mysql_fetch_array($r);
while ($a !== false){
$usid = $a["id"];
$nick = $a["user"];
$onl = $a["onl"];
$room = $a["room"];
$a = mysql_fetch_array($r);
if ($room=="letters"){
if(($onl+300>time())&&($room!="")){
echo "<a href=\"search.php?go=view&amp;$ses&amp;nick=$nick&amp;ref=$ref\">".$nick."</a> | \n";
echo "сейчас находится в <a href=\"chatmail.php?$ses&amp;ref=$ref\">записках</a><br/>\n";
} 
} else if ($room=="holl"){
if(($onl+300>time())&&($room!="")){
echo "<a href=\"search.php?go=view&amp;$ses&amp;nick=$nick&amp;ref=$ref\">".$nick."</a> | \n";
echo "сейчас находится в <a href=\"enter.php?$ses&amp;ref=$ref\">прихожей</a><br/>\n";
}
}else{
$roomselect = @mysql_query ("Select name from rooms where rm=$room");
$rooms = @mysql_fetch_array($roomselect);
$roomname=$rooms["name"];
if(($onl+300>time())&&($room!="")){
echo "<a href=\"search.php?go=view&amp;$ses&amp;nick=$nick&amp;ref=$ref\">".$nick."</a> | \n";
if($room==9)echo "Сейчас в комнате <a href=\"anlim.php?$ses&amp;rm=$room&amp;ref=$ref\">$roomname</a><br/>\n";
else if($room==11)echo "Сейчас в комнате <a href=\"klaznet.php?$ses&amp;rm=$room&amp;ref=$ref\">$roomname</a><br/>\n";
else echo "Сейчас в комнате <a href=\"chat.php?$ses&amp;rm=$room&amp;ref=$ref\">$roomname</a><br/>\n";
}
}
}
}
echo $divide;
echo "<a href=\"enter.php?$ses&amp;ref=$ref\">&#8592; Прихожая</a>\n"; 
echo $fsize2;
if ($ver=="wml")echo "</p></card></wml>\n";
else echo "</div></body></html>\n";
mysql_close ($link);
exit;
?>