Файл: archive_01122016_1136/public_html/admin/onl.php
Строк: 69
<?php
include ("../conf.php");
include ("../lock.php");
include ("../functions.php");
include ("../head.php");
if ($user == $myrow["user"] && $pass == $myrow["pass"] && $user != '')
{
bann($user);
$num = 10;
$page = $_GET['page'];
$result00 = mysql_query("SELECT COUNT(*) FROM `guests` WHERE `time` > '".(time() - 600)."'");
$temp = mysql_fetch_array($result00);
$posts = $temp[0];
$total = (($posts - 1) / $num) + 1;
$total = intval($total);
$page = intval($page);
if(empty($page) or $page < 0) $page = 1;
if($page > $total) $page = $total;
$start = $page * $num - $num;
$r = mysql_query("select * from guests where `time` > '".(time() - 600)."' order by id desc limit $start, $num",$db);
if (mysql_num_rows($r))
{
while ($myrow2 = mysql_fetch_array($r))
{
echo '<div class="nav">
<span class="ank_n">Посл. посещение:</span> <span class="ank_d">'.date("d.m.Y H:i", $myrow2['time']).'</span><br />
<span class="ank_n">Переходов:</span> <span class="ank_d">'.htmlspecialchars(trim($myrow2['refresh'])).'</span><br />
<span class="ank_n">UA:</span> <span class="ank_d">'.htmlspecialchars(trim($myrow2['ua'])).'</span><br />
<span class="ank_n">IP:</span> <span class="ank_d">'.$myrow2['ip'].'</span><br />';
if (!empty($myrow2['ref'])) echo '<span class="ank_n">URL:</span> <span class="ank_d"><a href="'.htmlspecialchars(trim($myrow2['ref'])).'">'.htmlspecialchars(trim($myrow2['ref'])).'</a></span><br />';
echo '</div>';
}
echo '<div class="nav">';
if ($page != 1) echo "<a href=online.php?user=$user&pass=$pass&page=".($page - 1).">Назад</a>";
if ($page != $total) echo " <a href=online.php?user=$user&pass=$pass&page=".($page + 1).">Далее</a>";
echo '</div>';
echo "<a href=/menu.php?user=$user&pass=$pass>В меню</a>";
include ("../foot.php");
exit();
}
else
{
echo "<div class='nav'>";
echo "Нет некого в гостях!<br />";
echo "</div>";
echo "<a href=/menu.php?user=$user&pass=$pass>В меню</a>";
include ("../foot.php");
exit();
}
echo "<a href=/menu.php?user=$user&pass=$pass>В меню</a>";
include ("../foot.php");
exit();
}
else
{
echo "<div class='nav'>";
echo "Ошибка! <br />Неверный <b>Ник</b> или <b>Пароль</b>!<br />";
echo "</div>";
echo <<<sss
<a href="/index.php">На главную</a>
sss;
include ("../foot.php");
}
?>