<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="js" uri="net.sourceforge.jsurveyor.jsurveyorlib" %>
<%@ page import="java.util.*" %>
<%@ page import="net.sourceforge.jsurveyor.*" %>
<jsp:useBean id="Data" class="net.sourceforge.jsurveyor.DataAccess">
</jsp:useBean>
<js:noCache />
<js:login access="admin" />
<js:border title="jSurveyor - Questionnaires">
<form action='admin_save_redirect.jsp' method='post'>
<input name='location' type='hidden' value='thirdTab' />
<%
int questionnaireID = Integer.parseInt(request.getParameter("QuestionnaireID"));
Questionnaire editQ = DataAccess.retrieveQuestionnaire(questionnaireID);
boolean state = editQ.getState();
%>
<input name='QuestionnaireID' type='hidden' value='<%= editQ.getQuestionnaireID() %>' />
	 <tr>
	  <td class='mainmenu_headline_unselected_rightborder'><input class='tab' name='button' type='submit' value='Edit questionnaire' title='Here you can edit this questionnaire' /> <!-- <a class='tab' href='admin_questionnaire.jsp' title='Here you can edit this questionnaire'>Edit questionnaire</a> --></td>
	  <td class='mainmenu_headline_unselected'><input class='tab' name='button' type='submit' value='Add/remove usergroups' title='Here you can add and remove usergroups' /><!-- <a class='tab' href='admin_usergroup.jsp' title='Here you can add and remove usergroups'>Add/remove usergroups</a> --></td>
	  <td class='mainmenu_headline' title='Here you can set the status of the questionnaire to active'>Activate</td>
	<td class='mainmenu_headline_emptyfield'>&nbsp;</td>
	 </tr>
	 
	 <tr>
	  <td colspan='4' class='mainmenu_blueframe'>
	    <table border='0' cellspacing='0' cellpadding='0'>
		  <tr>
		 
		  <td class='mainmenu_inner_workframe'>
		 	<table border='0'  cellspacing='0'>

			<tr>
			  <td style='width:70%;'>
			    By default this questionnaire will be inactive, unless you check the activationbox below. If the questionnaire is inactive, it will not be visible to users and therefore they cannot submit answers to it.<br /><br />
				If you check the activationbox below, the questionnaire will imediately be visible to users. You can change state to inactive later, and reactivate whenever you need. However you are not allowed to make changes to a deactivated questionnaire and then reactivate it again.<br /> This limit is made to ensure that older answers will not conflict with any possibly new questions or reformulations.
				<br /><br />
				You will be able to activate this questionnaire later.
			  </td>
			  <td>
			    &nbsp;
			  </td>
			</tr>
			<tr>
			<% if(state) { %>
			  <td><br /><input name='state' checked='checked' type='checkbox' title='Put a check in this box if you want to activate this questionnaire'/>Activate</td>
			<% } else { %>
			  <td><br /><input name='state' type='checkbox' title='Check this box if you want to activate this questionnaire'/>Activate</td>
			<% } %>
			</tr>
			</table> 
		  </td> <!-- Main workframe end -->
		  </tr>
	    </table>
      </td>
	</tr>

	<tr>
	<td>
	  <table><tr><td> <!-- Makes space between blue border and top of buttons -->
	  </td></tr>
	  </table>
	</td>
	</tr>

	<tr>

	  <td></td>
	  <td class='mainmenu_buttonline' colspan='4'><input class='stdbutton' name='button' type='submit' title='Click to return to Add/remove usergroups' value='Previous'/> <input class='stdbutton' name='button' type='submit' title='Click to save the questionnaire and return to List questionnaires page' value='Save & Exit' />
	  </td>
    </tr>
</form>
</js:border>