<?

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");

$m0=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM room0"));
$m1=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM room1"));
$m2=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM room2"));
$m3=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM room3"));
$m4=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM room4"));
$m5=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM room5"));
$m6=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM room6"));
$m7=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM room7"));
$m8=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM room8"));
$m9=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM room9"));
$m10=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM room10"));
$m11=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM room11"));
$m12=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM room12"));
$m13=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM room13"));
$m14=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM room14"));
$m15=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM room15"));
$m16=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM room16"));
$m17=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM room17"));
$m18=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM room18"));
$m19=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM room19"));
$m20=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM room20"));
$m21=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM room21"));
$m22=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM room22"));

$summa=$m0[0]+$m1[0]+$m2[0]+$m3[0]+$m4[0]+$m5[0]+$m6[0]+$m7[0]+$m8[0]+$m9[0]+$m10[0]+$m11[0]+$m12[0]+$m13[0]+$m14[0]+$m15[0]+$m16[0]+$m17[0]+$m18[0]+$m19[0]+$m20[0]+$m21[0]+$m22[0];

if ($ver=="wml"){
echo $xml;
echo $dtd;
echo "<wml>\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\"/>";
}

switch($mod) {

case '10ym':
if ($ver=="wml"){
echo "<card id=\"statistik\" title=\"Самые умные\">\n";
echo "<p align=\"center\">\n";
}else{
echo "<title>Самые умные</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>";
echo "<div align=\"center\">";
}
echo $fsize1;
echo "<b>Самые умные</b><br/>\n";
echo $divide;
$resu = @mysql_query ("Select user,credits,credits from users order by credits desc limit 0,10;");
$i = 1;
while ($a2 = mysql_fetch_array($resu))
{
echo ($i++).") ".$a2["user"]." (".$a2["credits"]." ответов)<br/>\n";
}
break;

case 'galery':
if ($ver=="wml"){
echo "<card id=\"statistik\" title=\"Самые красивые\">\n";
echo "<p align=\"center\">\n";
}else{
echo "<title>Самые красивые</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>";
echo "<div align=\"center\">";
}
echo $fsize1;
echo "<b>Самые красивые чатовцы</b><br/>\n";
echo $divide;
$resu = @mysql_query ("Select id,user,votefoto,img from users where img!='' order by votefoto desc limit 0,10;");
$i = 1;
while ($a2 = mysql_fetch_array($resu))
{
echo ($i++).") ".$a2["user"]."<a href=\"userfoto.php?usid=".$a2['id']."&amp;$ses&amp;ref=$ref\"><img src=\"scr.php?photos/".$a2['img']."\" alt=\"фото\"/></a>(".$a2['votefoto']." голосов)<br/>";
}
break;


case '10az':
if ($ver=="wml"){
echo "<card id=\"statistik\" title=\"Самые азартные\">\n";
echo "<p align=\"center\">\n";
}else{
echo "<title>Самые азартные</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>";
echo "<div align=\"center\">";
}
echo $fsize1;
echo "<b>Самые азартные</b><br/>\n";
echo $divide;
$resu = @mysql_query ("Select user,gposts from users order by gposts desc limit 0,10;");
$i = 1;
while ($a2 = mysql_fetch_array($resu))
{
echo ($i++).") ".$a2["user"]." (".$a2["gposts"]." постов)<br/>\n";
}
break;


case '10post':
if ($ver=="wml"){
echo "<card id=\"statistik\" title=\"Самые разговорчивые\">\n";
echo "<p align=\"center\">\n";
}else{
echo "<title>Самые разговорчивые</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>";
echo "<div align=\"center\">";
}
echo $fsize1;
echo "<b>Самые разговорчивые</b><br/>\n";
echo $divide;
$r = @mysql_query ("SELECT user,posts FROM users WHERE id != '2' ORDER BY posts desc LIMIT 0,10;");
$i = 1;
while ($a = mysql_fetch_array($r))
{
echo ($i++).") ".$a["user"]." - ".$a["posts"]."<br/>\n";
}
break;


case '10maf':
if ($ver=="wml"){
echo "<card id=\"statistik\" title=\"Криминальные авторитеты\">\n";
echo "<p align=\"center\">\n";
}else{
echo "<title>Криминальные авторитеты</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>";
echo "<div align=\"center\">";
}
echo $fsize1;
echo "<b>Криминальные авторитеты</b><br/>\n";
echo $divide;
$r2 = @mysql_query ("SELECT user,mafcredits FROM users ORDER BY mafcredits  desc LIMIT 0,10;");
$i = 1;
while ($a3 = mysql_fetch_array($r2))
{
echo ($i++).") ".$a3["user"]." - ".$a3["mafcredits"]."<br/>\n";
}
break;

case 'newtoday':
if ($ver=="wml"){
echo "<card id=\"statistik\" title=\"Новички сегодня\">\n";
echo "<p align=\"center\">\n";
}else{
echo "<title>Новички сегодня</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>";
echo "<div align=\"center\">";
}
echo $fsize1;
$curdate=date("d-m-Y");
$r = mysql_query("SELECT id,user FROM users WHERE date = '".$curdate."'");
echo "<b>Новички сегодня</b><br/>\n";
echo $divide;
if (mysql_affected_rows() == 0) {
echo "Сегодня нет новичков<br/>\n";
} else {
$a = mysql_fetch_array($r);
$i=0;
while ($a !== false){
$i++;
$nk = $a[0];
$nick = $a[1];
echo "$i) <a href=\"info.php?$ses&amp;nk=$nk&amp;ref=$ref\">$nick</a><br/>\n";
$a = mysql_fetch_array($r);
}   
}
break;

case 'fullignor':
if ($ver=="wml"){
echo "<card id=\"statistik\" title=\"Полный игнор\">\n";
echo "<p align=\"center\">\n";
}else{
echo "<title>Полный игнор</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>";
echo "<div align=\"center\">";
}
echo $fsize1;
$r = mysql_query("SELECT id,user FROM users WHERE inv = '2'");
echo "ВЫСШАЯ МЕРА НАКАЗАНИЯ. Их не видет никто в чате.<br/>\n";
echo $divide;
if (mysql_affected_rows() == 0) {
echo "Список Полного игнора пуст.<br/>\n";
} else {
$a = mysql_fetch_array($r);
$i=0;
while ($a !== false){
$i++;
$nk = $a[0];
$nick = $a[1];
echo "$i) <a href=\"info.php?$ses&amp;nk=$nk&amp;ref=$ref\">$nick</a><br/>\n";
$a = mysql_fetch_array($r);
}   
}
break;

case 'birthday':
if ($ver=="wml"){
echo "<card id=\"statistik\" title=\"Именинники\">\n";
echo "<p align=\"center\">\n";
}else{
echo "<title>Именинники</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>";
echo "<div align=\"center\">";
}
echo $fsize1;
$d=date("d-m-");
$y=date("Y");
$select = mysql_query ("Select id,user,birth from users where birth LIKE '%$d%'");
echo "<b>Имениннники сегодня</b><br/>\n";
echo $divide;
if (mysql_affected_rows() == 0) {
echo "Сегодня нет именинников<br/>\n";
} else { 
$i = 1;
while ($inf = @mysql_fetch_array ($select)){
$us=$inf["user"];
$usid=$inf["id"];
$birth=$inf["birth"];
$d1=substr($birth,0,2);
$m1=substr($birth,4,2);
$y1=substr($birth,6,4);
if ($y>$y1) $age=$y-$y1; else $age="(Не известно)";
if ((!$age)||($age==0)||($age=="")||($age>$y)) $age="(Не известно)"; else $age="(лет <b>".$age."</b> )\n";
echo ($i++).") <a href=\"info.php?$ses&amp;nk=$usid&amp;ref=$ref\">".$us."</a> ".$age."<br/>\n";
}
}
break;

case 'banned':
if ($ver=="wml"){
echo "<card id=\"statistik\" title=\"Забаненные\">\n";
echo "<p align=\"center\">\n";
}else{
echo "<title>Забаненные</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>";
echo "<div align=\"center\">";
}
echo $fsize1;
echo "<b>Забаненные</b><br/>\n";
echo $divide;
$r = mysql_query("SELECT ip,soft,user FROM bannlist");
if (mysql_affected_rows() == 0) {
echo "Список банна пуст<br/>\n";
} else {
$a = mysql_fetch_array($r);
while ($a !== false){
$ip=$a["ip"];
$soft=$a["soft"];
$bannik=$a["user"];
$brauz=strtok($soft,'/');
echo "<b>Ник:</b> ".$bannik." <b>IP:</b> ".$ip." /<b> SOFT: </b>".$brauz."<br/>\n";
$a = mysql_fetch_array($r);
}
}
break;

case 'admins':
if ($ver=="wml"){
echo "<card id=\"statistik\" title=\"Админы\">\n";
echo "<p align=\"center\">\n";
}else{
echo "<title>Админы</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>";
echo "<div align=\"center\">";
}
echo $fsize1;
echo "<b>Всеми любимые Админы</b><br/>\n";
echo $divide;
$r = mysql_query("SELECT id,user FROM users WHERE level = '7'");
if (mysql_affected_rows() == 0) {
echo "Админов нет (:<br/>\n";
} else {
$a = mysql_fetch_array($r);
while ($a !== false){
$nk = $a["id"];
$nick = $a["user"];
echo "<a href=\"info.php?$ses&amp;nk=$nk&amp;ref=$ref\">".$nick."</a><br/>\n";
$a = mysql_fetch_array($r);
}
}
break;

case 'sysadmin':
if ($ver=="wml"){
echo "<card id=\"statistik\" title=\"Супер Админы\">\n";
echo "<p align=\"center\">\n";
}else{
echo "<title>Супер Админы</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>";
echo "<div align=\"center\">";
}
echo $fsize1;
echo "<b>Всеми любимые Супер Админы</b><br/>\n";
echo $divide;
$r = mysql_query("SELECT id,user FROM users WHERE (level='8')&&(id!=10)");
$a = mysql_fetch_array($r);
while ($a !== false){
$nk = $a["id"];
$nick = $a["user"];
echo "<a href=\"info.php?$ses&amp;nk=$nk&amp;ref=$ref\">".$nick."</a><br/>\n";
$a = mysql_fetch_array($r);
}
break;

case 'smoders':
if ($ver=="wml"){
echo "<card id=\"statistik\" title=\"Старшие модеры\">\n";
echo "<p align=\"center\">\n";
}else{
echo "<title>Старшие модеры</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>";
echo "<div align=\"center\">";
}
echo $fsize1;
echo "<b>Старшие Модеры</b><br/>\n";
echo $divide;
$r = mysql_query("SELECT id,user FROM users WHERE level = '6'");
if (mysql_affected_rows() == 0) {
echo "Вакансия свободна<br/>\n";
} else {
$a = mysql_fetch_array($r);
while ($a !== false){
$nk = $a["id"];
$nick = $a["user"];
echo "<a href=\"info.php?$ses&amp;nk=$nk&amp;ref=$ref\">".$nick."</a><br/>\n";
$a = mysql_fetch_array($r);
}
}
break;

case 'moders':
if ($ver=="wml"){
echo "<card id=\"statistik\" title=\"Киллеры\">\n";
echo "<p align=\"center\">\n";
}else{
echo "<title>Киллеры</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>";
echo "<div align=\"center\">";
}
echo $fsize1;
echo "<b>Киллеры</b><br/>\n";
echo $divide;
$r = mysql_query("SELECT id,user FROM users WHERE level = '5'");
if (mysql_affected_rows() == 0) {
echo "Вакансия свободна<br/>\n";
} else {
$a = mysql_fetch_array($r);
while ($a !== false){
$nk = $a["id"];
$nick = $a["user"];
echo "<a href=\"info.php?$ses&amp;nk=$nk&amp;ref=$ref\">".$nick."</a><br/>\n";
$a = mysql_fetch_array($r);
}
}
break;

case 'vips':
if ($ver=="wml"){
echo "<card id=\"statistik\" title=\"V.I.P.-ы\">\n";
echo "<p align=\"center\">\n";
}else{
echo "<title>V.I.P.-ы</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>";
echo "<div align=\"center\">";
}
echo $fsize1;
echo "<b>V.I.P.-ы</b><br/>\n";
echo $divide;
$r = mysql_query("SELECT id,user FROM users WHERE level = '4'");
if (mysql_affected_rows() == 0) {
echo "Вакансия свободна<br/>\n";
} else {
$a = mysql_fetch_array($r);
while ($a !== false){
$nk = $a["id"];
$nick = $a["user"];
echo "<a href=\"info.php?$ses&amp;nk=$nk&amp;ref=$ref\">".$nick."</a><br/>\n";
$a = mysql_fetch_array($r);
}
}
break;

case 'm':
if ($ver=="wml"){
echo "<card id=\"statistik\" title=\"Парни чата!\">\n";
echo "<p align=\"center\">\n";
}else{
echo "<title>Парни чата!</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>";
echo "<div align=\"center\">";
}
echo $fsize1;
echo "<b>Парни чата!</b><br/>";
echo $divide; 
$userm = mysql_query ("select count(id) as num from users where sex ='М' and level<'4';");
$usm = mysql_fetch_array($userm);
$num = $usm["num"]; 
if(!isset($s))$s=0;
$mx=round(($num/10)+0.45);
if($s>$mx)$s=$mx;
if($s==0)$s=1;
$ot=(($s-1)*10)+1;
$do=$s*10;
if($do>$num)$do=$num;
$o=$ot-1;
$n=$ot;
if($do==0)$n=$o;
echo "Показывает $n-$do из $num<br/>\n";
echo $divide;
$r = mysql_query ("select id,user from users where sex ='М' and level<'4' order by posts desc limit $o,$do");
for ($i=$ot;$i<=$do;$i++){
$arr = mysql_fetch_array($r);
$login=$arr['user'];
$usid=$arr['id'];
echo ($i).") <a href=\"info.php?$ses&amp;nk=$usid&amp;ref=$ref\">".$login."</a><br/>"; 
}                                     
$next=$s+1;
$prev=$s-1;
if ($num>$do) {
$ot=(($next-1)*10)+1;
$do=$next*10;
if($do>$num)$do=$num;
echo $divide;
echo "<a href=\"statistik.php?mod=m&amp;$ses&amp;s=$next&amp;ref=$ref\">&gt;&gt;$ot-$do&gt;&gt;</a><br/>\n";
}
if($s>1) {
$ot=(($prev-1)*10)+1;
$do=$prev*10;
echo "<a href=\"statistik.php?mod=m&amp;$ses&amp;s=$prev&amp;ref=$ref\">&lt;&lt;$ot-$do&lt;&lt;</a><br/>\n";
}
break;

case 'zh':
if ($ver=="wml"){
echo "<card id=\"statistik\" title=\"Девушки чата!\">\n";
echo "<p align=\"center\">\n";
}else{
echo "<title>Девушки чата!</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>";
echo "<div align=\"center\">";
}
echo $fsize1;
echo "<b>Девушки чата!</b><br/>";
echo $divide; 
$userm = mysql_query ("select count(id) as num from users where sex ='Ж' and level<'4';");
$usm = mysql_fetch_array($userm);
$num = $usm["num"]; 
if(!isset($s))$s=0;
$mx=round(($num/10)+0.45);
if($s>$mx)$s=$mx;
if($s==0)$s=1;
$ot=(($s-1)*10)+1;
$do=$s*10;
if($do>$num)$do=$num;
$o=$ot-1;
$n=$ot;
if($do==0)$n=$o;
echo "Показывает $n-$do из $num<br/>\n";
echo $divide;
$r = mysql_query ("select id,user from users where sex ='Ж' and level<'4' order by posts desc limit $o,$do");
for ($i=$ot;$i<=$do;$i++){
$arr = mysql_fetch_array($r);
$login=$arr['user'];
$usid=$arr['id'];
echo ($i).") <a href=\"info.php?$ses&amp;nk=$usid&amp;ref=$ref\">".$login."</a><br/>"; 
}                                     
$next=$s+1;
$prev=$s-1;
if ($num>$do) {
$ot=(($next-1)*10)+1;
$do=$next*10;
if($do>$num)$do=$num;
echo $divide; 
echo "<a href=\"statistik.php?mod=zh&amp;$ses&amp;s=$next&amp;ref=$ref\">&gt;&gt;$ot-$do&gt;&gt;</a><br/>\n";
}
if($s>1) {
$ot=(($prev-1)*10)+1;
$do=$prev*10;
echo "<a href=\"statistik.php?mod=zh&amp;$ses&amp;s=$prev&amp;ref=$ref\">&lt;&lt;$ot-$do&lt;&lt;</a><br/>\n";
}
break;

default:
if ($ver=="wml"){
echo "<card id=\"statistik\" title=\"Статистика чата!\">\n";
echo "<p align=\"center\">\n";
}else{
echo "<title>Статистика чата!</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>";
echo "<div align=\"center\">";
}
echo $fsize1;
echo "<b>Статистика чата</b><br/>\n";
echo $divide;
$users=mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM users"));
$usersm=mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM users where sex='М'"));
$usersj=mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM users where sex='Ж'"));
echo "Всего юзеров: <b>".$users[0]."</b><br/>\n";
echo "Парней: <a href=\"statistik.php?$ses&amp;mod=m&amp;ref=$ref\">".$usersm[0]."</a><br/>\n";
echo "Девушек: <a href=\"statistik.php?$ses&amp;mod=zh&amp;ref=$ref\">".$usersj[0]."</a><br/>\n";
echo $divide;
$curdate=date("d-m-Y");
$newtoday=mysql_fetch_array(mysql_query("SELECT COUNT(id) from users WHERE date = '".$curdate."'"));
echo "Новенькие сегодня: <a href=\"statistik.php?$ses&amp;mod=newtoday&amp;ref=$ref\">".$newtoday[0]."</a><br/>\n"; 
$d=date("d-m-");
$birth = mysql_fetch_array(mysql_query ("Select count(id) from users where birth LIKE '%$d%'"));
echo "Именинники сегодня: <a href=\"statistik.php?$ses&amp;mod=birthday&amp;ref=$ref\">".$birth[0]."</a><br/>\n";
$banned=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM bannlist"));
echo "Забанненные IP+SOFT: <a href=\"statistik.php?$ses&amp;mod=banned&amp;ref=$ref\">".$banned[0]."</a><br/>\n"; 
$fullignor = mysql_fetch_array(mysql_query ("Select count(id) from users where inv = '2'"));
echo "Полный Игнор: <a href=\"statistik.php?$ses&amp;mod=fullignor&amp;ref=$ref\">".$fullignor[0]."</a><br/>\n"; 
echo $divide;
$sadmins=mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM users where (level='8')&&(id!=10)"));
echo "Супер-Админoв: <a href=\"statistik.php?$ses&amp;mod=sysadmin&amp;ref=$ref\">".$sadmins[0]."</a><br/>\n";
$admins=mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM users where level='7'"));
echo "Админов: <a href=\"statistik.php?$ses&amp;mod=admins&amp;ref=$ref\">".$admins[0]."</a><br/>\n"; 
$smods=mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM users where level='6' "));
echo "Ст.модеров: <a href=\"statistik.php?$ses&amp;mod=smoders&amp;ref=$ref\">".$smods[0]."</a><br/>\n"; 
$mods=mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM users where level='5' "));
echo "Киллеров: <a href=\"statistik.php?$ses&amp;mod=moders&amp;ref=$ref\">".$mods[0]."</a><br/>\n"; 
$vips=mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM users where level='4' "));
echo "V.I.P.-ов: <a href=\"statistik.php?$ses&amp;mod=vips&amp;ref=$ref\">".$vips[0]."</a><br/>\n"; 
echo $divide;
echo "<a href=\"statistik.php?$ses&amp;mod=10post&amp;ref=$ref\">Самые болтливые чатовцы</a><br/>\n"; 
echo "<a href=\"statistik.php?$ses&amp;mod=galery&amp;ref=$ref\">Самые красивые чатовцы</a><br/>\n"; 
echo "<a href=\"statistik.php?$ses&amp;mod=10az&amp;ref=$ref\">Самые азартные чатовцы</a><br/>\n"; 
echo "<a href=\"statistik.php?$ses&amp;mod=10ym&amp;ref=$ref\">Самые умные чатовцы</a><br/>\n"; 
echo "<a href=\"statistik.php?$ses&amp;mod=10maf&amp;ref=$ref\">Элита преступного мира</a><br/>\n"; 
echo $divide;
echo "Сообщений в базе: <b>".$summa."</b><br/>\n";
$letters=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM zapiski "));
echo "Записок в базе: <b>".$letters[0]."</b><br/>\n";
$vopros=mysql_fetch_array(mysql_query("SELECT COUNT(number) FROM bots "));
echo "Вопросов в базе: <b>".$vopros[0]."</b><br/>\n";
$anekdots=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM anekdot "));
echo "Анекдотов в базе: <b>".$anekdots[0]."</b><br/>\n";
$shutki=mysql_fetch_array(mysql_query("SELECT COUNT(klu4) FROM shutki "));
echo "Шуток в базе: <b>".$shutki[0]."</b><br/>\n";
break;
}
echo $divide;
if ((isset($rm))&&($rm!="")&&(!isset($pwd))){
echo "<a href=\"chat.php?$ses&amp;rm=$rm&amp;ref=$ref\">&#8592; В чат</a><br/>\n";
}else{
if($mod) echo "<a href=\"statistik.php?$ses&amp;ref=$ref\">&#8592; Статистика</a><br/>\n";
}
echo "<a href=\"enter.php?$ses&amp;ref=$ref\">&#8592; Прихожая</a><br/>\n";
echo $fsize2;
if ($ver=="wml")echo "</p></card></wml>";
else echo "</div></body></html>";
mysql_close ($link);
?>