Qui sotto riporto lo script di paginazione di Mr. Roby72 che ho personalizzato per il mio sito. si tratta di una paginazione di eventi presenti nella provincia dove abito. Sempre grazie all'aiuto di Roby 72 ho aggiunto due pulsanti per visualizzare solo gli eventi in pordenone, e un'altro per visualizzare tutti gli eventi.
premetto che io inserisco nel campo "luogo" nel mio db, il luogo dove verrà fatto l'evento.
il mio problema è il seguente: quando premo il pulsante per visualizzare solo gli eventi di pordenone, io vorrei che non mi cercasse all'interno del campo "luogo" solo la dicitura corretta di Pordenone, ma che mi visualizzi anche i nomi dov'e' presente il nome pordenone: ad esempio Torre di Pordenone..
insomma che mi visualizzi tutti i luoghi dov'e' presente la parola Pordenone.
come secondo pulsante vorrei che mi visualizzasse tutti i campi dove il luogo è diverso da pordenone..
è possibile secondo voi?
grazie
alessia
codice:<% iPageSize = 10 'NUMERO RECORD PER PAGINA If Request.QueryString("page") = "" Then iPageCurrent = 1 Else iPageCurrent = CInt(Request.QueryString("page")) End If luogo = trim(request("luogo")) datet = year(date()) & "/" & month (date()) & "/" & day(date()) strSQL = "select * from eventi where eventi.data_fine >= #"& datet &"#" if len(luogo) > 0 then strSQL = strSQL &" AND luogo = '"& luogo &"'" end if strSQL = strSQL &" order by data_inizio asc, ora_inizio asc, id asc" Set objRS = Server.CreateObject("ADODB.Recordset") objRS.PageSize = iPageSize objRS.CacheSize = iPageSize objRS.Open strSQL, objConn, adOpenStatic, adLockReadOnly, adCmdText reccount = objRS.recordcount iPageCount = objRS.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 stati trovati eventi.</td></table></p>" Else objRS.AbsolutePage = iPageCurrent iRecordsShown = 0 %> <table cellpadding="0" cellspacing="0" border="0" width="560"> <tr> <td bgcolor="#cccccc"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr height="22"> <td bgcolor="#E4E6E7" WIDTH="30" class="fortext"></td> <td bgcolor="#E4E6E7" WIDTH="195" class="fortext">Evento</td> <td bgcolor="#E4E6E7" WIDTH="175" class="fortext">Località</td> <td bgcolor="#E4E6E7" WIDTH="80" class="fortext">data inizio</td> <td bgcolor="#E4E6E7" WIDTH="80" class="fortext">data fine</td> </tr> <% 'SI VISUALIZZA IL CONTENUTO DELLA STRINGA SQL 'ALL'INTERNO DELLA TABELLA PRIMA DEFINITA cont=1 Do While iRecordsShown < iPageSize And Not objRS.EOF Dim Rig, bg Rig = Rig + 1 If Rig Mod 2 = 0 then bg = "#F3F4F5" Else bg = "#FFFFFF" End if Response.Write "<tr bgcolor = " & bg & "><td class=""fortext""><div align=""center"">[img][/img]</td>" Response.Write "<td class=""fortext"">"& Left((objRS("titolo")),30) &"..</td>" Response.Write "<td class=""fortext"">"& Left((objRS("luogo")),25) & "..</td>" Response.Write "<td class=""fortext"">" & objRS("data_inizio") & "</td>" %> <td class="fortext"> <% if objRS("data_inizio") = objRS("data_fine") then response.write " " else response.write objRS("data_fine") end if %> </td><% Cont = Cont + 1 'POSIZIONAMENTO ALLA RIGA SUCCESSIVA DEL DB iRecordsShown = iRecordsShown + 1 objRS.MoveNext Loop 'PULIZIA DEGLI OGGETTI ADO objRS.Close Set objRS = Nothing %> </table> </td> </tr> </table> <%End if%> <%If ipagecount <> 1 Then%> <center> <table align="center"> <tr valign="middle"> <td width="50%" align="center" valign="middle"><font face="verdana" size="1" color="#000000"> [ <%if iPageCurrent-2 > 0 and iPageCurrent > 2 then%> [img]../image/small/first.gif[/img] <%end if%> <%if iPageCurrent > 1 then%> [img]../image/small/pre.gif[/img] <%end if%> <%if iPageCount > 2 then if iPageCurrent-2 < 1 then da_pag = 1 else da_pag = iPageCurrent-2 if iPageCurrent+2 > iPageCount then fino_a_pag = iPageCount else fino_a_pag = iPageCurrent+2 else da_pag = 1 fino_a_pag = iPageCount end if%> <%for i = da_pag to fino_a_pag%> <%if i = iPageCurrent then%> <font color="red"><%=i%></font> <%else%> <%=i%> <%end if%> <%next%> <%if iPageCurrent > 0 and iPageCurrent < iPageCount then%> [img]../image/small/next.gif[/img] <%end if%> <%if iPageCurrent+1 < iPageCount then%> [img]../image/small/last.gif[/img] <%end if%> ] </font></td> </tr> <tr> <td colspan="2" align="center"><font face="verdana" size="1" color="#000000"> <center> Pagina <font color="#FF0000"><%=iPageCurrent%></font> di <font color="#FF0000"><%=iPageCount%></font> </center> </font></td> </tr> </table> <%end if%> <% objConn.Close Set objConn = Nothing %> </td> </tr> <tr> <td height="20" colspan="3"><div align="center"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><form method="get" action="default.asp"> <input type="hidden" name="page" value="<%=i%>" /> <input type="hidden" name="luogo" value="Pordenone" /> <input type="Submit" name="submit" value="Eventi di Pordenone" /> </form></td> <td> <form method="get" action="default.asp"> <input type="hidden" name="page" value="<%=i%>" /> <input type="hidden" name="luogo" value="" /> <input type="Submit" name="submit" value="tutti i comuni" /> </td> </tr> </table> </div></td> </tr> </table>

Rispondi quotando