$shift=sql_select("SELECT `ShiftEntry`.`Comment`, `Shifts`.*, `Room`.`Name`, `AngelTypes`.`Name` as `angel_type` FROM `ShiftEntry` JOIN `AngelTypes` ON (`ShiftEntry`.`TID` = `AngelTypes`.`TID`) JOIN `Shifts` ON (`ShiftEntry`.`SID` = `Shifts`.`SID`) JOIN `Room` ON (`Shifts`.`RID` = `Room`.`RID`) WHERE `id`=".sql_escape($id)." AND `UID`=".sql_escape($user['UID'])." LIMIT 1");
if(count($shift)>0){
$shift=$shift[0];
if(isset($_REQUEST['submit'])){
$comment=strip_request_item_nl('comment');
sql_query("UPDATE `ShiftEntry` SET `Comment`='".sql_escape($comment)."' WHERE `id`=".sql_escape($id)." LIMIT 1");
$shifts=sql_select("SELECT * FROM `ShiftEntry` JOIN `Shifts` ON (`ShiftEntry`.`SID` = `Shifts`.`SID`) JOIN `Room` ON (`Shifts`.`RID` = `Room`.`RID`) WHERE `UID`=".sql_escape($user['UID'])." ORDER BY `start`");
$html='<tr><td>Keine...</td><td></td><td></td><td></td><td></td><td>Gehe zum <a href="'.page_link_to('user_shifts').'">Schichtplan</a> um Dich für Schichten einzutragen.</td></tr>';