<?php require_once('includes/requirecompere.inc.php'); $cs_id=TGET('cs_id'); $op=TGET('op'); $mb_id=current_mb_id(); $DBConn->connect(true); $course=db_load_course_by_id($DBConn,$cs_id); if (!$course || $course['mb_id_owner']!=$mb_id) { redirect("qx-cmd-course.manage.html"); return; } $dataset+=$course; $qn_id_select=db_load_course_questionnaire_id($DBConn,$cs_id); $questionnaires=db_load_questionnaires($DBConn,$mb_id); $dataset['QUESTIONNAIRE']=array(); foreach ($questionnaires as $qn) { if ($qn['qn_id']==$qn_id_select) { $qn['SELECTED']=array(0); array_push($dataset['QUESTIONNAIRE'],$qn); } } foreach ($questionnaires as $qn) { if ($qn['qn_id']!=$qn_id_select) array_push($dataset['QUESTIONNAIRE'],$qn); } $dataset['SAVED']=$op=='saved'?array(0):array(); $dataset['ASSIGNED-NONE']=$qn_id_select?array():array(0); ?>