From b864f2c5b166e2fb883db9a4dd42b47c8c5ab9e2 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Thu, 29 Dec 2011 14:58:50 +0100 Subject: cleanup old unused files, display tshirt size in admin_active --- includes/pages/admin_active.php | 3 +++ includes/pages/user_shifts.php | 21 ++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) (limited to 'includes') diff --git a/includes/pages/admin_active.php b/includes/pages/admin_active.php index 48d163b1..55384345 100644 --- a/includes/pages/admin_active.php +++ b/includes/pages/admin_active.php @@ -1,5 +1,7 @@ '; $table .= '' . $usr['Nick'] . ''; + $table .= '' . $tshirt_sizes[$usr['Size']] . ''; $table .= '' . $usr['shift_count'] . ''; if ($usr['shift_count'] == 0) diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index eac6cd6f..8120a6c4 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -277,9 +277,9 @@ function view_user_shifts() { ); $shifts = sql_select("SELECT `Shifts`.*, `Room`.`Name` as `room_name` FROM `Shifts` JOIN `Room` USING (`RID`) - WHERE `Shifts`.`RID` IN (" . implode(',', $_SESSION['user_shifts']['rooms']) . ") - AND DATE(FROM_UNIXTIME(`start`)) IN ('" . implode("','", $_SESSION['user_shifts']['days']) . "') - ORDER BY `start`"); + WHERE `Shifts`.`RID` IN (" . implode(',', $_SESSION['user_shifts']['rooms']) . ") + AND DATE(FROM_UNIXTIME(`start`)) IN ('" . implode("','", $_SESSION['user_shifts']['days']) . "') + ORDER BY `start`"); $shifts_table = ""; $row_count = 0; @@ -290,27 +290,26 @@ function view_user_shifts() { $info[] = date("H:i", $shift['start']) . ' - ' . date("H:i", $shift['end']); if (count($_SESSION['user_shifts']['rooms']) > 1) $info[] = $shift['room_name']; - $shift_row = '' . join('
', $info) . ''; $shift_row .= '' . $shift['name']; - //$shift_row = '' . date(($_SESSION['user_shifts']['id'] == 0 ? "Y-m-d " : "") . "H:i", $shift['start']) . ' - ' . date("H:i", $shift['end']) . '' . $shift['name']; + if (in_array('admin_shifts', $privileges)) $shift_row .= ' [edit] [x]'; $shift_row .= '
'; $is_free = false; $shift_has_special_needs = 0 < sql_num_query("SELECT `id` FROM `NeededAngelTypes` WHERE `shift_id` = " . $shift['SID']); $query = "SELECT * - FROM `NeededAngelTypes` - JOIN `AngelTypes` - ON (`NeededAngelTypes`.`angel_type_id` = `AngelTypes`.`id`) - WHERE "; + FROM `NeededAngelTypes` + JOIN `AngelTypes` + ON (`NeededAngelTypes`.`angel_type_id` = `AngelTypes`.`id`) + WHERE "; if ($shift_has_special_needs) $query .= "`shift_id` = " . sql_escape($shift['SID']); else $query .= "`room_id` = " . sql_escape($shift['RID']); $query .= " AND `count` > 0 - AND `angel_type_id` IN (" . implode(',', $_SESSION['user_shifts']['types']) . ") - ORDER BY `AngelTypes`.`name`"; + AND `angel_type_id` IN (" . implode(',', $_SESSION['user_shifts']['types']) . ") + ORDER BY `AngelTypes`.`name`"; $angeltypes = sql_select($query); if (count($angeltypes) > 0) { -- cgit v1.2.3-70-g09d2