<?

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>";
echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>";
echo "<card id=\"who\" title=\"Кто в прихожей?\">";
echo "<p align=\"center\">";
}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=\"center\">";
}
echo $fsize1;
$tm = time()-300;
$pr_count = @mysql_query("SELECT id,user,inv,level FROM users WHERE onl> '".$tm ."' AND room='holl' group by user order by onl desc;");
if (mysql_affected_rows() == 0) {
echo "Никого нет. Пропали безвести (:<br/>";
} else {
$kol = mysql_affected_rows();
echo "Человек в прихожей: ".$kol."<br/>";
echo $divide; 
for ($k = 0; $k < $kol; $k++){
$pdc = @mysql_fetch_array($pr_count);
$user = $pdc["user"];
$nk = $pdc["id"];
$inv = $pdc["inv"];
$lev = $pdc["level"];
if ($inv != 1) echo "<a href=\"info.php?$ses&amp;nk=$nk&amp;ref=$ref\">".$user."</a>";
else if ($row["level"] > 6) echo "<a href=\"info.php?$ses&amp;nk=$nk&amp;ref=$ref\">".$user."(!)</a>";
if (($k+1) != $kol) print ', ';
}
if($kol>0) echo "<br/>";
unset($pdc);
}
echo$divide; 
echo "<a href=\"enter.php?$ses&amp;ref=$ref\">&#8592; Прихожая</a><br/>";
echo $fsize2;
if ($ver=="wml")echo "</p></card></wml>";
else echo "</div></body></html>";
?>