Location: PHPKode > scripts > AskPeople-Free PHP survey application > AskPeople_2_2_2/qeditor.php
<?php

session_start();

require_once('includes/config.inc.php');
require_once('includes/functions.inc.php');

require_once('login.inc.php');

if (!@in_array($_SESSION['admin_sid'],$_SESSION['allowedaccess'])) { // user doesn't have access to this survey
	die ("<div class='clearbox'><h2>Access denied</h2><p>Sorry, this project has not yet been shared with you. Please contact the project owner to be granted access, or <a href='index.php'>return to My Projects</a> and check whether the project is listed there.</p><br /></div>");
}

// help text:

$notesbox = "
<div id=\"notes\" class=\"clearbox\" style=\"clear:both;\">
	<h3>Notes</h3>
	<p>To include 'Other (please specify)' and a text box as a response option in a list, enter <code>other_specify:</code> in the list of responses. Optionally, you can define the label for the box by entering <code>other_specify:Custom label</code> - otherwise, the default text of 'Other (please specify)' will appear.</p>
	<p>Explanation of question types:<br />
	<strong>Single</strong>: a question with a list of options presented as radio buttons from which respondents can choose one<br />
	<strong>Dropdown</strong>: a question with a list of options presented as a dropdown menu from which respondents can choose one<br />
	<strong>Multi</strong>: a question with a list of options (tick boxes) from which a respondent can choose as many as apply<br />
	<strong>Smallbox</strong>: a one-line text box for short written answers<br />
	<strong>Bigbox</strong>: a multi-line text box with scroll bar for longer written answers<br />
	<strong>Pagebreak</strong>: marks the end of the current page of questions<br />
	<strong>Info</strong>: a text-only message or instruction</p>
	
	<p><strong>Grids:</strong><br />
	To make any single or multi question into a grid or scale-type question, just enter scale options in the scale box for that question.</p>
	
	<p><strong>Validation:</strong><br />
	To ensure respondents enter a response to a question, you can define a question as 'required'. This will present an on-screen message to respondents alerting them that an answer is required.
	</p>
</div>";

// end of help text


switch ($_REQUEST['action']) { // questionnaire to be saved

	  case "EditQuestionnaire" : // edit form
		
		$_SESSION['admin_sid'] = !isset($_SESSION['admin_sid']) ? $_REQUEST['sid'] : $_SESSION['admin_sid'];
		
		$qid = "surveys/quest_" . $_SESSION['admin_sid'] . ".xml";
		$loaded = loadQuest2($qid);

		$lastq = end($loaded['questions']); // grab last question
		$lastqid = $lastq['questionid'];

		$onloadfunc = "showq('q".$lastqid."');"; // JS function to run on page load
		include('includes/header.php');

		$templatemenu = makeTemplateMenu("templates/",$loaded['meta']['template'],"questionnaire[meta][template]","TRUE"); // only include PHP files

        $directory = (substr(dirname($_SERVER['PHP_SELF']),-1) == "/") ? dirname($_SERVER['PHP_SELF']) : dirname($_SERVER['PHP_SELF']) . "/";
		$surveylink = $protocol . $_SERVER['HTTP_HOST'] . $directory . "survey.php?sid=".$_SESSION['admin_sid'];

		$_SESSION['statusmsg'] = null; // reset the status var
	
		// build menu of questions
		for ($a=1;$a<=count($loaded['questions']);$a++) {
			$qmenu .= "<li class='qnode {$loaded['questions'][$a]['type']}' id=\"q{$loaded['questions'][$a][questionid]}_menu\"><a onclick=\"showq('q{$loaded['questions'][$a][questionid]}');return false;\" href='#'>".$loaded['questions'][$a]['questionid'].". (".$loaded['questions'][$a]['type'].")</a></li>\n";
		
			// build a menu of questions for moving
			//$movemenu .= "<option value='{$loaded['questions'][$a][questionid]}'>Q{$loaded['questions'][$a][questionid]}</option>\n";
		}
		
		if (count($loaded['questions'])>20) { // a longish questionnaire, so make the left menu a scrolling list
			$menuclass = "scrolling";
		} else {
			$menuclass = "notscrolling";
		}
		
		$outputform .= "
			<p id='surveylink'><img src=\"images/icons/web_16x16.gif\" width=\"16\" height=\"16\" class='icon' alt=\"Link to survey\" border=\"0\" />The link to this survey is: <a href='{$surveylink}'>{$surveylink}</a></p>
			
			<form action=\"qeditor.php\" method=\"post\" name=\"questionform\">
			
			<div id=\"questionlist\" class=\"{$menuclass}\">
				<h3 style='margin-left: 15px;'>Choose question:</h3>
				<ul>
					<li class='qnode'><strong><a onclick=\"showq('details');return false;\" href='#'>Questionnaire intro</a></strong></li>
					{$qmenu}
				</ul>
			</div>
			
			
			<div id=\"questioneditform\">
					<div id=\"titletemplate\">
						<p>Title: <input type=\"text\" size=\"30\" name=\"questionnaire[meta][title]\" value=\"{$loaded['meta']['title']}\" />
						&nbsp; Template:&nbsp;<span>$templatemenu</span></p>
					</div>

					<div id=\"details\" class=\"questionform qbox\">
						<h2>Questionnaire details</h2>
						<p>Creator: <input type=\"text\" size=\"20\" style='position:absolute;left:40%;margin-top:-5px;' name=\"questionnaire[meta][creator]\" value=\"{$loaded['meta']['creator']}\" /></p>
						<p>Date created: <input type=\"text\" size=\"20\" style='position:absolute;left:40%;margin-top:-5px;' name=\"questionnaire[meta][date]\" value=\"{$loaded['meta']['date']}\" /></p>
						<p>Introduction: (shown to respondents at the beginning of the questionnaire)</p>
						  <p style='width:99%; margin-top: -10px'><textarea class=\"textfield qtextbox\" cols=\"80\" rows=\"4\" name=\"questionnaire[meta][introduction]\">{$loaded['meta']['introduction']}</textarea></p>
						</p>
						<input type=\"hidden\" name=\"questionnaire[meta][id]\" value=\"{$loaded['meta']['id']}\" />
						<div style=\"clear:both;\">
							<p style=\"float:left; width: 49%;text-align:left;margin-top:5px;\">					
								  <input type=\"submit\" value=\"Save changes\" />
							</p>
						</div>
						</div>
		";

		for ($a=1;$a<=count($loaded['questions']);$a++) {

			if (strlen($loaded['questions'][$a])>0) {

				if ($loaded['questions'][$a][type] == "single" || $loaded['questions'][$a][type] == "dropdown" || $loaded['questions'][$a][type] == "multi") {
					$qoptions = @implode("\r",$loaded['questions'][$a][options]);
					$qscale = @implode("\r",$loaded['questions'][$a][scale]);
				} else {
					$qoptions = @implode('',$loaded['questions'][$a][options]);
					$qscale = NULL;
				}

				// build a menu of question types, highlighting the current setting for this question
				$qtype = $loaded['questions'][$a][type];
				$qtypearray = array("single","dropdown","multi","bigbox","smallbox","pagebreak","info");
				$qtypemenu = "<select name=\"questionnaire[questions][$a][type]\">\n";
				foreach($qtypearray as $v) {
					$qtypemenu .= ($v == $qtype) ? "<option value=\"$v\" selected=\"selected\">$v</option>\n" : "<option value=\"$v\">$v</option>\n";
				}
				$qtypemenu .= "</select> <a onclick=\"toggleVisibility('notes');\" href=\"#notes\"><img src=\"images/icons/help_16x16.gif\" width=\"16\" height=\"16\" class='icon' alt=\"Help\" border=\"0\" /></a>\n";

				// build a menu of question validation options, highlighting the current setting for this question
				$qvalidation = $loaded['questions'][$a]['validation'];
				$qvalidationmenu = "This question is: <select name=\"questionnaire[questions][$a][validation]\">\n";
				foreach($qvalidationarray as $v) {
					$qvalidationmenu .= ($v == $qvalidation) ? "<option value=\"$v\" selected=\"selected\">$v</option>\n" : "<option value=\"$v\">$v</option>\n";
				}	
				$qvalidationmenu .= "</select> <a onclick=\"toggleVisibility('notes');\" href=\"#notes\"><img src=\"images/icons/help_16x16.gif\" width=\"16\" height=\"16\" class='icon' alt=\"Help\" border=\"0\" /></a>\n";

				$movemenu = NULL; // reset
				for ($b=1;$b<=count($loaded['questions']);$b++) {
					// build a menu of questions for moving
					if ($a != $b) {
						$movemenu .= "<option value='{$loaded['questions'][$b][questionid]}'>Q{$loaded['questions'][$b][questionid]}</option>\n";				
					}
				}

				$outputform .= "
					<div id=\"q{$loaded['questions'][$a][questionid]}\" class=\"questionform\">
					  <div class='qbox'>
						<h2>Question {$loaded['questions'][$a][questionid]}</h2>\n
						<p><input type=\"hidden\" size=\"5\" name=\"questionnaire[questions][$a][questionid]\" value=\"{$loaded['questions'][$a][questionid]}\" />Question type: $qtypemenu &nbsp; $qvalidationmenu</p>
						<p>Question text:</p>
						  <p style='width:99%; margin-top: -10px;'>
						  <textarea class=\"textfield qtextbox\" name=\"questionnaire[questions][$a][questiontext]\" cols=\"80\" rows=\"5\">{$loaded['questions'][$a][questiontext]}</textarea>
						  </p>
						
						<div class='edit_responses'>
						 <p>Responses:<br /><em>Single/Dropdown/Multi:  each option on a new line</em><br /><textarea class=\"textfield\" name=\"questionnaire[questions][$a][options]\" cols=\"50\" rows=\"8\">$qoptions</textarea></p>
						</div>
						<div class='edit_scale'>
						 <p>Scale:<br /><em>Single/Multi: Turns question into grid</em><br /><textarea class=\"textfield\" name=\"questionnaire[questions][$a][scale]\" cols=\"50\" rows=\"8\">$qscale</textarea></p>
						</div>
						<div style='clear:both;'></div>
					  </div>
					  <br />
					  <div class='qformbuttoms' style=\"clear: both; position: relative; bottom: 10px; padding: 2px 5px 7px 5px;\">
							<div style=\"float:right; width: 77%;text-align:right; margin-top:5px;\">
								  
									 <input type=\"submit\" name=\"insertq\" value=\"Insert new q after Q{$loaded['questions'][$a][questionid]}\" />
							 		 &nbsp;<label>Move to after: <select name=\"moveq[{$loaded['questions'][$a][questionid]}]\" onchange=\"this.form.submit();\">
								      <option value='' selected='selected'>--</option>
								      {$movemenu}
								    </select></label>
								    &nbsp; <input type=\"submit\" name=\"deleteq\" onclick=\"return confirmSubmit('Are you sure you want to permanently delete this question?');\" value=\"Delete Q{$loaded['questions'][$a][questionid]}\" />
							</div>
							<div style=\"float:left; width: 20%; margin-top:5px;\">					
								  <input type=\"submit\" value=\"Save changes\" />
							</div>
						 <div style='clear:both;'></div>
					  </div>
					</div>
				";
			}
		}
		
		$outputform .= "
			<input type=\"hidden\" name=\"action\" value=\"SaveQuestionnaire\" />
			<input type=\"hidden\" name=\"sid\" value=\"{$loaded['meta']['id']}\" />
			</form>
			<div style='clear:both;'></div>
			{$notesbox}
			
			</div>
		";
		
		
		
	  break;

	  case "SaveQuestionnaire" :

		$mainfields = array("id","date","creator","template","title","introduction");
		$replace = array("\n","\r","|");

		foreach ($mainfields as $v) {
			$newquestionnaire[$v] = $_POST['questionnaire']['meta'][$v];
		}
		
		if ($_POST['insertq']) {
			$insertafter = substr(strrchr($_POST['insertq'],'Q'),1); // the ID of the question to insert after
			$numofqs = count($_POST['questionnaire']['questions']);

			//$_SESSION['statusmsg'] .= $insertafter . " ";
			//$_SESSION['statusmsg'] .= $numofqs . " ";

			if ($insertafter == $numofqs) { // user wants to insert question at end of survey, so add 1 to loop
				$qloop = $numofqs+1;
				$insertatend = "TRUE";
			} else {
				$qloop = $numofqs;
				$insertatend = "FALSE";		
			}

			for ($a=1;$a<=$qloop;$a++) {
				if (is_numeric($insertafter) && $a == $insertafter+1) {
					$newquestionnaire[] = array("questionid" => $a,"type" => $globalsettings['defaultQuestionType'],"validation" => "optional","questiontext" => "New question text");
					$insertafter = "inserted";
				}
				
				$rawoptions = explode("\r",trim($_POST['questionnaire']['questions'][$a]['options']));
				$rawscale = explode("\r",trim($_POST['questionnaire']['questions'][$a]['scale']));
				
				$outputoptions = (strlen($rawoptions)>0) ? cleanOptions($rawoptions,$replace) : null;
				$outputscale = (strlen($rawscale)>0) ? cleanOptions($rawscale,$replace) : null;	
		
				if ($insertafter != "inserted") { // not yet inserted, so questionid is unchanged
					$newquestionnaire[] = array("questionid" => $_POST['questionnaire']['questions'][$a]['questionid'],"type" => $_POST['questionnaire']['questions'][$a]['type'],"validation" => $_POST['questionnaire']['questions'][$a]['validation'],"questiontext" => $_POST['questionnaire']['questions'][$a]['questiontext'],"options" => $outputoptions,"scale" => $outputscale);
				} elseif ($a <= $numofqs) { // only add if not beyond the end of the 'true' question list
					$newquestionnaire[] = array("questionid" => $_POST['questionnaire']['questions'][$a]['questionid']+1,"type" => $_POST['questionnaire']['questions'][$a]['type'],"validation" => $_POST['questionnaire']['questions'][$a]['validation'],"questiontext" => $_POST['questionnaire']['questions'][$a]['questiontext'],"options" => $outputoptions,"scale" => $outputscale);
				}
			}
	
			$saved = savePoll($_SESSION['admin_sid'],$newquestionnaire);
			
			if ($saved) {
				$_SESSION['statusmsg'] .= "The questionnaire was saved.";
			} else {
				$_SESSION['statusmsg'] .= "Sorry, the questionnaire could not be saved.";
			}

			header("Location: qeditor.php?action=EditQuestionnaire&sid=".$_SESSION['admin_sid']."&stitle=".urlencode($_POST['questionnaire']['meta']['title']));			
			
			
		} elseif ($_POST['deleteq']) {
		
			$deleteid = substr(strrchr($_POST['deleteq'],'Q'),1);
			$numofqs = count($_POST['questionnaire']['questions']);
			
			$counter = 1;
			
			if ($numofqs > 1) {			
				for ($a=1;$a<=$numofqs;$a++) {
					if ($a != $deleteid) {
						$rawoptions = explode("\r",trim($_POST['questionnaire']['questions'][$a]['options']));
						$rawscale = explode("\r",trim($_POST['questionnaire']['questions'][$a]['scale']));
						
						$outputoptions = (strlen($rawoptions)>0) ? cleanOptions($rawoptions,$replace) : null;
						$outputscale = (strlen($rawscale)>0) ? cleanOptions($rawscale,$replace) : null;
		
						$newquestionnaire[] = array("questionid" => $counter,"type" => $_POST['questionnaire']['questions'][$a]['type'],"validation" => $_POST['questionnaire']['questions'][$a]['validation'],"questiontext" => $_POST['questionnaire']['questions'][$a]['questiontext'],"options" => $outputoptions,"scale" => $outputscale);
						$counter++;
					}
				}
				$saved = savePoll($_SESSION['admin_sid'],$newquestionnaire);
			} else {// trying to delete the only remaining question, so show error
				$saved = FALSE;
				$_SESSION['statusmsg'] = "Last question can't be deleted. ";
			}

			if ($saved) {
				$_SESSION['statusmsg'] = "The questionnaire was saved.";
			} else {
				$_SESSION['statusmsg'] .= "Sorry, the questionnaire could not be saved.";
			}

			header("Location: qeditor.php?action=EditQuestionnaire&sid=".$_SESSION['admin_sid']."&stitle=".urlencode($_POST['questionnaire']['meta']['title']));			
		
		} elseif (strlen(implode("",$_POST['moveq']))>0) {
								
			foreach((array)$_POST['moveq'] as $moveq => $afterq) {
				if (strlen($afterq)>0) {
					$movedq = $moveq;
					$toafterq = $afterq;
				}
			}
			
			if ($movedq > $toafterq) { // moving a q forward
				$movedqid = $toafterq+1;
			} else { // moving a q backward
				$movedqid = $toafterq; // because moving it will make the subsequent IDs decrement by 1
			}

			// do a virtual 'cut and paste' to the clipboard
			$rawoptions = explode("\r",trim($_POST['questionnaire']['questions'][$movedq]['options']));
			$rawscale = explode("\r",trim($_POST['questionnaire']['questions'][$movedq]['scale']));
			$outputoptions = (strlen($rawoptions)>0) ? cleanOptions($rawoptions,$replace) : null;
			$outputscale = (strlen($rawscale)>0) ? cleanOptions($rawscale,$replace) : null;

			$clipboardq = array(
				"questionid" => $movedqid,
				"type" => $_POST['questionnaire']['questions'][$movedq]['type'],
				"validation" => $_POST['questionnaire']['questions'][$movedq]['validation'],
				"questiontext" => $_POST['questionnaire']['questions'][$movedq]['questiontext'],
				"options" => $outputoptions,
				"scale" => $outputscale
			);
			
			
			$numofqs = count($_POST['questionnaire']['questions']);		
			$counter = 1;
			
			for ($a=1;$a<=$numofqs;$a++) {
				
				$rawoptions = explode("\r",trim($_POST['questionnaire']['questions'][$a]['options']));
				$rawscale = explode("\r",trim($_POST['questionnaire']['questions'][$a]['scale']));
				
				$outputoptions = (strlen($rawoptions)>0) ? cleanOptions($rawoptions,$replace) : null;
				$outputscale = (strlen($rawscale)>0) ? cleanOptions($rawscale,$replace) : null;

				if ($a == $movedq) { // moving a question back in the questionnaire, so question to be moved is reached first
					// do nothing
				} elseif ($a == $toafterq) { // moving a question forward in the questionnaire, so insertion point is reached first
					$newquestionnaire[] = array("questionid" => $counter,"type" => $_POST['questionnaire']['questions'][$a]['type'],"validation" => $_POST['questionnaire']['questions'][$a]['validation'],"questiontext" => $_POST['questionnaire']['questions'][$a]['questiontext'],"options" => $outputoptions,"scale" => $outputscale);					
					$newquestionnaire[] = $clipboardq; //paste
					$counter = $counter+2;				
				} else { 
					$newquestionnaire[] = array("questionid" => $counter,"type" => $_POST['questionnaire']['questions'][$a]['type'],"validation" => $_POST['questionnaire']['questions'][$a]['validation'],"questiontext" => $_POST['questionnaire']['questions'][$a]['questiontext'],"options" => $outputoptions,"scale" => $outputscale);
					$counter++;
				}
			}
			
			//print_r($newquestionnaire);
			
			$saved = savePoll($_SESSION['admin_sid'],$newquestionnaire);
			
			if ($saved) {
				$_SESSION['statusmsg'] = "The questionnaire was saved.";
			} else {
				$_SESSION['statusmsg'] = "Sorry, the questionnaire could not be saved.";
			}
			
			header("Location: qeditor.php?action=EditQuestionnaire&sid=".$_SESSION['admin_sid']."&stitle=".urlencode($_POST['questionnaire']['meta']['title']));			
			
		} else {
			for ($a=1;$a<=count($_POST['questionnaire']['questions']);$a++) {
				$rawoptions = explode("\r",trim($_POST['questionnaire']['questions'][$a]['options']));
				$rawscale = explode("\r",trim($_POST['questionnaire']['questions'][$a]['scale']));
				
				$outputoptions = (strlen($rawoptions)>0) ? cleanOptions($rawoptions,$replace) : null;
				$outputscale = (strlen($rawscale)>0) ? cleanOptions($rawscale,$replace) : null;
				
				$newquestionnaire[] = array("questionid" => $_POST['questionnaire']['questions'][$a]['questionid'],"type" => $_POST['questionnaire']['questions'][$a]['type'],"validation" => $_POST['questionnaire']['questions'][$a]['validation'],"questiontext" => $_POST['questionnaire']['questions'][$a]['questiontext'],"options" => $outputoptions,"scale" => $outputscale);
			}

			$saved = savePoll($_SESSION['admin_sid'],$newquestionnaire);
			
			if ($saved) {
				$_SESSION['statusmsg'] = "The questionnaire was saved.";
			} else {
				$_SESSION['statusmsg'] = "Sorry, the questionnaire could not be saved.";
			}

			header("Location: qeditor.php?action=EditQuestionnaire&sid=".$_SESSION['admin_sid']."&stitle=".urlencode($_POST['questionnaire']['meta']['title']));			

	  	}


	  break;

	case "EditXML" :

		include('includes/header.php');
		
        $directory = (substr(dirname($_SERVER['PHP_SELF']),-1) == "/") ? dirname($_SERVER['PHP_SELF']) : dirname($_SERVER['PHP_SELF']) . "/";
		$surveylink = $protocol . $_SERVER['HTTP_HOST'] . $directory . "survey.php?sid=".$_SESSION['admin_sid'];

		$qid = "surveys/quest_" . $_SESSION['admin_sid'] . ".xml";
		$loaded = loadFile($qid,"\t");

		$_SESSION['statusmsg'] = null; // reset the status var

		$outputform = "
			<p id='surveylink'><img src=\"images/icons/web_16x16.gif\" width=\"16\" height=\"16\" class='icon' alt=\"Link to survey\" border=\"0\" />The link to this survey is: <a href='{$surveylink}'>{$surveylink}</a></p>
			<p id=\"introduction\">This is the 'raw' format of the questionnaire. You can edit this to move questions around and make changes quickly, but please be careful as errors in the markup may stop your questionnaire from working.</p>
			<form action=\"qeditor.php\" method=\"post\" class='clearbox'>
			<div id=\"questioneditxml\" style='width:99%;'>
				<textarea cols=\"80\" rows=\"25\" name=\"xmlquest\">$loaded</textarea>
				<input type=\"hidden\" name=\"action\" value=\"SaveXML\" />
				<input type=\"hidden\" name=\"sid\" value=\"{$_SESSION['admin_sid']}\" />
				<p style=\"text-align:center;\"><input type=\"submit\" value=\"Save changes to XML\" />  or <a href=\"qeditor.php?action=DownloadXML\">Download XML version</a></p>
			</div>
			</form>
		";

	  break;

	case "SaveXML" :

		$qid = "surveys/quest_" . $_SESSION['admin_sid'] . ".xml";
		$saved = saveFile($qid,$_POST['xmlquest']);

		if ($saved) {
			$_SESSION['statusmsg'] = "The questionnaire was saved.";
		} else {
			$_SESSION['statusmsg'] = "Sorry, the questionnaire could not be saved.";
		}
		header("Location: qeditor.php?action=EditXML");

	  break;	
	
	case "DownloadXML" :
	
		$qid = "surveys/quest_" . $_SESSION['admin_sid'] . ".xml";
		$loaded = loadFile($qid,"\t");
		
		$dodgy = array(" ","'",",",".");		
		$nicefilename = "quest_".$_SESSION['admin_sid'].".xml";

		header("Content-Type: text/plain");
		// a load of extra headers here so IE doesn't choke on the file...
		header("Pragma: public");
		header("Expires: 0"); // set expiration time
		header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
		// define filename for download as export.txt
		header("Content-Disposition: attachment; filename=\"".$nicefilename."\"");
		
		echo ($loaded);
		exit();
	
	  break;

	case "ExportQuestionnaire" :

		$configpath = "surveys/config_" . $_SESSION['admin_sid'] . ".php";	
		include_once($configpath); // load survey settings

		$output = exportQuestToText($_SESSION['admin_sid'],"on"); // include tickboxes (set to 'off' to prevent)

		$dodgy = array(" ","'",",",".");

		$now = date("d-M");
		$nicefilename = substr(strtolower(str_replace($dodgy,"_",$_SESSION['admin_stitle'])),0,10) . "_" . $now . "_plain.txt";

		header("Content-Type: text/plain");
		// a load of extra headers here so IE doesn't choke on the file...
		header("Pragma: public");
		header("Expires: 0"); // set expiration time
		header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
		// define filename for download as export.txt
		header("Content-Disposition: attachment; filename=\"".$nicefilename."\"");
		
		echo (strip_tags($output)); // also strip any stray HTML in the questionnaire
		exit();
		
	  break;

	default :

		header("Location: qeditor.php?action=EditQuestionnaire"); // default to form editor
		
	  break;

}

echo ($outputform);

include('includes/footer.php');

?>
Return current item: AskPeople-Free PHP survey application