query.jsp 1.88 KB
Newer Older
CED SA's avatar
CED SA committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>


<tiles:insert  definition=".listaNoAzioniDef" flush="true">

	<tiles:put name="head" type="string">
	</tiles:put>

	<tiles:put name="titoloMaschera" type="string" value="Esecuzione comandi SQL" />
	 
	<tiles:put name="dettaglio" type="string">
	<form name="query" method="post" action="${pageContext.request.contextPath}/Query.do">
		<table class="ricerca">
			<tr>
				<td class="etichetta-dato">Inserire query di SELECT</td>
				<td class="valore-dato">
					<textarea rows="10" cols="80" name="sql" id="sql">${param.sql}</textarea>
				</td>
			</tr>
			<tr>
				<td class="etichetta-dato">Inserire il codice PIN</td>
				<td class="valore-dato">
					<input type="password" name="pin" size="10" />
				</td>
			</tr>
			<tr class="comandi-dettaglio">
				<td colspan="2">
					<input type="submit" value="Estrai" class="bottone-azione"/>
					<input type="button" value="Cancella" class="bottone-azione" onclick="document.getElementById('sql').value = '';"/>&nbsp;
				</td>
			</tr>
		</table>
	</form>
	<c:if test="${not empty requestScope.risultato}">
	<br/>
	<br/>
	Numero record estratti: ${fn:length(requestScope.risultato)}<br/>
	
	<table class="datilista" id="risultatoQuery">
	<c:forEach var="riga" items="${requestScope.risultato}" varStatus="status">
	<c:if test="${status.first}">
	<thead>
	<tr>
		<c:forEach var="nomeColonna" items="${riga}"><th>${nomeColonna.key}</th></c:forEach>
	</tr>
	</thead>
	<tbody>
	</c:if>
	<tr class="<c:if test="${status.index % 2 == 0}">odd</c:if><c:if test="${status.index % 2 == 1}">even</c:if>">
	<c:forEach var="campo" items="${riga}"><td><c:out value="${campo.value}"/></td></c:forEach>
	</tr>
	</c:forEach>
	</tbody>
	</table>
	</c:if>
	</tiles:put>

</tiles:insert>