%@ LANGUAGE="VBScript" %>
<%
Response.expires=0
If InStr(1,CStr(Request.ServerVariables("HTTP_USER_AGENT")),"MSIE5")<>0 Then
ie=true
Else
ie=false
End If
operator1 = CStr(Request.Form("operator1"))
firstname1 = CStr(Request.Form("firstname1"))
operator2 = CStr(Request.Form("operator2"))
firstname2 = CStr(Request.Form("firstname2"))
comments = CStr(Request.Form("comments"))
num_positions= CInt(Request.Form("num_positions"))
comments= Replace(comments,"'","''")
Set Connection = Server.CreateObject("ADODB.Connection")
Connection.Open phdb_rd
Connection.BeginTrans
SQLstmt=" select max(position) max_pos from phoffline.tld_positions "
On Error Resume Next
Set RS= Connection.Execute(SQLstmt)
' response.write(SQLstmt & "
")
tempholder = RS("max_pos")
If IsNull(tempholder) Then
max_pos = 0
Else
max_pos=CInt(tempholder)
End If
If Err.Number = 0 Then
SQLstmt=" insert into phoffline.log_entries (log_date,action,logid) "
SQLstmt= SQLStmt & " values (SysDate,'TLD_ACTION',phoffline.logid.nextval)"
On Error Resume Next
response.write(SQLStmt & "
")
' Set RS= Connection.Execute(SQLstmt)
End If
If Err.Number = 0 Then
'
' fill comments
'
If comments<>"" Then
SQLstmt=" insert into phoffline.log_comments (logid,text) "
SQLstmt= SQLStmt & " values (phoffline.logid.currval,'" & CStr(comments) & "')"
response.write(SQLStmt & "
")
On Error Resume Next
' Set RS= Connection.Execute(SQLstmt)
End If
End If
If Err.Number = 0 Then
'
' fill operators
'
If Operator1<>"" Then
SQLstmt=" insert into phoffline.log_operators (logid,operator) "
SQLstmt= SQLStmt & " values (phoffline.logid.currval,'" & CStr(operator1) & "')"
response.write(SQLStmt & "
")
On Error Resume Next
' Set RS= Connection.Execute(SQLstmt)
End If
End If
If Err.Number = 0 Then
If Operator2<>"" Then
SQLstmt=" insert into phoffline.log_operators (logid,operator) "
SQLstmt= SQLStmt & " values (phoffline.logid.currval,'" & CStr(operator2) & "')"
response.write(SQLStmt & "
")
On Error Resume Next
' Set RS= Connection.Execute(SQLstmt)
End If
End If
For i=1 To num_positions
If Err.Number = 0 Then
SQLstmt=" insert into phoffline.tld_positions (position,x,y,z,description) "
SQLstmt= SQLStmt & " values (" & CStr(max_pos+i) & ","
SQLstmt= SQLstmt & CStr(Request.Form("X" & CStr(i))) & ","
SQLstmt= SQLstmt & CStr(Request.Form("Y" & CStr(i))) & ","
SQLstmt= SQLstmt & CStr(Request.Form("Z" & CStr(i))) & ",'"
SQLstmt= SQLstmt & Replace(CStr(Request.Form("description" & CStr(i))),"'","''") & "')"
response.write(SQLStmt & "
")
On Error Resume Next
' Set RS= Connection.Execute(SQLstmt)
End If
If Err.Number = 0 Then
SQLstmt=" insert into phoffline.tld_position_log (position,logid) "
SQLstmt= SQLstmt & " values (" & CStr(max_pos+i) & ",phoffline.logid.currval)"
response.write(SQLstmt & "
")
On Error Resume Next
' Set RS= Connection.Execute(SQLstmt)
End If
Next
If Err.Number = 0 Then
Connection.RollbackTrans
' Connection.CommitTrans
Connection.Close
Set Connection=nothing
Set RS=nothing
%>
Error #<%= Err.Number %> occurred;
<%= Err.Description %>.
<% End If %>