2303 |
02 Apr 14 |
olle |
1 |
<%@ page |
2303 |
02 Apr 14 |
olle |
2 |
pageEncoding="UTF-8" |
2303 |
02 Apr 14 |
olle |
3 |
session="false" |
2303 |
02 Apr 14 |
olle |
4 |
import="net.sf.basedb.core.User" |
2303 |
02 Apr 14 |
olle |
5 |
import="net.sf.basedb.core.DbControl" |
2303 |
02 Apr 14 |
olle |
6 |
import="net.sf.basedb.core.SessionControl" |
2303 |
02 Apr 14 |
olle |
7 |
import="net.sf.basedb.core.Application" |
2303 |
02 Apr 14 |
olle |
8 |
import="net.sf.basedb.clients.web.Base" |
2303 |
02 Apr 14 |
olle |
9 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
2303 |
02 Apr 14 |
olle |
10 |
%> |
2303 |
02 Apr 14 |
olle |
11 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
2303 |
02 Apr 14 |
olle |
12 |
<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %> |
2303 |
02 Apr 14 |
olle |
13 |
<% |
2303 |
02 Apr 14 |
olle |
14 |
final SessionControl sc = Base.getExistingSessionControl(request, true); |
2303 |
02 Apr 14 |
olle |
15 |
final String ID = sc.getId(); |
2303 |
02 Apr 14 |
olle |
16 |
final float scale = Base.getScale(sc); |
2303 |
02 Apr 14 |
olle |
17 |
final String home = ExtensionsControl.getHomeUrl("net.sf.basedb.labenv"); |
2303 |
02 Apr 14 |
olle |
18 |
DbControl dc = null; |
2303 |
02 Apr 14 |
olle |
19 |
try |
2303 |
02 Apr 14 |
olle |
20 |
{ |
2303 |
02 Apr 14 |
olle |
21 |
dc = sc.newDbControl(); |
2303 |
02 Apr 14 |
olle |
22 |
final User user = User.getById(dc, sc.getLoggedInUserId()); |
2303 |
02 Apr 14 |
olle |
23 |
%> |
2303 |
02 Apr 14 |
olle |
24 |
<base:page type="default" > |
2989 |
02 Dec 14 |
olle |
25 |
<base:head |
3735 |
10 Feb 16 |
olle |
26 |
scripts="~../labenv.js,~labenvironmentdatabasestatistics.js,~boxplot.js" |
3735 |
10 Feb 16 |
olle |
27 |
styles="path.css,~../css/labenv.css,~../css/report.css" |
2989 |
02 Dec 14 |
olle |
28 |
> |
2303 |
02 Apr 14 |
olle |
29 |
|
2989 |
02 Dec 14 |
olle |
30 |
<style> |
2303 |
02 Apr 14 |
olle |
31 |
canvas |
2303 |
02 Apr 14 |
olle |
32 |
{ |
2303 |
02 Apr 14 |
olle |
33 |
width: 700px; |
2303 |
02 Apr 14 |
olle |
34 |
height: 550px; |
2303 |
02 Apr 14 |
olle |
35 |
} |
2989 |
02 Dec 14 |
olle |
36 |
.guide |
2989 |
02 Dec 14 |
olle |
37 |
{ |
2989 |
02 Dec 14 |
olle |
38 |
position: absolute; |
2989 |
02 Dec 14 |
olle |
39 |
z-index: 99; |
2989 |
02 Dec 14 |
olle |
40 |
display: none; |
2989 |
02 Dec 14 |
olle |
41 |
background-color: #224488; |
2989 |
02 Dec 14 |
olle |
42 |
} |
2303 |
02 Apr 14 |
olle |
43 |
</style> |
2303 |
02 Apr 14 |
olle |
44 |
</base:head> |
2989 |
02 Dec 14 |
olle |
45 |
<base:body> |
2303 |
02 Apr 14 |
olle |
46 |
<p:path><p:pathelement |
3011 |
05 Dec 14 |
nicklas |
47 |
title="LabEnv" href="<%="./labenvironmentdatabasestatistics.jsp?ID="+ID%>" |
2303 |
02 Apr 14 |
olle |
48 |
/><p:pathelement title="Lab environment statistics" |
2303 |
02 Apr 14 |
olle |
49 |
/></p:path> |
2989 |
02 Dec 14 |
olle |
50 |
<div id="x-guide" class="guide" style="width: 1px;"></div> |
2989 |
02 Dec 14 |
olle |
51 |
<div id="y-guide" class="guide" style="height: 1px;"></div> |
2989 |
02 Dec 14 |
olle |
52 |
|
2303 |
02 Apr 14 |
olle |
53 |
<div class="content"> |
2989 |
02 Dec 14 |
olle |
54 |
<form name="labenv" id="wizard" class="wizard"> |
2303 |
02 Apr 14 |
olle |
55 |
|
2303 |
02 Apr 14 |
olle |
<!-- 1. Report type--> |
2989 |
02 Dec 14 |
olle |
57 |
<div class="step" id="step-1"> |
2989 |
02 Dec 14 |
olle |
58 |
<div class="step-no">1</div> |
2989 |
02 Dec 14 |
olle |
59 |
<div class="step-title">Report type</div> |
2989 |
02 Dec 14 |
olle |
60 |
<div class="step-content"> |
2989 |
02 Dec 14 |
olle |
61 |
|
2989 |
02 Dec 14 |
olle |
62 |
<table class="step-form"> |
2989 |
02 Dec 14 |
olle |
63 |
<tr> |
2303 |
02 Apr 14 |
olle |
64 |
<td class="prompt">Report</td> |
2303 |
02 Apr 14 |
olle |
65 |
<td class="input"> |
2989 |
02 Dec 14 |
olle |
66 |
<select name="reporttype" style="width: 20em"> |
2303 |
02 Apr 14 |
olle |
67 |
<option value="labenvironmentdailydistribution" selected="yes">Daily distribution statistics</option> |
2303 |
02 Apr 14 |
olle |
68 |
<option value="labenvironmentweeklydistribution">Weekly distribution statistics</option> |
2303 |
02 Apr 14 |
olle |
69 |
</select> |
2303 |
02 Apr 14 |
olle |
70 |
</td> |
2303 |
02 Apr 14 |
olle |
71 |
<td class="status" id="report.status"></td> |
2303 |
02 Apr 14 |
olle |
72 |
<td class="help"> |
2989 |
02 Dec 14 |
olle |
73 |
<span id="report.message" class="message"></span> |
2303 |
02 Apr 14 |
olle |
74 |
Select which report to generate. |
2303 |
02 Apr 14 |
olle |
75 |
</td> |
2303 |
02 Apr 14 |
olle |
76 |
</tr> |
2303 |
02 Apr 14 |
olle |
77 |
</table> |
2989 |
02 Dec 14 |
olle |
78 |
</div> |
2989 |
02 Dec 14 |
olle |
79 |
</div> |
2303 |
02 Apr 14 |
olle |
80 |
|
2439 |
19 May 14 |
olle |
81 |
<div id="parameterSection" style="display:none;"> |
2303 |
02 Apr 14 |
olle |
82 |
<p></p> |
2303 |
02 Apr 14 |
olle |
<!-- 2. Report parameters--> |
2989 |
02 Dec 14 |
olle |
84 |
<div class="step" id="step-2"> |
2989 |
02 Dec 14 |
olle |
85 |
<div class="step-no">2</div> |
2989 |
02 Dec 14 |
olle |
86 |
<div class="step-title">Report parameters</div> |
2989 |
02 Dec 14 |
olle |
87 |
<div class="step-content"> |
2989 |
02 Dec 14 |
olle |
88 |
|
2989 |
02 Dec 14 |
olle |
89 |
<table class="step-form"> |
2303 |
02 Apr 14 |
olle |
90 |
<tr> |
2303 |
02 Apr 14 |
olle |
91 |
<td valign="top" class="prompt"> |
2303 |
02 Apr 14 |
olle |
92 |
<div id="reportPeriodSubSection01" style="display:none;"> |
2303 |
02 Apr 14 |
olle |
93 |
<text id="reportPeriodSubSection01Header">From</text> |
2303 |
02 Apr 14 |
olle |
94 |
</div> |
2303 |
02 Apr 14 |
olle |
95 |
</td> |
2303 |
02 Apr 14 |
olle |
96 |
<td valign="top" class="input"> |
2303 |
02 Apr 14 |
olle |
97 |
<div id="reportPeriodSubSection02" style="display:none;"> |
2989 |
02 Dec 14 |
olle |
98 |
Date <input type="text" name="fromdate" value="" |
2989 |
02 Dec 14 |
olle |
99 |
style="width: 10em" maxlength="10" |
2989 |
02 Dec 14 |
olle |
100 |
data-auto-init="focus-on-enter" data-next-focus="fromtime" |
2989 |
02 Dec 14 |
olle |
101 |
> |
2989 |
02 Dec 14 |
olle |
102 |
Time <input type="text" name="fromtime" value="" |
2989 |
02 Dec 14 |
olle |
103 |
style="width: 4em" maxlength="4" |
2989 |
02 Dec 14 |
olle |
104 |
data-auto-init="focus-on-enter" data-next-focus="todate" |
2989 |
02 Dec 14 |
olle |
105 |
> |
2303 |
02 Apr 14 |
olle |
106 |
</div> |
2303 |
02 Apr 14 |
olle |
107 |
</td> |
2303 |
02 Apr 14 |
olle |
108 |
<td valign="top" class="status" id="sensorSelect.status"></td> |
2303 |
02 Apr 14 |
olle |
109 |
<td class="help"> |
2303 |
02 Apr 14 |
olle |
110 |
<div id="reportPeriodSubSection04" style="display:none;"> |
2303 |
02 Apr 14 |
olle |
111 |
<span id="sensorSelect.message" class="message" style="display: none;"></span> |
2303 |
02 Apr 14 |
olle |
112 |
<text id="reportPeriodSubSection04HelpText">Select sensor(s)</text><br> |
2303 |
02 Apr 14 |
olle |
113 |
</div> |
2303 |
02 Apr 14 |
olle |
114 |
</td> |
2303 |
02 Apr 14 |
olle |
115 |
</tr> |
2303 |
02 Apr 14 |
olle |
116 |
<tr> |
2303 |
02 Apr 14 |
olle |
117 |
<td valign="top" class="prompt"> |
2303 |
02 Apr 14 |
olle |
118 |
<div id="viewTypeSubSection01" style="display:none;"> |
2303 |
02 Apr 14 |
olle |
119 |
To |
2303 |
02 Apr 14 |
olle |
120 |
</div> |
2303 |
02 Apr 14 |
olle |
121 |
</td> |
2303 |
02 Apr 14 |
olle |
122 |
<td valign="top" class="input"> |
2303 |
02 Apr 14 |
olle |
123 |
<div id="viewTypeSubSection02" style="display:none;"> |
2989 |
02 Dec 14 |
olle |
124 |
Date <input type="text" name="todate" value="" |
2989 |
02 Dec 14 |
olle |
125 |
style="width: 10em" maxlength="10" |
2989 |
02 Dec 14 |
olle |
126 |
data-auto-init="focus-on-enter" data-next-focus="totime" |
2989 |
02 Dec 14 |
olle |
127 |
> |
2989 |
02 Dec 14 |
olle |
128 |
Time <input type="text" name="totime" value="" |
2989 |
02 Dec 14 |
olle |
129 |
style="width: 4em" maxlength="4" |
2989 |
02 Dec 14 |
olle |
130 |
data-auto-init="focus-on-enter" data-next-focus="weekdayfilter" |
2989 |
02 Dec 14 |
olle |
131 |
> |
2303 |
02 Apr 14 |
olle |
132 |
</div> |
2303 |
02 Apr 14 |
olle |
133 |
</td> |
2303 |
02 Apr 14 |
olle |
134 |
<td valign="top" class="status" id="displayViewType.status"></td> |
2303 |
02 Apr 14 |
olle |
135 |
<td class="help"> |
2303 |
02 Apr 14 |
olle |
136 |
<div id="viewTypeSubSection04" style="display:none;"> |
2303 |
02 Apr 14 |
olle |
137 |
<span id="displayViewType.message" class="message" style="display: none;"></span> |
2303 |
02 Apr 14 |
olle |
138 |
End date+time (YYYYMMDD, HHMM) Blank fields give data to end. |
2303 |
02 Apr 14 |
olle |
139 |
</div> |
2303 |
02 Apr 14 |
olle |
140 |
</td> |
2303 |
02 Apr 14 |
olle |
141 |
</tr> |
2395 |
29 Apr 14 |
olle |
142 |
<tr> |
2395 |
29 Apr 14 |
olle |
143 |
<td valign="top" class="prompt"> |
2395 |
29 Apr 14 |
olle |
144 |
<div id="dayTimeFilterSubSection01" style="display:none;"> |
2395 |
29 Apr 14 |
olle |
145 |
Daytime filter |
2395 |
29 Apr 14 |
olle |
146 |
</div> |
2395 |
29 Apr 14 |
olle |
147 |
</td> |
2395 |
29 Apr 14 |
olle |
148 |
<td valign="top" class="input"> |
2395 |
29 Apr 14 |
olle |
149 |
<div id="dayTimeFilterSubSection02" style="display:none;"> |
2989 |
02 Dec 14 |
olle |
150 |
From time <input type="text" name="filterfromtime" value="" |
2989 |
02 Dec 14 |
olle |
151 |
style="width: 4em" maxlength="4" |
2989 |
02 Dec 14 |
olle |
152 |
data-auto-init="focus-on-enter" data-next-focus="filtertotime" |
2989 |
02 Dec 14 |
olle |
153 |
> |
2989 |
02 Dec 14 |
olle |
154 |
To time <input type="text" name="filtertotime" value="" |
2989 |
02 Dec 14 |
olle |
155 |
style="width: 4em" maxlength="4" |
2989 |
02 Dec 14 |
olle |
156 |
data-auto-init="focus-on-enter" data-next-focus="weekdayfilter" |
2989 |
02 Dec 14 |
olle |
157 |
> |
2395 |
29 Apr 14 |
olle |
158 |
</div> |
2395 |
29 Apr 14 |
olle |
159 |
</td> |
2395 |
29 Apr 14 |
olle |
160 |
<td valign="top" class="status" id="dayTimeFilter.status"></td> |
2395 |
29 Apr 14 |
olle |
161 |
<td class="help"> |
2395 |
29 Apr 14 |
olle |
162 |
<div id="dayTimeFilterSubSection04" style="display:none;"> |
2395 |
29 Apr 14 |
olle |
163 |
<span id="dayTimeFilter.message" class="message" style="display: none;"></span> |
2395 |
29 Apr 14 |
olle |
164 |
Select what daytime interval to include in statistics (HHMM). Note that climate control in some labs are only active during day. Blank fields give data for full day. |
2395 |
29 Apr 14 |
olle |
165 |
</div> |
2395 |
29 Apr 14 |
olle |
166 |
</td> |
2395 |
29 Apr 14 |
olle |
167 |
</tr> |
2303 |
02 Apr 14 |
olle |
168 |
<tr> |
2303 |
02 Apr 14 |
olle |
169 |
<td valign="top" class="prompt"> |
2303 |
02 Apr 14 |
olle |
170 |
<div id="weekDayFilterSubSection01" style="display:none;"> |
2303 |
02 Apr 14 |
olle |
171 |
Week day filter |
2303 |
02 Apr 14 |
olle |
172 |
</div> |
2303 |
02 Apr 14 |
olle |
173 |
</td> |
2303 |
02 Apr 14 |
olle |
174 |
<td valign="top" class="input"> |
2303 |
02 Apr 14 |
olle |
175 |
<div id="weekDayFilterSubSection02" style="display:none;"> |
2989 |
02 Dec 14 |
olle |
176 |
<select id="weekDayFilterSelectId" name="weekdayfilter" style="width: 15em"> |
2303 |
02 Apr 14 |
olle |
177 |
<option value="all">All</option> |
2395 |
29 Apr 14 |
olle |
178 |
<option value="mondaytofriday">Mon-Fri only</option> |
2303 |
02 Apr 14 |
olle |
179 |
<option value="saturdaytosunday">Sat-Sun only</option> |
2395 |
29 Apr 14 |
olle |
180 |
<option value="workdays" selected="yes">Workdays</option> |
2395 |
29 Apr 14 |
olle |
181 |
<option value="nonworkdays">Non-workdays</option> |
2303 |
02 Apr 14 |
olle |
182 |
</select> |
2303 |
02 Apr 14 |
olle |
183 |
</div> |
2303 |
02 Apr 14 |
olle |
184 |
</td> |
2303 |
02 Apr 14 |
olle |
185 |
<td valign="top" class="status" id="weekDayFilter.status"></td> |
2303 |
02 Apr 14 |
olle |
186 |
<td class="help"> |
2303 |
02 Apr 14 |
olle |
187 |
<div id="weekDayFilterSubSection04" style="display:none;"> |
2303 |
02 Apr 14 |
olle |
188 |
<span id="weekDayFilter.message" class="message" style="display: none;"></span> |
2395 |
29 Apr 14 |
olle |
189 |
Select what weekdays to include in statistics. Note that climate control in some labs are shut down on non-workdays (Saturdays, Sundays and work-free days related to holidays). |
2303 |
02 Apr 14 |
olle |
190 |
</div> |
2303 |
02 Apr 14 |
olle |
191 |
</td> |
2303 |
02 Apr 14 |
olle |
192 |
</tr> |
2303 |
02 Apr 14 |
olle |
193 |
<tr> |
2303 |
02 Apr 14 |
olle |
194 |
<td valign="top" class="prompt"> |
2303 |
02 Apr 14 |
olle |
195 |
<div id="chartVariantSubSection01" style="display:none;"> |
2303 |
02 Apr 14 |
olle |
196 |
Chart data |
2303 |
02 Apr 14 |
olle |
197 |
</div> |
2303 |
02 Apr 14 |
olle |
198 |
</td> |
2303 |
02 Apr 14 |
olle |
199 |
<td valign="top" class="input"> |
2303 |
02 Apr 14 |
olle |
200 |
<div id="chartVariantSubSection02" style="display:none;"> |
2989 |
02 Dec 14 |
olle |
201 |
<select id="sensorSelectId" name="chartvariant" style="width: 20em"> |
2303 |
02 Apr 14 |
olle |
202 |
<option value="all">All</option> |
2303 |
02 Apr 14 |
olle |
203 |
</select> |
2303 |
02 Apr 14 |
olle |
204 |
</div> |
2303 |
02 Apr 14 |
olle |
205 |
</td> |
2303 |
02 Apr 14 |
olle |
206 |
<td valign="top" class="status" id="displaychartVariant.status"></td> |
2303 |
02 Apr 14 |
olle |
207 |
<td class="help"> |
2303 |
02 Apr 14 |
olle |
208 |
<div id="chartVariantSubSection04" style="display:none;"> |
2303 |
02 Apr 14 |
olle |
209 |
<span id="displaychartVariant.message" class="message" style="display: none;"></span> |
2303 |
02 Apr 14 |
olle |
210 |
Select what data to report. |
2303 |
02 Apr 14 |
olle |
211 |
</div> |
2303 |
02 Apr 14 |
olle |
212 |
</td> |
2303 |
02 Apr 14 |
olle |
213 |
</tr> |
2303 |
02 Apr 14 |
olle |
214 |
</table> |
2989 |
02 Dec 14 |
olle |
215 |
</div> |
2989 |
02 Dec 14 |
olle |
216 |
</div> |
2303 |
02 Apr 14 |
olle |
217 |
</div> |
2303 |
02 Apr 14 |
olle |
218 |
|
2989 |
02 Dec 14 |
olle |
219 |
<div class="step" id="step-3"> |
2989 |
02 Dec 14 |
olle |
220 |
<div class="step-no">3</div> |
2989 |
02 Dec 14 |
olle |
221 |
<div class="step-title">Generated report |
2989 |
02 Dec 14 |
olle |
222 |
<span id="printButton" class="link"><img src="../images/print.png">Print version…</span> |
2989 |
02 Dec 14 |
olle |
223 |
</div> |
2989 |
02 Dec 14 |
olle |
224 |
<div class="step-content" id="step-3-content"> |
2989 |
02 Dec 14 |
olle |
225 |
<div id="reportdiv" style="text-align: center;"></div> |
2989 |
02 Dec 14 |
olle |
226 |
</div> |
2989 |
02 Dec 14 |
olle |
227 |
</div> |
2989 |
02 Dec 14 |
olle |
228 |
|
2989 |
02 Dec 14 |
olle |
229 |
<div id="wizard-status"></div> |
2303 |
02 Apr 14 |
olle |
230 |
|
2303 |
02 Apr 14 |
olle |
231 |
<div class="messagecontainer error" id="errorMessage" style="display: none; width: 950px; margin-left: 20px; margin-bottom: 0px;"></div> |
2989 |
02 Dec 14 |
olle |
232 |
|
2989 |
02 Dec 14 |
olle |
233 |
<table class="navigation" id="navigation"> |
2303 |
02 Apr 14 |
olle |
234 |
<tr> |
2989 |
02 Dec 14 |
olle |
235 |
<td><base:button id="gocancel" title="Cancel" /></td> |
2989 |
02 Dec 14 |
olle |
236 |
<td><base:button id="gonext" title="Next" image="<%="gonext.png"%>" /></td> |
2989 |
02 Dec 14 |
olle |
237 |
<td><base:button id="gocreate" title="Generate" image="<%="gonext.png"%>" /></td> |
2989 |
02 Dec 14 |
olle |
238 |
<td><base:button id="gorestart" title="Restart" image="<%="goback.png"%>" /></td> |
2303 |
02 Apr 14 |
olle |
239 |
<td id="gonext.message" class="message"></td> |
2303 |
02 Apr 14 |
olle |
240 |
</tr> |
2303 |
02 Apr 14 |
olle |
241 |
</table> |
2303 |
02 Apr 14 |
olle |
242 |
</form> |
2303 |
02 Apr 14 |
olle |
243 |
</div> |
2303 |
02 Apr 14 |
olle |
244 |
|
2303 |
02 Apr 14 |
olle |
245 |
</base:body> |
2303 |
02 Apr 14 |
olle |
246 |
</base:page> |
2303 |
02 Apr 14 |
olle |
247 |
<% |
2303 |
02 Apr 14 |
olle |
248 |
} |
2303 |
02 Apr 14 |
olle |
249 |
finally |
2303 |
02 Apr 14 |
olle |
250 |
{ |
2303 |
02 Apr 14 |
olle |
251 |
if (dc != null) dc.close(); |
2303 |
02 Apr 14 |
olle |
252 |
} |
2303 |
02 Apr 14 |
olle |
253 |
%> |