Файл: mail.php
Строк: 28
<?
include_once 'system/sys.php';
include 'system/funcs.php';
if(!$cms->us['id']){
header('location: /');
exit;
}
verh('Почта','Меню');
$num = 10;
$posts = DB::$dbs->querySingle("SELECT count(id) FROM `poch` where `us` = ?",array($cms->us['id']));
if($posts==0){echo'<div class="list1">Контактов нет...</div>';}else{
$total = intval(($posts - 1) / $num) + 1;
$page = $func->num($_GET['page']);
if(empty($page) or $page < 0) $page = 1;
if($page > $total) $page = $total;
$start = $page * $num - $num;
$mails = DB::$dbs->query("SELECT * from `poch` where `us` = ? order by `last` desc limit $start,$num",array($cms->us['id']));
while($mail = $mails -> fetch()){
echo'<div class="lst">'.$func->uNick($mail['kem']).' [<a href="/msg'.$mail['kem'].'">диалог</a>] [<b>'.DB::$dbs->querySingle("SELECT count(id) from `msg` where `us` = ? and `kem` = ? and `see` = ?",array($cms->us['id'],$mail['kem'],1)).'</b>/'.DB::$dbs->querySingle("SELECT count(id) from `msg` where `us` = ? and `kem` = ? or `kem` = ? and `us` = ?",array($cms->us['id'],$mail['kem'],$cms->us['id'],$mail['kem'])).'] ['.t($mail['last']).'] </div>';
}
echo '<div class="list1">';
$func->page('?');
echo '</div><div class="list1"><a href="/search.php">Поиск контакта</a></div>
<div class="list1"><a href="/ignor.php">Игнор-лист</a></div>';
}
niz();
?>