Файл: adm_panel/jurnal_system.php
Строк: 151
<?
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';
user_access('system_jurnal',null,'/'.SID);
adm_check();
$set['title'] = lang('Системный журнал');
include_once H.'sys/inc/thead.php';
title();
aut();
unset($_SESSION['spam_count']);
$count_jurnal = count::query("jurnal_system", "`read` = '0' ");
$count_foto = count::query("jurnal_system", "`read` = '0' and `type`='spam_foto'");
$count_forum = count::query("jurnal_system", "`read` = '0' and `type`='spam_forum'");
$count_chat = count::query("jurnal_system", "`read` = '0' and `type`='spam_chat'");
$count_system = count::query("jurnal_system", "`read` = '0' and `type`='system'");
$count_vedro = count::query("jurnal_system", "`read` = '1'");
$count_profile = count::query("jurnal_system", "`read` = '0' and `type`='spam_profile'");
$count_files = count::query("jurnal_system", "`read` = '0' and `type`='spam_files'");
$count_spam_mail = count::query("jurnal_system", "`read` = '0' and `type`='spam_mail'");
echo '
<div class="p_m">
<a href="?type_jurnal=spam_forum">'.lang('Жалоба на форуме').' ['.$count_forum.']</a> ::
<a href="?type_jurnal=spam_chat">'.lang('Жалоба в чате').' ['.$count_chat.']</a> ::
<a href="?type_jurnal=spam_files">'.lang('Жалоба на файл').' ['.$count_files.']</a> ::
<a href="?type_jurnal=spam_mail">'.lang('Жалоба в почте').'. ['.$count_spam_mail.']</a> <br/>
</div>
<div class="p_m">
<a href="?type_jurnal=spam_profile">'.lang('Жалоба на анкету').' ['.$count_profile.']</a> ::
<a href="?type_jurnal=spam_foto">'.lang('Жалоба на фото').'. ['.$count_foto.']</a> <br/>
</div>
<div class="p_m">
<a href="?type_jurnal=system">'.lang('Системные').' ['.$count_system.']</a> ::
<a href="?old">'.lang('Корзина').' ['.$count_vedro.']</a> :: <a href="?">'.lang('На модерации').'['.$count_jurnal.']</a>
</div>
';
if (isset($_GET['read']))
{
query("UPDATE `jurnal_system` SET `read` = '1' where id = ".intval($_GET['read']));
$_SESSION['message'] = lang('Успешно проверено');
exit(header('Location: ?'));
}
if (isset($_GET['read_sytem']) and $user['level'] > 2)
{
query("UPDATE `jurnal_system` SET `read` = '1' WHERE `type` = 'system'");
$_SESSION['message'] = lang('Системные сообщения отмечены как прочитанные');
exit(header('Location: ?'));
}
if (isset($_GET['old']))
{
echo '
<div class="msg">'.lang('Корзина журнала - в ней хранятся старые оповещения или отмеченные модератором как проверенные').'
<br/>'.lang('Удаляются раз в 30 дней автоматически').'
.
</div>
';
$k_post=@mysql_result(mysql_query("SELECT COUNT(*) FROM `jurnal_system` where `read` = '1'"),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="p_m">
<a href="?">'.lang('Выход из корзины').'</a>
</div>
';
if ($k_post == 0) msg(lang('Корзина пуста!'));
$jurnal_sql=mysql_query("SELECT * FROM `jurnal_system` where `read` = '1' ORDER BY id DESC LIMIT $start, $set[p_str]");
while ($row = @mysql_fetch_array($jurnal_sql))
{
echo "<div class='p_m'>
<span class='' style='float:right;'>".vremja($row['time'])." </span><br/>
<div class='status_o_s'> </div>
<div class='status_o'> ".output_text($row['msg'])." </div>
</div>";
}
if ($k_page > 1)str("?old&",$k_page,$page); // Вывод страниц
}
if (!isset($_GET['old']))
{
if (isset($_GET['type_jurnal']))
$types=" where `type` = '".my_esc($_GET['type_jurnal'])."' and `read` = '0' ";
else
$types = " where `read` = '0' ";
$k_post=@mysql_result(query("SELECT COUNT(*) FROM `jurnal_system` $types "),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
if (isset($_GET['type_jurnal']) and $_GET['type_jurnal'] == 'system' and $user['level'] > 2 and $count_system > 0)
echo "<div class='p_m'>[<a href='?read_sytem'>".lang('Отметить все')."</a>]</div>";
if ($k_post==0)msg('Пусто');
$jurnal_sql=query("SELECT * FROM `jurnal_system` $types ORDER BY id DESC LIMIT $start, $set[p_str]");
while ($row = @mysql_fetch_array($jurnal_sql))
{
echo "<div class='p_m'><span class='' style='float:right;'>".vremja($row['time'])." </span><br/>
<div class='status_o_s'> </div>
<div class='status_o'> ".output_text($row['msg'])." </div>
<br/>
<a href='?read=$row[id]'><span class='ank_span_m' style='color:green;'>".lang('Проверенно')."</span></a>
<br/></div>";
}
if (@$_GET['type_jurnal'] != null)
$type_p = "?type_jurnal=".my_esc(@$_GET['type_jurnal'])."&";
else
$type_p = "?";
if ($k_page > 1)str($type_p,$k_page,$page); // Вывод страниц
}
include_once H.'sys/inc/tfoot.php';
?>