Ecco qua
codice:
<%
RecordsPerPagina = ipag
page = Request("page")
paginavenditex = "attici-e-ville-in-vendita.asp"
if page="" then
if page="" then page=1
if idDB = "SQL" then
If idDVmweb = 0 then
strSQL= "SELECT * FROM offerte WHERE idDVm <> " & idDvmweb & " and bloccato = 0 "
else
strSQL= "SELECT * FROM offerte WHERE idDVm = " & idDvmweb & " and bloccato = 0 "
end if
else
strSQL="SELECT * FROM offerte WHERE bloccato = 0 "
end if
P_prezzo = 1000000000000
tolleranza=int(P_prezzo/2)
if P_prezzo<>"" then
if P_prezzo<>"1000000000000" and P_prezzo<>"2"then
if P_prezzo="1" then
strSQL=strSQL&" AND costo_E <= 800 "
else
strSQL=strSQL&" AND costo_E <= (("&P_prezzo&")*2) "
end if
strSQL=strSQL&" AND costo_E >= "&P_prezzo&" "
else
if P_prezzo="2" then
strSQL=strSQL&" AND costo_E <= 1000000000"
strSQL=strSQL&" AND costo_E >= 4000"
else
strSQL=strSQL&" AND costo_E <= "&P_prezzo&" "
end if
end if
end if
strSQL=strSQL&"and immobile like '%Ville & Casali VE%' and offerta like '%VE%'"
strSQL=strSQL & " ORDER BY costo_E asc"
Session("ok_strSQL")=strSQL
else
Session("ok_strSQL")=Session("ok_strSQL")
end if
%>
<%
set rs=Conn.Execute(Session("ok_strSQL"))
if not rs.EOF then
totrecords=0
While Not rs.EOF
totrecords=totrecords+1
rs.MoveNext
wend
rs.movefirst()
rs.move = page * Recordsperpagina-Recordsperpagina
numpagine=totrecords\RecordsPerPagina
if totrecords mod recordsperpagina<>0 then
numpagine=numpagine+1
end if