Ver Mensaje Individual
  #3 (permalink)  
Antiguo 09/04/2008, 10:17
jovi_javi
 
Fecha de Ingreso: enero-2008
Mensajes: 37
Antigüedad: 16 años, 4 meses
Puntos: 0
Re: imprimir registros

Aqui tienes el codigo


<?php
include ("../../includes/config.php");
include ("../../includes/funciones.php");

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link href="estilos/pantalla.css" rel="stylesheet" type="text/css" media="screen">
<link href="estilos/impresora.css" rel="stylesheet" type="text/css" media="print">


</head>
<body bgcolor="#CDCDCD">

// esto lo utilizo para que me de la fecha anterior del sistema y compararla con el mysql
<?

$fecha_cambiada = mktime(0,0,0,date("m"),date("d")-1,date("Y"));
$fecha = date("Y-m-d", $fecha_cambiada);
//echo $fecha;

?>


<div id="tabla_listado_movible">
<table class="tabla_listado" bgcolor="#FFFFFF" width="950" border="3" cellpadding="0" cellspacing="0">
<thead>
<tr>
<td width="46" align="center">op1</td>
<td width="56" align="center">op2</td>
<td width="211" align="center">op3</td>
<td width="102" align="center">op4</td>
<td width="52" align="center">op5</td>
<td width="87" align="center" >op6</td>
<td width="74" align="center" >op7</td>
<td width="127" align="center" >op8</td>
<td width="78" align="center" >op9</td>
<td width="91" align="center" >op0</td>
</tr>
</thead>
<?
//nos conectamos a mysql
$conexion = conectar ();
//consulta.
$sql = "SELECT op1, op2, op3, op4, op5, op6, op7, op8, op9, op0 FROM base de datos.tabla WHERE op1='$fecha' ORDER BY op2 DESC, op3 DESC, op4 DESC";
$res= mysql_query($sql) or die (mysql_error());

echo "<tbody class='scroll'>";
echo "<tr>";

if( mysql_num_rows($res) >0){
//impresión de los datos.
while (list($op1,$op2,$op3,$op4,$op5,$op6,$op7,$op8,$op9 ,$op0) = mysql_fetch_array($res)) {


echo "<td align='center'>$op1</td>\n";
echo "<td align='center'>$op2</td>\n";
echo "<td align='center'>$op3</td>\n";
echo "<td align='center'>$op4</td>\n";
echo "<td align='center'>$op5</td>\n";
echo "<td align='center'>$op6</td>\n";
echo "<td align='center'>$op7</td>\n";
echo "<td align='center'>$op8</td>\n";
echo "<td align='center'>$op9</td>\n";
echo "<td align='center'>$op0</td></tr>\n";

}
echo "</tbody>";
}else{
echo "<td colspan='10' align='center' >no se obtuvieron resultados</td>";
}
mysql_close($conexion);
?>
</table>
</div>
<div id="apDiv5"><img src ="foto.gif" width="82" height="48" /></div>
<div class="Estilo1" id="apDiv2">TITULO</div>
<div id="apDiv4"><img src="foto2.GIF" width="272" height="26" /></div>
<div class="Estilo1" id="apDiv3">TITULO</div>
<div class="Estilo1" id="apDiv1">TITULO</div>
</body>
</html>


Me gustaria que si la tabla tiene 100 o mas registros y en cada folio cabe por Ej. 50, que los otros 50 me aparezca con la foto y titulos del encabezado (que estan al final del codigo) y con el encabezado de la tabla (justo antes de la conexion a la base de datos) en otro folio, y asi asta completar todos los registros que aya.

Gracias