<?php $cs_id=TGET('cs_id'); $lctr_id=TGET('lctr_id'); $mb_id_to=TGET('mb_id_to'); $op=TGET('op'); $mb_id_from=current_mb_id(); $timezone_bias_seconds=get_user_time_zone()*60; $lecture=null; $course=null; if ($lctr_id) { $DBConn->connect(true); $lecture=db_load_lecture_by_id($DBConn,$lctr_id); if ($lecture) $course=db_load_course_by_id($DBConn,$lecture['cs_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_'); $date_since=datetime_datepart($lecture['lctr_since'],$timezone_bias_seconds); $date_expire=datetime_datepart($lecture['lctr_expire'],$timezone_bias_seconds); if ($date_since==$date_expire) $dataset['DAY-SAME']=array(0); else $dataset['DAY-DIFFERRED']=array(0); $mb_id_to=$course['mb_id_owner']; } else if ($cs_id) { $DBConn->connect(true); $course=db_load_course_by_id($DBConn,$cs_id); $mb_id_to=$course['mb_id_owner']; } $dataset['mb_id_to']=$mb_id_to; if (!$mb_id_from && !$mb_id_to) require_once('includes/requirelogin.inc.php'); $dataset['COURSE-ONLY']=$course?array(0):array(); $dataset['LECTURE-ONLY']=$lecture?array(0):array(); if ($course) { $dataset+=$course; $USE_THEME_BY_USER_ID=$course['mb_id_owner']; } if ($lecture) $dataset+=$lecture; if ($op=='revise' && $_SESSION['reserv.inputcache.domain']) { $dataset+=$_SESSION['reserv.inputcache.data']; $dataset+=$_SESSION['reserv.inputcache.errorareas']; } ?>