1<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="iso-8859-1"%>
2
3<html><head>
4<%@ include file="head.jsp" %>
5<script type="text/javascript">
6function fillBox(what)
7{
8	document.forms[0].query.value = "SELECT * FROM " + what.firstChild.nodeValue;
9	return false;
10}
11</script>
12<style>
13input[type="submit"],input[type="button"] {
14    padding: 10px 50px;
15    margin: 10px 0px -20px 0px;
16}
17p {
18    padding: 0;
19    border: 0;
20    margin: 0px 0px 5px 0px;
21}
22</style>
23</head><body class="mainframe bgcolor1" onload="document.getElementById('query').focus()">
24<h1>Database query</h1>
25
26<div style="float:left; text-align:left; width: 100%; display: block;">
27<fmt:message key="db.tables" />
28</div>
29<div style="float:left; text-align:left; width: 100%; display: block;">
30<fmt:message key="db.query" />
31</div>
32<div style="float:left;">
33
34<form method="post" action="db.view" name="action">
35    <textarea rows="8" cols="140" id="query" name="query" style="margin-top:1em">${model.query}</textarea><br>
36
37    <fieldset style="margin-top:8px;">
38
39    <input type="radio" id="default" name="option" value="default" checked="checked" style="margin-top:8px;">
40    <label for="export"> Output to Console</label>
41
42    <input type="radio" id="export" name="option" value="export">
43    <label for="export"> Export as CSV</label>
44
45    <input type="radio" id="download" name="option" value="download">
46    <label for="download"> Download as CSV</label><br>
47
48    </fieldset>
49
50    <input type="submit" value="query">
51</form>
52
53</div>
54<div style="float:left;margin-top: 158px;margin-left: -480px;">
55<c:if test="${model.export}">
56    <p class="warning">
57        ${model.exportPath}
58    </p>
59</c:if>
60</div>
61
62<c:if test="${model.download}">
63    <p class="warning">
64        download
65    </p>
66</c:if>
67
68<c:if test="${not empty model.result}">
69<div style="left;">
70    <h1 style="margin-top:530px">Result</h1>
71
72    <table class="indent ruleTableCellDB" style="border-collapse:collapse; white-space:nowrap; border-spacing:1px;">
73        <c:forEach items="${model.result}" var="row" varStatus="loopStatus">
74
75            <c:if test="${loopStatus.count == 1}">
76                <tr>
77                    <c:forEach items="${row}" var="entry">
78                        <td class="ruleTableHeader">${entry.key}</td>
79                    </c:forEach>
80                </tr>
81            </c:if>
82            <tr>
83                <c:forEach items="${row}" var="entry">
84                    <td class="ruleTableCellDB">${entry.value}</td>
85                </c:forEach>
86            </tr>
87        </c:forEach>
88
89    </table>
90</div>
91</c:if>
92
93<c:if test="${not empty model.error}">
94    <h1 style="margin-top:510px;">Error</h1>
95
96    <p class="warning">
97        ${model.error}
98    </p>
99</c:if>
100
101</body></html>