|
|
|
|
<%@ Language=VBScript %>
<%
'
' Declare variables.
'
Dim objConn ' Declare connection object
Dim OpPostDivID ' Variable to hold search value.
Dim strWhere ' Where clause for the select
Dim previous_OpName ' Used to identify the point when -
Dim current_OpName ' categories change.
Dim row_complete ' Boolean that assists in arranging entries
' in 2-column table.
'
' Init variables
'
Session.timeout = 5
OpPostDivID = ""
strWhere = ""
'
' Establish connection to the DataBase.
'
%>
<%
OpPostDivID = Request("OpPostDivID")
strPostDiv = Request("strPostDiv")
strLocation = Request("strLocation")
strANDOR = Request("strANDOR")
strLName = Request("strLName")
strFName = Request("strFName")
IF OpPostDivID = "" THEN
' This is true when the no search has yet been performed.
%> <%
ELSE
strWhere = " WHERE ((pocid > 0 "
IF OpPostDivID <> "*" THEN
' build a where clause by first surrounding all selected categories
' with tick marks.
IF OpPostDivID < 0 THEN
strWhere = strWhere & " AND OpID = " & cstr(-OpPostDivID) & " "
ELSE
strWhere = strWhere & " AND subDivID = " & OpPostDivID & " "
END IF
END IF
IF strLocation <> "*" THEN
strWhere = strWhere & " AND GeoLocID = " & strLocation
END IF
strWhere = strWhere & ")"
IF strLName <> "" or strFName <> "" THEN
strWhere = strWhere & " " & strANDOR & " ("
IF strLName <> "" THEN
strWhere = strWhere & " LastName LIKE '%" & strLName & "%'"
END IF
IF strFName <> "" THEN
IF strLName <> "" THEN
strWhere = strWhere & " AND "
END IF
strWhere = strWhere & " FirstName LIKE '%" & strFName & "%'"
END IF
strWhere = strWhere & ")"
END IF
strWhere = strWhere & ")"
' Extract the information pertaining to the POCs being
' generated.
'
sql = "SELECT * " &_
" FROM q_POCs " &_
strWhere &_
" ORDER BY OpName, LastName, FirstName "
' Debug statemtns
' Response.Write (sql)
' open a recordset.
Set poc_rs = Server.CreateObject("ADODB.Recordset")
poc_rs.Open sql, objConn
IF poc_rs.EOF THEN
%>
<%
ELSE
%>
| List of DMS points of contact. |
<%
previous_OpName = ""
row_complete = true
DO WHILE Not poc_rs.eof
current_OpName = poc_rs.Fields("OpName").Value
IF previous_OpName <> current_OpName THEN
WriteLN("| Operation: " & current_OpName & " | ")
' Will need to start new row.
row_complete = true
END IF
' The following IF controls 2-column display. It places
' tag in front of every other entry.
IF row_complete THEN
%> <%
row_complete = false
ELSE
row_complete = true
END IF %>
Name: <%=poc_rs.Fields("Rank").Value%> <%=poc_rs.Fields("FirstName").Value%> <%=poc_rs.Fields("LastName").Value%>
E-mail:
<%
IF not (IsNull(poc_rs.Fields("eMail").Value) OR _
IsEmpty(poc_rs.Fields("eMail").Value) OR _
poc_rs.Fields("eMail").Value = "") THEN
' There is something found in the e-mail field. Display this field
' to the user.
%>"><%=poc_rs.Fields("eMail").Value%><%
END IF
%>
<%=poc_rs.Fields("OpName").Value%>/<%=poc_rs.Fields("Category").Value%>: <%=poc_rs.Fields("SubDivName").Value%>
DSN Pref: <%IF isNull(poc_rs.Fields("DSNPref").Value) THEN
WriteLN("none")
ELSE
WriteLN(poc_rs.Fields("DSNPref").Value)
END IF%>
CML Phone: <%=poc_rs.Fields("Phone").Value%>
FAX: <%=poc_rs.Fields("FAX").Value%>
Location: <%=poc_rs.Fields("GeoLocName").Value%>
Position: <%=poc_rs.Fields("Position").Value%> |
<%
' This IF controls 2-column display. It places tag
' after 2-nd entry after .
IF row_complete THEN
%> <%
END IF
previous_OpName = poc_rs.Fields("OpName").Value
poc_rs.MoveNext
LOOP
' This IF places after the last entry is there was
' odd number of entries and was not placed by the
' previous IF inside the loop.
IF not row_complete THEN
%> <%
END IF
%>
<%
END IF ' poc_rs.EOF
END IF
%>
|
|