test for existing shifts

This commit is contained in:
Philip Häusler 2014-03-26 18:51:34 +01:00
parent dc7a56f422
commit cf20bc1c29
1 changed files with 6 additions and 0 deletions

View File

@ -296,6 +296,12 @@ function view_user_shifts() {
$ical_shifts = array(); $ical_shifts = array();
$days = sql_select_single_col("SELECT DISTINCT DATE(FROM_UNIXTIME(`start`)) AS `id`, DATE(FROM_UNIXTIME(`start`)) AS `name` FROM `Shifts` ORDER BY `start`"); $days = sql_select_single_col("SELECT DISTINCT DATE(FROM_UNIXTIME(`start`)) AS `id`, DATE(FROM_UNIXTIME(`start`)) AS `name` FROM `Shifts` ORDER BY `start`");
if (count($days) == 0) {
error(_("The administration has not configured any shifts yet."));
redirect('?');
}
$rooms = sql_select("SELECT `RID` AS `id`, `Name` AS `name` FROM `Room` WHERE `show`='Y' ORDER BY `Name`"); $rooms = sql_select("SELECT `RID` AS `id`, `Name` AS `name` FROM `Room` WHERE `show`='Y' ORDER BY `Name`");
if (count($rooms) == 0) { if (count($rooms) == 0) {