<?php require_once('includes/requirecompere.inc.php'); require_once('includes/requirepost.inc.php'); require_once('includes/message.inc.php'); $lctr_id=0+TPOST('lctr_id'); $msg_brief=TPOST('msg_brief'); $msg_text=TPOST('msg_text'); $mb_id_owner=current_mb_id(); $timezone_bias_seconds=get_user_time_zone()*60; $DBConn->connect(); $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; } if (datetime_to_seconds($lecture['lctr_expire'])<=uniwits_time()) { redirect("qx-cmd-course.lecture.detail-lctr_id-".$lctr_id."-op-fail.cancel.afterstart.html"); return; } $DBConn->begin(true); $staff_ids=db_load_lecture_staff_ids($DBConn,$lctr_id); $participant_ids=db_load_lecture_participant_ids($DBConn,$lctr_id); $all_mb_ids=array_merge($staff_ids,$participant_ids); array_push($all_mb_ids,$mb_id_owner); db_cancel_lecture($DBConn,$lctr_id,$mb_id_owner); db_delete_lecture_unit_income($DBConn,$lctr_id); send_message( $DBConn, 'CANCEL', $mb_id_owner, 'COMPERE', $all_mb_ids, 'MEMBER', $msg_text, $msg_brief, array( 'msg_lctr_id'=>$lctr_id, 'msg_cs_id'=>$lecture['cs_id'] ) ); $DBConn->commit(); redirect("qx-cmd-course.lecture.cancelled-cs_id-".$lecture['cs_id'].".html"); ?>