<?php require_once('includes/requirecompere.inc.php'); $lctr_id=0+TGET('lctr_id'); $op=TGET('op'); $mb_id_cur=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']); else { redirect("./"); return; } $team=db_load_team($DBConn,$mb_id_cur,array('VALID')); $all_ids=array_projection($team,'mb_id_member'); if ($mb_id_cur!=$course['mb_id_owner'] && !in_array($mb_id_cur,$all_ids)) { redirect("./"); return; } $assigned_ids=db_load_lecture_staff_ids($DBConn,$lctr_id); $comperes=db_load_comperes($DBConn,$all_ids); $avail_ids=db_filter_for_available_compere( $DBConn, $all_ids, $lecture['cs_id'], $lecture['lctr_since'], $lecture['lctr_expire'] ); $dataset+=$lecture; $dataset+=$course; $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['ONDUTY']=array(); $dataset['AVAIL']=array(); foreach ($comperes as $compere) { if (in_array($compere['mb_id'],$assigned_ids)) array_push($dataset['ONDUTY'],$compere); else if (in_array($compere['mb_id'],$avail_ids)) array_push($dataset['AVAIL'],$compere); } $dataset['ERROR-NOSTAFF']=$dataset['ONDUTY']?array():array(0); $dataset['AVAIL-NONE']=$dataset['AVAIL']?array():array(0); $dataset['AVAIL-EXIST']=$dataset['AVAIL']?array(0):array(); $dataset['LECTURE-ADDED']=$op=='lecture-added'?array(0):array(); ?>