%
strUserName = session("UserName")
strAction = request("cmdSort")
strAccessLevel = session("AccessLevel")
PageNo = cInt(request.form("page"))
sSQL = request.form("strSQL")
If PageNo = "" then
PageNo=1
end if
If PageNo < 1 then
PageNo=1
end if
sState = Request("State")
sCity = Request("City")
'sPriceSort = request("PriceSort")
sCategory = Request("Category")
sSQL = "Select * from TblServices where Date <= #" & Date() & "#"
if sCategory <> "" then
sSQL = sSQL + " AND Category = '"+ sCategory + "'"
end if
if sState <> "" then
sSQL = sSQL & " AND State = '" + sState + "'"
end if
if sCity <> "" then
sSQL = sSQL & " AND City = '" + sCity + "'"
end if
if strAction <> "" then
if strSortType2 = "Asc" then
sSQL = sSQL & " order by " + strSortType + " ASC"
end if
if strSortType2 = "Desc" then
sSQL = sSQL & " order by " + strSortType + " DESC"
end if
end if
Set rsSearch = Server.CreateObject("ADODB.Recordset")
rsSearch.Open sSQL, objADO, 3, 3
TotalRecs = rsSearch.recordcount
rsSearch.Pagesize=5
TotalPages = cInt(rsSearch.pagecount)
if PageNo > TotalPages then
PageNo = TotalPages
end if
if not rsSearch.eof then
rsSearch.absolutepage=PageNo
end if
%>
<% Sub DisplayCDThumbnails%>
<% if rsSearch.eof then %>
Sorry. No companies are listed in our service directory for <%= cat %> at this time.
We are always adding new affiliations. Please check back again soon.
Click here to add your company's services to our directory.
<% else %>
|
<% if sCategory <> "" then %>
<%= ucase(sCategory) %>
<% else %>
ALL SERVICE CATEGORIES
<% end if %>
-
<% if sCity <> "" then %>
<%= ucase(sCity) %>
<% else %>
ALL CITIES
<% end if %>
-
<% if sState <> "" then %>
<%= ucase(sState) %>
<% else %>
ALL STATES
<% end if %>
|
<% while not rsSearch.EOF %>
|
<% if rsSearch("website") <> "" then %>
"><%= rsSearch("Company") %>
<% else %>
<%= rsSearch("Company") %>
<% end if %>
-
<%= rsSearch("description") %>
|
|
<%= rsSearch("city") %>, <%= rsSearch("state") %>
|
<% rsSearch.MoveNext %>
<% wend %>
<% end if %>
|
<%End Sub%>
|
|
SEARCH RESULTS |
<% if WarningErrMsg <> "" then %>
| Error(s):<%= warningErrMsg %>
|
<% end if %>
|
<%
x = 0
For x = 1 to 5
If rsSearch.eof then
Exit For
Else
%>
| <%If Not rsSearch.EOF Then Call DisplayCDThumbnails%>
<%If Not rsSearch.EOF Then rsSearch.MoveNext%> |
|
<%
End If
Next
%>
|
|