<?php require_once('includes/requirecompere.inc.php'); require_once('includes/requirepost.inc.php'); $lctr_id=0+TPOST('lctr_id'); $mb_id_owner=current_mb_id(); $timezone_bias=get_user_time_zone()*60; $DBConn->connect(); $DBConn->begin(true); $lecture=db_load_lecture_by_id($DBConn,$lctr_id); if ($lecture) $course=db_load_course_by_id($DBConn,$lecture['cs_id']); if (!$lecture || $course['mb_id_owner']!=$mb_id_owner) { $DBConn->rollback(); redirect("./"); return; } $ids_dismiss=TPOST('ids_dismiss'); $ids_assign=TPOST('ids_assign'); $team=db_load_team($DBConn,$mb_id_owner,'VALID'); $ids_team_member=array_projection($team,'mb_id_member'); $ids_team_member=db_filter_for_available_compere_grant( $DBConn, $ids_team_member, $lecture['cs_id'], $lecture['lctr_since'], $lecture['lctr_expire'], $lctr_id ); $ids_lecture_staff=db_load_lecture_staff_ids($DBConn,$lctr_id); if ($ids_dismiss) $ids_lecture_staff=array_diff($ids_lecture_staff,$ids_dismiss); if ($ids_assign) $ids_lecture_staff=array_merge($ids_lecture_staff,$ids_assign); $ids_lecture_staff=array_intersect($ids_lecture_staff,$ids_team_member); db_save_lecture_staff($DBConn,$lctr_id,$ids_lecture_staff); $DBConn->commit(); redirect("qx-cmd-course.lecture.staff-lctr_id-".$lctr_id.".html"); ?>