engelsystem/includes/model/Shifts_model.php

26 lines
580 B
PHP
Raw Normal View History

2013-12-09 17:10:07 +01:00
<?php
/**
* Returns all shifts with needed angeltypes and count of subscribed jobs.
*/
function Shifts() {
$shifts_source = sql_select("
SELECT `Shifts`.*, `Room`.`RID`, `Room`.`Name` as `room_name`
FROM `Shifts`
JOIN `Room` ON `Room`.`RID` = `Shifts`.`RID`
");
if ($shifts_source === false)
return false;
foreach ($shifts_source as &$shift) {
$needed_angeltypes = NeededAngelTypes_by_shift($shift);
if ($needed_angeltypes === false)
return false;
2013-12-09 17:17:23 +01:00
2013-12-09 17:10:07 +01:00
$shift['angeltypes'] = $needed_angeltypes;
}
2013-12-09 17:17:23 +01:00
return $shifts_source;
2013-12-09 17:10:07 +01:00
}
?>