<% Dim fp_conn, fp_rs, fp_rs2,fp_rs22, fp_rs3,fp_rs4 Dim fp_rs5 Dim ls_Req, lb_FirstTime, li_City Dim ls_Surface, ls_SurfaceFeet, ls_Order, ls_BgColor Dim ls_PicRoomsB, ls_PicPriceB, ls_PicIDB Dim ls_PicRoomsT, ls_PicPriceT, ls_PicIDT Dim li_Surface Dim li_NumProperties, li_Count, li_Div, li_Mod Dim li_CountNeighborhood, li_ColonnesMax, li_LignesMax Dim ls_Choice, lb_SR, li_SelectPage Set fp_conn = Server.CreateObject("ADODB.Connection") fp_conn.Open Application("MyDB_ConnectionString") li_City = 1 ls_City = "Jerusalem" ls_Choice = "Sale" 'Recuperation de la page li_SelectPage = Int(Request.QueryString("page")) If li_SelectPage = 0 then li_SelectPage = 1 End if '*********************************************** 'Default: Jerusalem 'If ls_Choice="Sale" Then li_City = Int(Request.QueryString("idcity")) ls_City = Request.QueryString("city") If li_City = 0 then li_City = 1 ls_City = "Jerusalem" Else 'we search the name of the city ls_Req = "SELECT name FROM City WHERE idcity = " & li_City fp_rs4 = fp_conn.Execute(ls_Req) ls_City = fp_rs4("name") End if 'On verifie le nombre de villes. Si =1, on n'affiche pas la phrase qui suit Set fp_rs10 = Server.CreateObject("ADODB.Recordset") ls_Req = "SELECT distinct Sale.idcity FROM Sale " ls_Req = ls_Req & " WHERE Sale.flagsale = 1" ls_Req = ls_Req & " AND Sale.luxury = 1 " fp_rs10.Open ls_Req, fp_conn li_Count = 0 Do While not fp_rs10.EOF li_Count = li_Count + 1 fp_rs10.Movenext Loop fp_rs10.Close If li_Count>1 Then %>

If you want an other city than Jerusalem so select a city.

<% Set fp_rs0 = Server.CreateObject("ADODB.Recordset") ls_Req = "SELECT distinct City.name, City.idcity FROM City, Sale " ls_Req = ls_Req & " WHERE City.idcity = Sale.idcity " ls_Req = ls_Req & " AND Sale.flagsale =1 " ls_Req = ls_Req & " AND Sale.luxury = 1 " ls_Req = ls_Req & " ORDER BY City.name " fp_rs0.Open ls_Req, fp_conn li_i=0 Do While not fp_rs0.EOF li_i = li_i+1 If li_i<=4 then If li_City = fp_rs0("idcity") then %> <% Else %> <%If li_City = fp_rs0("idcity") then %> <% li_i=1 End if fp_rs0.Movenext Loop %>
&choice=<% = ls_Choice %>"> <% = fp_rs0("name") %> <% Else %> &choice=<% = ls_Choice %>"> <% = fp_rs0("name") %> <% End if %>
&choice=<% = ls_Choice %>"> <% = fp_rs0("name") %> <% Else %> &choice=<% = ls_Choice %>"> <% = fp_rs0("name") %> <% End if %>
<% fp_rs0.Close End if 'End if '***************************************%>
<% Set fp_rs = Server.CreateObject("ADODB.Recordset") ls_Req = "SELECT distinct Neighborhood.idneighborhood, Neighborhood.name " ls_Req = ls_Req & " FROM Neighborhood, Sale " ls_Req = ls_Req & " WHERE Neighborhood.idneighborhood=Sale.idneighborhood " ls_Req = ls_Req & " AND Neighborhood.idcity = " & li_City ls_Req = ls_Req & " AND Sale.luxury = 1 " If ls_Choice="Sale" then ls_Req = ls_Req & " AND flagSale = 1 " Else ls_Req = ls_Req & " AND flagSale = 0 " End if ls_Req = ls_Req & " ORDER BY Neighborhood.name " fp_rs.Open ls_Req, fp_conn 'Count number of neighborhood li_CountNeighborhood = 0 Do while not fp_rs.EOF li_CountNeighborhood = li_CountNeighborhood + 1 fp_rs.Movenext Loop If li_CountNeighborhood>0 then %> Select your neighborhood(s) and then click "Quick search" button. <% Next %>
<% li_i=0 li_j=0 li_ColonnesMax = 3 li_Div = Round(li_CountNeighborhood / li_ColonnesMax) li_Mod = li_CountNeighborhood Mod li_ColonnesMax If li_Mod>0 then li_LignesMax = li_Div + 1 Else li_LignesMax = li_Div End if fp_rs.MoveFirst Do while not fp_rs.EOF li_i=li_i+1 If li_i=1 then %> <% End if ls_Neigh = fp_rs("name") ls_IDNeigh = fp_rs("idneighborhood") if li_i <% Else li_i = 0%>
<% =ls_Neigh %>
<% =ls_Neigh %>
<% End if fp_rs.Movenext Loop If li_i>0 and li_i < li_LignesMax then For li_j=1 to (li_LignesMax - li_i) %>
.
<% End if fp_rs.Close %>

   

<%End if %> <% 'Count number properties ls_Req = "SELECT count(*) as C " ls_Req = ls_Req & " FROM Sale " ls_Req = ls_Req & " WHERE flagSale = 1 and luxury = 1" ls_Req = ls_Req & " AND Sale.idcity = " & li_City lb_SR=True Set fp_rs22 = fp_conn.Execute(ls_Req) 'Search of number pages (1 page = 10 properties) li_NumProperties = 10 li_NumPages = 1 li_Count=fp_rs22("C") li_Div = Round(li_Count / li_NumProperties) li_Mod = li_Count Mod li_NumProperties If li_Mod>0 then li_NumPages = li_Div + 1 Else li_NumPages = li_Div End if '////////////////////////////// ls_Order = Request.QueryString("order") ls_PicRoomsB ="..\MyFiles\bottom-orange.JPG" ls_PicPriceB ="..\MyFiles\bottom-orange.JPG" ls_PicIDB = "..\MyFiles\bottom-orange.JPG" ls_PicRoomsT ="..\MyFiles\top-orange.JPG" ls_PicPriceT ="..\MyFiles\top-orange.JPG" ls_PicIDT = "..\MyFiles\top-orange.JPG" ls_Req = "SELECT Sale.idSale as ID , Neighborhood.name, Sale.surface, " ls_Req = ls_Req & " Sale.rooms, Sale.floor, Sale.price, Sale.comments, " ls_Req = ls_Req & " Picture.pic1 " ls_Req = ls_Req & " FROM Neighborhood, Sale, Picture " ls_Req = ls_Req & " WHERE Neighborhood.idneighborhood=Sale.idneighborhood " ls_Req = ls_Req & " AND Sale.idsale = Picture.idsale " ls_Req = ls_Req & " AND Sale.flagSale = 1 " ls_Req = ls_Req & " AND Sale.luxury = 1 " ls_Req = ls_Req & " AND Sale.idcity = " & li_City SELECT CASE Trim(ls_Order) CASE "roomsT" ls_Req = ls_Req & " ORDER BY Sale.rooms DESC" ls_PicRoomsT = "..\MyFiles\top-blue.JPG" CASE "roomsB" ls_Req = ls_Req & " ORDER BY Sale.rooms " ls_PicRoomsB = "..\MyFiles\bottom-blue.JPG" CASE "priceT" ls_Req = ls_Req & " ORDER BY Sale.price DESC" ls_PicPriceT = "..\MyFiles\top-blue.JPG" CASE "priceB" ls_Req = ls_Req & " ORDER BY Sale.price " ls_PicPriceB = "..\MyFiles\bottom-blue.JPG" CASE ELSE ls_Req2 = ls_Req ls_Req2 = ls_Req2 & " AND Picture.pic1='' " ls_Req = ls_Req & " AND Picture.pic1<>'' " ls_Req = ls_Req & " ORDER BY Sale.idSale desc" END SELECT lb_SR=True %>
<% ls_BgColor = "#AEC9E3" If lb_SR Then Set fp_rs2 = Server.CreateObject("ADODB.Recordset") fp_rs2.Open ls_Req, fp_conn 'Page 1 = between 1 to 10 properties 'Page 2 = between 10 to 20 properties 'Page 3 = between 30 to 40 properties '..... li_Between1= li_NumProperties * (li_SelectPage - 1) li_Between2= li_NumProperties * li_SelectPage li_i = 0 ls_Title = "Property list for " & ls_Choice Do While not fp_rs2.EOF li_i = li_i+1 ls_Surface = fp_rs2("surface") ls_SurfaceFeet="" If li_i=1 then %>

<% = ls_Title%>

<% End if If li_i> li_Between1 and li_i<=li_Between2 then li_Price=Int(fp_rs2("price")) ls_Price = fp_rs2("price") If li_Price = 0 then ls_Price = "" End if If li_Price=>1000 and li_Price<10000 then ls_Price = Left(ls_Price,1) & "," & Right(ls_Price, 3) End if If li_Price=>10000 and li_Price<100000 then ls_Price = Left(ls_Price,2) & "," & Right(ls_Price, 3) End if If li_Price=>100000 and li_Price<1000000 then ls_Price = Left(ls_Price,3) & "," & Right(ls_Price, 3) End if If li_Price=>1000000 and li_Price<10000000 then ls_Price = Left(ls_Price,4) & "," & Right(ls_Price, 3) ls_Price = Left(ls_Price,1) & "," & Right(ls_Price, 7) End if 'Area If Trim(ls_Surface)<>"" then li_Surface=Int(fp_rs2("surface")) If li_Surface=>1000 and li_Surface<10000 then ls_Surface = Left(ls_Surface,1) & "," & Right(ls_Surface, 3) End if If li_Surface=>10000 and li_Surface<100000 then ls_Surface = Left(ls_Surface,2) & "," & Right(ls_Surface, 3) End if If li_Surface=>100000 and li_Surface<1000000 then ls_Surface = Left(ls_Surface,3) & "," & Right(ls_Surface, 3) End if If li_Surface=>1000000 and li_Surface<10000000 then ls_Surface = Left(ls_Surface,4) & "," & Right(ls_Surface, 3) End if 'Area feet li_Surface = Int(fp_rs2("surface") * 10.8) ls_SurfaceFeet = Round(fp_rs2("surface") * 10.8) If li_Surface=>1000 and li_Surface<10000 then ls_SurfaceFeet = Left(ls_SurfaceFeet,1) & "," & Right(ls_SurfaceFeet, 3) End if If li_Surface=>10000 and li_Surface<100000 then ls_SurfaceFeet = Left(ls_SurfaceFeet,2) & "," & Right(ls_SurfaceFeet, 3) End if If li_Surface=>100000 and li_Surface<1000000 then ls_SurfaceFeet = Left(ls_SurfaceFeet,3) & "," & Right(ls_SurfaceFeet, 3) End if If li_Surface=>1000000 and li_Surface<10000000 then ls_SurfaceFeet = Left(ls_SurfaceFeet,4) & "," & Right(ls_SurfaceFeet, 3) End if End if ls_File=fp_rs2("pic1") If fp_rs2("pic1")="" then ls_File="../MyFiles/logo.gif" End if If ls_BgColor="#AEC9E3" then ls_BgColor = "#CFDFEF" Else ls_BgColor="#AEC9E3" End if %> <% End if fp_rs2.Movenext Loop If Trim(ls_Req2)<>"" then Set fp_rs22 = Server.CreateObject("ADODB.Recordset") fp_rs22.Open ls_Req2, fp_conn Do While not fp_rs22.EOF li_i = li_i+1 ls_Surface = fp_rs22("surface") ls_SurfaceFeet="" If li_i> li_Between1 and li_i<=li_Between2 then li_Price=Int(fp_rs22("price")) ls_Price = fp_rs22("price") If li_Price = 0 then ls_Price = "" End if If li_Price=>1000 and li_Price<10000 then ls_Price = Left(ls_Price,1) & "," & Right(ls_Price, 3) End if If li_Price=>10000 and li_Price<100000 then ls_Price = Left(ls_Price,2) & "," & Right(ls_Price, 3) End if If li_Price=>100000 and li_Price<1000000 then ls_Price = Left(ls_Price,3) & "," & Right(ls_Price, 3) End if If li_Price=>1000000 and li_Price<10000000 then ls_Price = Left(ls_Price,4) & "," & Right(ls_Price, 3) ls_Price = Left(ls_Price,1) & "," & Right(ls_Price, 7) End if 'Area If Trim(ls_Surface)<>"" then li_Surface=Int(fp_rs22("surface")) If li_Surface=>1000 and li_Surface<10000 then ls_Surface = Left(ls_Surface,1) & "," & Right(ls_Surface, 3) End if If li_Surface=>10000 and li_Surface<100000 then ls_Surface = Left(ls_Surface,2) & "," & Right(ls_Surface, 3) End if If li_Surface=>100000 and li_Surface<1000000 then ls_Surface = Left(ls_Surface,3) & "," & Right(ls_Surface, 3) End if If li_Surface=>1000000 and li_Surface<10000000 then ls_Surface = Left(ls_Surface,4) & "," & Right(ls_Surface, 3) End if 'Area feet li_Surface = Int(fp_rs22("surface") * 10.8) ls_SurfaceFeet = Round(fp_rs22("surface") * 10.8) If li_Surface=>1000 and li_Surface<10000 then ls_SurfaceFeet = Left(ls_SurfaceFeet,1) & "," & Right(ls_SurfaceFeet, 3) End if If li_Surface=>10000 and li_Surface<100000 then ls_SurfaceFeet = Left(ls_SurfaceFeet,2) & "," & Right(ls_SurfaceFeet, 3) End if If li_Surface=>100000 and li_Surface<1000000 then ls_SurfaceFeet = Left(ls_SurfaceFeet,3) & "," & Right(ls_SurfaceFeet, 3) End if If li_Surface=>1000000 and li_Surface<10000000 then ls_SurfaceFeet = Left(ls_SurfaceFeet,4) & "," & Right(ls_SurfaceFeet, 3) End if End if ls_File=fp_rs22("pic1") If fp_rs22("pic1")="" then ls_File="../MyFiles/logo.gif" End if If ls_BgColor="#AEC9E3" then ls_BgColor = "#CFDFEF" Else ls_BgColor="#AEC9E3" End if %> <% End if fp_rs22.Movenext Loop fp_rs22.Close End if %>

ID

Location

Area

Rooms

Floor

Price($)

Comments
m2 feet
&choice=<% = ls_Choice%>"> Tefah.com - Jerusalem Real Estate, Israel &choice=<% = ls_Choice%>"><% =fp_rs2("ID") %> <% =fp_rs2("name") %>

<% =ls_Surface %>

<% =ls_SurfaceFeet %>

<% =fp_rs2("rooms") %>

<% =fp_rs2("floor") %>

<% =ls_Price %>

<% =fp_rs2("comments") %>
&choice=<% = ls_Choice%>"> Tefah.com - Jerusalem Real Estate, Israel &choice=<% = ls_Choice%>"><% =fp_rs22("ID") %> <% =fp_rs22("name") %>

<% =ls_Surface %>

<% =ls_SurfaceFeet %>

<% =fp_rs22("rooms") %>

<% =fp_rs22("floor") %>

<% =ls_Price %>

<% =fp_rs22("comments") %>
<% fp_rs2.Close End if fp_conn.Close %>

<% '********************************************************* ' PAGES - PREVIUOS / NEXT '********************************************************* li_MaxPages = 7 li_Count = 1 'Trouver le nombre de tours li_NbPages = (li_NumPages / li_MaxPages) li_ModPages = li_NumPages Mod li_MaxPages li_i = 1 If li_ModPages > 0 Then li_NbPages = Int(li_NbPages) + 1 End if lb_True = False li_Tour = 1 Do While not lb_True and li_i<=Int(li_NbPages) li_Tour = (li_MaxPages * li_i) / li_SelectPage li_ModTour = (li_MaxPages * li_i) Mod li_SelectPage If Int(li_Tour)>0 Then li_Tour = li_i lb_True = True End if li_i = li_i + 1 Loop 'Affichage du Previous li_Tour = Int(li_Tour - 1) If li_SelectPage>li_MaxPages Then If li_SelectPage => (li_MaxPages * li_Tour) + 1 Then li_Count = (li_MaxPages * li_Tour) + 1 %> Previous . <% End if End if 'Affichage des numeros de pages en faisant attention au nb de pages. li_AjoutPage = li_NumPages - li_MaxPages + 1 If li_AjoutPage > 0 then li_AjoutPage = li_MaxPages Else li_AjoutPage = li_NumPages End if li_Counter = li_Count For li_j = 1 to li_AjoutPage li_Counter = li_Counter + 1 Next li_ReducPage = li_NumPages - li_Counter + 1 If li_ReducPage<0 Then li_AjoutPage = li_AjoutPage + li_ReducPage End if 'Affichage des pages For li_k = 1 to li_AjoutPage If li_SelectPage = li_Count Then %> <%= li_Count%> <% Else %> <%= li_Count%> <% End if %> . <% li_Count = li_Count + 1 Next If li_NumPages => li_Count Then %> Next <% End if %>

Home Page | List your Property With Us | Agents | Contact Us | Send to a friend  
 

Tefah.com  Jerusalem Pearl Hotel, Zahal Square ISRAEL   Tel: 972-2-622-2282   email: website@tefah.com

Copyright © 2005 Tefah.com. All rights reserved.