<%@ include file="/includes.jsp"%>
<%@ taglib prefix="smvc" uri="http://www.springframework.org/tags/form"%>
	<br/>
	<smvc:form action="importQueryBuilder.form?${_csrf.parameterName}=${_csrf.token}" method="post" enctype="multipart/form-data">
		<input type="hidden" name="redirectParams" value="<c:out value="${requestScope['javax.servlet.forward.query_string']}" />" />
		<table>
			<tr>
				<td class="error"><smvc:errors path="fileFormatError" /></td>
			</tr>
		</table>
		<br/>
		<fieldset class="nobg" style="width: 40%; text-align: left">
			<legend>Import Query</legend>
			<fieldset>
				File:&#160;<input type="file" name="document" onchange="setFileSize(this);"/><br/>
			</fieldset>
			<fieldset class="buttonFieldset">
				<input type="submit" name="startQueryImport" value="Start Import"/>
			</fieldset>

				<c:if test="${totalQueries != null}">
					<div class="message">
						<img src="../images/16x16/information.png" alt="i" />&#160;  <c:if test="${totalQueries == 1 }">There was 1 query in the import file</c:if>
																				<c:if test="${totalQueries != 1 }">There were <c:out value="${totalQueries}"/> queries in the import file</c:if>
						<ul>
						<c:if test="${numberInsertedQueries != null}">
							 <li>Queries created: <c:out value="${numberInsertedQueries}"/></li>						
						</c:if>
						</ul>
					</div>
				</c:if>
				<c:if test="${!empty numberRejectedQueries}">
					<c:if test="${numberRejectedQueries != 0}">
						<div class="message">
							<img src="../images/16x16/exclamation.png" alt="Warning"/> Note:<c:out value="${numberRejectedQueries}"/> queries were not imported.
						</div>
					</c:if>
				</c:if>

				<smvc:errors/>
		</fieldset>		
	</smvc:form>
	<input type="button" value="Return To Queries" onclick="document.location='queries.jsp'"/>
