%@language=vbscript%>
<%
Option Explicit
Response.Buffer=true
Dim DataConn, sConnectString
sConnectString = "DSN=MDNetLink"
set DataConn = Server.CreateObject("ADODB.Connection")
DataConn.ConnectionString = sConnectString
DataConn.CommandTimeout = 30
DataConn.CursorLocation = 3
DataConn.Open
dim website
dim serverName
dim protocol
if cstr(Request.ServerVariables("HTTPS")) = "on" then
protocol = "https://"
else
protocol = "http://"
end if
serverName = Request.ServerVariables("http_host")
website = protocol & serverName '' & "/mdnetlink"
' Search Page
' Common Functions will be used in both the Doctor Search and Practice Search forms.
const resultsPage = "search.asp"
' FORM NAME CONSTANTS
const FRM_FIRST_NAME = "first_name"
const FRM_LAST_NAME = "last_name"
const FRM_STATE_COUNTY = "City_State_DDBox"
const FRM_ZIP = "zip"
const FRM_SPECIALTY = "specialty"
const FRM_PRACTICE_NAME = "practice_name"
const FRM_PHYSICIAN_FORM_NAME = "FrmPhysicianSearch"
const FRM_PRACTICE_FORM_NAME = "FrmPracticeSearch"
const FRM_PHYSICIAN_SEARCH = "Find Physician"
const FRM_PRACTICE_SEARCH = "Find Practice"
const FRM_FIND_ALL = "Find All"
' SQL STATEMENT CONSTANTS
const SQL_GET_STATE_COUNTY = "select distinct s.state_code & ':' & o.county as id, s.state_abbrev &' - '& o.county as name, o.county, s.state_abbrev from office o, states s where o.state_code = s.state_code order by s.state_abbrev, o.county "
const SQL_GET_CITY_STATES = "select distinct s.state_code &':'& o.city as id, s.state_abbrev &' - '& o.city as name, o.city, s.state_abbrev from office o, states s where o.state_code = s.state_code order by s.state_abbrev, o.city"
const SQL_SPECIALTY = "select specialty,specialty from specialties where specialty <> 'Dentistry' order by specialty" ' 12/18/00 KLC keeping Dentistry from list of specialties.
dim arrDDBoxDefault(1,2)
arrDDBoxDefault(0,0) = ""
arrDDBoxDefault(0,1) = " "
dim htmlLocationDDBox
htmlLocationDDBox = createHTMLDropDown(":1", "", SQL_GET_STATE_COUNTY, arrDDBoxDefault, "BLANK", 0)
dim htmlSpecialtyDDBox
htmlSpecialtyDDBox = createHTMLDropDown(":1", "", SQL_SPECIALTY, null, "BLANK", 4)
dim varFirstName
dim varLastName
dim varPracticeName
dim varCityState
dim varSpecialty
dim varZip
dim bPhysicianSearch
dim bPracticeSearch
bPhysicianSearch = false
bPracticeSearch = false
' 4/21/01 KLC - whether or not to retain the search criteria.
dim bRetainCriteria
bRetainCriteria = false
dim sBody
sBody=""
dim htmlSearchResults
htmlSearchResults = ""
dim sAction
sAction = Request.Form("action")
dim iActiveSearch
iActiveSearch = Request.QueryString("searchid")
if iActiveSearch = "" then
iActiveSearch = 1
end if
' MAIN ROUTINE
if sAction = FRM_PHYSICIAN_SEARCH then
bPhysicianSearch = true
call setVariablesToFormValues
if varFirstName = "" and varLastName = "" and varCityState = "" and varSpecialty = "" and varZip = "" then
htmlSearchResults = "You must specify a search criteriaYou must specify a search criteria
"
if cint(iActiveSearch) = 1 then
sBody = sBody & GetPhysicianSearchHTMLForm(htmlLocationDDBox)
else
sBody = sBody & GetPracticeSearchHTMLForm(htmlLocationDDBox)
end if
sBody = sBody & "
"
sBody = sBody & "
"
sBody = sBody & ""
'call WriteTemplate(sBody, GetClearFormScript, "MDNetLink Search", "background=""images/newcad.gif""")
call WriteTemplate(sBody, GetClearFormScript, "MDNetLink Search", "bgcolor=""#ffffff"" style=""margin: 0px;"" id=""body""")
' END OF MAIN ROUTINE
%>
<%
' Purpose: will abstract us from knowing what the look n feel is.
' This function can be extended to include ads or other promotional details.
'
function GetHeaderHTML(sScript, sTitle, sBodyTagAttributes)
dim sTemp
'sTemp = ""& sTitle &""& sScript &""
sTemp = ""& sTitle &""& sScript &""
GetHeaderHTML = sTemp
end function
' Purpose: will abstract us from knowing what the look n feel is.
' This function can be extended to include ads or other promotional details.
'
function GetFooterHTML
dim sTemp
sTemp = ""
GetFooterHTML = sTemp
end function
function WriteTemplate(htmlBody, sScript, sTitle, sBodyTagAttributes)
dim htmlHeader
'htmlHeader = GetHeaderHTML(sScript, sTitle, sBodyTagAttributes )
dim htmlFooter
'htmlFooter = GetFooterHTML
'Response.write(htmlHeader)
Response.Write(htmlBody)
'Response.Write(htmlFooter)
end function
function setSelected(byval sDDBox, byval sName, byval sValue)
dim sTemp
sTemp = sDDBox
dim arrValues
if isMissing(sValue) then
redim arrValues(1)
arrValues(0) = ""
else
arrValues = Split(sValue, ",")
end if
dim x
for x = 0 to ubound(arrValues)
sTemp = replace(sTemp, "