Файл: top/24h.php
Строк: 44
<?php
// by -=ШАХТЕР=- (waphp.ru - качай только тут)
include 'config.php';
//---------------------------------------------------------------
//---------------------------------------------------------------
$title='Статистика';
include_once 'head.php';
echo "".$div1."Статистика</div>";
// ------------------------------ вывод статистики пользователя ---------------------
//проверка ввода id
if (empty($_GET['uid']))
{
echo "<b>Ошибка!</b>";
print ''.$div4.'<a href="'.$rating_url.'index.php">'.$site_name.'</a> <img src="img/gt.gif" alt=">" /> Статистика</div>';
include "foot_code.php";
exit;
}
$uid=(int)check($_GET['uid']);
// проверка существования учетной записи
$result = mysql_query("SELECT * FROM top_users WHERE uid=$uid");
$row=mysql_fetch_array($result);
if (empty($row))
{
echo "<b>Ошибка!</b>";
print ''.$div4.'<a href="'.$rating_url.'index.php">'.$sname.'</a> <img src="img/gt.gif" alt=">" /> Статистика</div>';
include "foot_code.php";
exit;
}
$act = check($_GET['act']);
$site_names = esc2($row['site_name']);
$link = esc2($row['link']);
$admin = esc2($row['admin']);
$info = esc2($row['info']);
//----------------------- Место в топе---------------------------
$result = mysql_query("SELECT * FROM `weeks` WHERE `host` >= $host_today AND `date`=$today ORDER BY `host` DESC;");
@$top_place = mysql_num_rows($result);
$page = ceil($top_place/$count_top);
// текущий час, и дата
$temp_hour = date("H");;
$temp_date = date("Ymd");;
$result = mysql_query("SELECT * FROM count_24 WHERE date=$temp_date AND uid = $uid");
echo "<br /><p><div class="ifield">Статистика за неделю:</div>";
// Выводим заголовок таблицы:
echo "<table border="1" width="30%" bgcolor="#e5e5e5">";
echo "<tr><td>Дата</td><td>Хосты</td><td>Хиты</td></tr>";
// Выводим таблицу:
$week_day = date("w");
for ($c=0; $c<mysql_num_rows($result); $c++)
{
echo "<tr>";
$f = mysql_fetch_array($result);
$date=strtr($f['hour'],array('0'=>'01:00 - 01:59','1'=>'01:00 - 01:59','2'=>'02:00 - 02:59','3'=>'03:00 - 03:59','4'=>'04:00 - 04:59','5'=>'05:00 - 05:59','6'=>'06:00 - 06:59','7'=>'07:00 - 07:59','8'=>'08:00 - 08:59','9'=>'09:00 - 09:59','10'=>'10:00 - 10:59','11'=>'11:00 - 11:59','12'=>'12:00 - 12:59','13'=>'13:00 - 13:59','14'=>'14:00 - 14:59','15'=>'15:00 - 15:59','16'=>'16:00 - 16:59','17'=>'17:00 - 17:59','18'=>'18:00 - 18:59','19'=>'19:00 - 19:59','20'=>'20:00 - 20:59','21'=>'21:00 - 21:59','22'=>'22:00 - 22:59','23'=>'23:00 - 23:59'));
echo "<td>$date</td><td>$f[host]</td><td>$f[count]</td></tr>";
}
$result0 = mysql_query("SELECT sum(count),sum(host) FROM count_24 WHERE date=$temp_date AND uid = $uid");
$row=mysql_fetch_row($result0);
$all_hits = (int)$row[0];
$all_hosts = (int)$row[1];
echo "<td><b>Всего</b></td><td><b>$all_hosts</b></td><td><b>$all_hits</b></td></tr>";
echo "<td><b>В среднем</b></td><td><b>".round($all_hosts/mysql_num_rows($result))."</b></td><td><b>".round($all_hits/mysql_num_rows($result))."</b></td></tr>";
echo "</table></p>";
echo "<b>График</b><br/>";
echo "<img src="graphic_24.php?uid=$uid" alt="24 часа" /> <br/>";
echo "<br /><a href='stat.php?uid=$uid'>Статистика</a><br/>";
print ''.$div4.'<a href="'.$rating_url.'index.php">'.$site_name.'</a> <img src="img/gt.gif" alt=">" /> <a href="index.php?p='.$page.'">'.$link.'</a> <img src="img/gt.gif" alt=">" /> Статистика</div>';
include "foot_code.php";
?>