<html>
<head>
<meta http-equiv="Content-Language" content="it">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>MOTORE</title>
<script language="javascript">
var win = null;
function apri(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left ='+LeftPosition+',scrollbars='+scroll+',noresize'
win = window.open(mypage,myname,settings)
}
</script>
</head>
<body>
</p>
<font face="verdana" size="1">
<div align="center">
<%
risultatiPerPagina = 2
pagina = request.queryString("pagina")
if len(pagina) > 0 and isNumeric(pagina) then
pagina = cLng(pagina)
else
pagina = 1
end if
if pagina < 1 then pagina = 1
questaPagina = request.serverVariables("PATH_INFO")
sezione = request.form("sezione")
tipologia = request.form("og")
sottotipologia = request.form("o")
regione = request.form("regione")
provincia = request.form("provincia")
comune = request.form("comune")
qString = "sezione=" & server.URLEncode(sezione) & "&tipologia=" & server.URLEncode(tipologia) & "&sottotipologia=" & server.URLEncode(sottotipologia) & "®ione=" & server.URLEncode(regione) & "&provincia=" & server.URLEncode(provincia) & "&comune=" & server.URLEncode(comune)
function fixSQL(theString)
theString = replace(theString,"'","''")
theString = replace(theString,"%","[%]")
theString = replace(theString,"#","[#]")
theString = replace(theString,"_","[_]")
theString = replace(theString,"[","[[]")
theString = replace(theString,"]","[]]")
fixSQL = theString
end function
sql = "SELECT * FROM immobili WHERE 1 = 1 "
if len(sezione) > 0 then sql = sql & "AND sezione = '" & fixSQL(sezione) & "' "
if len(tipologia) > 0 then sql = sql & "AND tipologia = '" & fixSQL(tipologia) & "' "
if len(sottotipologia) > 0 then sql = sql & "AND sottotipologia = '" & fixSQL(sottotipologia) & "' "
if len(regione) > 0 then sql = sql & "AND regione = '" & fixSQL(regione) & "' "
if len(provincia) > 0 then sql = sql & "AND provincia = '" & fixSQL(provincia) & "' "
if len(comune) > 0 then sql = sql & "AND comune = '" & fixSQL(comune) & "' "
sql = sql & "ORDER BY [ID]"
set rs = server.createObject("ADODB.Recordset")
rs.open sql, conn, 3, 1
if not rs.eof then
rs.pageSize = risultatiPerPagina
if rs.pageCount > pagina then pagina = 1
rs.absolutePage = pagina
response.write "Totale: " & rs.recordCount
response.write " Pagine: "
for p = 1 to rs.pageCount
if p = pagina then
response.write p & " "
else
response.write "
" & p & " "
end if
next
for r = 0 to risultatiPerPagina
if not rs.eof then
%>
<fieldset style="width: 500px; height: 59px">
<table border="0" width="500" cellspacing="1" id="table1" height="59">
<tr>
<td width="129">
<p align="center">
<%
if TRIM(rs.Fields("foto")) & "[]" <> "[]" then
%>
<a href="javascript
:apri('public/foto/<%=rs.Fields("foto")%>','','550','500','no');">
[img]public/foto/<%=rs.Fields([/img]" height="90" border="0" width="103"></a>
<%
else
%>
[img]images/nofoto.png[/img]
<%
end if
%>
</td>
<td><%=rs.Fields("provincia")%>-<%=rs.Fields("indirizzo")%>
<%=rs.Fields("sezione")%>-<%=rs.Fields("tipologia")%>-<%=rs.Fields("sottotipologia")%>-<%=rs.Fields("mq")%>
<%=rs.Fields("note")%>
</td>
</tr>
</table>
</fieldset>
----------------------------------------------------------------------------------------
</p>
</font>
<%
rs.moveNext
else
exit for
end if
next
response.write "Pagine: "
for p = 1 to rs.pageCount
if p = pagina then
response.write p & " "
else
response.write "
" & p & " "
end if
next
end if
%></font>
<p align="center">
</p>
</html>