checkPermissions('ofice-stompjes', 'RO', true)) { echo 'error 401 unauthorized'; exit; } # Page functions # JS Scripts to load for this page $jsScriptLoadData['delete_confirmation'] = true; $jsScriptLoadData['stompjes'] = true; $jsScriptLoadData['datatables'] = true; $jsScriptLoadData['multiFilterSelect'] = true; $jsScriptLoadData['datepicker'] = true; # PageClasses Setup # Retrieve Information for the page $stmt = $GLOBALS['conn']->query("SELECT user_uuid, user_full_name, user_first_name, user_profile_picture_thumbnail, user_stompable, user_email FROM vc_users WHERE user_stompable = '1'"); $administrators = []; while ($row = $stmt->fetch_assoc()) { $administrators[$row['user_uuid']] = $row; $administrators[$row['user_uuid']]['amount'] = 0; } if (!isset($_GET['fd'])) { $SelectFromDate = strtotime(date('Y-m-01')); } else { $date = str_replace('/', '-', htmlspecialchars($_GET['fd'], ENT_QUOTES, 'UTF-8')); $SelectFromDate = strtotime($date . ' 00:00:00'); } if (!isset($_GET['td'])) { $SelectTillDate = time(); } else { $date = str_replace('/', '-', htmlspecialchars($_GET['td'], ENT_QUOTES, 'UTF-8')); $SelectTillDate = strtotime($date . ' 23:59:59'); } $stompjes = array(); $stmt = $GLOBALS['conn']->query("SELECT stomp_uuid, office_stompjes.user_uuid, user_full_name, user_first_name, stomp_timestamp FROM office_stompjes INNER JOIN vc_users ON office_stompjes.user_uuid = vc_users.user_uuid WHERE stomp_timestamp BETWEEN '$SelectFromDate' AND '$SelectTillDate' AND user_stompable = '1' ORDER BY stomp_timestamp DESC"); while ($row = $stmt->fetch_assoc()) { array_push($stompjes, $row); $administrators[$row['user_uuid']]['amount']++; } # Start page output ?>