|
|
@ -4,12 +4,21 @@
|
|
|
|
* Sign up for a shift.
|
|
|
|
* Sign up for a shift.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function shift_entry_add_controller() {
|
|
|
|
function shift_entry_add_controller() {
|
|
|
|
|
|
|
|
global $privileges, $user;
|
|
|
|
|
|
|
|
|
|
|
|
if (isset($_REQUEST['shift_id']) && preg_match("/^[0-9]*$/", $_REQUEST['shift_id'])) {
|
|
|
|
if (isset($_REQUEST['shift_id']) && preg_match("/^[0-9]*$/", $_REQUEST['shift_id'])) {
|
|
|
|
$shift_id = $_REQUEST['shift_id'];
|
|
|
|
$shift_id = $_REQUEST['shift_id'];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
redirect(page_link_to('user_shifts'));
|
|
|
|
redirect(page_link_to('user_shifts'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Locations laden
|
|
|
|
|
|
|
|
$rooms = sql_select("SELECT * FROM `Room` WHERE `show`='Y' ORDER BY `Name`");
|
|
|
|
|
|
|
|
$room_array = [];
|
|
|
|
|
|
|
|
foreach ($rooms as $room) {
|
|
|
|
|
|
|
|
$room_array[$room['RID']] = $room['Name'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$shift = Shift($shift_id);
|
|
|
|
$shift = Shift($shift_id);
|
|
|
|
$shift['Name'] = $room_array[$shift['RID']];
|
|
|
|
$shift['Name'] = $room_array[$shift['RID']];
|
|
|
|
if ($shift === false) {
|
|
|
|
if ($shift === false) {
|
|
|
|