<%@ LANGUAGE="VBScript" %> <% geo_mod=Request("GEO_MOD") timedate=CStr(Request("DATE")) Set Connection = Server.CreateObject("ADODB.Connection") ' Connection.Mode = adModeRead ' Connection.Open phdb_rd If timedate="" Then SQLStmt = " select to_char(sysdate,'MM/DD/YYYY') 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 %> <% Else date_string=" TO_DATE('" & timedate & "','MM/DD/YYYY') " End If ' ' Get GEO MOD information for this module. Bail out if module not defined ' SQLStmtx = "select gm.SMOD_TYPE,gm.SMOD_ORIENTATION " SQLStmtx = SQLStmtx & " from ASSEMBLY.GEO_MODS gm " SQLStmtx = SQLStmtx & " where gm.GEO_MOD='" & CStr(geo_mod) & "' " SQLStmtx = SQLStmtx & " and " & date_string & ">=gm.STARTDATE and gm.STOPDATE>=" & date_string ' ' response.write(SQLStmtx) ' Set RSx = Connection.Execute(SQLStmtx) If Not RSx.EOF Then defined=true ' ' module seems to be defined, go fo it... ' SQLStmty = "select gms.GEO_SENSOR,gms.SENSOR_POS,gms.GEO_MOD,gms.SMOD_MOD_POS,gma.MODULE_ID " SQLStmty = SQLStmty & " from ASSEMBLY.GEO_MOD_SENSOR gms, " SQLStmty = SQLStmty & " (select GEO_MOD,SMOD_MOD_POS,MODULE_ID from ASSEMBLY.GEO_MOD_ASSIGNMENT " SQLStmty = SQLStmty & " where (geo_mod,smod_mod_pos,logdate) in (select max(geo_mod),max(smod_mod_pos),max(logdate) from " SQLStmty = SQLStmty & " (select geo_mod,smod_mod_pos,logdate from ASSEMBLY.GEO_MOD_ASSIGNMENT where " & date_string & ">=logdate) group by GEO_MOD,smod_mod_pos)) gma " SQLStmty = SQLStmty & " where gma.GEO_MOD(+)=gms.GEO_MOD and gma.SMOD_MOD_POS(+)=gms.SMOD_MOD_POS " SQLStmty = SQLStmty & " and (gms.GEO_MOD,gms.SMOD_MOD_POS) in " SQLStmty = SQLStmty & " (select distinct gm.GEO_MOD,sr.SMOD_MOD_POS " SQLStmty = SQLStmty & " from ASSEMBLY.GEO_MODS gm,ASSEMBLY.SMOD_READOUT sr " SQLStmty = SQLStmty & " where gm.SMOD_TYPE=sr.SMOD_TYPE and gm.GEO_MOD='" & CStr(geo_mod) & "' " SQLStmty = SQLStmty & " and " & date_string & ">=gm.STARTDATE and gm.STOPDATE>=" & date_string & ") " SQLStmty = SQLStmty & " order by gms.GEO_SENSOR " ' ' response.write(SQLStmty) ' Set RSy = Connection.Execute(SQLStmty) ' SQLStmt = "select gma.MODULE_ID,gma.SMOD_MOD_POS,to_char(gma.LOGDATE,'DD-MON-YYYY HH24:MI') LOGDATE,gma.OPERATOR " SQLStmt = SQLStmt & " from ASSEMBLY.GEO_MOD_ASSIGNMENT gma" SQLStmt = SQLStmt & " where gma.GEO_MOD='" & CStr(geo_mod) & "' " SQLStmt = SQLStmt & " order by gma.SMOD_MOD_POS,gma.LOGDATE" ' ' response.write(SQLStmt) ' Set RS = Connection.Execute(SQLStmt) Else defined=false End If %> Module Description

Geometrical Module <%=geo_mod%>, Status on <%=timedate%>

<% If defined Then %>
Super Module Type <%=RSx("SMOD_TYPE")%>
Rotation Code (<%=Cint(RSx("SMOD_ORIENTATION"))%>): <% Select Case Cint(RSx("SMOD_ORIENTATION")) Case 1 Response.write(" Module columns and rows match Phat conventions") Case 2 Response.write(" Internal module column numbering runs in direction opposite to Phat conventions, column number is flipped") Case 3 Response.write(" Internal module row numbering runs in direction opposite to Phat conventions, row number is flipped") Case 4 Response.write(" Internal module row and column numbering runs in direction opposite to Phat conventions, both of them are flipped") Case Else End Select %>
">
<%If Not RSy.Eof Then%>

Phat Sensor Assignments

<% Do While Not RSy.EoF%> <% RSy.MoveNext Loop%>
Phat Sensor Module Position Sensor Position Assigned Module
<%=RSy("GEO_SENSOR")%> <%=RSy("SMOD_MOD_POS")%> <%=RSy("SENSOR_POS")%> <% If IsNull(RSy("MODULE_ID")) Then response.write("module not assigned at this time") Else response.write("" & CStr(RSy("MODULE_ID")) & "") End If %>
<%End If%> <% If Not RS.Eof Then %>

Assignment Logbook:

<% Do While Not RS.EoF %> <% RS.MoveNext Loop %>
Position Module_ID Operator

Start Validity Date

<%=RS("SMOD_MOD_POS") %> "><%=RS("MODULE_ID") %> <%=RS("OPERATOR") %> <%=RS("LOGDATE") %>
<% Else %>

Module ID not yet assigned <% End If %>

<% Else %>

Module not connected at this time

<% End If ' long if statement, all the way from the top. Connection.Close %>