<?
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';

if (isset($user))$ank['id']=$user['id'];
if (isset($_GET['id']))$ank['id']=intval($_GET['id']);
$ank=get_user($ank[id]);

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

include_once '../sys/inc/thead.php';
title();
err();


echo "<div class='mytitle'>";
echo "".online($ank['id'])." <a href='/info.php?id=$ank[id]'>$ank[nick]</a><br/>Статусы\n";
echo "</div>\n";
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `dnev` WHERE `id_user` = '$ank[id]'"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
echo "<table class='post'>\n";
$lim=" LIMIT $start, $set[p_str]";
$q=mysql_query("SELECT * FROM `dnev` WHERE `id_user` = '$ank[id]' ORDER BY `time` DESC  $lim");
if (mysql_num_rows($q)==0) 
{
echo "У $ank[nick] нет записей\n";
}
while ($dnev = mysql_fetch_assoc($q))
{
//echo "   <tr>\n";

echo "<div class='hello'>";
echo "<a href='dnev.php?id=$dnev[id]'>$dnev[name]</a> \n";
	echo "</div>\n";
	echo "<div class='statuskomm'>";
	
	echo "<img src='/style/icons/bubl.png' alt='' class='icon'/> <font color='#8b8a87'> ".mysql_result(mysql_query("SELECT COUNT(*) FROM `dnev_kom` WHERE `id_dnev` = '$dnev[id]'"),0)." - <img src='/style/icons/clss.png' alt='' class='icon'/> $dnev[rating] чел -</font> <img src='/style/icons/clock.png' alt='' class='icon'/> <font color='#8b8a87'>".vremja($dnev[time])."</font>\n";
	echo "</div>\n";
echo "<div class='linechat'></div>";
}
echo "</table>\n";

if ($k_page>1)str('?id='.$ank['id'].'&amp;',$k_page,$page); // Вывод страниц

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