View file sdark.mobi/adm_root/amail3.php

File size: 3.74Kb
<?
require_once '../core/system.php';
echo admin();
if(isset($_GET['id'])){
$ank3 = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '".abs(intval($_GET['ank']))."' LIMIT 1"));
$ank = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '".abs(intval($_GET['id']))."' LIMIT 1"));
$header = "Почта / $ank3[nick]";
require_once '../core/head.php';
if($user['save']<1){ header('Location: /');}
echo "<div class='foot'><a  href='?id=$ank[id]&ank=$ank3[id]'><img src='/images/icon/reload.png'> Обновить</a>
<span class='float-right'><a href='/moduls/smiles'><img src='/images/icon/smiley.png'> Смайлики</a></span></div>";
$req = mysql_query("SELECT * from `ban` where `id_us` = ".abs(intval($_GET['ank']))." and `time`>'".time()."'");
$ban = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if(intval($_GET['ank'])==1 && $user['id'] != 11  && $user['prava']<5){header("Location: /"); exit;}
if(intval($_GET['ank'])==500  && $user['prava']<5){header("Location: /"); exit;}

$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `mail` WHERE `unlink` != ".abs(intval($_GET['ank']))." AND `id_user` = ".abs(intval($_GET['ank']))." AND `id_kont` = '$ank[id]' and `del_user`!=".abs(intval($_GET['ank']))." and `del_kont`!=".abs(intval($_GET['ank']))." OR `id_user` = '$ank[id]' and `del_user`!=".abs(intval($_GET['ank']))." and `del_kont`!=".abs(intval($_GET['ank']))." AND `id_kont` = ".abs(intval($_GET['ank']))." AND `unlink` != ".abs(intval($_GET['ank'])).""),0);

$k_page = k_page($k_post,10);
$page = page($k_page);
$start = 10*$page-10;
$q=mysql_query("SELECT * FROM `mail` WHERE `unlink` != ".abs(intval($_GET['ank']))." AND `id_user` = ".abs(intval($_GET['ank']))." AND `id_kont` = '$ank[id]'  and `del_user`!=".abs(intval($_GET['ank']))." and `del_kont`!=".abs(intval($_GET['ank']))." OR `id_user` = '$ank[id]' AND `id_kont` = ".abs(intval($_GET['ank']))." and `del_user`!=".abs(intval($_GET['ank']))." and `del_kont`!=".abs(intval($_GET['ank']))." AND `unlink` != ".abs(intval($_GET['ank']))." ORDER BY id DESC LIMIT $start, 10");
$erq=mysql_num_rows($q);
if($erq>0){
echo "<hr>";}
if($erq==0){echo "<hr><div class='player'>Нет сообщений</div>";}
while($post = mysql_fetch_array($q)) {
$ank2 = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $post[id_user] LIMIT 1"));
if($ank2['prava']=="5"){$status="<font color='ffc22b'>[A]</font>";$tcolor='F7990D';}
if($ank2['prava']=="4"){$status="<font color='ffc22b'>[a]</font>";$tcolor='EBC621';}
if($ank2['prava']=="3"){$status="<font color='ffc22b'>[M]</font>";}
if($ank2['prava']=="2"){$status="<font color='ffc22b'>[m]</font>";}
echo "<div class='player'>";
echo online($ank2['id']);
echo " <a href='/user/$ank2[id]/'><font color='$ank2[font]'>$ank2[nick]</font></a>";
if($ank2['prava']>=2){echo" $status";}
if($post['read'] == 1){
echo " <span class='float-right white'>".vremja($post['time'])."</span>";
echo "<br><span class='white'>".smiles($post['msg'])."</span><br>";
}else{
echo "<span class='float-right grey'>".vremja($post['time'])."</span>";
if ($ank2['prava'] >= 4){
echo "<br><font color='$tcolor'>".smiles($post['msg'])."</font><br>";}
else{echo "<br><span class='grey'>".smiles($post['msg'])."</span><br>";}
}

echo "</div>";
echo "<hr>";
}

if ($k_page>1)str('amail3?id='.intval($_GET['id']).'&ank='.abs(intval($_GET['ank'])).'&',$k_page,$page); // Вывод страниц
if($k_page>1)echo"<hr>";
echo"<div class='but-list'><a href='amail2?id=".abs(intval($_GET['ank']))."'><img src='/images/icon/mail.png'> Сообщения $ank3[nick]</a></div></div>";
echo"<div class='but-list'><a href='amail2?id=$ank[id]'><img src='/images/icon/mail.png'> Сообщения $ank[nick]</a></div></div>";
}
if(empty($_GET['id'])){header("Location: / ");}
require_once '../core/foot.php';
?>