-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin_queue.php
38 lines (26 loc) · 1.37 KB
/
admin_queue.php
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
37
38
<?php
require_once dirname(__FILE__).'/libs/config.php';
_require_login();
if(!_check_permission('super_admin')){
header('Location: /');
exit;
}
$user = _get_user_array();
$queue = null;
$queue_executed = null;
$limit = 20;
if(
!empty($_GET['limit']) &&
intval($_GET['limit']) > 0 &&
intval($_GET['limit']) <= 10000
){
$limit = intval($_GET['limit']);
}
$db->queryall('SELECT q.*, CONCAT(u.name, IF(g.id IS NOT NULL, CONCAT(\' (Guest \',g.id,\')\'), \'\')) as name, u.username FROM action_queue q INNER JOIN users u ON u.id = q.user_id LEFT JOIN guests g on q.guest_id = g.id WHERE q.executed=1 '.(!empty($_GET['user_id']) && intval($_GET['user_id']) ? ' AND u.id = '.intval($_GET['user_id']) : '').' ORDER BY q.time_start DESC LIMIT #', $queue_executed, '', $limit);
$db->queryall('SELECT q.*, CONCAT(u.name, IF(g.id IS NOT NULL, CONCAT(\' (Guest \',g.id,\')\'), \'\')) as name, u.username FROM action_queue q INNER JOIN users u ON u.id = q.user_id LEFT JOIN guests g on q.guest_id = g.id WHERE q.executed=0 '.(!empty($_GET['user_id']) && intval($_GET['user_id']) ? ' AND u.id = '.intval($_GET['user_id']) : '').' ORDER BY q.time_start ASC LIMIT #', $queue, '', $limit);
$smarty->assign('queue', $queue);
$smarty->assign('queue_executed', $queue_executed);
$smarty->assign('user', $user);
$smarty->assign('permissions', _get_permissions());
$smarty->display('admin_queue.tpl');
?>