<?
include '../../config.php';
include '../../func.php';
head();
aut();


if ( isset($_GET['id']) ) {
    $id = num($_GET['id']);
    } else {
if ( empty($_SESSION['panel_user']) ) {
    
    header('Location: index.php');
    exit();
} else {
    $id = $_SESSION['panel_user'];
}

}

$us = mysql_fetch_assoc(mysql_query("SELECT * FROM `profile` WHERE `id` = '".$id."'"));
echo head . 'IP: '.$us['ip']. div;


$all = mysql_result(mysql_query("SELECT count(*) FROM profile WHERE `ip` = '".$us['ip']."'"), 0);

if($all){
$onpage = 10;
$allpage = ceil($all/$onpage);
$this_page = (isset($_GET['p'])) ? intval($_GET['p']) : 1 ;
if($this_page < 1 || $this_page > $allpage)$this_page = 1;
$start = $this_page*$onpage - $onpage;
$result = mysql_query("SELECT * FROM profile WHERE `ip` = '".$us['ip']."' order by id desc limit ".num($start).",".num($onpage)."");
while($user = mysql_fetch_assoc($result)){
    echo link2 . "<a href=\"../profile.php?id=".$user['id']."\">".$user['login']."</a> <b>".$us['ip']."</b> " . div;
}

echo link1 . '<b>Страницы:</b> ';
navigation($allpage,"ips.php?id=$us[id]&p={p}",1,1);
echo div;
}
        
navig();
foot();
?>