  
<jsp:useBean id="em" scope="session" class="EntrakMain"/>
<%@ page language="java" import=" java.util.*" errorPage="error.jsp"%>
<%!
    String timeScale;
    String environmentParameter ="tmp2";
    String resolution;
	String frequency;
	String fromHour;
	String toHour;
	String fromMinute;
	String toMinute;	
	String fromMonth;
	String toMonth;
	String fromYear;
	String toYear;
	String fromDay;
	String toDay;
	String eboxId ="A061737265";
	String ic_item;
	
	String hostOfDBMS;
%>
<html>
<head>
<title>RealTimeIndoorEnv</title>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</head>
 


<body BGCOLOR="#FFFFFF" TEXT="#000000" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0">

 
<table WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" HEIGHT="100%" BORDERCOLOR="#000000">
  <tr> 
	<td WIDTH="60%" HEIGHT="129" ALIGN="CENTER" VALIGN="middle"> 
	
	  <form NAME="form1" METHOD="post" ACTION="">
		<table WIDTH="80%" BORDER="0" CELLPADDING="2" BGCOLOR="#000000" ALIGN="CENTER">
		  <tr VALIGN="middle" BGCOLOR="#999999"> 
			<td ALIGN="center"> 
			  <center>
			  </center>
			  <table WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" HEIGHT="100%">
			  
			  	<tr> 
				  <td WIDTH="34%"><font COLOR="#FFFFFF" FACE="Arial, Helvetica, sans-serif" SIZE="2">e-box 
					id:</font></td>
				  <td WIDTH="66%"> 
					<input TYPE="text" NAME="eboxId" VALUE=<%=eboxId%> >
				  </td>
				</tr>
			  
				<tr> 
				  <td WIDTH="34%"><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">Parameter:</font> 
				  </td>
				  <td WIDTH="66%">
				   <input TYPE="text" NAME= "environmentParameter"  VALUE= <%=environmentParameter%> ></td>
				  <!--td WIDTH="66%"><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF"> 
					<select NAME="environmentParameter">					 
					  <option VALUE="tmp1" selected >temperature 1</option>
					  <option VALUE="tmp2" >temperature 2</option>
					  <option VALUE="tmp3">temperature 3</option>
         		    <option VALUE="tmp4">temperature 4</option>
					  <option VALUE="occ1">occupancy 1</option>
					  <option VALUE="occ2">occupancy 2</option>
					  <option VALUE="coc">CO</option>
					  <option VALUE="hmd">humidity</option>
					  <option VALUE="gas">gas meter </option>
					  <option VALUE="elec1">electricity meter 1</option>
					  <option VALUE="mem">memory</option>
					</select>
					</font></td -->
				</tr>
			
				<!--tr>
				  <td WIDTH="34%"><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">ic_item:</font></td>
				  <td WIDTH="66%">
					<input TYPE="text" NAME="ic_item" VALUE=temp1>
				  </td >
				</tr-->
			  </table>
			</td>
			<td ALIGN="center"> 
			  <center>
				<font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">Period:</font> 
			  </center>
			</td>
			<td ALIGN="center" VALIGN="middle"> 
			  <table WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" HEIGHT="100%" ALIGN="RIGHT">
				<tr> 
				  <td ALIGN="center" VALIGN="middle" NOWRAP> 
					<p><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">from: 
					  <select NAME="fromHour">
						<option selected >00</option>
						<option>01</option>
						<option>02</option>
						<option>03</option>
						<option>04</option>
						<option>05</option>
						<option>06</option>
						<option>07</option>
						<option>08</option>
						<option >09</option>
						<option>10</option>
						<option>11</option>
						<option>12</option>
						<option>13</option>
						<option>14</option>
						<option>15</option>
						<option>16</option>
						<option>17</option>
						<option>18</option>
						<option>19</option>
						<option>20</option>
						<option>21</option>
						<option>22</option>
						<option>23</option>
					  </select>
					  : 
					  <select NAME="fromMinute">
						<option VALUE="00" SELECTED>00</option>
						<option VALUE="15">15</option>
						<option VALUE="30">30</option>
						<option VALUE="45">45</option>
					  </select>
					  , </font><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF"> 
					  <select NAME="fromDay">
						<option >01</option>
						<option>02</option>
						<option>03</option>
						<option>04</option>
						<option>05</option>
						<option>06</option>
						<option>07</option>
						<option >08</option>
						<option >09</option>
						<option>10</option>
						<option>11</option>
						<option>12</option>
						<option>13</option>
						<option>14</option>
						<option>15</option>
						<option>16</option>
						<option>17</option>
						<option>18</option>
						<option>19</option>
						<option>20</option>
						<option>21</option>
						<option>22</option>
						<option>23</option>
						<option>24</option>
						<option>25</option>
						<option>26</option>
						<option>27</option>
						<option>28</option>
						<option>29</option>
						<option>30</option>
						<option>31</option>
					  </select>
					  <select NAME="fromMonth">
						<option VALUE="01" >Jan</option>
						<option VALUE="02">Feb</option>
						<option VALUE="03">Mar</option>
						<option VALUE="04">Apr</option>
						<option VALUE="05">May</option>
						<option VALUE="06">Jun</option>
						<option VALUE="07">Jul</option>
						<option VALUE="08">Aug</option>
						<option VALUE="09">Sep</option>
						<option VALUE="10"   >Oct</option>
						<option VALUE="11"SELECTED>Nov</option>
						<option VALUE="12">Dec</option>
					  </select>
					  <select NAME="fromYear">
						 
						<option VALUE="2002">2002</option>
						<option VALUE="2003" SELECTED>2003</option>
					  </select>
					  </font></p>
				  </td>
				</tr>
				<tr> 
				  <td ALIGN="center" VALIGN="middle" NOWRAP> 
					<p><font COLOR="#FFFFFF" FACE="Arial, Helvetica, sans-serif" SIZE="2">to: 
					  <select NAME="toHour">
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">00</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">01</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">02</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">03</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">04</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">05</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">06</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">07</font></option>
						<option selected><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">08</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">09</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">10</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">11</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">12</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">13</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">14</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">15</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">16</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">17</font></option>
						<option ><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">18</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">19</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">20</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">21</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">22</font></option>
						<option selected ><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">23</font></option>
					  </select>
					  : 
					  <select NAME="toMinute">
						<option VALUE="00" SELECTED><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">00</font></option>
						<option VALUE="15"><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">15</font></option>
						<option VALUE="30"><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">30</font></option>
						<option VALUE="45"><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">45</font></option>
					  </select>
					  </font> <font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF"> 
					  ,</font><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF"> 
					  <select NAME="toDay">
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">01</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">02</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">03</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">04</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">05</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">06</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">07</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">08</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">09</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">10</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">11</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">12</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">13</font></option>
						<option selected><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">14</font></option>
						<option ><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">15</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">16</font></option>
						<option ><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">17</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">18</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">19</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">20</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">21</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">22</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">23</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">24</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">25</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">26</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">27</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">28</font></option>
						<option><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">29</font></option>
						<option ><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">30</font></option>
						<option ><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">31</font></option>
					  </select>
					  <select NAME="toMonth">
						<option VALUE="01">Jan</option>
						<option VALUE="02">Feb</option>
						<option VALUE="03">Mar</option>
						<option VALUE="04">Apr</option>
						<option VALUE="05">May</option>
						<option VALUE="06">Jun</option>
						<option VALUE="07">Jul</option>
						<option VALUE="08">Aug</option>
						<option VALUE="09" >Sep</option>
						<option VALUE="10" selected>Oct</option>
						<option VALUE="11"SELECTED>Nov</option>
						<option VALUE="12">Dec</option>
					  </select>
					  <select NAME="toYear">
						 
						<option VALUE="2002">2002</option>
						<option VALUE="2003" selected>2003</option>
					  </select>
					  </font></p>
				  </td>
				</tr>
			  </table>
			</td>
			<td ALIGN="center"><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF">Frequency:</font></td>
			<td ALIGN="center"> 
			  <select NAME="frequency">
				<option VALUE="Monthly">Monthly</option>
				<option VALUE="Daily" SELECTED>Daily</option>
				<option VALUE="Hourly">Hourly</option>
				<option VALUE="Half Hourly">Half Hourly</option>
				<option VALUE="Minute">Minutes</option>
				
			  </select>
			</td>
			
			
			<!--td ALIGN="center" WIDTH="10"><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF"> 
			  <input TYPE="image" BORDER="0" NAME="imageField" SRC="images/start.gif" WIDTH="64" HEIGHT="17">
			  </font></td-->
		  </tr>
		  
		 
			  
       <td ALIGN="center" WIDTH="10"><font FACE="Arial, Helvetica, sans-serif" SIZE="2" COLOR="#FFFFFF"> 
			  <input TYPE="image" BORDER="0" NAME="imageField" SRC="images/start.gif" WIDTH="64" HEIGHT="17">
			  </font></td>		  
		</table>
	  </form>
	</td>
  </tr>
  <tr> 
	<td WIDTH="70%" ALIGN="CENTER" VALIGN="top" HEIGHT="516"> 
	  <center>
		<% 
		if (request.getParameter("eboxId")!=null){
		
			environmentParameter=request.getParameter("environmentParameter");
			frequency=request.getParameter("frequency");
			fromMonth=request.getParameter("fromMonth");
			fromYear=request.getParameter("fromYear");
			fromDay=request.getParameter("fromDay");
			fromHour=request.getParameter("fromHour");
			fromMinute=request.getParameter("fromMinute");
			toMonth=request.getParameter("toMonth");
			toYear=request.getParameter("toYear");
			toDay=request.getParameter("toDay");
			toHour=request.getParameter("toHour");
			toMinute=request.getParameter("toMinute");
			eboxId=request.getParameter("eboxId");


			//ic_item=request.getParameter("ic_item");
			ic_item=environmentParameter;
			
			hostOfDBMS=em.hostOfDBMS;
			String userName =em.username;
            String password =new String(em.password); 
		
	  %>
			<!--img SRC="LineChart123?environmentParameter=<%=environmentParameter%>&frequency=<%=frequency%>&fromHour=<%=fromHour%>&fromMinute=<%=fromMinute%>&fromDay=<%=fromDay%>&fromMonth=<%=fromMonth%>&fromYear=<%=fromYear%>&toHour=<%=toHour%>&toMinute=<%=toMinute%>&toDay=<%=toDay%>&toMonth=<%=toMonth%>&toYear=<%=toYear%>&eboxId=<%=eboxId%>&ic_item=<%=ic_item%>" WIDTH="500" HEIGHT="300" --> 
			<img SRC="LineChart123?environmentParameter=<%=environmentParameter%>&frequency=<%=frequency%>&fromHour=<%=fromHour%>&fromMinute=<%=fromMinute%>&fromDay=<%=fromDay%>&fromMonth=<%=fromMonth%>&fromYear=<%=fromYear%>&toHour=<%=toHour%>&toMinute=<%=toMinute%>&toDay=<%=toDay%>&toMonth=<%=toMonth%>&toYear=<%=toYear%>&eboxId=<%=eboxId%>&ic_item=<%=ic_item%>&userName=<%=userName%>&password=<%=password%>&hostOfDBMS=<%=hostOfDBMS%>" WIDTH="500" HEIGHT="300" > 
		
			
			<%
		}
		%>
		  </center>
		</table>
	  </body>
</html>
