From 2d0b2542c9af24a9ec4dd05010bc554010151e61 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Sat, 29 Dec 2012 14:41:09 +0100 Subject: a few fixes and polishes in myshifts, shifts and menu --- includes/pages/user_myshifts.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'includes/pages/user_myshifts.php') diff --git a/includes/pages/user_myshifts.php b/includes/pages/user_myshifts.php index 007a1681..caa92cce 100644 --- a/includes/pages/user_myshifts.php +++ b/includes/pages/user_myshifts.php @@ -71,6 +71,7 @@ function user_myshifts() { $shifts = sql_select("SELECT * FROM `ShiftEntry` JOIN `Shifts` ON (`ShiftEntry`.`SID` = `Shifts`.`SID`) JOIN `Room` ON (`Shifts`.`RID` = `Room`.`RID`) WHERE `UID`=" . sql_escape($shifts_user['UID']) . " ORDER BY `start`"); $html = ""; + $timesum = 0; foreach ($shifts as $shift) { if (time() > $shift['end']) $html .= ''; @@ -91,6 +92,7 @@ function user_myshifts() { $shift_entries[] = $user_source['Nick']; } $html .= join(", ", $shift_entries); + $timesum += ($shift['end'] - $shift['start']) / (60*60); } $html .= ''; @@ -109,6 +111,7 @@ function user_myshifts() { return msg().template_render('../templates/user_myshifts.html', array ( 'intro' => sprintf(Get_Text('pub_myshifts_intro'), $LETZTES_AUSTRAGEN), 'shifts' => $html, + 'time_sum' => $timesum, 'msg' => $msg, 'ical_text' => sprintf(Get_Text('inc_schicht_ical_text'), page_link_to_absolute('ical') . '&key=' . $shifts_user['ical_key'], -- cgit v1.2.3-70-g09d2