<%@ LANGUAGE="VBScript" %> <% If Not IsEmpty(request.form("Close")) Then %> <% End If timedate=Request("timedate") Set Connection = Server.CreateObject("ADODB.Connection") Connection.Mode = adModeRead Connection.Open phdb_rd If timedate="" Or IsEmpty(request.form("Selected_Time")) Then SQLStmt = " select to_char(sysdate,'MM/DD/YYYY HH24:MI:SS') timedate from dual " Set RS = Connection.Execute(SQLStmt) timedate = CStr(RS("timedate")) Set RS=nothing End If If Not IsDate(timedate) Then message="Wrong Time/Date format " & timedate %> <% End If timedate_par=replace(timedate," ","%20") %> Magnet Status
               
<% SQLStmt = " select to_char(logdate,'MM/DD/YYYY HH24:MI:SS') ddate, " SQLStmt = SQLStmt & " 24*60*(to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')-logdate) ddif, " SQLStmt = SQLStmt & " to_char(imag,'99990.0') imag,to_char(imag2,'99990.0') imag2,to_char(voltage,'99990.0') voltage,to_char(hall_pos,'0.0000') hall_pos,to_char(hall_neg,'0.0000') hall_neg, " SQLStmt = SQLStmt & " to_char(temp_in,'990.0') temp_in,to_char(temp_out,'990.0') temp_out,state,status,status_str " SQLStmt = SQLStmt & " from phoffline.magnet_monitoring " SQLStmt = SQLStmt & " where logdate=(select max(logdate) from phoffline.magnet_monitoring " SQLStmt = SQLStmt & " where logdate between to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')-2 " SQLStmt = SQLStmt & " and to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')) " Set RS = Connection.Execute(SQLStmt) ' response.write(SQLStmt) If Not RS.EoF Then %>
<% Do While Not RS.EOF %> <% RS.Movenext Loop %>
Graph Last DB write I1 I2 V Hall P Hall N Tin Tout State Status Status String

Graph

<% If CDbl(RS("ddif"))" & CStr(RS("ddate")) & "") Else Response.write("" & CStr(RS("ddate")) & "") End If %> <%=RS("imag")%> <%=RS("imag2")%> <%=RS("voltage")%> <%=RS("hall_pos")%> <%=RS("hall_neg")%> <%=RS("temp_in")%> <%=RS("temp_out")%> <%=RS("state")%> <%=RS("status")%> <%=RS("status_str")%>
<% Else ' No recent data %>

No data for the last two days

<% End If Connection.Close Set RS=nothing Set Connection=nothing %>