<?php require_once('includes/courseinfo.inc.php'); require_once('includes/options.inc.php'); require_once('includes/reservation.inc.php'); require_once('includes/question.inc.php'); $CMD_TMPL_NAME='reserve.lecture'; $lctr_id=0+TREQUEST('lctr_id'); $plc_clsr_id=TREQUEST('plc_clsr_id'); $optc=TREQUEST('optc'); $message=TREQUEST('message'); if ($plc_clsr_id) list($plc_id,$clsr_id)=explode(',',$plc_clsr_id); else { $clsr_id=TREQUEST('clsr_id'); $plc_id=TREQUEST('plc_id'); } $mb_id=current_mb_id(); $timezone_bias_seconds=get_user_time_zone()*60; if (!$lctr_id && $_SESSION['reserv.inputcache.domain']=='reserve.lecture') $inputdata=$_SESSION['reserv.inputcache.data']; else $inputdata=array('lctr_id'=>$lctr_id,'plc_id'=>$plc_id,'clsr_id'=>$clsr_id,'optc'=>$optc,'message'=>$message); $DBConn->connect(true); $lecture=db_load_lecture_by_id($DBConn,$inputdata['lctr_id']); if (!$lecture || !$inputdata['clsr_id'] || !$inputdata['plc_id']) { redirect("./"); return; } $course=db_load_course_by_id($DBConn,$lecture['cs_id']); if (!db_is_compere_qualified($DBConn,$course['mb_id_owner'])) { redirect("./"); return; } if (!questionnaire_reserve_guide($DBConn,$lecture['cs_id'],array('redirect'=>true))) return; $USE_THEME_BY_USER_ID=$course['mb_id_owner']; $_SESSION['reserv.inputcache.domain']='reserve.lecture'; $_SESSION['reserv.inputcache.data']=$inputdata; $_SESSION['reserv.inputcache.errorareas']=array(); $dataset['REVISE-LINK']=array(0); $dataset+=prepare_lecture_reserve_dataset($DBConn,$lecture,$course,false,false,$inputdata,array('selected_o_ids_only'=>true,'check_options_min'=>true)); $reservation_count=db_count_reservations_of_compere($DBConn,$course['mb_id_owner']); $dataset['ERROR-COUNT-LIMIT']=$reservation_count>=get_compere_limit($DBConn,$course['mb_id_owner'],'reservation.count')?array(0):array(); $dataset+=prepare_answer_set_dataset($DBConn,null,retrieve_transfered_answer_data($DBConn,$lecture['cs_id'])); $dataset['DISPLAY-ANSWER-SET']=$dataset['ANSWER-SET']?array(0):array(); ?>