<% strUserName = session("UserName") strAction = request("cmdSort") strSortType = request("SortType") strSortType2 = request("SortType2") 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 'sPriceType = Request.form("PriceType") sFromYear = Request("FromYear") sToYear = Request("ToYear") sFromPrice = Request("FromPrice") sToPrice = Request("ToPrice") sState = Request("State") sCity = Request("City") sForSaleBy = Request("ForSaleBy") 'sPriceSort = request("PriceSort") sType = Request("Type") sMake = Request("Make") sModel = Request("Model") sSQL = "Select * from CDListing" sSQL = sSQL & " Where CDYear between '" + sFromYear + "' AND '" + sToYear + "'" if sType <> "" then sSQL = sSQL + " and CDType = '"+ sType + "'" end if If sForSaleBy = "3" Then sSQL = sSQL & " and (CDAccessLevel = '3' or CDAccessLevel = '7')" If sForSaleBy = "2" Then sSQL = sSQL & " and (CDAccessLevel = '2' or CDAccessLevel = '6')" if sMake <> "" then sSQL = sSQL + " and CDMake = '"+ sMake + "'" end if if sModel <> "" then sSQL = sSQL + " and CDModel = '"+ sModel + "'" end if if sState <> "" then sSQL = sSQL & " AND CDState = '" + sState + "'" end if if sCity <> "" then sSQL = sSQL & " AND CDCity = '" + sCity + "'" end if 'if sMake = "All" then sMake = "All" 'Response.Write "You searched for a(n) " & sMake & " " & sModel & " between " & SFromYear & " and " & sToYear & " in " &sCity& " " &sState 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 Len(rsSearch("CDListingImage")) > 0 Then If UCase(Left(rsSearch("CDListingImage"),7))="HTTP://" Then%> " border="0" width="240" height="160">
<%Else%> " border="0" width="240" height="160">
<%End If Else%> <%End If%>


<% if Session("accesslevel") = "1" or strUserName = RSSearch("CDUserName") and session("CarUser") = "1" then %> &Action=Edit">   "> <% end if %>
<% if not rsSearch("CDYear") = "0" or rsSearch("CDYear") = "" then %> <%=rsSearch("CDYear")%><%end if%> <% if not rsSearch("CDMake") = "0" or rsSearch("CDMake") = "" then %> <%=rsSearch("CDMake")%><%end if%> <% if not rsSearch("CDModel") = "0" or rsSearch("CDModel") = "" then %> <%=rsSearch("CDModel")%><%end if%> <% if not rsSearch("CDEdition") = "0" or rsSearch("CDEdition") = "" then %> <%=rsSearch("CDEdition")%>
<%end if%> <% if not rsSearch("CDDrive") = "0" or rsSearch("CDDrive") = "" then %> <%=rsSearch("CDDrive")%><%end if%> <% if not rsSearch("CDLiter") = "0" or rsSearch("CDLiter") = "" then %> <%=rsSearch("CDLiter")%><%end if%> <% if not rsSearch("CDEngine") = "0" or rsSearch("CDEngine") = "" then %> <%=rsSearch("CDEngine")%>
<%end if%> <% if not rsSearch("CDDoors") = "0" or rsSearch("CDDoors") = "" then %> <%=rsSearch("CDDoors")%><%end if%> <% if not rsSearch("CDStyle") = "0" or rsSearch("CDStyle") = "" then %> <%=rsSearch("CDStyle")%><%end if%>

<%if len(rsSearch("CDDescription")) > 0 then Response.Write left(rsSearch("CDDescription"),150) & "... " %> ">More <% else response.write "Description Not Given

" end if %>
Location: <%= RsSearch("CDCity") %>   <%= RsSearch("CDState") %>

<% if rsSearch("CDMSRP") <> "" then if rsSearch("CDMSRP") = 0 then %> Call For Price <% else MSRP = FormatCurrency(rsSearch("CDMSRP"), 2) %> Price: <%=MSRP%> <% end if end if if strAccessLevel = "1" or strAccessLevel = "2" then if rsSearch("CDWholeSalePrice") <> "" then if rsSearch("CDWholesalePrice") = 0 then %>
Call For Dealer Price
<% else Wholesale = FormatCurrency(rsSearch("CDWholesalePrice"), 2) %>
Dealer Price: <%=Wholesale%>
<% end if end if %> <% end if %>
<%End Sub%>
<% if WarningErrMsg <> "" then %> <% end if %>
VEHICLE SEARCH RESULTS
Error(s):<%= warningErrMsg %>
<% x = 0 For x = 1 to 5 If rsSearch.eof then Exit For Else %> <% End If Next %>
<%If Not rsSearch.EOF Then Call DisplayCDThumbnails%> <%If Not rsSearch.EOF Then rsSearch.MoveNext%>


Page <%=PageNo%> of <%=TotalPages%>
<%=TotalRecs%> vehicle(s) found.