<%@ include file="/includes.jsp" %>
<%@ taglib prefix="smvc" uri="http://www.springframework.org/tags/form"%>
<style>
	.pageBox {
		padding: 5px;
	}
	
	.pageBoxTitle {
		background-color: #DEE9EC;
		font-weight: bold;
		padding: 2px;
	}
	
	.sectionBox {
		padding: 5px;
	}
	
	.sectionBoxTitle {
		text-align: center;
		border-bottom: 1 solid black;
		font-weight: bold;
	}
	
	.fieldTitle {
		padding: 2px 3px 2px 3px;
	}
	
	.navigation	{
		color: #555;
		margin-left: 1em;
	}
</style>
<br/>
<script type="text/javascript">
<!--
    function cancelEditForm() {
        document.getElementById("method").value = "cancel";
        document.getElementById("editSummaryForm").submit();
        return true;
    }
    function saveAndReorder() {
        document.getElementById("method").value = "saveAndReorder";
        document.getElementById("editSummaryForm").submit();
        return true;
    }//-->
    function save() {
        document.getElementById("method").value = "save";
        document.getElementById("editSummaryForm").submit();
        return true;
    }

</script>

<div class="breadcrumb">
You are here: <a href="../emdt/emdtHome.form"><img src="../emdt/images/16x16/icon.png" style="vertical-align: top;"/> eMDT</a> &gt; <a href="../emdt/reportMenu.jsp">Reports</a> &gt; <a href="../emdt/patientSummaryActions.form">Patient Summaries</a>&gt; <a class="selected" >Edit Summary Details</a>
</div>
<smvc:form id="editSummaryForm" action="../emdt/summaryFormActions.form" modelAttribute="summaryFormForm">
	<input type="hidden" name="redirectParams" value="<c:out value="${requestScope['javax.servlet.forward.query_string']}" />" />
	<input type="hidden" name="method" value="save" id="method"/>
	<div class="error">
	<c:if test="${message != null}">
			<c:out value="${message}"/>
	</c:if>
	</div>
	<table width="70%">
		<tr>
			<td>
				<div class="dialogBox">
				<div class="dialogTitle">Form: <c:out value="${formDef.label}"/></div>
				<div class="dialogContent">
				
				 	<c:forEach var="page" items="${formDef.children}">
				 		<div class="pageBox">
				 			<div class="pageBoxTitle">Page:<c:out value="${page.label}"/></div>
				 			<div class="pageBoxContent">
				 				<c:forEach var="section" items="${page.children}">
				 					<div class="sectionBox">
				 						<div class="sectionBoxTitle">Section: <c:out value="${section.label}"/></div>
				 						<div class="sectionBoxContent">
				 							<c:forEach var="field" items="${section.children}">
				 								<div class="fieldTitle"><smvc:checkbox path="selected" value="${field.name}" cssClass="allNonInvert"/>&nbsp;<c:out value="${field.label}"/></div>
				 							</c:forEach>
				 						</div>
				 					</div>
				 				</c:forEach>
				 			</div>
				 		</div>
				 	</c:forEach>
				 	<div class="navigation">Select: <a href="javascript:select('all')">All</a> | <a href="javascript:select('none')">None</a> | <a href="javascript:select('invert')">Invert</a>
				 	</div>
				 	
				</div>
				</div>
			</td>
		</tr>
		<tr>
			<td align="center">
				<input type="button" value="Cancel" onclick="javascript:location.href='../emdt/patientSummaryActions.form?method=load&id=<c:out value="${patientSummary.guid}"/>'"/>&nbsp;
				<input type="button" value="Save" onclick="save();"/>&nbsp;
				<input type="button" value="Save And Reorder" onclick = "return saveAndReorder();"/></td>
		</tr>
	</table>
</smvc:form>