<?php require_once('includes/requirecompere.inc.php'); $cs_id=0+TGET('cs_id'); $mb_id=current_mb_id(); $DBConn->connect(true); $course=db_load_course_by_id($DBConn,$cs_id); if ($mb_id!=$course['mb_id_owner']) { redirect("./"); return; } $staff=db_load_course_staff($DBConn,$cs_id); $team=db_load_team($DBConn,$mb_id,array('VALID')); $staff_ids=array_projection($staff,'mb_id'); $team_member_ids=array_projection($team,'mb_id_member'); $all_mb_ids=array_merge($staff_ids,$team_member_ids); $members=db_load_comperes($DBConn,$all_mb_ids); $dataset['ONDUTY']=array(); $dataset['AVAILABLE']=array(); foreach ($members as $m) { if (in_array($m['mb_id'],$staff_ids)) array_push($dataset['ONDUTY'],$m); else if (in_array($m['mb_id'],$all_mb_ids)) array_push($dataset['AVAILABLE'],$m); } $dataset+=$course; $dataset['ONDUTY-NONE']=$dataset['ONDUTY']?array():array(0); $dataset['AVAILABLE-NONE']=$dataset['AVAILABLE']?array():array(0); $dataset['ONDUTY-EXIST']=$dataset['ONDUTY']?array(0):array(); $dataset['AVAILABLE-EXIST']=$dataset['AVAILABLE']?array(0):array(); $dataset+=prepare_wizard_dataset(); ?>