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 $lime_sid = bigintval($_POST['select']); if (is_numeric($_POST['selectrs'])) { $lime_rs_sid = bigintval($_POST['selectrs']); } //** 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.deflt = 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) 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')"; $rs = $db->Execute($sql); if ($rs) { $qid = $db->Insert_ID(); if ($respsc == 1) { $lime_mode = $db->qstr($_POST['lime_mode']); $lime_template = $db->qstr($_POST['lime_template']); $lime_endurl = $db->qstr($_POST['lime_endurl']); $sql = "UPDATE questionnaire SET lime_mode = $lime_mode, lime_template = $lime_template, lime_endurl = $lime_endurl WHERE questionnaire_id = $qid"; $db->Execute($sql); } $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"); } ?> ',sl.surveyls_title) AS title FROM " . LIME_PREFIX . "surveys AS s LEFT JOIN " . LIME_PREFIX . "surveys_languagesettings AS sl ON ( s.sid = sl.surveyls_survey_id) WHERE s.active = 'Y' GROUP BY s.sid"; $surveys = $db->GetAll($sql); if (!empty($surveys)){?>
" title="" />
" data-off="" data-width="80" />
" data-off="" data-width="80"/>
" data-off="" data-onstyle="danger" data-width="80" />
" data-off="" 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);?>