Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

garas-man

Paginação x mais de uma tabela não quero isso

Recommended Posts

Seguinte: peguei um esquema de paginação que está funciando beleza. Só tem um porém: não estou conseguindo mandar mostrar os itens dentro de uma só tabela. O que está acontecendo é que mostra uma tabela por item. Veja o codigo abaixo.

 

Seguinte: peguei um esquema de paginação que está funciando beleza. Só tem um porém: não estou conseguindo mandar mostrar os itens dentro de uma só tabela. O que está acontecendo é que mostra uma tabela por item. Veja o codigo abaixo.

 

Seleciona da tabela contato

objTB = "SELECT * FROM cad_produtos"

objRS.Open objTB,objConn

mypage=request("pagina")

If mypage="" then

mypage=1

end if

mypagesize=request("total")

If mypagesize="" then

mypagesize=10

end if

mySQL=request("'")

IF mySQL="" THEN

mySQL=SQLtemp

END IF

'objRS.movefirst

objRS.pagesize=mypagesize

maxpages=cint(objRS.pagecount)

maxrecs=cint(objRS.pagesize)

objRS.absolutepage=mypage

howmanyrecs=0

%>

<html>

<LINK REL=stylesheet HREF="backup/admin/liks_etc.css" TYPE="text/css">

<head>

<title>Tela de Consulta - Itens cadastrados</title>

<style> <!--body {scrollbar-face-color: #0000ff; scrollbar-shadow-color: #000080; scrollbar-highlight-color: #ffffff; scrollbar-3dlight-color: #000000; scrollbar-darkshadow-color:#ffffff; scrollbar-track-color: #ffffff; scrollbar-arrow-color: #ffffff;}--> </style>

<style>

<!--

A:link {color:#0000FF;TEXT-DECORATION: none}

A:visited {color:#000000;TEXT-DECORATION: none}

A:active {color:#000000;TEXT-DECORATION:none }

a:hover {color:"Blue";text-decoration: underline}

.textbox {

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 12px;

color: #0000FF;

background-attachment: fixed;

background-image: url(backup/box_shadow.gif);

}

-->

</style>

</head>

<body bgcolor="#FFFFFF" leftmargin="1" topmargin="1" marginwidth="1" marginheight="1">

<div align="center" style="width: 756; height: 119">

<table width="100%" border="0" cellspacing="0" cellpadding="0" height="1" align="center">

<tr>

<td width="448" valign="top" height="136">

<table border="0" cellpadding="0" cellspacing="0" width="778" align="center">

<tr bgcolor="ffffff">

<td colspan="3">

<table width="100%" border="0" cellspacing="2" cellpadding="2">

<tr>

<td bgcolor="#f5f5f5">

<div align="center"><font color="#000099"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><a href="backup/cadastro.html" class="menu">Incluir</a></font></b></font></div>

</td>

<td bgcolor="#f5f5f5">

<div align="center"><font color="#000099"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#CCCCCC"><a href="backup/escolhe_pra_excluir.asp" class="menu"><font color="#000099">Excluir</font></a></font></b></font></div>

</td>

<td bgcolor="#f5f5f5">

<div align="center"><font color="#000099"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#CCCCCC">Alterar</font></b></font></div>

</td>

</tr>

</table>

 

</td>

</tr>

<tr>

<td colspan="3" align="center" valign="top">

<table width="736" border="0" cellspacing="0" cellpadding="0" height="18">

<tr>

<td align="center" height="1" width="734"> <font face="Verdana, Arial, Helvetica, sans-serif" color="#000099" size="3"><b><br>

<font size="2">Selecione o(s) íten(s) a ser(em) excluido(s)</font></b></font></td>

</tr>

</table>

<form method="GET" action="altera_cad_admin.asp">

<font color="#FFFFFF">

<%

WHILE NOT howmanyrecs>=maxrecs

%>

<%response.write"<font size='1' color='black' face='Verdana, Arial,Helvetica, sans-serif'>Página " & mypage & " de " & maxpages & "<br>"%>

</font>

<table width="100%" height="52" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#000000">

<tr bgcolor="#009797">

<td width="59" height="26" align="center"> <font size="1" color="FFFFFF"><b><font face="Verdana">Codigo:</font></b>

</font></td>

<td width="217" align="center" bgcolor="#009797"><font size="1" color="FFFFFF"><b><font face="Verdana">Descrição:</font></b>

</font></td>

<td width="52" height="26" align="center"> <font size="1" color="FFFFFF"><b><font face="Verdana">Valor

Unitário :</font></b> </font></td>

<td width="41" height="26" align="center"><font size="1" color="FFFFFF"><b><font face="Verdana">ICMS:</font></b>

</font></td>

<td width="49" align="center"><font size="1" color="FFFFFF"><b><font face="Verdana">IPI:</font></b>

</font></td>

<td width="80" align="center"><font size="1" color="FFFFFF"><b><font face="Verdana">Total

Nota:</font></b> </font></td>

<td width="50" align="center"><font size="1" color="FFFFFF"><b><font face="Verdana">Total

Frete:</font></b> </font></td>

<td width="65" align="center"><font size="1" color="FFFFFF"><b><font face="Verdana">Frete:</font></b>

</font></td>

<td width="70" align="center"><font size="1" color="FFFFFF"><b><font face="Verdana">Valor

Total:</font></b> </font></td>

<td width="64" height="26" align="center"> <font size="1" color="FFFFFF">

<input name="alterar" type="submit" id="alterar" style="BORDER-RIGHT: #006262 1px solid; BORDER-TOP: #006262 1px solid; FONT-SIZE: 8pt; BORDER-LEFT: #006262 1px solid; COLOR: #000000; BORDER-BOTTOM: #006262 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #B6DADA" value="Alterar">

</font></td>

</tr>

<tr bgcolor="#B6DADA">

<td height="20" align="center">

<div align="left"><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">

<%Response.write objRS("categ")%>

</font><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">

<%Response.write objRS("id")%>

</font></b></font><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">

</font> </b></font></div></td>

<td align="center"> <div align="left"><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">

<%Response.write objRS("desc")%>

</font></b></font></div></td>

<td height="20" align="center">

<div align="left"><b><font color="#000000" size="1" face="Verdana, Arial, Helvetica, sans-serif">R$</font></b><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif">

<%Response.write objRS("vl_unit")%>

</font></b></font></div></td>

<td height="20" align="center">

<div align="left"><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">

</font><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">

<%Response.write objRS("icms")%>

</font><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">

</font><font size="1"><b><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif">%</font></b></font></b></font><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">

</font></b></font></div></td>

<td align="center"> <div align="left"><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">

<%Response.write objRS("ipi")%>

</font><font size="1"><b><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif">%</font></b></font></b></font></div></td>

<td align="center"> <div align="left"><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">

</font><font color="#000000" size="1" face="Verdana, Arial, Helvetica, sans-serif">R$</font><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">

<%Response.write objRS("vl_nota")%>

</font></b></font></div></td>

<td align="center"> <div align="left"><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">

</font><font color="#000000" size="1" face="Verdana, Arial, Helvetica, sans-serif">R$</font><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">

<%Response.write objRS("total_frete")%>

</font></b></font></div></td>

<td align="center"> <div align="left"><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">

</font><font color="#000000" size="1" face="Verdana, Arial, Helvetica, sans-serif">R$</font><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">

<%Response.write objRS("frete")%>

</font></b></font></div></td>

<td align="center"> <div align="left"><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">

</font><font color="#000000" size="1" face="Verdana, Arial, Helvetica, sans-serif">R$</font><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">

<%Response.write objRS("vl_total")%>

</font></b></font></div></td>

<td width="64" height="20" align="center" bgcolor="#B6DADA">

<div align="center"><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">

</font><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">

<input name="radio" type="radio" value="<%=objRS(0)%>">

</font></b></font><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">

</font> </b></font></div></td>

</tr>

</table>

<%

objRS.movenext

howmanyrecs=howmanyrecs+1

wend

'loop

objRS.close

set objRS=nothing%>

</form>

</td>

</tr>

</table>

</td>

</tr>

</table>

<%

pad=""

scriptname=request.servervariables("script_name")

response.write "<table rows='1' cols='1' width='97%'><tr>"

response.write "<td>"

response.write "<td align=center><font size='1' color='black' face='Verdana, Arial,Helvetica, sans-serif'>"

if (mypage mod 10) = 0 then

counterstart = mypage - 9

else

counterstart = mypage - (mypage mod 10) + 1

end if

counterend = counterstart + 9

if counterend > maxpages then counterend = maxpages

if counterstart <> 1 then

ref="<a href='" & scriptname

ref=ref & "?pagina=" & 1

ref=ref & "&total=" & mypagesize

ref=ref & "&sqlQuery=" & server.URLencode(mySQL)

ref=ref & "'>Primeira</a> : "

Response.Write ref

 

 

ref="<a href='" & scriptname

ref=ref & "?pagina=" & (counterstart - 1)

ref=ref & "&total=" & mypagesize

ref=ref & "&sqlQuery=" & server.URLencode(mySQL)

ref=ref & "'>anterior</a> "

Response.Write ref

end if

Response.Write "["

for counter=counterstart to counterend

If counter>=10 then

pad="

end if

if cstr(counter) <> mypage then

ref="<a href='" & scriptname

ref=ref & "?pagina=" & counter

ref=ref & "&total=" & mypagesize

ref=ref & "&sqlQuery=" & server.URLencode(mySQL)

ref=ref & "'>" & pad & counter & "</a>"

else

ref="<b>" & pad & counter & "</b>"

end if

response.write ref

if counter <> counterend then response.write " "

next

Response.Write ]"

if counterend <> maxpages then

ref=" <a href='" & scriptname

ref=ref & "?pagina=" & (counterend + 1)

ref=ref & "&total=" & mypagesize

ref=ref & "&sqlQuery=" & server.URLencode(mySQL)

ref=ref & "'>Proxima</a>"

Response.Write ref

 

 

ref=" : <a href='" & scriptname

ref=ref & "?pagina=" & maxpages

ref=ref & "&total=" & mypagesize

ref=ref & "&sqlQuery=" & server.URLencode(mySQL)

ref=ref & "'>Ultima</a>"

Response.Write ref

end if

response.write "<br></font>"

response.write "</td>"

response.write "</table>"

%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Essa é fácil:

Procure aonde ele abre(<table>) e fecha(</table>) a tabela e coloque antes(<table>) e depois(</table>) do while.

 

Valeu?

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.