Ir para conteúdo
Fórum Script Brasil
  • 0

paginacao de produtos


claytonprog

Pergunta

Pessoal! Tenho esse código aqui tá funcionando belza mais preciso fazer uma páginação, alguém poderia ajudar a adaptar:

<tr>
                            <td><tr><br>
    <td height="156" width="412" style="border-style:solid; border-width:1px; "><font color="#000000"><%cont = 1%>

<table height="101" width="399" cellspacing="4" style="border-collapse: collapse" cellpadding="0">
    
<%         
           
       set rs = cn.execute("SELECT * From Products order by rnd(ProductID)")
            
                     
      %>
      
      <%
      
      if request.QueryString("cid") <> "" then
      
      set rs = cn.execute("Select * From Products Where CategoryID=" & request.QueryString("cid"))
      
      else

        'Response.Write "<font color='#0000FF'"
        'response.write "</p>"
        'Response.write "<br>Nenhum produto Cadastrado"

      
      end if
           
     
     %>
     
     <%
      
if RS.EOF then %>


<div align="center">
</font></font></font>
                                        <font color=#BF3200 face=verdana><b>
<font size="2"><br>Nenhum 
produto cadastrado</font></b></font><font face="Tahoma"><font size="2" color="#BF3200">
<% else %> 
      
      
<%End If %>       


<% While not rs.EOF %>



</font></font><font face="Tahoma" color="#289AD4">



<td width="133" style="border-style: none; border-width: medium"><a href="detalhes_produtos.asp?ID=<%=rs("productid")%>"style="text-decoration: none"><img src="images/products/<%=rs.fields("image")%>" width="100" height="86" alt="clique na imagem" ></a></td>
<td width="254" height="39" style="border-style:none; border-width:medium; "><font size="2" color="#00000" face="tahoma"><p align="justify"><%=rs.fields("productname")%></font><P>
<b>

           <% if rs("price") = "0,0" then %> 
                 <font size="2" color="#00000" face="tahoma">Preço Sob Consulta</font></b>
               
                  <% else %>
                  
                  <font size="2" color="#800000" face="tahoma">Preço:<%=FormatCurrency(rs.fields("price"),2)%></font>

                  <% end if %>
           </b><br>

</td>



<% If cont = 2 then %>

</tr>
<tr>

<%
cont = 1


Else


cont = cont + 1

End if

rs.MoveNext

wend


if cont = 2 then
%>

<tr>
<td height="1" width="133" style="border-style:none; border-width:medium; " align="center"></td>
<%Elseif contador = 1 then %>

<td height="1" width="254" style="border-top-style: none; border-top-width: medium; border-left-style:none; border-left-width:medium"></td>



<% End if %>

</tr>
<p></p>

</table></font>
    
                            </td>
</tr>

Preciso paginar pra ficar assim:

primeira 1 2 3 4 5 6 ultima

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

  • 0

Ted K'! Amigão este código seu ajudou bastante está funcionando aqui, porém eu preciso de uma coisinha que eu esqueci de mensionar, preciso que os dados apareçam em 4 colunas tipo o do Orkut.

Ex: Foto1 Foto2 Foto3 Foto 4

Está assim meu código adapatado do seu;

<tr>
  <td width="44%" height="30" bgcolor="#EBEBEB" class="classFonte01">&nbsp;<strong>Nome</strong>&nbsp;</td>
  <td width="47%" bgcolor="#EBEBEB" class="classFonte01">&nbsp;<strong>E-Mail</strong>&nbsp;</td>
</tr>
  <%
  conn.CursorLocation = 3
  Set rs = Server.CreateObject("Adodb.RecordSet")
  rs.Pagesize = 4
  rs.Open "SELECT * FROM tblperfil order by nome",conn

  If rs.Eof Then
  Response.Write("")
  Else
  PaginaAtual = CInt(Request.Querystring("Pages"))

  If PaginaAtual = 0 Then
  PaginaAtual = 1
  End If

  rs.AbsolutePage = PaginaAtual
  Num = rs.PageCount

  While Not rs.Eof And rs.AbsolutePage = PaginaAtual
  %>
<tr>
  <td height="22" bgcolor="#F7F7F7" class="classFonte01">&nbsp;<% Response.Write(rs("Nome")) %>&nbsp;</td>
  <td bgcolor="#F7F7F7" class="classFonte01">&nbsp;<% Response.Write(rs("cliques")) %>&nbsp;</td>
</tr>
  <%
  rs.MoveNext : Wend
  Anterior = PaginaAtual - 1
  Proximo = PaginaAtual + 1

  If Anterior <= 0 Then
  Anterior = 1
  End If

  If Proximo > rs.PageCount Then
  Proximo = rs.PageCount
  End If
  %>
<tr>
  <td height="30" colspan="2" align="right" bgcolor="#EBEBEB" class="classFonte01"><strong>Paginas:</strong>&nbsp;<%
  Jo = 1
  While Jo <= rs.PageCount

  If PaginaAtual = Jo Then
  Response.Write("["&Jo&"]&nbsp;&nbsp;")
  Else
  Response.Write("<a href=""comunidade.asp?Pages="&Jo&""" class=""classFonte01"" title=""P&aacute;gina "&Jo&""">"&Jo&"</a>&nbsp; ")
  End If
  Jo = Jo + 1
  Wend
  End If
%></td>
</tr>

Me dá uma força ai e faz a adaptação do código.

Desde já agradeço.

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      652k
×
×
  • Criar Novo...