<?php

////////////////////////////////////////
////// Логи администрации
////// by Akimitsu, 2011
////////////////////////////////////////

include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';

$set['title']='Логи администрации';

include_once '../sys/inc/thead.php';

title();
err();
aut();

if(isset($user)){

if ($user['level']!= 2<4){echo'Данная страница недоступна для вас!';}else{

$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `akimitsu_admlogs`"),0);

$onpage=10;
$k_page=k_page($k_post,$onpage);
$page=page($k_page);
$start=$onpage*$page-$onpage;

if ($k_post == 0)
{
	echo 'Логов администрации не обнаружено!';
}

$q = mysql_query("SELECT * FROM `akimitsu_admlogs` ORDER BY `id` DESC LIMIT $start, $onpage");

while($row=mysql_fetch_assoc($q)){

$un = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id`= '".$row['my_uid']."' LIMIT 1"));

$un2 = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id`= '".$row['go_uid']."' LIMIT 1"));

echo '<b>Кто:</b> <a href="/info.php?id='.$row['my_uid'].'">'.$un['nick'].'</a><br/><b>Кому:</b> <a href="/info.php?id='.$row['go_uid'].'">'.$un2['nick'].'</a><br/><b>Тип:</b> '.$row['type'].'<br/><b>Описание:</b> '.$row['msg'].'<br/><b>Дата:</b> '.vremja($row['date']).'<hr/>';
};
if ($k_page>1)str('?&amp;',$k_page,$page);
};
}else{
echo '<div class="msg">Данная страница доступна только для авторизованых пользователей!</div>';
};

include_once '../sys/inc/tfoot.php';
?>