Файл: _modules/admin/log/index.php
Строк: 54
<?php
# mark core v1.0
# author Drk in
# date 24.10.19
# core
require_once ( $_SERVER['DOCUMENT_ROOT']."/_core/system.php" );
# admin
system::adm(1);
# get
$s = isset( $_GET['s'] ) ? system::abs($_GET['s']): 0; # type
$c = isset( $_GET['c'] ) ? system::abs($_GET['c']): 0; # clear
# GET clear log
if ($c == 1):
$CK = system::check($_GET['CK']);
if ($user['admin'] == 1):
if ($CK == $user['CK']):
DB :: $dbh -> query("TRUNCATE admin_log");
foreach (glob(cache.'_admin_log/*') as $file):
@unlink($file);
endforeach;
send::admin_log($user['id'],'Очистил лог действий','0');
system::header('?','Успешно',1);
# error
else: system::header('?', 'Ошибка, возможно вам подкинули эту ссылку'); endif;
else: system::header('?', 'Ошибка, возможно вам подкинули эту ссылку'); endif;
endif;
# meta
$title = 'Лог :: '.domain;
# head
require_once ( head );
echo '
<div class="fights fights-about">
<a href ="?">Все</a> | <a href="?s=1">Чат</a>
</div>';
if ($s > 0) $thing = "WHERE type = {$s}";
if ($s == 0)$thing = null;
$cn = DB :: $dbh -> querySingle("SELECT count(id) FROM admin_log {$thing}");
if ($cn == 0)echo '<div class="dialog"><h1 class="pda">КПК</h1><p>› Cписок действий пуст<br></p></div>';
$page = new page($cn);
$limit = $cn > $page -> elements ? $page -> limit : null;
$query = DB :: $dbh -> query("SELECT id FROM admin_log {$thing} ORDER BY time DESC {$limit}");
while ($act = $query -> fetch()):
$act = cache_admin_log::get($act['id']);
$data = cache_user::get($act['user']);
echo '
<div class="dialog">
<div style="padding-right: 7px;float: left;margin-top: 5px;">
'.user::min_ava($data['ava']).'
</div><div style="overflow: hidden;">
<h1 class="chat">'.user::chat($act['user']).'</h1></div>
<div style="padding-top: 34px;text-align: left;">
<div style="color: #747987;margin: 2px 3px;word-wrap: break-word;">› <font color="#ffffff">'.system::text($act['mess']).'</font></div></div>
<div style="padding-top: 4px;text-align: left;">
<div class ="small" style="margin: 2px 3px;word-wrap: break-word;">› '.system::time($act['time']).'</div>
</div>
</div>
';
endwhile;
$page -> get('?');
echo '
<div class="fights-link" style="margin: 5px"><a href="?c=1&CK='.$user['CK'].'">Очистить лог</a></div>
<div class="fights-link" style="margin: 5px"><a href="/admin">Вернуться назад</a></div>
<div class="line"></div>';
# foot
require_once ( foot );
?>