<%@ include file="/includes.jsp" %>
<br/>
<html:javascript formName="meetingForm" staticJavascript="true" dynamicJavascript="true"/>
<s:form action="/meetings/saveMeeting" onsubmit="return validateMeetingForm(this);">
	<c:forEach var="attendee" items="${meetingForm.meeting.attendees}" varStatus="attIndex">
			<c:set var="attIndexInteger" value="${attIndex.count}"/>
				<%
				com.ardeo.entities.event.Attendee attendee = (com.ardeo.entities.event.Attendee) pageContext.getAttribute("attendee");
				Integer attIndex = (Integer) pageContext.getAttribute("attIndexInteger");
				%>
		<html:hidden property="meeting.attendees[<c:out value="${attIndex}"/>].name"/>
		<html:hidden property="meeting.attendees[<c:out value="${attIndex}"/>].address"/>
	</c:forEach>
	<c:if test="${meetingForm.meeting.items }">
		<c:forEach var="item" items="${meetingForm.meeting.items}" varStatus="index">
		<c:set var="indexInteger" value="${index.count}"/>
				<%
				com.ardeo.entities.MeetingItem item = (com.ardeo.entities.MeetingItem) pageContext.getAttribute("item");
				Integer index = (Integer) pageContext.getAttribute("indexInteger");
				%>
				<html:hidden property='<%="patientIsDiscussed(" + item.getPatientDiscussed().getId() + ")"%>'/>
				<html:hidden property='<%="patientReasonNotes(" + item.getPatientDiscussed().getId() + ")"%>'/>
				<html:hidden property='<%="followUpDate(" + item.getPatientDiscussed().getId() + ")"%>'/>
				<html:hidden property='<%="patientNotes(" + item.getPatientDiscussed().getId() + ")"%>'/>
		</c:forEach>
	</c:if>
		
	<table cellpadding="0" cellspacing="0">
		<tr>
			<td valign="top">
				<tags:dialogBox title="Meeting Overview">
					<table>
						<tr>
							<td  class="label">Title: <html:text size="70" property="meeting.title"/></td>
						</tr>
						<tr>
							<td  class="label">
								Date: <webapp:date property="startDate" defaultValue="today" styleId="meetingDate"/> 
								From: <html:text property="startTime" size="5"/> 
								Until: <html:text property="endTime" size="5"/> 
							</td>
						</tr>
						<tr>
							<td>
								Include summary:&nbsp;
								<html:select property="meeting.summaryId">
									<html:option value=""></html:option>
									<c:forEach var="summary" items="${emdt.patientSummaries}">
										<html:option value="<c:out value="${summary.id}"/>"><c:out value="${summary.title}"/></html:option>
									</c:forEach>
								</html:select>
							</td>
						</tr>
						<tr>
							<td class="label">
								Notes:<br/>
								<html:textarea rows="12" cols="50" property="meeting.notes"/>
							</td>
						</tr>
					</table>
				</tags:dialogBox>
			</td>
				</tr>
			</table>
			<br/>

	<html:submit value="Choose Patients" onclick="return dispatch('changePatients')"/>&nbsp;<html:submit value="Save"/><br/><br/>
</s:form>