<?php
include '../inc/db.php';
include '../inc/1.php';
if (($user['moder']==0) && ($user['admin']==0)){header("Location: /index.php");
exit;}
if (!$_GET['id']){
header("Location: /index.php");
exit;}
$id=intval($_GET['id']);
echo "<div class='t2'>Лог</div>";
if (!$_GET['p'])$_GET['p']=1;
$page=intval($_GET['p']);
$start=($page*15-15);
$q=mysql_query("SELECT * FROM `log` WHERE `user` = '$id' ORDER BY `id` DESC LIMIT $start, 15");
$b=1;
while ($f=mysql_fetch_assoc($q)){
$p=($b%2);
$ank=gus($f['user']);
echo "<div class='p$p'>".im($f['user'])." <a href='/ank.php?id=$f[user]'>$ank[name]</a>: $f[text]<br>*Событие: ".vremja($f['time'])."</div>";
$b++;
}
$q1=(mysql_num_rows(mysql_query("SELECT * FROM `log` WHERE `user` = '$id'"))/15);
$q2=round(mysql_num_rows(mysql_query("SELECT * FROM `log` WHERE `user` = '$id'"))/15);
if ($q1>$q2)$pages=($q2+1);
else
$pages=$q2;
pages($pages, $page, "?id=$id&p");
include '../inc/foot.php';
?>