* @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"); global $ldb; 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; if (isset($_POST['ras'])) $ras = 1; if (isset($_POST['rws'])) $rws = 1; if (isset($_POST['testing'])) $testing = 1; if (isset($_POST['rs'])) $rs = 1; $name = $db->qstr($_POST['description'],get_magic_quotes_gpc()); $rs_intro = $db->qstr($_POST['rs_intro'],get_magic_quotes_gpc()); $rs_project_intro = $db->qstr($_POST['rs_project_intro'],get_magic_quotes_gpc()); $rs_project_end = $db->qstr($_POST['rs_project_end'],get_magic_quotes_gpc()); $rs_callback = $db->qstr($_POST['rs_callback'],get_magic_quotes_gpc()); $rs_answeringmachine = $db->qstr($_POST['rs_answeringmachine'],get_magic_quotes_gpc()); if ($_POST['select'] == "new") { //create one from scratch include("../functions/functions.limesurvey.php"); $lime_sid = create_limesurvey_questionnaire($name); } else { //use existing lime instrument $lime_sid = bigintval($_POST['select']); } $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) VALUES (NULL,$name,'$lime_sid','$ras','$rws','$rs',$rs_intro,$rs_project_intro,$rs_project_end,$rs_callback,$rs_answeringmachine,'$testing')"; $rs = $db->Execute($sql); if ($rs) { $qid = $db->Insert_ID(); print "

Successfully inserted $name as questionnaire $qid, linked to $lime_sid

"; }else { print "

Error: Failed to insert questionnaire

"; } } //create new questionnaire ?>

"/>