<?
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/adm_check.php';
include_once '../../sys/inc/user.php';
$set['title']='wwe';
include_once '../../sys/inc/thead.php';
title();
err();
aut(); // надо уже знать, что это такое
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `mail`"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
echo "<div class='title'><center>Всего сообщений: $k_post </center></div>\n";
echo "<table class='post'>\n";
if ($k_post==0)
{
echo "   <tr>\n";
echo "  <td class='p_t'>\n";
echo "Нет сообщений\n";
echo "  </td>\n";
echo "   </tr>\n";
}
$q=mysql_query("SELECT * FROM `mail` ORDER BY id DESC LIMIT $start, $set[p_str]");

while ($post = mysql_fetch_assoc($q))
{
if ($post['id_user']==0)
{
$ank['id']=0;
$ank['pol']='mail';
$ank['level']=0;
}
else
$ank=get_user($post['id_user']);
$ank2=get_user($post['id_kont']);
//$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $post[id_user] LIMIT 1"));
echo "  <td class='p_t'>\n";
echo "От: <a href='/info.php?id=$ank[id]'>$ank[nick]</a>".online($ank['id'])."</a>\n";
echo "К: <a href='/info.php?id=$ank2[id]'>$ank2[nick]</a>".online($ank2['id'])."</a><br />\n";
echo "(Отправленно:".vremja($post['time']).")\n";
if ($post['read']==0)echo "<b><font color='red'>(не прочитано)</font></b><br />\n";
echo "  </td>\n";
echo "   </tr>\n";
echo "   <tr>\n";
if ($set['set_show_icon']==1)echo "  <td class='p_m' colspan='2'>\n"; else echo "  <td class='p_m'>\n";
echo output_text($post['msg'])."<br />\n";
echo "  </td>\n";
echo "   </tr>\n";
}
echo "</table>\n";
if ($k_page>1)str('?',$k_page,$page); // Вывод страниц


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