<%@language=vbscript%>
<%
localita=request.querystring("posto")
qualita=request.querystring("stel")
regi=request.querystring("regione")
individuo=request.querystring("nome")
cosa=request.querystring("categor")
zona=lcase(regi)
indi=lcase(individuo)
luogo=lcase(localita)
arr=array(luogo,indi,zona,cosa,qualita)
dim strsql
strsql="select man, imag, id from tblex where "
dd=trim(arr(0))
cc=trim(arr(1))
ff=trim(arr(2))
gg=trim(arr(3))
yy=trim(arr(4))
if len(luogo)<> 0 then
strsql=strsql &" luo like'%"&dd&"%'"
end if
if len(indi)<> 0 then
if len(luogo)<> 0 then strsql= strsql &"or"
strsql= strsql &" man like'%"&cc&"%'"
end if
if len(zona)<> 0 then
if len(luogo)<> 0 or len(indi)<> 0 then strsql=strsql& "or"
strsql=strsql &" regio like'%"&ff&"%'"
end if
if len(cosa)<>0 then
if len(luogo)<>0 or len(indi)<>0 or len(zona)<>0 then strsql=strsql &"or"
strsql=strsql &" category like'%"&gg&"%'"
end if
if len(qualita)<> 0 then
if len(luogo) or len(indi) or len(zona) or len(cosa) then strsql=strsql &"or"
strsql=strsql &" stel like'%"&yy&"%'"
end if
page=request.querystring("p")
if page=""then page="1"
num=10
strconn="Provider=Microsoft.Jet.OLEDB.4.0; Data Source="& server.mappath("/turismo/pino.mdb")
set objconn= server.createobject("adodb.connection")
objconn.open strconn
set rs=objconn.execute(strsql)
rs.pagesize=num
%>
<html>
<title>Untitled Document</title>
<body>
<%if rs.eof then
response.write("there aren't answers")
else
numpage=rs.pagecount
rs.absolutepage=cint(page)
for i =1 to num %>
<table><tr> <td bgcolor="#FF9900" width="18%" height="58">[img]file/<% response.write rs.collect([/img]"></td> <td bgcolor="#FF9900" width="24%"><div align="center"><%response.write rs.collect("man")%></div></td><td bgcolor="#FF9900" width="17%">
"><%response.write rs.collect("id")%></td></tr></table>
<%
rs.movenext
next
for i =0 to numpage%>
<%=i%>
<%next
end if%>
<%rs.close
set rs= nothing
objconn.close
set objconn=nothing%>
</body>
</html>