codice:
<%
iPageSize = 25 'NUMERO RECORD PER PAGINA
If Request.QueryString("page") = "" Then
iPageCurrent = 1
Else
iPageCurrent = CInt(Request.QueryString("page"))
End If
%>
<%sql = "SELECT * FROM strutture where 1=1"
if Request.form("provincia") <> "" then
sql = sql & " and provincia = '" & Request.form("provincia") & "'"
end if
if Request.form("struttura") <> "" then
sql = sql & " and categoria_struttura = '" & Request.form("struttura") & "'"
end if
if Request.form("stelle") <> "" then
sql = sql & " and stelle_struttura = " & Request.form("stelle") & ""
end if
if Request.form("provincia") = "" then
sql = sql & " and regione = '" & Session("regione") & "'"
end if
sql = sql & " and online = 'Si' order by stelle_struttura desc, nome_struttura"
' response.write sql
Set rs = Server.CreateObject("ADODB.Recordset")
rs.PageSize = iPageSize
rs.CacheSize = iPageSize
rs.Open sql, cn, 3, 3%>
<%reccount = rs.recordcount
iPageCount = rs.PageCount
If iPageCurrent > iPageCount Then iPageCurrent = iPageCount
If iPageCurrent < 1 Then iPageCurrent = 1
If iPageCount = 0 Then
Response.Write "
<table><td><font face='verdana' size='2' color='#000000'>Non sono state trovate strutture.</td></table></p>"
Else
rs.AbsolutePage = iPageCurrent
iRecordsShown = 0
%>
<%
'SI VISUALIZZA IL CONTENUTO DELLA STRINGA SQL
'ALL'INTERNO DELLA TABELLA PRIMA DEFINITA
cont=1
Do While iRecordsShown < iPageSize And Not rs.EOF
%>