Просмотр файла statistik.php

Размер файла: 4.02Kb
<?php
include_once("incs/conf.php");
include_once("incs/fmysql.php");
include_once("incs/fnc.php");
include_once("incs/head.php");

$act=fil($_GET['act']);

$ban_ok=$user[ban]-$time;
if($ban_ok>0){
head("Статистика",$meuser,$auth);
echo "<div class='rowup'>";
include_once("incs/title.php");
echo "Статистика</div>";

echo "Вы забанены по причине:<br>";
echo "<b>$user[ban_prich]</b><br>";
echo "До окончания бана осталось: $ban_ok сек.<br>";
echo "Старайтесь больше не нарушать <a href=\"rules.php\">правила</a> сайта!<br>";
include_once("incs/down.php");
}

if($settings[statistik]==1){
head("Статистика",$meuser,$auth);
echo "<div class='rowup'>";
include_once("incs/title.php");
echo "Статистика</div>";

echo "Раздел закрыт<br>";
include_once("incs/down.php");}

switch($act){

case'kto_gde':

head("Статистика - Кто где?",$meuser,$auth);
echo "<div class='rowup'>";
include_once("incs/title.php");
echo "<a href=\"statistik.php\">Статистика</a> - Кто где?</div>";

echo "<b>В чате:</b><br>";
$gde_user_ch = mysql_num_rows(mysql_query("SELECT `id` FROM `user` WHERE `gde` = 'chat' AND `time_gde` > '".($time-180)."'"));
if($gde_user_ch==0){echo "В чате никого нет<br>";}

$gde_chat=mysql_query("SELECT * FROM `user` WHERE `gde` = 'chat' AND `time_gde` > '".($time-180)."'");
while ($gde_chat_us = mysql_fetch_array($gde_chat))
{
echo "<div class='menu'><a href=\"my.php?id=$gde_chat_us[id]\">$gde_chat_us[nick]</a></div>";
}

echo "<b>В форуме:</b><br>";
$gde_user_fo = mysql_num_rows(mysql_query("SELECT `id` FROM `user` WHERE `gde` = 'forum' AND `time_gde` > '".($time-180)."'"));
if($gde_user_fo==0){echo "В форуме никого нет<br>";}

$gde_forum=mysql_query("SELECT * FROM `user` WHERE `gde` = 'forum' AND `time_gde` > '".($time-180)."'");
while ($gde_forum_us = mysql_fetch_array($gde_forum))
{
echo "<div class='menu'><a href=\"my.php?id=$gde_forum_us[id]\">$gde_forum_us[nick]</a></div>";
}

echo "<b>В обменнике:</b><br>";
$gde_user_obm = mysql_num_rows(mysql_query("SELECT `id` FROM `user` WHERE `gde` = 'obmen' AND `time_gde` > '".($time-180)."'"));
if($gde_user_obm==0){echo "В обменнике никого нет<br>";}

$gde_obmen=mysql_query("SELECT * FROM `user` WHERE `gde` = 'obmen' AND `time_gde` > '".($time-180)."'");
while ($gde_obmen_us = mysql_fetch_array($gde_obmen))
{
echo "<div class='menu'><a href=\"my.php?id=$gde_obmen_us[id]\">$gde_obmen_us[nick]</a></div>";
}

echo "<b>В библиотеке:</b><br>";
$gde_user_lib = mysql_num_rows(mysql_query("SELECT `id` FROM `user` WHERE `gde` = 'lib' AND `time_gde` > '".($time-180)."'"));
if($gde_user_lib==0){echo "В библиотеке никого нет<br>";}

$gde_lib=mysql_query("SELECT * FROM `user` WHERE `gde` = 'lib' AND `time_gde` > '".($time-180)."'");
while ($gde_lib_us = mysql_fetch_array($gde_lib))
{
echo "<div class='menu'><a href=\"my.php?id=$gde_lib_us[id]\">$gde_lib_us[nick]</a></div>";
}

include_once("incs/down.php");
break;

}

head("Статистика",$meuser,$auth);
echo "<div class='rowup'>";
include_once("incs/title.php");
echo "Статистика</div>";

$us = mysql_num_rows(mysql_query("SELECT id FROM user"));
$ma = mysql_num_rows(mysql_query("SELECT id FROM mail"));
$qv = mysql_num_rows(mysql_query("SELECT id FROM qv"));
$ch = mysql_num_rows(mysql_query("SELECT id FROM chat_post"));
$fo = mysql_num_rows(mysql_query("SELECT id FROM forum_post"));
$time_user_24h=$time-24*3600;
$user_24h = mysql_num_rows(mysql_query("SELECT id FROM `user` WHERE `date_last` > '$time_user_24h'"));
$obmen_files = mysql_num_rows(mysql_query("SELECT id FROM `obmen` WHERE `id_user` != '0' AND `mod` = '1'"));

echo "Посетителей онлайн за 24 часа: <b>$user_24h</b><br>";
echo "Пользователей зарегистрировано: <b>$us</b><br>";
echo "Сообщений в почте: <b>$ma</b><br>";
echo "Сообщений в гостевой: <b>$qv</b><br>";
echo "Сообщений в чате: <b>$ch</b><br>";
echo "Сообщений в форуме: <b>$fo</b><br>";
echo "Файлов в обменнике: <b>$obmen_files</b><br>";

echo "<div class=\"menu\"><a href=\"statistik.php?act=kto_gde\">Кто где?</a></div>";

include_once("incs/down.php");
?>