summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2012-12-28 23:38:31 +0100
committerPhilip Häusler <msquare@notrademark.de>2012-12-28 23:38:31 +0100
commit1867c884848b85c5766c7d2cbc30b353356d00a9 (patch)
tree70ce0b7c8ab1ee082f7a33290f7a98aeda6c959b /includes
parent263edf58f2751fbd042d71a1e786f6b203e3f71a (diff)
more stats
Diffstat (limited to 'includes')
-rw-r--r--includes/pages/guest_stats.php3
1 files changed, 3 insertions, 0 deletions
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.")));