Visualizzazione dei risultati da 1 a 8 su 8
  1. #1

    Impaginazione molto incasinata!

    Ho questa select (premetto che non sono programatore):

    codice:
    set rscatlist=db.execute ("SELECT price, ( price *  ( 100 - scontoperc)) / 100 AS sconto, * FROM clientiart RIGHT JOIN products ON clientiart.productid=products.productid WHERE (((products.catcode)="&catcode&") AND ((clientiart.custid)="&custid&" Or (clientiart.custid) Is Null) AND ((clientiart.codcategoria)="&catcode&" Or (clientiart.codcategoria) Is Null))")
    --------------

    La stampa a video è questa:

    <table width="90%" align="center" cellpadding="2" cellspacing="0" border="1" bgcolor="#ffffff"><%
    'Display list of other products in category
    if not rscatlist.eof then
    rscatlist.movefirst
    while not rscatlist.eof
    %>
    <tr><td width="70">
    <font size="1" face="helvetica" color="<%= COLlight %>">

    <form action="addprod.asp?productid=<%= rscatlist("productid")%>" method="post">
    Q.tà:
    <SELECT NAME="qty">
    <OPTION SELECTED VALUE="1">1
    <OPTION VALUE="2">2
    <OPTION VALUE="3">3
    <OPTION VALUE="4">4
    </SELECT></td><td>

    <input type="hidden" name="stage" value="2"><font size="1" face="verdan" color="<%= COLlight %>">&price=<%=rscatlist("sconto")%>"><%=rscatlist("nam e")%>


    Il Tuo prezzo: € <%=rscatlist("sconto")%>

    Listino: € <%=rscatlist("price")%>
    </font>
    <td><input type=image src="images/carr.gif" border=0 alt="Aggiungi l'articolo all'ordine"></td>

    </td></tr><tr><td colspan="3" bgcolor="#eeeeee"></td></tr></form>
    <%
    rscatlist.movenext
    wend
    end if
    %>
    </table>


    ---------
    Ho provato già ad impaginare usando questo sistema
    http://freeasp.html.it/script/view_script.asp?id=137

    ma non mi viene per niente.. la select è un pò incasianta
    ma è testata e funziona perfettamente.

    GRAZIE DELLA MANO

    http://www.adottauntetto.com

  2. #2
    usa questo thread

  3. #3
    mi sembra più comlicato du quello che ho utilizzatro...
    il mio prblema è he la select non estrae slamente l'ID ma parecchi valori...non so se mi spiego ..boh?

    http://www.adottauntetto.com

  4. #4
    STP PROVANDO QUESTO MA LA SELECT E' TROPPO CAZZUTA (scaricata da creamweb
    E QUESTI SCRIPTM NON MI CONTA I RECORDS:


    <%
    iPageSize = 10 'NUMERO RECORD PER PAGINA

    If Request.QueryString("page") = "" Then
    iPageCurrent = 1
    Else
    iPageCurrent = CInt(Request.QueryString("page"))
    End If

    strSQL = ("SELECT price, ( price * ( 100 - scontoperc)) / 100 AS sconto, * FROM clientiart RIGHT JOIN products ON clientiart.productid=products.productid WHERE (((products.catcode)="&catcode&") AND ((clientiart.custid)="&custid&" Or (clientiart.custid) Is Null) AND ((clientiart.codcategoria)="&catcode&" Or (clientiart.codcategoria) Is Null))")

    'strSQL = "SELECT * FROM tGiocatori ORDER BY giocatore ASC"
    Set objRS = Server.CreateObject("ADODB.Recordset")
    objRS.PageSize = iPageSize
    objRS.CacheSize = iPageSize
    objRS.Open strSQL, db, 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 giocatori.</td></table></p>"
    Else
    objRS.AbsolutePage = iPageCurrent
    iRecordsShown = 0
    %>
    <table cellpadding="0" cellspacing="0" border="0" width="95%">
    <tr>
    <td bgcolor="#cccccc">
    <table cellpadding="2" cellspacing="1" border="0" width="100%">
    <tr height="22">
    <td bgcolor="#dddddd" WIDTH="6%"><font face="verdana" size="2" color="#000000">N.</font></td>
    <td bgcolor="#dddddd" WIDTH="29%"><font face="verdana" size="2" color="#000000">Giocatore</font></td>
    <td bgcolor="#dddddd" WIDTH="4%" align="center"><font face="verdana" size="2" color="#000000">Ruolo</font></td>
    <td bgcolor="#dddddd" WIDTH="11%" align="center"><font face="verdana" size="2" color="#000000">Squadra</font></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 = "#E4E4E4"
    Else
    bg = "#ccccff"
    End if
    Response.Write "<tr bgcolor = " & bg & "><td><font color='#000000' face='Verdana' size='1'>" & (iPageSize*iPageCurrent)-iPageSize+Cont & "</font></td>"
    Response.Write "<td><font color='#000000' face='Verdana' size='1'>" & objRS("name") & "</font></td>"
    Response.Write "<td align='center'><font color='#000000' face='Verdana' size='1'>" & objRS("productid") & "</font></td>"
    Response.Write "<td align='center'><font color='#000000' face='Verdana' size='1'>" & objRS("sconto") & "</font></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>
    <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]images/first.gif[/img]
    <%end if%>
    <%if iPageCurrent > 1 then%>
    [img]images/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]images/next.gif[/img]
    <%end if%>
    <%if iPageCurrent+1 < iPageCount then%>
    [img]images/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>
    </center>
    <%end if%>
    <%
    db.Close
    Set db= Nothing
    %>

    http://www.adottauntetto.com

  5. #5
    in effetti non ti spieghi


    cosa vorresti fare?

  6. #6
    voglio semplicement eimpaginare (per es: 1o record per pagina)
    ma senza modificare la select

    http://www.adottauntetto.com

  7. #7
    help

    http://www.adottauntetto.com

  8. #8
    ma che vuyol dire senza modificare la select??

    mica modifichi la select con quello script che hai postato

    fai i response.write di quello che devi stampare a video una volta che hai aperto il recordset

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.