<%@ LANGUAGE="VBScript" %> <% If Request("day")="" or len(Request("day"))<>8 Then c_day="" Else c_day= CStr(Request("day")) End If Set Connection = Server.CreateObject("ADODB.Connection") Connection.Mode = adModeRead Connection.Open phdb_rd_repl SQLStmtx = "select to_char(sysdate,'DD Mon YYYY') ddate,to_char(sysdate,'HH24:MI:SS') ttime,global_name from global_name " ' response.write(SQLStmtx & "
" ) Set RSx = Connection.Execute(SQLStmtx) If Not RSx.EOF Then select case CStr(RSx("global_name")) case "PHDB.WORLD" dbname="Main Phobos Database" case "ORACLE.WORLD" dbname="Phobos Server (old) Database" case "KRPHOBOS.WORLD" dbname="Krakow Database" case "ROCHESTER.WORLD" dbname="Rochester Database" end select Else dbname="Undefined Database" End If If c_day<>"" Then SQLStmt0 = "select to_char(to_date('" & c_day & "','YYYYMMDD'),'DD-Mon-YYYY') xdate from dual " Else SQLStmt0 = "select to_char(sysdate,'DD-Mon-YYYY') xdate,to_char(sysdate,'YYYYMMDD') c_day from dual " End If ' response.write(SQLStmt0 & "
" ) Set RS0 = Connection.Execute(SQLStmt0) If Not RS0.EoF Then title="Shift logbook, " & RS0("xdate") Else title="Shift logbook" End If If c_day="" Then c_day=CStr(RS0("c_day")) End if SQLStmt = " select max(le.log_date) log_date,to_char(max(le.log_date),'MM/DD/YYYY') ldate,max(le.logid) logidd, " SQLStmt = SQLStmt & " to_char(max(le.log_date),'MM/DD/YYYY HH24:MI:SS') ddate, " SQLStmt = SQLStmt & " max(le.action) action,max(lc.text) user_comment,min(substr(lo.firstname,1,1) || '.' || ' ' || lo.operator) operator1,max(substr(lo.firstname,1,1) || '.' || ' ' || lo.operator) operator2 " SQLStmt = SQLStmt & " FROM phoffline.log_entries le, phoffline.log_comments lc,phoffline.log_operators lo " SQLStmt = SQLStmt & " where lc.logid(+)=le.logid and lo.logid(+)=le.logid " SQLStmt = SQLStmt & " and (le.action='SHIFT_COMMENT' or le.action='LOGBOOK_PICTURE') " SQLStmt = SQLStmt & " and le.log_date between to_date('" & c_day & "','YYYYMMDD') " SQLStmt = SQLStmt & " and to_date('" & c_day & "','YYYYMMDD')+1 " SQLStmt = SQLStmt & " group by le.logid" SQLStmt = SQLStmt & " order by log_date asc " ' response.write(SQLStmt & "
" ) Set RS = Connection.Execute(SQLStmt) %> Shift Logbook

<%=Title%>


Note: time goes from top to bottom of the page !
<% Do While Not RS.EoF rcolor="#FFFFFF" If Not IsNull(RS("operator1")) Then operator=CStr(RS("operator1")) If Not RS("operator2")=RS("operator1") Then operator=operator & " and " & RS("operator2") End If Else operator="Unknown" End If If Not IsNull(RS("user_comment")) Then comments=CStr(RS("user_comment")) commentsbr= Replace(comments,Chr(13) & Chr(10),"
",1,-1,1) Else comments="" commentsbr="" End If %> <% RS.MoveNext Loop %>
Log Date

Comments

<%= response.write(RS("ddate") & "
" & operator) %>
<%= commentsbr %> <% If RS("action")="LOGBOOK_PICTURE" Then response.write(" ") response.write(" ") End If %>
<% Connection.Close %>