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


$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'];
$lim=" LIMIT $start, $set[p_str]";
$q=mysql_query("SELECT * FROM `dnev` WHERE `id_user` = '$ank[id]' ORDER BY `time` DESC  LIMIT 1");

while ($dnev = mysql_fetch_assoc($q))
{
$dnev_us_k=mysql_result(mysql_query("SELECT COUNT(*) FROM `dnev` WHERE `id_user` = '$ank[id]'"),0);
echo "<div class='statuskomm'>";
echo "<img src='/style/icons/bubl.png' alt='' class='icon'/> <a href='dnev/dnev.php?id=$dnev[id]'><font color='#6c6c6f'><u>".mysql_result(mysql_query("SELECT COUNT(*) FROM `dnev_kom` WHERE `id_dnev` = '$dnev[id]'"),0)."</a></u></font> - \n";
echo "<img src='/style/icons/clss.png' alt='' class='icon'/>\n";
if (isset($user) && $user['id']!=$ank['id'] && $user['balls']>=0 && $user['rating']>=0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `status_rating` WHERE `id_user` = '$user[id]' AND `id_status` = '$dnev[id]'"), 0)==0)
if (isset($user) && $user['id']!=$dnev_avt['id'])echo " <a href=\"dnev/dnev.php?id=$dnev[id]&amp;rating=up\" title=\"Поставить класс\"><font color='#6c6c6f'><u>Класс!</u></font></a> \n";
echo "<font color='#6c6c6f'><u> $dnev[rating] чел</u></font>\n";
echo "- <a href='/dnev/dnev_list.php?id=$ank[id]'><font color='#6c6c6f'><u>Статусы</u> $dnev_us_k</font></a> <br/>\n";
echo "</div>\n";
}
?>