codice:
<%
risultatiPerPagina = 10
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")
sesso = request.queryString("sesso")
eta = request.queryString("eta")
provincia = request.queryString("provincia")
paese = request.queryString("paese")
citta = request.queryString("citta")
iscrizione = request.queryString("iscrizione")
foto = request.queryString("foto")
online = request.queryString("online")
listUsersOnline = application("usersOnline")
oggi = date()
qString = "sesso=" & server.URLEncode(sesso) & "&eta=" & server.URLEncode(eta) & "&provincia=" & server.URLEncode(provincia) & "&paese=" & server.URLEncode(paese) & "&iscrizione=" & server.URLEncode(iscrizione) & "&foto=" & server.URLEncode(foto) & "&online=" & server.URLEncode(online)
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
if len(online) > 0 then
online = cLng(online)
else
online = 0
end if
sql = "SELECT * FROM tbl_authors WHERE 1 = 1 "
if len(sesso) > 0 then sql = sql & "AND sesso = '" & fixSQL(sesso) & "' "
if len(eta) > 0 then sql = sql & "AND eta = '" & fixSQL(eta) & "' "
if len(provincia) > 0 then sql = sql & "AND provincia = '" & fixSQL(provincia) & "' "
if len(paese) > 0 then sql = sql & "AND paese = '" & fixSQL(paese) & "' "
if foto = "si" then sql = sql & "AND FotoProfilo <> '""' "
'utenti online
if online = 1 then
for i = 0 to uBound(listUsersOnline)
sql = sql & "AND name = '" & listUsersOnline(i)(0) & "' "
next
End If
if len(citta) > 0 then sql = sql & "AND citta = '" & fixSQL(citta) & "' "
set rs = server.createObject("ADODB.Recordset")
rs.open sql, adoCon, 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
%>
<table border="0" cellspacing="1" id="table1">
<tr>
<%
colonne = 1
for r = 1 to risultatiPerPagina
if not rs.eof then
%>
<td bordercolor="#FF0F00" style="border-style: dotted; border-width: 1px" height="59" width="170">
<%=rs.Fields("name")%>
[img] <%if rs.Fields([/img] ">
[img] <%if online = 1 then Response.Write [/img]" alt="<%if online = 1 then Response.Write "Online" else Response.Write "Offline" %>">
<%=rs.Fields("dataNascita")%> - <%=rs.Fields("citta")%> (<%=rs.Fields("provincia")%>)
</td>
<td rowspan="1" bordercolor="#FF0F00" style="border-style: dotted; border-width: 1px" height="59" width="59">
">[img]<%if rs.Fields([/img]" height="59" width="59" alt="Visualizza Profilo" border="0">
</td>
<td></td>
<td></td>
<td></td>
<%if colonne = 3 then %>
<tr>
<tr>
<tr>
<%colonne = 1 %>
<%end if%>
<%
colonne = colonne + 1
rs.moveNext
else
exit for
end if
next
%>
</tr>
</table>
<%
response.write "Pagine: "
for p = 1 to rs.pageCount
if p = pagina then
response.write p & " "
else
response.write "" & p & " "
end if
next
else
response.write "
Nessun Risultato Trovato!</p>"
end if
rs.close
set rs = nothing
adoCon.close
set adoCon = nothing
%>