home > search listings > results
 
Listings Results  

<% today = date() thedate = today-70 color1 = "#eeeeee" color2 = "#ffffff" count = 0 numPerPage = 10 nextRecoNum = 1 if request.querystring("curPage") = "" then curPage = 1 session("passedValue")= request.QueryString else if isnumeric(request.querystring("curPage")) then curPage = request.querystring("curPage") else response.redirect "/missing.asp" end if end if if request.querystring("range")="" or not isnumeric(request.querystring("range")) then response.redirect "/missing.asp" end if if request.querystring("range2")="" or not isnumeric(request.querystring("range2")) then response.redirect "/missing.asp" end if set conn = server.CreateObject("ADODB.Connection") set rsListings = server.createObject("ADODB.Recordset") rsListings.CursorLocation = adUseClient %> <% for each checkedName in request.queryString if request.queryString(checkedName) = "on" then underS = inStr(checkedName, "_") slash = inStr(checkedName, "8") dot = inStr(checkedName, "9") if underS <> 0 then checkedName = replace(checkedName, "_", " ") end if if slash <> 0 then checkedName = replace(checkedName, "8", "/") end if if dot <> 0 then checkedName = replace(checkedName, "9", ".") end if if left(checkedName,1) = "a" then city = 1 showCity = showCity & "'" & right(checkedName, len(checkedName)-1) & "'" & "," if checkedName="aShuswap" then showCity = showCity & "'Scotch Creek','Sorrento','Anglemont','Magna Bay','Celista'," end if elseif left(checkedName,1) = "b" then proptype= 1 showproptype = showproptype & "'" & right(checkedName, len(checkedName)-1) & "'" & "," end if end if next if city = 1 then showCity = left(showCity, len(showCity)-1) showCity = "(" & showCity & ")" else end if if proptype =1 then showproptype = left(showproptype, len(showproptype)-1) showproptype = "(" & showproptype & ")" else end if if request.queryString("waterfront") = "on" then vWaterfront = " and waterfront = 1 " else vWaterfront = "" end if if request.queryString("virtualtoursonly") = "on" then virtualtourspart = " and (virtualtourtype <> '' or (virtualtour1 <> '' and owner='homelife')) " else virtualtourspart = "" end if if request.querystring("bBusiness")="on" or request.querystring("bIndustrial")="on" or request.querystring("bCommercial_Investment")="on" or request.querystring("bResidential_Investment")="on" or request.querystring("bResorts_and_RV_Parks")="on" or request.querystring("bMobile_Home_Parks")="on" or request.querystring("bRetail_Space")="on" or request.querystring("bOffice_Space")="on" or request.querystring("bHotels")="on" or request.querystring("bMotels")="on" or request.querystring("bPubs")="on" then forrentpart=" " else forrentpart=" and for_rent <> 1 " end if if city <> 1 and proptype <> 1 and request.queryString("showallproptype") <> "on" and request.queryString("showallcity") <> "on" then response.write "" & "Please choose a city or select a property type.

" & "Try Again" else if city = 1 then if request.queryString("keyword") <> "" then listingsQuery = "SELECT owner,id,photo,photo1,photo2,price,for_rent,for_lease,soldstatus,city,address,proptype,reduced,development,highlightphrase,comments1 FROM listings WHERE for_rent <> 1 and (status='' or status is null) and ( description like '%"& replace(request.queryString("keyword"),"'","''")&"%' or highlightphrase like '%"& replace(request.queryString("keyword"),"'","''")&"%' or address like '%"& replace(request.queryString("keyword"),"'","''")&"%') " & vWaterfront & virtualtourspart & " and city in" & showCity & "and price >= "&request.queryString("range")& " and price <="& request.queryString("range2") & " and owner<>'cove' and owner<>'vattoy' and realtorid not in "&bannedid&" and soldstatus = 0 and datelisted > '"&mysqlDate(thedate)&"' and prov='BC' ORDER BY price" else listingsQuery = "SELECT owner,id,photo,photo1,photo2,price,for_rent,for_lease,city,soldstatus,address,proptype,reduced,development,highlightphrase,comments1 FROM listings WHERE for_rent <> 1 and (status='' or status is null) and city in" & showCity & vWaterfront & virtualtourspart & " and price >= "&request.queryString("range")& " and price <="& request.queryString("range2") & " and owner<>'cove' and owner<>'vattoy' and realtorid not in "&bannedid&" and soldstatus = 0 and datelisted > '"&mysqlDate(thedate)&"' and prov='BC' ORDER BY price" end if end if if proptype = 1 then if request.queryString("keyword") <> "" then listingsQuery = "SELECT owner,id,photo,photo1,photo2,price,for_rent,for_lease,soldstatus,city,address,proptype,reduced,development,highlightphrase,comments1 FROM listings WHERE for_rent <> 1 and (status='' or status is null) and proptype in" & showproptype &" and ( description like '%"& replace(request.queryString("keyword"),"'","''")&"%' or highlightphrase like '%"& replace(request.queryString("keyword"),"'","''")&"%' or address like '%"& replace(request.queryString("keyword"),"'","''")&"%') " & vWaterfront & virtualtourspart &" and price >= "&request.queryString("range")& " and price <="& request.queryString("range2") & " and owner<>'cove' and owner<>'vattoy' and realtorid not in "&bannedid&" and soldstatus = 0 and datelisted > '"&mysqlDate(thedate)&"' and prov='BC' ORDER BY price" else listingsQuery = "SELECT owner,id,photo,photo1,photo2,price,for_rent,for_lease,soldstatus,city,address,proptype,reduced,development,highlightphrase,comments1 FROM listings WHERE for_rent <> 1 and (status='' or status is null) and proptype in" & showproptype &"and price >= "&request.queryString("range")& vWaterfront & virtualtourspart & " and price <="& request.queryString("range2") & " and realtorid not in "&bannedid&" and owner<>'cove' and owner<>'vattoy' and soldstatus = 0 and datelisted > '"&mysqlDate(thedate)&"' and prov='BC' ORDER BY price" end if end if if city = 1 and proptype = 1 then if request.queryString("keyword") <> "" then listingsQuery = "SELECT owner,id,photo,photo1,photo2,price,for_rent,for_lease,soldstatus,city,address,proptype,reduced,development,highlightphrase,comments1 FROM listings WHERE for_rent <> 1 and (status='' or status is null) and city in" & showCity & "and proptype in" & showproptype & " and ( description like '%"& replace(request.queryString("keyword"),"'","''")&"%' or highlightphrase like '%"& replace(request.queryString("keyword"),"'","''")&"%' or address like '%"& replace(request.queryString("keyword"),"'","''")&"%') "& vWaterfront & virtualtourspart &" and price >= "&request.queryString("range")& " and price <="& request.queryString("range2") & " and realtorid not in "&bannedid&" and owner<>'cove' and owner<>'vattoy' and soldstatus = 0 and datelisted > '"&mysqlDate(thedate)&"' and prov='BC' ORDER BY price" else listingsQuery = "SELECT owner,id,photo,photo1,photo2,price,for_rent,for_lease,soldstatus,city,address,proptype,reduced,development,highlightphrase,comments1 FROM listings WHERE (status='' or status is null) and city in" & showCity & "and proptype in" & showproptype & "and price >= "&request.queryString("range")& vWaterfront & virtualtourspart &" and price <="& request.queryString("range2") & " and realtorid not in "&bannedid&" and owner<>'cove' and owner<>'vattoy' and soldstatus = 0 " & forrentpart &" and datelisted > '"&mysqlDate(thedate)&"' and prov='BC' ORDER BY price" end if end if rsListings.open listingsQuery, conn, adOpenstatic, adLockReadonly, adCmdtext totalRecords = rsListings.recordCount %>
<% if not(rsListings.EOF) then rsListings.moveFirst rsListings.pageSize = numPerPage totalpages = rsListings.pageCount rsListings.AbsolutePage = curPage nextRecoNum = rsListings.Absoluteposition lastRecoOnPage = nextRecoNum + rsListings.pageSize - 1 if totalRecords <> -1 and totalRecords < lastRecoOnPage then lastRecoOnPage= totalRecords end if %> Results:   <%= nextRecoNum %>-<%= lastRecoOnPage %> of <%= totalRecords %>

<% if totalRecords <> 0 then %> <% if curPage <> 1 then %> <% else %> <% if int(curPage) < totalPages then %> <% else %> <% end if %>
<< previous results<< previous results <% end if %>
<%= nextRecoNum - count %>-<%= lastRecoOnPage %> of <%= totalrecords %> results
next results >>
<% end if %> <% rsListings.close set rsListings=nothing conn.close set conn = nothing end if 'end checking, if nothing is checked in the form %>