<?php
session_name("SESID");
session_start();
include ('../verh.php');
if($_SESSION['pass']!=$adminpass) {exit;}
$id=@$_REQUEST['id'];
$p=@intval($_GET['p']);
$res=mysql_query("SELECT *, DATE_FORMAT(date, '%d.%m.%y') AS date FROM inet_in WHERE id_site='$id' AND ip!='' ORDER BY date DESC LIMIT $p,$limit");
$ldate="";
while ($a=mysql_fetch_array($res)) {
if ($a['date']!=$ldate) {
echo "<b>$a[date]</b><br/>";
$ldate=$a['date'];
}
echo "$a[ip]<br/>";
}
$next = $p+$limit;
$prev = $p-$limit;
if ($p>0) {
echo "<a href=\"ip.php?p=$prev&id=$id\">Назад</a>";
}
list($c)=mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM inet_in WHERE id_site='$id' AND ip!=''"));
if ($p+$limit<$c) {
echo " <a href=\"ip.php?p=$next&id=$id\">Далее</a>";
}
echo "<a href=\"apanel.php\">Админка</a><br/>";
include ('../niz.php');
?>