From 1867c884848b85c5766c7d2cbc30b353356d00a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20H=C3=A4usler?= Date: Fri, 28 Dec 2012 23:38:31 +0100 Subject: [PATCH] more stats --- includes/pages/guest_stats.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/pages/guest_stats.php b/includes/pages/guest_stats.php index 8d96bbbf..80df246b 100644 --- a/includes/pages/guest_stats.php +++ b/includes/pages/guest_stats.php @@ -19,6 +19,9 @@ function guest_stats() { $done_shifts_seconds += $done_shift['end'] - $done_shift['start']; $stats['done_work_hours'] = round($done_shifts_seconds / (60*60), 0); + $users_in_action_source = sql_select("SELECT `Shifts`.`start`, `Shifts`.`end` FROM `ShiftEntry` JOIN `Shifts` ON `Shifts`.`SID`=`ShiftEntry`.`SID` WHERE `Shifts`.`start` < " . time() . " AND `Shifts`.`end` > " . time()); + $stats['users_in_action'] = count($users_in_action_source); + header("Content-Type: application/json"); die(json_encode($stats)); } else die(json_encode(array('error' => "Wrong api_key.")));