<?php
//*********************/
//Скрипт переписан админом
//http://waufon.ru  Кот      *  Проги для компа и мобил
//Помогал админ
//http://pfc.h2m.ru/ КОСМОС  * Посети непожалееш
//всю эту срань господнюю
//перехуяривали на дыры
//http://rus-waphost.ru/ Nitrix * Супер хост без висов
/*********************/
require( "inc/conf.inc.php" );
require( "inc/check.php" );
echo "<title>Статистика</title>";
echo "<style type=\"text/css\">";
echo "body { font-size: {$fs}; color: {$tcol}; background-color: {$bcol}; text-align: center }";
echo "a:link,a:visited { text-decoration: underline; color: {$lcol} }";
echo "div { border-style:solid; border-width: 1px; background-color: {$rcol} }";
echo "</style>";
echo "</head>";
echo "<body>";
switch ( $mod )
{
case "a0":
echo "<div>Поддержка:<br/>---<br/>";
$r = mysql_query( "select id, login,posts from users where level = 9 order by posts desc ;" );
while ( $a = mysql_fetch_array( $r ) )
{
++$i;
echo "<b>{$i}</b>.<a href=\"user.php?id={$id}&amp;pass={$pass}&amp;dbid={$a['id']}\">{$a['login']}</a> \r({$a['posts']})<br/>";
}
echo "</div>";
break;
case "a1" :
echo "<div>Главные админы чата:<br/>---<br/>";
$r = mysql_query( "select id, login,posts from users where level = 8 order by posts desc ;" );
while ( $a = mysql_fetch_array( $r ) )
{
++$i;
echo "<b>{$i}</b>.<a href=\"user.php?id={$id}&amp;pass={$pass}&amp;dbid={$a['id']}\">{$a['login']}</a>\r({$a['posts']})<br/>";
}
echo "</div>";
break;
case "a2" :
echo "<div>Админы чата:<br/>---<br/>";
$r = mysql_query( "select id, login,posts from users where level=7 order by posts desc ;" );
while ( $a = mysql_fetch_array( $r ) )
{
++$i;
echo "<b>{$i}</b>.<a href=\"user.php?id={$id}&amp;pass={$pass}&amp;dbid={$a['id']}\">{$a['login']}</a>\r({$a['posts']})<br/>";
}
echo "</div>";
break;
case "a3" :
echo "<div>Наши высшие модеры:<br/>---<br/>";
$r = mysql_query( "select id, login,posts from users where level=6 order by posts desc ;" );
while ( $a = mysql_fetch_array( $r ) )
{
++$i;
echo "<b>{$i}</b>.<a href=\"user.php?id={$id}&amp;pass={$pass}&amp;dbid={$a['id']}\">{$a['login']}</a>\r({$a['posts']})<br/>";
}
echo "</div>";
break;
case "a4" :
echo "<div>Наши модеры:<br/>---<br/>";
$r = mysql_query( "select id, login,posts from users where level=5 order by posts desc ;" );
while ( $a = mysql_fetch_array( $r ) )
{
++$i;
echo "<b>{$i}</b>.<a href=\"user.php?id={$id}&amp;pass={$pass}&amp;dbid={$a['id']}\">{$a['login']}</a>\r({$a['posts']})<br/>";
}
echo "</div>";
break;
case "a5" :
echo "<div>Важные персоны :)<br/>---<br/>";
$r = mysql_query( "select id, login,posts from users where level=4 order by posts desc ;" );
while ( $a = mysql_fetch_array( $r ) )
{
++$i;
echo "<b>{$i}</b>.<a href=\"user.php?id={$id}&amp;pass={$pass}&amp;dbid={$a['id']}\">{$a['login']}</a>\r({$a['posts']})<br/>";
}
echo "</div>";
break;
case "a6" :
echo "<div>Десятка самых разговорчивых:<br/>---<br/>";
$r = @mysql_query( "select id, login,posts from users where posts>0 order by posts desc limit 10;" );
while ( $a = mysql_fetch_array( $r ) )
{
++$i;
echo "<b>{$i}</b>.<a href=\"user.php?id={$id}&amp;pass={$pass}&amp;dbid={$a['id']}\">{$a['login']}</a>\r({$a['posts']})<br/>";
}
echo "</div>";
break;
case "a7" :
echo "<div>Десятка самых умных:<br/>---<br/>";
$r = @mysql_query( "select id, login,vposts from users where vposts>0 order by vposts desc limit 10;" );
while ( $a = mysql_fetch_array( $r ) )
{
++$i;
echo "<b>{$i}</b>.<a href=\"user.php?id={$id}&amp;pass={$pass}&amp;dbid={$a['id']}\">{$a['login']}</a>\r({$a['vposts']})<br/>";
}
echo "</div>";
break;
case "a8" :
echo "<div>Десятка Богатых :)<br/>---<br/>";
$r = @mysql_query( "select id, login,credits,id from users where credits>0 order by credits desc limit 10;" );
while ( $a = mysql_fetch_array( $r ) )
{
++$i;
echo "<b>{$i}</b>.<a href=\"user.php?id={$id}&amp;pass={$pass}&amp;dbid={$a['id']}\">{$a['login']}</a>\r({$a['credits']})<br/>";
}
echo "</div>";
break;
case "a9" :
$curdate = date( "Y-m-d" );
$r = mysql_query( "SELECT id, login from users WHERE regdate = '".$curdate."' order by id desc limit 10" );
if ( mysql_num_rows( $r ) == 0 )
{
echo "<div>Сегодня нет новеньких.</div>";
}
else
{
echo "<div>Реги за сегодня:<br/>---<br/>";
while ( $a = mysql_fetch_array( $r ) )
{
echo "<b><a href=\"user.php?id={$id}&amp;pass={$pass}&amp;dbid={$a['id']}\">{$a['login']}</a></b><br/>";
}
echo "</div>";
}
break;
case "a10" :
echo "<div>Жители нашего городка:</div>";
$max = 10;
$p = intval( $p );
$page = $p * $max;
if ( $s < 0 )
{
$s = 0;
}
$r = mysql_query( "select id,login from users order by id desc limit {$page},{$max};" );
$i = mysql_num_rows( $r );
while ( $a = mysql_fetch_array( $r ) )
{
echo "<b><a href=\"user.php?id={$id}&amp;pass={$pass}&amp;dbid={$a['id']}\">{$a['login']}</a></b><br/>";
}
echo "---<br/>";
if ( 0 < $p )
{
print ( "<a href=\"stats.php?id={$id}&amp;pass={$pass}&amp;mod={$mod}&amp;p=".( $p - 1 ) )."\">&#171;назад</a>\r";
}
if ( $max <= $i )
{
print ( "<a href=\"stats.php?id={$id}&amp;pass={$pass}&amp;mod={$mod}&amp;p=".( $p + 1 ) )."\">дальше&#187;</a>";
}
echo "<br/>---";
break;
default :
$level = $row['level'];
$q = mysql_query( "select id from users" );
$allu = mysql_num_rows( $q );
$q1 = mysql_query( "select id from users where sex='1'" );
$cmans = mysql_num_rows( $q1 );
$q2 = mysql_query( "select id from users where sex='2'" );
$cwomans = mysql_num_rows( $q2 );
$curdate = date( "Y-m-d" );
$q3 = mysql_query( "SELECT id from users WHERE regdate = '{$curdate}'" );
$cnt = mysql_num_rows( $q3 );
$curdata = date( "Y-m-d" );
$q4 = mysql_query( "SELECT id from users WHERE bdata = '{$curdata}'" );
$cntr = mysql_num_rows( $q4 );
$data = file( "data/stats.dat" );
$ex = explode( "|", $data[0] );
$mline = $ex[0];
$mdata = date( "d. m. Y", $ex[1] );
$mtime = date( "H:i", $ex[1] );
echo "<div>Зарегистировано <b>";
echo "<a href=\"stats.php?id={$id}&amp;pass={$pass}&amp;mod=a10\">{$allu}</a>";
echo "</b> пользователей<br/>";
echo "из них <b>{$cmans}</b> парней и <b>{$cwomans}</b> девушек.<br/>";
echo "У <b>".( $allu - ( $cmans + $cwomans ) )."</b> неудалось определить пол.<br/>";
echo "Рекорд посещаемости в <b>{$mline}</b> человек был зарегистрирован <b>{$mdata}</b> в <b>{$mtime}</b>.<br/>";
echo "Сегодня зарегистрировалось\r";
echo "<a href=\"stats.php?id={$id}&amp;pass={$pass}&amp;mod=a9\">{$cnt}</a>\r";
echo "человек.</div>";
if (8< $level )
	{
echo "<br/><div><a href=\"stats.php?id={$id}&amp;pass={$pass}&amp;mod=a0\"><b>Поддержка</b></a></div>";
	}
echo "<br/><div><a href=\"stats.php?id={$id}&amp;pass={$pass}&amp;mod=a1\">Главные админы</a>";
echo "<br/>---<br/>";
echo "<a href=\"stats.php?id={$id}&amp;pass={$pass}&amp;mod=a2\">Админы</a><br/>";
echo "<a href=\"stats.php?id={$id}&amp;pass={$pass}&amp;mod=a3\">Высшие модеры</a><br/>";
echo "<a href=\"stats.php?id={$id}&amp;pass={$pass}&amp;mod=a4\">Модеры</a><br/>";
echo "<a href=\"stats.php?id={$id}&amp;pass={$pass}&amp;mod=a5\">V.I.P.</a>";
echo "<br/>---<br/>";
echo "<a href=\"stats.php?id={$id}&amp;pass={$pass}&amp;mod=a6\">Топ</a><br/>";
echo "<a href=\"stats.php?id={$id}&amp;pass={$pass}&amp;mod=a7\">Знатоки</a><br/>";
echo "<a href=\"stats.php?id={$id}&amp;pass={$pass}&amp;mod=a8\">Игроки</a><br/>";
echo "<a href=\"bdate.php?id={$id}&amp;pass={$pass}&amp;mod=a1\">АмЯнИнНиКи</a><br/>";
$b1 = mysql_query( "select count(*) as num from users where ban = 1;" );
$b2 = mysql_fetch_array( $b1 );
$b3 = $b2['num'];
$k1 = mysql_query( "select count(*) as num from users where kick > '".time( )."';" );
$k2 = mysql_fetch_array( $k1 );
$k3 = $k2['num'];
echo "<br/>---<br/>";
echo "<b><a href=\"blacklist.php?id={$id}&amp;pass={$pass}&amp;ref={$ref}\">Доска позора</a></b> [{$b3}/{$k3}]";
echo "<br/>---<br/>";
echo "</div><br/>";
break;
}
if ( isset( $mod ) )
{
echo "<br/><a href=\"stats.php?id={$id}&amp;pass={$pass}&amp;ref={$ref}\">Статистика</a><br/>";
}
echo "<a href=\"enter.php?id={$id}&amp;pass={$pass}&amp;ref={$ref}\">Прихожая</a><br/>";
$end = gettime( );
echo "<p align=\"center\">[".round( $end - $mystart, 5 )."]</p>";
echo "<p>{$ip}</p>";
require("inc/coper.php");
echo "</body></html>";
mysql_close( $link );
?>