<% strAccessLevel = session("AccessLevel") strUserName2 = session("userName") strId = request("Id") ' Create a recordset object to store specific table information Set objrs = Server.CreateObject("ADODB.Recordset") SQL = "Select * From TblWishList where Id=" & strId 'Set the recordset object equal to the SQL query string objrs.Open SQL, objADO, 1, 3 'strId = objrs("Id") strType = objrs("PropertyType") strTerms = objrs("PropertyTerms") strLowPrice = objrs("LowPrice") strHighPrice = objrs("HighPrice") strTotalFt = objrs("TotalFt") strBedrooms = objrs("Bedrooms") strBathrooms = objrs("Bathrooms") strState = objrs("State") strCity = objrs("City") strZip = objrs("Zip") strCountry = objrs("Country") PageNo = cInt(request.form("page")) sSQL = request.form("strSQL") If PageNo = "" then PageNo=1 end if If PageNo < 1 then PageNo=1 end if sSQL = "SELECT * FROM (REFlooring RIGHT JOIN (RERoom RIGHT JOIN (REExterior RIGHT JOIN" sSQL = sSQL & " (REAC RIGHT JOIN (((((REHeat RIGHT JOIN (REGarage RIGHT JOIN" sSQL = sSQL & " (REDriveway RIGHT JOIN REListing ON REDriveway.REDrivewayID = REListing.REDrivewayID)" sSQL = sSQL & " ON REGarage.REGarageID = REListing.REGarageID) ON REHeat.REHeatID = REListing.REHeatID)" sSQL = sSQL & " LEFT JOIN RERoof ON REListing.RERoofID = RERoof.RERoofID) LEFT JOIN" sSQL = sSQL & " RESewer ON REListing.RESewerID = RESewer.RESewerID) LEFT JOIN" sSQL = sSQL & " REStyle ON REListing.REStyleID = REStyle.REStyleID) LEFT JOIN" sSQL = sSQL & " REWater ON REListing.REWaterID = REWater.REWaterID) ON REAC.REACID = REListing.REACID)" sSQL = sSQL & " ON REExterior.REExteriorID = REListing.REExteriorID)" sSQL = sSQL & " ON (RERoom.RERoomID = REListing.REListingRoom8ID)" sSQL = sSQL & " AND (RERoom.RERoomID = REListing.REListingRoom7ID)" sSQL = sSQL & " AND (RERoom.RERoomID = REListing.REListingRoom6ID)" sSQL = sSQL & " AND (RERoom.RERoomID = REListing.REListingRoom5ID)" sSQL = sSQL & " AND (RERoom.RERoomID = REListing.REListingRoom4ID)" sSQL = sSQL & " AND (RERoom.RERoomID = REListing.REListingRoom3ID)" sSQL = sSQL & " AND (RERoom.RERoomID = REListing.REListingRoom2ID)" sSQL = sSQL & " AND (RERoom.RERoomID = REListing.REListingRoom1ID))" sSQL = sSQL & " ON (REFlooring.REFlooringID = REListing.REListingFlooring8ID)" sSQL = sSQL & " AND (REFlooring.REFlooringID = REListing.REListingFlooring7ID)" sSQL = sSQL & " AND (REFlooring.REFlooringID = REListing.REListingFlooring6ID)" sSQL = sSQL & " AND (REFlooring.REFlooringID = REListing.REListingFlooring5ID)" sSQL = sSQL & " AND (REFlooring.REFlooringID = REListing.REListingFlooring4ID)" sSQL = sSQL & " AND (REFlooring.REFlooringID = REListing.REListingFlooring3ID)" sSQL = sSQL & " AND (REFlooring.REFlooringID = REListing.REListingFlooring2ID)" sSQL = sSQL & " AND (REFlooring.REFlooringID = REListing.REListingFlooring1ID))" sSQL = sSQL & " WHERE (" If Len(strType) > 0 Then sSQL = sSQL & "(REListingType='" + strType + "') AND " If Len(strTerms) > 0 Then sSQL = sSQL & "(RESaleType='" + strTerms + "') AND " If (strBedrooms) <> 0 Then sSQL = sSQL & "((REListingBedrooms) >= " & strBedrooms & ") AND " If (strBathrooms) <> 0 Then sSQL = sSQL & "((REListingBathrooms) >= " & strBathrooms & ") AND " If (strTotalFt) <> 0 Then sSQL = sSQL & "(REListingTotalFt >= " & strTotalFt & ") AND " If strState <> "" Then sSQL = sSQL & "(REListingState = '" + strState + "') AND " If strCity <> "" Then sSQL = sSQL & "(REListingCity = '" + strCity + "') AND " If strZip <> "" Then sSQL = sSQL & "(REListingZip = '" + strZip + "') AND " If strCountry <> "" Then sSQL = sSQL & "(REListingCountry = '" + strCountry + "') AND " If (strLowPrice) <> 0 And Len(strHighPrice) < 1 Then sSQL = sSQL & "(REListingPrice >= " & strLowPrice & ") AND " If (strLowPrice) <> 0 And Len(strHighPrice) > 0 Then sSQL = sSQL & "(REListingPrice BETWEEN " & strLowPrice & " AND " & strHighPrice & ") AND " sSQL = sSQL & "(REListingActive=True)) order by REListingCity, REListingPrice, REListingAddress1" Set rsSearch = Server.CreateObject("ADODB.Recordset") rsSearch.Open sSQL, objADO, 3, 3 TotalRecs = rsSearch.recordcount rsSearch.Pagesize=9 TotalPages = cInt(rsSearch.pagecount) if PageNo > TotalPages then PageNo = TotalPages end if if not rsSearch.eof then rsSearch.absolutepage=PageNo strSaleType = rsSearch("RESaleType") end if if not rsSearch.eof then strStateName = rsSearch("REListingState") SQL = "SELECT * FROM TblStates where StateName = '" + strStateName + "'" Set rsState = Server.CreateObject("ADODB.Recordset") rsState.Open SQL, objADO, 3, 3 end if Sub DisplayREThumbnails%> "> <%If Len(rsSearch("REListingImage")) > 0 Then If UCase(Left(rsSearch("REListingImage"),7))="HTTP://" Then%> " border="0" height="110" width="150"> <%Else%> " border="0" height="110" width="150"> <%End If Else%> <%End If%> <% if Session("AccessLevel") = "1" or session("UserName") = rsSearch("REListingUserName") then %> ">    ">
<% end if %> <%= rsSearch("REListingType") %>, <%= rsSearch("RESaleType") %>
Date Listed: <%= rsSearch("REDateAdded") %>
Site Listing #: <%= rsSearch("REListingId") %>

<% if rsSearch("REListingPrice") > 0 then %> Price: <%= formatCurrency(rsSearch("REListingPrice"))%>
<% else %> Contact For Price
<% end if %> <% if rsSearch("REDisplayAddress") = "1" then Response.Write rsSearch("REListingAddress1") & "
" end if Response.Write rsSearch("REListingCity") & ", " & rsState("StateId") & " " & rsSearch("REListingZip")%>

<% lREListingTotalFt = rsSearch("REListingTotalFt") iREListingBedrooms = rsSearch("REListingBedrooms") iREListingBathrooms = rsSearch("REListingBathrooms") curREListingPrice = rsSearch("REListingPrice") If lREListingTotalFt > 0 Then Response.Write lREListingTotalFt & " sq. ft.
" If iREListingBedrooms > 0 Then Response.Write iREListingBedrooms & " Bedrooms" If iREListingBathrooms > 0 And Len(iREListingBathrooms) > 0 Then Response.Write " / " & iREListingBathrooms & " Baths
" End If %>

<%End Sub%>

    WISH LIST RESULTS -     <%=TotalRecs%> item(s) found

<% x = 0 For x = 1 to 3 If rsSearch.eof then Exit For Else %>
<%If Not rsSearch.EOF Then%><%Call DisplayREThumbnails%> <%rsSearch.MoveNext%> <%End If%> <%If Not rsSearch.EOF Then%><%Call DisplayREThumbnails%> <%rsSearch.MoveNext%> <%End If%> <%If Not rsSearch.EOF Then%><%Call DisplayREThumbnails%> <%End If%>
<%If Not rsSearch.EOF Then rsSearch.MoveNext%> <% End If Next %>


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