<?php require_once('includes/requirecompere.inc.php'); $cg_id=TGET('cg_id'); $op=TGET('op'); $mb_id_owner=current_mb_id(); $DBConn->connect(true); $group=db_load_course_group($DBConn,$cg_id,$mb_id_owner); if (!$group) { redirect("qx-cmd-coursegroup.manage.html"); } else { $dataset+=$group; $csgrp_cs_ids=db_load_course_group_course_ids($DBConn,$cg_id); $courses=db_load_course_by_owner($DBConn,$mb_id_owner); $dataset['COURSE']=array(); $dataset['COURSE-AVAIL']=array(); foreach ($courses as $course) { if (in_array($course['cs_id'],$csgrp_cs_ids)) array_push($dataset['COURSE'],$course); else array_push($dataset['COURSE-AVAIL'],$course); } $dataset['COURSE-NONE']=$courses?array():array(0); } $dataset['SAVED-OK']=$op=='saved-ok'?array(0):array(); ?>