From 86a38a3372557bd72db309e7b24b4a4a95544397 Mon Sep 17 00:00:00 2001 From: msquare Date: Fri, 29 Dec 2017 17:19:27 +0100 Subject: add user work log entries feature --- includes/pages/admin_active.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'includes/pages/admin_active.php') diff --git a/includes/pages/admin_active.php b/includes/pages/admin_active.php index 576cdc49..18553159 100644 --- a/includes/pages/admin_active.php +++ b/includes/pages/admin_active.php @@ -58,7 +58,9 @@ function admin_active() SELECT `User`.*, COUNT(`ShiftEntry`.`id`) AS `shift_count`, - %s AS `shift_length` + (%s + ( + SELECT SUM(`work_hours`) * 3600 FROM `UserWorkLog` WHERE `user_id`=`User`.`UID` + )) AS `shift_length` FROM `User` LEFT JOIN `ShiftEntry` ON `User`.`UID` = `ShiftEntry`.`UID` LEFT JOIN `Shifts` ON `ShiftEntry`.`SID` = `Shifts`.`SID` @@ -140,7 +142,9 @@ function admin_active() SELECT `User`.*, COUNT(`ShiftEntry`.`id`) AS `shift_count`, - %s AS `shift_length` + (%s + ( + SELECT SUM(`work_hours`) * 3600 FROM `UserWorkLog` WHERE `user_id`=`User`.`UID` + )) AS `shift_length` FROM `User` LEFT JOIN `ShiftEntry` ON `User`.`UID` = `ShiftEntry`.`UID` LEFT JOIN `Shifts` ON `ShiftEntry`.`SID` = `Shifts`.`SID` ' . ($show_all_shifts ? '' : 'AND (`Shifts`.`end` < ' . time() . " OR `Shifts`.`end` IS NULL)") . ' -- cgit v1.2.3-54-g00ecf