qstr($_POST['description']); $rs_intro = $db->qstr(html_entity_decode($_POST['rs_intro'],ENT_QUOTES,'UTF-8')); $rs_project_intro = $db->qstr(html_entity_decode($_POST['rs_project_intro'],ENT_QUOTES,'UTF-8')); $rs_project_end = $db->qstr(html_entity_decode($_POST['rs_project_end'],ENT_QUOTES,'UTF-8')); $rs_callback = $db->qstr(html_entity_decode($_POST['rs_callback'],ENT_QUOTES,'UTF-8')); $rs_answeringmachine = $db->qstr(html_entity_decode($_POST['rs_answeringmachine'],ENT_QUOTES,'UTF-8')); $info = $db->qstr(html_entity_decode($_POST['info'],ENT_QUOTES,'UTF-8')); //use existing lime instrument $tmp = explode(';',$_POST['select']); $lime_sid = bigintval($tmp[0]); $remote = intval($tmp[1]); //** get default coma-separated outcomes list and use it for new questionnaire as initial set $sql = "SELECT o.outcome_id FROM `outcome` as o WHERE o.default = 1;"; $def = $db->GetAll($sql); for ($i=0; $i < count($def); $i++){ foreach($def[$i] as $key => $val){ $do[] = $val; } } $do = implode($do,","); //** - end $sql = "INSERT INTO questionnaire (questionnaire_id,description,lime_sid,restrict_appointments_shifts,restrict_work_shifts,respondent_selection,rs_intro,rs_project_intro,rs_project_end,rs_callback,rs_answeringmachine,testing,lime_rs_sid,info,self_complete,referral,outcomes,remote_id) VALUES (NULL,$name,'$lime_sid','$ras','$rws','$rs',$rs_intro,$rs_project_intro,$rs_project_end,$rs_callback,$rs_answeringmachine,'$testing',$lime_rs_sid,$info,$respsc,$referral,'$do','$remote')"; $rs = $db->Execute($sql); if ($rs) { $qid = $db->Insert_ID(); $cl = "info"; $message = T_("Successfully inserted") . " " . T_("with ID") . " $qid,