<?php
define('MTOP', 1);
$title = 'Статистика';
require_once ('system/connect.php');
require_once ('system/core.php');
require_once ('system/function.php');
require_once ('head.php');
$plaforms_moder = mysql_num_rows(mysql_query("SELECT * FROM `sait` WHERE `status` = '0' AND `ban` = '0'"));
$plaforms_ban = mysql_num_rows(mysql_query("SELECT * FROM `sait` WHERE `ban` = '1'"));
$plaforms_all = mysql_num_rows(mysql_query("SELECT * FROM `sait`"));
$users_all = mysql_num_rows(mysql_query("SELECT * FROM `users`"));
$cat_all = mysql_num_rows(mysql_query("SELECT * FROM `cat`"));
$saits = mysql_query("SELECT * FROM `sait` ORDER BY `id`");
while($sait = mysql_fetch_array($saits)){
$day_host = $day_host + $sait['hosts'];
$day_hit = $day_hit + $sait['hits'];
$yday_host = $yday_host  + $sait['hosts2'];
$yday_hit = $yday_hit + $sait['hits2'];
$all_host = $all_host + $sait['all_hosts'];
$all_hit = $all_hit + $sait['all_hits'];
$day_in = $day_in + $sait['in'];
$day_out = $day_out + $sait['out'];
$yday_in = $yday_in + $sait['in2'];
$yday_out = $yday_out + $sait['out2'];
$all_in = $all_in + $sait['all_in'];
$all_out = $all_out + $sait['all_out'];
}
$online = mysql_num_rows(mysql_query("SELECT * FROM `sait_online`"));
echo '<div class="title2">Общее</div>
<div class="main">Всего пользователей: <b>'.$users_all.'</b><br/>
Всего площадок: <b>'.$plaforms_all.'</b><br/>
Всего категорий: <b>'.$cat_all.'</b></br>
Заблокированных: <b>'.$plaforms_ban.'</b><br/>
<a href="/m/online_statistic.php" title="yamus"><u>Онлайн</u></a> на всех сайтах: <a><b><font color="#00cc00">'.$online.'</font></b></a><br /></div>';
echo '<div class="orange">ЗА СЕГОДНЯ</div>
<div class="main">Хостов: <b>'.$day_host.'</b><br/>
Хитов: <b>'.$day_hit.'</b><br/>
В топ: <b>'.$day_in.'</b><br/>
Из топа: <b>'.$day_out.'</b></div>
<div class="orange">ЗА ВЧЕРА</div>
<div class="main">Хостов: <b>'.$yday_host.'</b><br/>
Хитов: <b>'.$yday_hit.'</b><br/>
В топ: <b>'.$yday_in.'</b><br/>
Из топа: <b>'.$yday_out.'</b></div>
<div class="orange">ЗА МЕСЯЦ</div>
<div class="main">Хостов: <b>'.$all_host.'</b><br/>
Хитов: <b>'.$all_hit.'</b><br/>
В топ: <b>'.$all_in.'</b><br/>
Из топа: <b>'.$all_out.'</b></div>';
##
$new_sait = mysql_query("SELECT * FROM `".$prefix."sait` WHERE `status` = '1' AND `ban` = '0' ORDER BY `id` DESC LIMIT 1");
$new_sait_check = mysql_num_rows($new_sait);
$nsait = mysql_fetch_array($new_sait);
$new = ($new_sait_check > 0)  ? '<a href = "http://'.$set['home'].'/infos.php?id='.$nsait['id'].'">'.$nsait['url'].'</a>' : 'Нет';
echo '<div class="topni"><center><b>Последний добавленный сайт: '.$new.'</b></center></div>';
##
require_once ('foot.php');
?>