user_shifts fixed error with empty shifts table

main
Philip Häusler 13 years ago
parent a5c6ad4393
commit 8e35c721d7

@ -103,6 +103,8 @@ function user_shifts() {
} else {
$shifts = sql_select("SELECT * FROM `Shifts` ORDER BY `start`");
$days = array ();
$rooms = array ();
if (count($shifts) > 0) {
foreach ($shifts as $shift)
$days[] = date("Y-m-d", $shift['start']);
$days = array_unique($days);
@ -159,6 +161,7 @@ function user_shifts() {
if ($id != 0 || ($show_shift && $row_count++ < 15))
$shifts_table .= $shift_row . '</td></tr>';
}
}
return template_render('../templates/user_shifts.html', array (
'room_select' => make_room_select($rooms, $id, $day),

Loading…
Cancel
Save