Файл: statistika.php
Строк: 86
<?php
///////////////////////////////////////
// //
// Автор скрипта: maxim529 //
// Email: kaznet@spaces.ru //
// ICQ: 632360940 //
// //
///////////////////////////////////////
define('MKTOP', 1);
$title = 'Статистика';
require_once ('system/connect.php');
require_once ('system/core.php');
require_once ('system/function.php');
require_once ('head.php');
$plaforms_no_moder = mysql_num_rows(mysql_query("SELECT * FROM `sait` WHERE `status` = '0'"));
$plaforms_moder = mysql_num_rows(mysql_query("SELECT * FROM `sait` WHERE `status` = '1'"));
$plaforms_ban = mysql_num_rows(mysql_query("SELECT * FROM `sait` WHERE `ban` = '1'"));
$plaforms_all = mysql_num_rows(mysql_query("SELECT * FROM `sait`"));
$plaforms_moder = $plaforms_moder - $plaforms_ban;
$users_all = mysql_num_rows(mysql_query("SELECT * FROM `users`"));
$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`"));
$new_sait = mysql_query("SELECT * FROM `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);
echo '<div class="links">Всего пользователей: '.$users_all.'<br/>
Всего площадок: '.$plaforms_all.'<br/>
Активных площадок: '.$plaforms_moder.'<br/>
Неактивных площадок: '.$plaforms_no_moder.'<br/>
Заблокированных площадок: '.$plaforms_ban.'</div>
<div class="title">Статистика на сегодня:</div>
<table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr><td class="links">Хосты</td><td class="links">Хиты</td><td class="links">В топ</td><td class="links">Из топа</td></tr>
<tr><td class="links">'.$day_host.'</td><td class="links">'.$day_hit.'</td><td class="links">'.$day_in.'</td><td class="links">'.$day_out.'</td></tr></table>
<div class="title">Статистика на вчера:</div>
<table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr><td class="links">Хосты</td><td class="links">Хиты</td><td class="links">В топ</td><td class="links">Из топа</td></tr>
<tr><td class="links">'.$yday_host.'</td><td class="links">'.$yday_hit.'</td><td class="links">'.$yday_in.'</td><td class="links">'.$yday_out.'</td></tr></table>
<div class="title">Общая статистика:</div>
<table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr><td class="links">Хосты</td><td class="links">Хиты</td><td class="links">В топ</td><td class="links">Из топа</td></tr>
<tr><td class="links">'.$all_host.'</td><td class="links">'.$all_hit.'</td><td class="links">'.$all_in.'</td><td class="links">'.$all_out.'</td></tr></table>
<div class="links">Сейчас онлайн на сайтах: '.$online.'</div>';
if($new_sait_check > 0) echo '<a class="link" href = "/infos.php?id='.$nsait['id'].'">Последний добавленый сайт: '.$nsait['url'].'</a>';
require_once ('foot.php');
?>