Ver Mensaje Individual
  #5 (permalink)  
Antiguo 25/09/2008, 08:48
u2actual
 
Fecha de Ingreso: septiembre-2008
Mensajes: 3
Antigüedad: 15 años, 7 meses
Puntos: 0
Respuesta: Urgente problemas con paginacion

Cita:
Iniciado por lathix Ver Mensaje
publica el codigo mejor y te ayudamos :P

en todo caso puedes poner los link asi

<a href="listar.php?pag=" . $pg . "&var1=" . GET['var1'] . ">Pagina 2</a>

y asi pasas los valores por url
Saludos lathix

este es el codigo de la pagina busqueda.php

ahora intente hacerlo con guardando la variable en una coqui recargar la pagina para que me tome el valor de la cookie inmediatamente lo hace pero cuando paso a la segunda pagina no me manda ningun registro, ahorita solo estos probando con un campo pero van hacer 4:

Ojala puedas ayudarme, Gracias

<?php

if(!isset($COOKIE_SET)) // $cookie_set es nuestra variable de control
// de flujo
{
setcookie("prueba", $descripcion);
header("Location: $PHP_SELF?COOKIE_SET=1");
$desc = $_COOKIE['prueba']; // ponemos cookie_set
exit; // como true
}


$tamano_pag = 5;

$pagina = $_GET["pagina"];

if (!$pagina) {
$ini = 0;
$pagina = 1;
}
else {
$ini = ($pagina - 1) * $tamano_pag;
}

$desc = $_COOKIE['prueba'];

?>

<HTML>
<HEAD>
<TITLE>Sistema de Busqueda BUSSFILE WEB</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251">

<style type="text/css">
<!--
.style2 {
font-size: 11px;
color: #000066;
}
.style5 {
font-size: 11px;
font-weight: bold;
color: #000066;
}
.t11 { font-family: Tahoma;
font-size: 11px;
font-style: normal;
}
.style21 {font-size: 12px}
.tah10 { font-family: Tahoma;
font-size: 10px;
text-decoration: none;
color: #000000;
}
.style26 {
font-size: 16px;
color: #FFFFFF;
font-weight: bold;
font-family: Tahoma;
}
.style33 {font-family: Tahoma; font-size: 11px; }
-->
</style>
</HEAD>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>

<?php
/** conexion ***************************/
// conectamos a la base de datos
$link = mysql_connect("localhost","filedig_filedig","filed ig130407");
if(!$link) {
die("Error al intentar conectar: ".mysql_error());
}
// seleccionamos la base de datos
$db_link = mysql_select_db("filedig_SSAPLP", $link);
if(!$db_link) {
die("Error al intentar seleccionar la base de datos". mysql_error());
}


function formato_fecha($fecha){

$date = split("[/-]",$fecha);
return $date[2]."-".$date[1]."-".$date[0];
}


$fechai = formato_fecha($Fec1);
$fechaf = formato_fecha($Fec2);

$desc = $_COOKIE['prueba'];



/** fin conexion ************************/
// hacemos una consulta
// para mostrar los registros






$sql = mysql_query("SELECT * FROM Polizas where proveedor = '$desc'" , $link) or die(mysql_error());
$total_registros = mysql_num_rows($sql);
$sql = mysql_query("SELECT * FROM Polizas where proveedor = '$desc' LIMIT $ini , $tamano_pag " , $link) or die(mysql_error());



$total_paginas = ceil($total_registros / $tamano_pag);

?>

</td>
<TABLE height="100%" BORDER=0 CELLPADDING=0 CELLSPACING=0 background="images/bg.gif">
<TR>
<TD width="120" background="Images/bg.gif" bgCOLOR="#C1E2FC" class="style21">&nbsp;</TD>
<td width="1" bgcolor="#000000" class="style21"><img src="images/spacer.gif" width="1" height="1"></td>
<TD width="780"><table width="780" height="596" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<th width="780" height="113" class="style21" scope="row"><img src="Images/Encabezado.gif" width="780" height="113"></th>
</tr>
<tr>
<th height="7" class="style21" scope="row"><img src="Images/linea.gif" width="780" height="7"></th>
</tr>
<tr>
<th height="26" background="Images/enc3.gif" bgcolor="#FFFFFF" class="style26" scope="row">BUSSFILE WEB Ver. 1.2 </th>
</tr>
<tr>
<th height="419" bgcolor="#FFFFFF" scope="row"><table width="720" height="71" border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="673" height="19" scope="col">&nbsp;</th>
</tr>
<tr>
<td height="33">


<TABLE width="707" BORDER=1 CELLPADDING=1 CELLSPACING=1>
<TR bgcolor="#FFFFFF">
<TD width="80"><span class="style33">&nbsp;Folio</span></TD>
<TD width="121"><span class="style33">&nbsp;Factura&nbsp;</span></TD>
<TD width="102"><span class="style33">&nbsp;Fecha&nbsp;</span></TD>
<TD width="299"><span class="style33">&nbsp;Proveedor&nbsp;</span></TD>
<TD width="77"><span class="style33">&nbsp;Visualizar &nbsp;</span></TD>
</TR>

<?php
// mostramos los registros

while($row = mysql_fetch_array($sql)){
//printf("<tr><td> %s</td><td> %s </td><td> %s </td><td><a href=\"Eliminar.php?id=$row[Folio]\">Visualizar</a>
//</td></tr>",$row["Folio"],$row["Factura"],$row["Proveedor"]);

printf("<tr><td> %s</td><td> %s </td><td> %s </td><td> %s </td><td><a href=\"Eliminar.php?id=$row[Folio]\"><img src='Images/edit.gif 'border='0'></a>
</td></tr>",$row["Folio"],$row["Factura"],$row["Fecha"],$row["Proveedor"]);

}


if($total_registros) {

echo "<center>";

if(($pagina - 1) > 0) {
echo "<a href='busqueda.php?pagina=".($pagina-1)."'>< Anterior</a> ";

}


for ($i=1; $i<=$total_paginas; $i++){
if ($pagina == $i) {
echo "<b>".$pagina."</b> ";
} else {
echo "<a href='busqueda.php?pagina=$i'>$i</a> ";
}
}

if(($pagina + 1)<=$total_paginas) {
echo " <a href='busqueda.php?pagina=".($pagina+1)."'>Siguien te ></a>";

}

echo "</center>";

}

?>


</table></td>
</tr>
<tr>
<td height="19">&nbsp;</td>
</tr>
</table></th>
</tr>
<tr>
<th height="7" scope="row"><img src="Images/linea.gif" width="780" height="7"></th>
</tr>
<tr>
<th height="20" background="Images/bgdown1.gif" scope="row"><table width="772" height="24" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="411"><div align="center"><span class="style5">2006 Softfile Software y Archivos Digitales Derechos reservados</span></div></td>
<td width="361"><div align="center"><span class="style2 textoBlanco"><strong>M&eacute;xico - Tel: 01 55 5025-8363- [email protected]</strong></span></div></td>
</tr>
</table></th>
</tr>
</table></TD>
<td width="1" bgcolor="#000000"><img src="images/spacer.gif" width="1" height="1"></td>
<TD width="136" background="Images/bg.gif" bgCOLOR="#C1E2FC">&nbsp;</TD>
</TR>
</TABLE>

</BODY>
</HTML>