<?php require_once('includes/requirecompere.inc.php'); $lctr_id=0+TGET('lctr_id'); $mb_id_owner=current_mb_id(); $timezone_bias_seconds=get_user_time_zone()*60; $DBConn->connect(true); $lecture=db_load_lecture_by_id($DBConn,$lctr_id); if ($lecture) $course=db_load_course_by_id($DBConn,$lecture['cs_id']); if (!$course || $mb_id_owner!=$course['mb_id_owner']) { redirect("./"); return; } $staff_ids=db_load_lecture_staff_ids($DBConn,$lctr_id); $staff=db_load_members($DBConn,$staff_ids); $classroom=db_load_classroom($DBConn,$lecture['clsr_id']); $seatcount=db_count_seats_of_lecture($DBConn,$lctr_id); $dataset+=array_key_prepend(split_datetime($lecture['lctr_since'],$timezone_bias_seconds),'since_'); $dataset+=array_key_prepend(split_datetime($lecture['lctr_expire'],$timezone_bias_seconds),'expire_'); $dataset+=$lecture; $dataset+=$course; $dataset+=$classroom; $dataset['ONDUTY']=$staff; $dataset['seatcount']=$seatcount; $dataset['SEAT-RESERVED']=$seatcount?array(0):array(); $dataset['CANCELLABLE']=datetime_to_seconds($lecture['lctr_expire'])>uniwits_time()?array(0):array(); ?>