Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it
    Registrato dal
    Mar 2003
    residenza
    Prato
    Messaggi
    687

    Problema form ricerca avanzata

    Ho questo form che richiama due pagine asp. Una orizzontale e l'altra verticale.
    http://www.bardellosport.com/1.asp

    Sto cercando invano di modificare lo script della pagina orizzontale.
    Vorrei che invece di una riga appaiano due righe.

    Questo è il codice:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Untitled Document</title><link rel="stylesheet" href="link.css" type="text/css">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body>
    <%
    '-----------------------------------------------------------------------------------------
    ' Paginazione Avanzata Risultati
    '-----------------------------------------------------------------------------------------
    '-----------------------------------------------------------------------------------------
    Function PaginazioneAvanzata(ByVal linkto, ByVal linktoQS)

    Dim MaxPage, Midpage, UltimaPagina, indice, fromindice, toindice

    Response.Write ("Pagina " & "" & page & "" & "di " & "" & objAsgRs.pageCount & "
    " )
    Maxpage=10
    Midpage=(Maxpage\2)+1
    UltimaPagina=objAsgRs.pageCount

    if Maxpage>UltimaPagina then
    for indice = 1 to UltimaPagina
    if CInt(indice)=CInt(page) then
    Response.Write ("[" & indice & "] " )
    else
    Response.Write ("[" & indice & "] " )
    end if
    next
    else
    if CInt(Midpage)<CInt(page) then

    fromindice=page-Midpage+1
    toindice=page+Midpage-1
    if toindice>UltimaPagina then
    toindice=UltimaPagina
    fromindice=toindice-Maxpage+1
    end if
    else
    fromindice=1
    toindice=Maxpage
    end if

    if fromindice <> 1 then
    Response.Write ("[&lt;&lt;] " )
    end if
    for indice = fromindice to toindice
    if CInt(indice)=CInt(page) then
    Response.Write ("[" & indice & "] " )
    else
    Response.Write ("[" & indice & "] " )
    end if
    next
    if fromindice<UltimaPagina-Maxpage then
    Response.Write ("[&gt;&gt;] " )
    end if
    end if

    End Function


    IF request.querystring("ruota") = "" THEN
    aaa="bari"
    else
    aaa=request.querystring("ruota")
    END IF
    dataDa= month(request("dataDa")) & "/" &day(request("dataDa")) & "/" & year(request("dataDa"))
    dataA= month(request("dataA")) & "/" & day(request("dataA")) & "/" & year(request("dataA"))


    dim nomeruota()



    If instr(aaa,"bari") then

    redim preserve nomeruota(1)
    nomeruota(0)="bari"
    response.write d
    Dim arrayb(4)
    arrayb(0)="b1"
    arrayb(1)="b2"
    arrayb(2)="b3"
    arrayb(3)="b4"
    arrayb(4)="b5"
    b= a & "b1,b2,b3,b4,b5"
    end if

    if instr(aaa,"cagliari") then
    redim preserve nomeruota(2)
    nomeruota(1)="cagliari"


    Dim arrayc(4)
    arrayc(0)="c1"
    arrayc(1)="c2"
    arrayc(2)="c3"
    arrayc(3)="c4"
    arrayc(4)="c5"
    c=a & ",c1,c2,c3,c4,c5"
    end if
    If instr(aaa,"venezia") then
    redim preserve nomeruota(3)
    nomeruota(2)="venezia"
    v=a & ",v1,v2,v3,v4,v5"
    end if
    if instr(aaa,"torino") then
    redim preserve nomeruota(4)
    nomeruota(3)="torino"
    t=a & ",t1,t2,t3,t4,t5"
    end if
    If instr(aaa,"firenze") then
    redim preserve nomeruota(5)
    nomeruota(4)="firenze"
    f=a & ",f1,f2,f3,f4,f5"
    end if
    if instr(aaa,"milano") then
    redim preserve nomeruota(6)
    nomeruota(5)="milano"
    m=a & ",m1,m2,m3,m4,m5"
    end if
    If instr(aaa,"napoli") then
    redim preserve nomeruota(7)
    nomeruota(6)="napoli"
    n=a & ",n1,n2,n3,n4,n5"
    end if
    if instr(aaa,"genova") then
    redim preserve nomeruota(8)
    nomeruota(7)="genova"
    g=a & ",g1,g2,g3,g4,g5"
    end if
    If instr(aaa,"palermo") then
    redim preserve nomeruota(9)
    nomeruota(8)="palermo"
    p=a & ",p1,p2,p3,p4,p5"
    end if
    if instr(aaa,"roma") then
    redim preserve nomeruota(10)
    nomeruota(9)="roma"
    r=a & ",r1,r2,r3,r4,r5"
    end if
    'If left(a, 1) ="," then
    'a= mid(a,2, len(a)-1)
    'end if
    a= b & c & f& g &n&m &p & r&v &t
    If left(a, 1) ="," then
    a= mid(a,2, len(a)-1)
    end if
    Dim strAsgSQL ' Stringa SQL di esecuzione
    Dim objAsgConn ' Oggetto Connessione
    Dim strAsgConn ' Stringa di connessione al db
    Dim objAsgRs
    Set objAsgConn = Server.CreateObject("ADODB.Connection")

    ' Definisci il recordset
    set objAsgRs = Server.CreateObject("ADODB.Recordset")

    strAsgMapPath = Server.MapPath("fpdb/lotto.mdb")

    strAsgConn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & strAsgMapPath
    '---------------------------------------------------
    ' Apri connessione al Database
    '---------------------------------------------------

    'dim arrayb(5)=["b1,b2,b3,b4,b5"]
    objAsgConn.Open strAsgConn
    strAsgSQL = "SELECT data, "
    strAsgSQL = strAsgSQL & a
    strAsgSQL = strAsgSQL & " from lotto"
    strAsgSQL = strAsgSQL & " where data Between #" & dataDa & "# and #" & dataA & "#"
    strAsgSQL = strAsgSQL & " order by data desc"

    'response.write strasgsql
    'SET objAsgRs= objAsgConn.Execute(strAsgSQL)
    objAsgRs.Open strAsgSQL, objAsgConn, 3, 3
    ' paginazione avanzata
    Dim page
    Dim RecordsPerPage
    page = Request.QueryString("page")
    RecordsPerPage =7 'visualizzazione record x pagina

    If len(page) > 0 And IsNumeric(page) Then
    page = CLng(page)
    Else
    page = 1
    End If

    objAsgRs.PageSize = RecordsPerPage
    objAsgRs.AbsolutePage = page
    intAsgCount = (RecordsPerPage * (page-1))

    %>
    <table border=1 bgcolor="#33CC99"><tr>

    <td width=60>Data</td>
    <%
    For asgOutput = 1 To RecordsPerPage
    if not objasgrs.eof then
    intAsgCount = intAsgCount + 1
    %>
    <td bordercolor="#CCFF00" width=105 colspan=5><%=objasgrs("data")%></td>
    <%
    objasgrs.movenext
    end if

    next

    %>
    </tr>


    <%
    objasgrs.movefirst


    'for x=0 to 4 'non è arrayb ma in generale


    'If Not objAsgRs.EOF Then
    'intAsgCount = intAsgCount + 1
    %>
    <% if instr(a, "b")>0 then

    %>
    <tr><td width=60>Bari</td>
    <% objAsgRs.PageSize = RecordsPerPage
    objAsgRs.AbsolutePage = page
    intAsgCount = (RecordsPerPage * (page-1))
    For asgOutput = 1 To RecordsPerPage
    intAsgCount = intAsgCount + 1
    if not objasgrs.eof then

    %>
    <td ><%response.write objasgrs("b1") %></td><td><%= objasgrs("b2")%></td><td><%= objasgrs("b3")%></td><td><%= objasgrs("b4")%></td><td><%=objasgrs("b5")%></td>
    <%
    'next
    objasgrs.movenext

    end if
    next
    %>
    </tr>
    <%
    end if
    objasgrs.movefirst
    if instr(a, "c")>0 then
    %>

    <tr><td width=60>Cagliari</td><% objAsgRs.PageSize = RecordsPerPage
    objAsgRs.AbsolutePage = page
    intAsgCount = (RecordsPerPage * (page-1))
    For asgOutput = 1 To RecordsPerPage
    if not objasgrs.eof then
    intAsgCount = intAsgCount + 1

    %>
    <td><%response.write objasgrs("c1") %></td><td><%= objasgrs("c2") %></td><td><%= objasgrs("c3") %></td><td><%= objasgrs("c4") %></td><td><%= objasgrs("c5")%></td>
    <%
    'next
    objasgrs.movenext
    end if
    next
    %></tr>
    <%
    end if
    objasgrs.movefirst
    if instr(a, "f")>0 then
    %>

    <tr><td width=60>Firenze</td>
    <% objAsgRs.PageSize = RecordsPerPage
    objAsgRs.AbsolutePage = page
    intAsgCount = (RecordsPerPage * (page-1))
    For asgOutput = 1 To RecordsPerPage
    if not objasgrs.eof then
    intAsgCount = intAsgCount + 1
    %>
    <td><%response.write objasgrs("f1") %></td><td><%= objasgrs("f2") %></td><td><%= objasgrs("f3") %></td><td><%= objasgrs("f4") %></td><td><%= objasgrs("f5")%></td>
    <%
    'next
    objasgrs.movenext

    end if
    next%>
    </tr>
    <%
    end if
    objasgrs.movefirst
    'da copy #####################
    if instr(a, "g")>0 then
    %>
    <tr><td width=60>Genova</td>
    <% objAsgRs.PageSize = RecordsPerPage
    objAsgRs.AbsolutePage = page
    intAsgCount = (RecordsPerPage * (page-1))
    For asgOutput = 1 To RecordsPerPage
    if not objasgrs.eof then
    intAsgCount = intAsgCount + 1
    %>
    <td><%response.write objasgrs("g1") %></td><td><%= objasgrs("g2") %></td><td><%= objasgrs("g3") %></td><td><%= objasgrs("g4") %></td><td><%= objasgrs("g5")%></td>
    <%
    'next
    objasgrs.movenext

    end if
    next %>
    </tr>
    <%
    end if
    objasgrs.movefirst
    'fine da copy ################
    'da copy #####################


    if instr(a, "m")>0 then
    %>
    <tr><td width=60>Milano</td>
    <% objAsgRs.PageSize = RecordsPerPage
    objAsgRs.AbsolutePage = page
    intAsgCount = (RecordsPerPage * (page-1))
    For asgOutput = 1 To RecordsPerPage
    if not objasgrs.eof then
    intAsgCount = intAsgCount + 1
    %>
    <td><%response.write objasgrs("m1") %></td><td><%= objasgrs("m2") %></td><td><%= objasgrs("m3") %></td><td><%= objasgrs("m4") %></td><td><%= objasgrs("m5")%></td>
    <%
    'next
    objasgrs.movenext

    end if
    next %>
    </tr>
    <%
    end if
    objasgrs.movefirst
    'fine da copy ################
    'da copy #####################
    if instr(a, "n")>0 then
    %>
    <tr><td width=60>Napoli</td>
    <% objAsgRs.PageSize = RecordsPerPage
    objAsgRs.AbsolutePage = page
    intAsgCount = (RecordsPerPage * (page-1))
    For asgOutput = 1 To RecordsPerPage
    if not objasgrs.eof then
    intAsgCount = intAsgCount + 1
    %>
    <td><%response.write objasgrs("n1") %></td><td><%= objasgrs("n2") %></td><td><%= objasgrs("n3") %></td><td><%= objasgrs("n4") %></td><td><%= objasgrs("n5")%></td>
    <%
    'next
    objasgrs.movenext

    end if
    next %>
    </tr>
    <%
    end if
    objasgrs.movefirst
    'fine da copy ################
    'da copy #####################
    if instr(a, "p")>0 then
    %>
    <tr><td width=60>Palermo</td>
    <% objAsgRs.PageSize = RecordsPerPage
    objAsgRs.AbsolutePage = page
    intAsgCount = (RecordsPerPage * (page-1))
    For asgOutput = 1 To RecordsPerPage
    if not objasgrs.eof then
    intAsgCount = intAsgCount + 1 %>
    <td><%response.write objasgrs("p1") %></td><td><%= objasgrs("p2") %></td><td><%= objasgrs("p3") %></td><td><%= objasgrs("p4") %></td><td><%= objasgrs("p5")%></td>
    <%
    'next
    objasgrs.movenext

    end if
    next%>
    </tr>
    <%
    end if
    objasgrs.movefirst
    'fine da copy ################
    'da copy #####################
    if instr(a, "r")>0 then
    %>
    <tr><td width=60>Roma</td>
    <% objAsgRs.PageSize = RecordsPerPage
    objAsgRs.AbsolutePage = page
    intAsgCount = (RecordsPerPage * (page-1))
    For asgOutput = 1 To RecordsPerPage
    if not objasgrs.eof then
    intAsgCount = intAsgCount + 1
    %>
    <td><%response.write objasgrs("r1") %></td><td><%= objasgrs("r2") %></td><td><%= objasgrs("r3") %></td><td><%= objasgrs("r4") %></td><td><%= objasgrs("r5")%></td>
    <%
    'next
    objasgrs.movenext

    end if
    next%>
    </tr>
    <%
    end if
    objasgrs.movefirst
    'fine da copy ################
    'da copy #####################
    if instr(a, "t")>0 then
    %>
    <tr><td width=60>Torino</td>
    <% objAsgRs.PageSize = RecordsPerPage
    objAsgRs.AbsolutePage = page
    intAsgCount = (RecordsPerPage * (page-1))
    For asgOutput = 1 To RecordsPerPage
    if not objasgrs.eof then
    intAsgCount = intAsgCount + 1
    %>
    <td><%response.write objasgrs("t1") %></td><td><%= objasgrs("t2") %></td><td><%= objasgrs("t3") %></td><td><%= objasgrs("t4") %></td><td><%= objasgrs("t5")%></td>
    <%
    'next
    objasgrs.movenext

    end if
    next%>
    </tr>
    <%
    end if
    objasgrs.movefirst
    'fine da copy ################
    'da copy #####################
    if instr(a, "v")>0 then
    %>
    <tr><td width=60>Venezia</td>
    <% objAsgRs.PageSize = RecordsPerPage
    objAsgRs.AbsolutePage = page
    intAsgCount = (RecordsPerPage * (page-1))
    For asgOutput = 1 To RecordsPerPage
    if not objasgrs.eof then
    intAsgCount = intAsgCount + 1
    %>
    <td><%response.write objasgrs("v1") %></td><td><%= objasgrs("v2") %></td><td><%= objasgrs("v3") %></td><td><%= objasgrs("v4") %></td><td><%= objasgrs("v5")%></td>
    <%
    'next
    objasgrs.movenext

    end if
    next%>
    </tr>
    <%
    end if
    objasgrs.movefirst
    'fine da copy ################

    %>
    <%
    'objAsgRs.MoveNext
    'response.write Intasgcount


    Call PaginazioneAvanzata("orizzontale.asp","ruota=" & aaa &"&dataDa=" & dataDa& "&dataA=" & dataA )
    %>
    </table>
    </body>
    </html>

  2. #2
    Mi sembra di aver già visto quella funzione da qualche parte.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.