php include system sys php include system funcs php if isset us header

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
include '../system/sys.php';
include '../system/funcs.php';
if (!isset ($us)) {
header ('location: /');
exit;
}
if ($us['level']<1) {
header ('location: /adm_panel/');
exit;
}
H('Модерация файлов');
$id = isset($_GET['id']) ? abs(intval($_GET['id'])) : false;
if (isset($_GET['ok'])) {
$f = DB::$dbs->queryFetch("SELECT * FROM zc_f where id = ? limit 1",array($id));
if ($_GET['ok'] == 'da') {
DB :: $dbs -> query ("UPDATE `zc_f` SET `dop`='da' WHERE (`id`='" . $f['id'] . "')");
DB :: $dbs -> query ("INSERT INTO `action` (`value`,`t`,`us`) VALUES ('Ваш [url=/zc/file" . $f['id'] . "]файл[/url] успешно прошел модерацию!', '" . time () . "', '" . $f['us'] . "')");
}
elseif ($_GET['ok'] == 'net') {
DB :: $dbs -> query ("UPDATE `zc_f` SET `dop`='net' WHERE (`id`='" . $f['id'] . "')");
DB :: $dbs -> query ("INSERT INTO `action` (`value`,`t`,`us`) VALUES ('Ваш файл не прошел модерацию!', '" . time () . "', '" . $f['us'] . "')");
}
header('location:?');
die();
}
$count = DB::$dbs->querySingle("SELECT COUNT(*) from zc_f WHERE dop = '' ");
if ($count==0) {
echo '<div class="list">Файлов на модерации нет</div>';
}
$array = DB::$dbs->query("SELECT * FROM zc_f WHERE dop = '' ORDER BY time DESC");
while($arr = $array->fetch()) {
echo '<div class="list1"><a href="/zc/file'.$arr['id'].'">'.$arr['name'].'</a> ('.datef($arr['time']).')<br/>[<a href="zc_mod.php?id='.$arr['id'].'?ok=da">Принять</a> / <a href="zc_mod.php?id='.$arr['id'].'?ok=net">Не принимать</a>]</div>';
}
F();
?>