more stats

This commit is contained in:
Philip Häusler 2012-12-28 23:38:31 +01:00
parent 263edf58f2
commit 1867c88484
1 changed files with 3 additions and 0 deletions

View File

@ -19,6 +19,9 @@ function guest_stats() {
$done_shifts_seconds += $done_shift['end'] - $done_shift['start']; $done_shifts_seconds += $done_shift['end'] - $done_shift['start'];
$stats['done_work_hours'] = round($done_shifts_seconds / (60*60), 0); $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"); header("Content-Type: application/json");
die(json_encode($stats)); die(json_encode($stats));
} else die(json_encode(array('error' => "Wrong api_key."))); } else die(json_encode(array('error' => "Wrong api_key.")));