<%@ include file="/includes.jsp"%>
<link href="../referrals/css/main.css" type="text/css" rel="stylesheet" />
<%@ taglib prefix="smvc" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<script type="text/javascript">
	function searchPatient(event) {
		if (event.keyCode == 13) {
			document.getElementById(patientInMeeting);
		}
	}
</script>
<table  width="60%">
<tr><td>
<c:if test="${requestScope.errorMsg ne null}">
	<div class="error"><img
		src="../images/16x16/error_white_bg.png" alt="e" /><c:out value="${requestScope.errorMsg}"/></div>
	<br />
</c:if>
</td></tr>

<tr><td>
<form id="patientInMeeting" action="patientInMeeting.form" method="post">
<input type="hidden" name="action" id="action" value="SEARCH" />
<input type="hidden" name="<c:out value="${_csrf.parameterName}"/>" value="<c:out value="${_csrf.token}" />" />
<input type="hidden" name="clickedFrom" id="clickedFrom" value='<%=request.getAttribute("clickedFrom")!=null?request.getAttribute("clickedFrom"):""%>' />
<tags:dialogBox title="Find Patients in Meetings">
	<div class="rowDivFirst">&nbsp;</div>
	<div class="rowDivFirst">
		<div class="fieldSetColumnFirst">&nbsp;&nbsp;Patient Forename</div>
		<div class="fieldSetColumnSecond">
			<input type="text" name="patientForename" value="<c:out value="${patientForename}"/>">
		</div>
		<div class="fieldSetColumnFirst">Patient Surname</div>
		<div class="fieldSetColumnFourth">
			<input type="text" name="patientSurname" value="<c:out value="${patientSurname}"/>">		
		</div>
	</div>
	<div class="rowDivFirst">&nbsp;</div>
	<div class="rowDivFirst">
		<div class="fieldSetColumnFirst">&nbsp;&nbsp;Meeting date</div>
		<div class="fieldSetColumnSecond">
			<input type="text" class="mediumTxtBox" name="meetingdate" id="meetingdate" value="<c:out value="${meetingdate}"/>" title="Enter date of meeting in dd/mm/yyyy format, or leave blank to search for any meeting date" placeholder="dd/mm/yyyy">
		 	<img title='Click to choose date' style='cursor: pointer'
				src='../images/16x16/date.png' id='meetingdate_DateTrigger' />
		</div>
		<div class="fieldSetColumnFirst">Patient Hospital number</div>
		<div class="fieldSetColumnFourth">
			<input type="text" name="hospitalnumber" value="<c:out value="${hospitalnumber}"/>">
		</div>
	</div>
	<div class="rowDivFirst">&nbsp;</div>
	<div class="rowDivFirst">
		<div class="fieldSetColumnFirst">&nbsp;&nbsp;Hospital</div>
		<div class="fieldSetColumnFourth">
			<select name="selectedHospital" id="selectedHospital" >
				<option value="">----All Hospital---</option>
				<c:forEach var="hospitals" items="${webapp.hospMap}">
					<option value="<c:out value="${hospitals.key}"/>" <c:if test="${selectedHospital== hospitals.key}">selected="selected"</c:if> ><c:out value="${hospitals.value}"/></option>
				</c:forEach>
			</select>
		</div>
		<div style="width:40%;height:auto;">&nbsp;</div>
	</div>
	<div class="rowDivFirst">
		<div class="fieldSetColumnFirst">&nbsp;&nbsp;Meeting speciality</div>
		<div class="fieldSetColumnFourth">
			<webapp:selectAndEditList includeEmpty="true" path="speciality" domain="EMDT" list="speciality" currentValue="${speciality}"/>
		</div>
		<div style="width:40%;height:auto;">&nbsp;</div>
	</div>
	<div class="rowDivFirst">&nbsp;</div>
</tags:dialogBox>

<div class="containerMedium">
	<div class="floatRight">
		<input type="submit" value="Search" onclick="document.getElementById('patientInMeeting').submit();" />
	</div>
</div>
</form></td></tr></table>
