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,

" . T_("linked to survey") . "  $lime_sid "; } else{ $cl = "danger"; $message = T_("Error: Failed to insert questionnaire"); } ?>
" title="" />
" data-off="" data-width="80" />
" data-off="" data-width="80"/>
" data-off="" data-onstyle="danger" data-width="80" />
" data-off="" data-width="80"/>
basePath = "../include/ckeditor/"; $ckeditorConfig = array("toolbar" => array(array("tokens","-","Source"), array("Cut","Copy","Paste","PasteText","PasteFromWord","-","Print","SpellChecker"), array("Undo","Redo","-","Find","Replace","-","SelectAll","RemoveFormat"), array('Link','Unlink','Anchor'), array('Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'), array('About'), "/", array("Bold","Italic","Underline","Strike","-","Subscript","Superscript"), array("NumberedList","BulletedList","-","Outdent","Indent","Blockquote"), array('JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'), array('BidiLtr', 'BidiRtl'), array('Styles','Format','Font','FontSize'), array('TextColor','BGColor')), "extraPlugins" => "tokens"); ?>
" style="margin-top: -5px;">

editor("rs_intro","",$ckeditorConfig);?>
" style="margin-top: -5px;">

editor("rs_project_intro","",$ckeditorConfig);?>
" style="margin-top: -5px;">

editor("rs_callback","",$ckeditorConfig);?>
" style="margin-top: -5px;">

editor("rs_answeringmachine","",$ckeditorConfig);?>
" style="margin-top: -5px;">

editor("rs_project_end","",$ckeditorConfig); ?>
" style="margin-top: -5px;">

editor("info","",$ckeditorConfig);?>