* @copyright Deakin University 2007,2008 * @package queXS * @subpackage admin * @link http://www.deakin.edu.au/dcarf/ queXS was writen for DCARF - Deakin Computer Assisted Research Facility * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2 * */ /** * Configuration file */ include ("../config.inc.php"); /** * Database file */ include ("../db.inc.php"); /** * XHTML functions */ include ("../functions/functions.xhtml.php"); /** * Input functions */ include("../functions/functions.input.php"); /** * CKEditor */ include("../include/ckeditor/ckeditor.php"); global $db; xhtml_head(T_("New: Create new questionnaire"),true,false,array("../js/new.js")); if (isset($_POST['import_file'])) { //file has been submitted global $db; $ras =0; $rws = 0; $testing = 0; $rs = 0; $lime_sid = 0; $respsc = 0; $lime_rs_sid = "NULL"; if (isset($_POST['ras'])) $ras = 1; if (isset($_POST['rws'])) $rws = 1; if (isset($_POST['testing'])) $testing = 1; if (isset($_POST['respsc'])) $respsc = 1; if ($_POST['selectrs'] != "none") $rs = 1; $lime_mode = "NULL"; $lime_template = "NULL"; $lime_endurl = "NULL"; if ($respsc == 1) { $lime_mode = $db->qstr($_POST['lime_mode'],get_magic_quotes_gpc()); $lime_template = $db->qstr($_POST['lime_template'],get_magic_quotes_gpc()); $lime_endurl = $db->qstr($_POST['lime_endurl'],get_magic_quotes_gpc()); } $name = $db->qstr($_POST['description'],get_magic_quotes_gpc()); $rs_intro = $db->qstr(html_entity_decode($_POST['rs_intro'],get_magic_quotes_gpc())); $rs_project_intro = $db->qstr(html_entity_decode($_POST['rs_project_intro'],get_magic_quotes_gpc())); $rs_project_end = $db->qstr(html_entity_decode($_POST['rs_project_end'],get_magic_quotes_gpc())); $rs_callback = $db->qstr(html_entity_decode($_POST['rs_callback'],get_magic_quotes_gpc())); $rs_answeringmachine = $db->qstr(html_entity_decode($_POST['rs_answeringmachine'],get_magic_quotes_gpc())); $info = $db->qstr(html_entity_decode($_POST['info'],get_magic_quotes_gpc())); //use existing lime instrument $lime_sid = bigintval($_POST['select']); if (is_numeric($_POST['selectrs'])) { $lime_rs_sid = bigintval($_POST['selectrs']); } $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,lime_mode,lime_template,lime_endurl) 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,$lime_mode,$lime_template,$lime_endurl)"; $rs = $db->Execute($sql); if ($rs) { $qid = $db->Insert_ID(); print "

" . T_("Successfully inserted") . " $name " . T_("as questionnaire") . " $qid, " . T_("linked to") . " $lime_sid

"; }else { print "

" . T_("Error: Failed to insert questionnaire") . "

"; } } //create new questionnaire ?>

GetAll($sql); if (!empty($surveys)) { print ""; } else { print "" . T_("Create an instrument in Limesurvey") .""; } ?>

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

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

"/>