<%@ LANGUAGE="VBScript" %> <% ' ' 0 - bit_enabled ' 1 - scaledown ' 2 - ifscaledown ' 3 - name ' 4 - lcrdate ' 5 - ifsettable ' Dim bit_parameter(5,31) Dim All_scaledowns(15) For i=0 To 15 All_Scaledowns(i)=2^i Next If Request("n_refresh")="" Then n_refresh=0 config_id="" Else n_refresh=CInt(Request("n_refresh"))+1 config_id=Request.form("config_id") If config_id="" Then n_refresh=0 End If End If ' response.write(n_refresh) Set Connection = Server.CreateObject("ADODB.Connection") Connection.Mode = adModeRead Connection.Open phdb_rd ' ' Check if people registered for shift/logbook writing ' operator1="" operator2="" firstname1="" firstname2="" registered=0 If Request.Cookies("PHOBOSPORTAL").HasKeys Then strCookie1=Request.Cookies("PHOBOSPORTAL")("OPERATOR1") If Not (IsNull(strCookie1) OR ( Len(strCookie1) = 0)) Then registered=1 operator1=CStr(strCookie1) firstname1=CStr(Request.Cookies("PHOBOSPORTAL")("FIRSTNAME1")) strCookie2=Request.Cookies("PHOBOSPORTAL")("OPERATOR2") If Not (IsNull(strCookie2) OR ( Len(strCookie2) = 0)) Then operator2=CStr(strCookie2) firstname2=CStr(Request.Cookies("PHOBOSPORTAL")("FIRSTNAME2")) End If End If End if If registered=1 Then ' this is a very long If ! If Firstname1<>"" Then Fullname1=Ucase(Left(Firstname1,1)) & ". " & operator1 Else Fullname1=operator1 End If If Firstname2<>"" Then Fullname2=Ucase(Left(Firstname2,1)) & ". " & operator2 Else Fullname2=operator2 End If ' ' recover refreshed config_id and timedate ' config_id=Request.form("config_id") timedate=Request.form("timedate") If timedate="" Then SQLStmt = " select to_char(sysdate,'MM/DD/YYYY HH24:MI:SS') timedate from dual " ' response.write(SQLStmt) 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") ' ' Get the bit settings, as they are defined at timedate ' SQLStmt = " select tbs.startdate,tbs.bit_position,tbs.bit_name,tbs.ifscaledown,tbs.ifsettable,tbs.description,to_char(tbs.crdate,'MMDDYYYYHH24MISS') lcrdate " SQLStmt = SQLStmt & " from phoffline.trigger_bit_setting tbs, " SQLStmt = SQLStmt & " (select max(startdate) startdate,bit_position from phoffline.trigger_bit_setting " SQLStmt = SQLStmt & " where startdatenbit Then message="Bit mismatch while reading database, Read: " & bit_read & " Counted: " & nbit %> <% End If bit_parameter(0,nbit) = 0 bit_parameter(1,nbit) = 1 bit_parameter(2,nbit) = CStr(CLng(RS("ifscaledown"))) bit_parameter(3,nbit) = CStr(RS("bit_name")) bit_parameter(4,nbit) = CStr(RS("lcrdate")) bit_parameter(5,nbit) = CStr(CInt(RS("ifsettable"))) RS.Movenext nbit=nbit+1 Loop nbit=nbit-1 ' %> Set Trigger Configuration

Create Trigger Configuration <%=config_id %>

<% If n_refresh<1 Then %>

Warning: Before changing any parameters you MUST:

0) Register on the Portal (without registration this page is readonly)
1) Type name of the new trigger configuration
2) Adjust validity time
3) REFRESH the page by clicking Change/Refresh button.
4) Set all bit and scaledown values
5) After all changes click "Update Database Button". You will have a chance to confirm your choices again
<% End If %>
<% If n_refresh<1 Then %>

Adjust Name, Time and Date of the new configuration and click Change/Refresh button <% End If %>

New Configuration Name:
Validity Time and Date:

<% For i=0 to nbit %> " value="<%=bit_parameter(2,i)%>"> " value="<%=bit_parameter(3,i)%>"> " value="<%=bit_parameter(4,i)%>"> <% Next %>
<% If operator1="" Then names="Operators Not Registered, no database entry possible" Else If operator2="" Then response.write("Operator: ") names= Fullname1 Else response.write("Operators: ") names=Fullname1 & " and " & Fullname2 End If End If %> <%=names %>
Description:
<% For i=0 To nbit %> <% response.write(" ") response.write(" " & vbCrLf) %> <% Next %>
Bit Bit Name Bit Enabled Scaledown
<%=i%> <%=bit_parameter(3,i)%>") If bit_parameter(5,i)=0 Then response.write(" 0" & vbCrLf) Elseif bit_parameter(5,i)=1 Then response.write(" 1" & vbCrLf) Else response.write("" & vbCrLf) End If response.write("") If bit_parameter(2,i)=0 Or bit_parameter(5,i)=0 Then response.write("" & vbCrLf) Else response.write(" ") End If response.write("
<% Response.write(" " & vbCrLf) %>
<% Else Response.write("You must be registered on the Portal to create new configurations") End If Connection.Close %>