Просмотр файла sdark.mobi/adm_root/anote.php

Размер файла: 3.11Kb
<?
require_once '../core/system.php';
if (isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '".intval($_GET['id'])."'"),0) == true){
$ank = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id`  = '".intval($_GET['id'])."'"));
}
if($user['prava'] < 3) {
header("Location: /");
exit;
}
$header = "Блокнот";
require_once '../core/head.php';
echo "<div class='foot'><a  href='?id=".$ank['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>";

$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `note` WHERE `id_user` = '$ank[id]'"),0);
$k_page = k_page($k_post,10);
$page = page($k_page);
$start = 10*$page-10;
$q=mysql_query("SELECT * FROM `note` WHERE  `id_user` = '$ank[id]'  ORDER BY id DESC LIMIT $start, 10");
echo "<div class='line'></div>";
if(isset($_GET['del'])) {
$id_chmsg = intval($_GET['id']);
$mmm = mysql_fetch_array(mysql_query("SELECT * FROM `note` WHERE `id` = '".abs(intval($_GET['id']))."' and `id_user`='$ank[id]'"));
if(intval($_GET['id'])!=$mmm['id']){header('Location: ?');
$_SESSION['err']  =  'Запись не найдена';}else{
$del_chat_msg = mysql_query("DELETE FROM `note` WHERE `id` = '".$id_chmsg."'");
$_SESSION['message'] = 'Запись удалена!';
 header("Location: ?"); }}
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']=="3"){$status="<font color='ffc22b'>[m]</font>";}
echo "<div class='news'><a style='border-left: 1px solid #2C2C2C;' class='news-close' href='?del&id=$post[id]'></a><div class='note foot' style='padding: 5px'>";
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='white'> ".vremja($post['time'])."</span>";
echo "<br><span class='white'>".smiles($post['msg'])."</span><br>";
}else{
echo "<span class='grey'> ".vremja($post['time'])."</span> <a href='?edit&id=$post[id]'>(Изм.)</a>";
if ($ank2['prava'] >= 4){
echo "<br><font color='$tcolor'>".smiles($post['msg'])."</font><br></div></div><div class='line'></div>";}
else{echo "<br><span class='grey'>".smiles(antimat($post['msg']))."</span><br></div></div><div class='line'></div>";}
}

echo "</div>";
}
$req = mysql_query("SELECT * FROM `note` WHERE `id_user` = '$ank[id]'");
$note=mysql_num_rows($req);
echo"<div class='mli center''><div class='empty2'></div><img src='/images/icon/st.png' width=12 height=12> Количество записей ($note/20)<div class='empty2'></div></div>
";
if($note>=10)echo"<div class='line'></div>";

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


require_once '../core/foot.php';
?>