<%@ include file="/includes.jsp"%>
<%@ taglib prefix="smvc" uri="http://www.springframework.org/tags/form"%>

	<smvc:form action="wmuhExporter.form" method="post">
	<input type="hidden" name="redirectParams" value="<c:out value="${requestScope['javax.servlet.forward.query_string']}" />" />

		<fieldset class="nobg" style="width: 40%; text-align: left"><legend>WMUH Urgent Cancer Referrals Feed</legend>

		<fieldset class="buttonFieldset">
			<div align="left">
			This will query the WMUH Data Warehouse and produce a data extract.<br/>
			This process may take some time.<br/><br/>
			To begin, click this button:
			</div>
			<div align="center">
			<input type="submit" name="startExport" value="Step 1: Start export from Data Warehouse" onclick="showPleaseWait();"/>
			<c:if test="${not empty errors}">
				<br/>
				<img src="../images/16x16/error.png" alt="Error" /><font color="red"> There were errors - please see below for details.</font>
				<br/>
			</c:if>
			<c:if test="${results != null}">
				File: <a href="file:///${outputfile }" target="_blank" title="Click to download xml export file"><c:out value="${outputfile }"/></a><br/><br/>
				<input type="submit" name="startImport" value="Step 2: Click here to import this file" />
			</c:if>
			</div>
		</fieldset>
			
		<c:if test="${not empty results}">
			<fieldset class="nobg">
				<legend>Results</legend>
				<div class="message">
					<img src="../images/16x16/information.png" alt="i" /> Result of feed export:
					<ul>
						<c:forEach var="row" items="${results }" varStatus="ss">
							<li><c:out value="${row}" /></li>
						</c:forEach>
					</ul>
				</div>
			</fieldset>	

		</c:if> 
		<c:if test="${not empty errors}">
			<fieldset class="nobg">
			<img src="../images/16x16/error.png" alt="Error" /><font color="red"> Errors:</font>
			
			<ul>
				<c:forEach var="row" items="${errors }" varStatus="ss">
					<li><c:out value="${row}"/></li>
				</c:forEach>
			</ul>
			</fieldset>
		</c:if>
	</fieldset>
	</smvc:form>

		<iframe id="waitframe" src="reports/pleaseWait.jsp" frameborder="0" width="200" style="visibility:hidden;" ></iframe>



