<?php require_once('includes/requirecompere.inc.php'); require_once('includes/requirepost.inc.php'); $qn_id=TPOST('qn_id'); $question_select=TPOST('question_select'); $question_required=TPOST('question_required'); $question_ordinal=TPOST('question_ordinal'); $cs_id_select=TPOST('cs_id_select'); $mb_id=current_mb_id(); if (!$qn_id) { redirect("./"); return; } $DBConn->connect(); $DBConn->begin(true); $question_required=(array)$question_required; $qnqlist=array(); if ($question_select) { foreach ($question_select as $q_id) { array_push($qnqlist,array( 'q_id'=>$q_id, 'qnq_required'=>in_array($q_id,$question_required)?1:0, 'qnq_ordinal'=>$question_ordinal[$q_id] )); } } fix_ordinal_of_rows($qnqlist,'qnq_ordinal'); db_set_questionnaire_question($DBConn,$mb_id,$qn_id,$qnqlist); db_set_questionnaire_course($DBConn,$mb_id,$qn_id,$cs_id_select); $DBConn->commit(); redirect("qx-cmd-questionnaire.setting-qn_id-".$qn_id."-op-saved.html"); ?>