![Neurótico](http://static.forosdelweb.com/fdwtheme/images/smilies/scared.png)
![en desacuerdo](http://static.forosdelweb.com/fdwtheme/images/smilies/dedosabajo.png)
La verdad estoy urgido pues es tema de mi pasantía para el grado de Lic en Informática.
Agradezco lo q puedan hacer al respecto.
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
Mi archivo:
<? require_once('C:/AppServ/www/cintoteca/ToPDF/class.ezpdf.php');
$pdf =& new Cezpdf('LETTER','landscape');
$pdf->selectFont('../fonts/Times-Roman.afm');
$pdf->ezSetCmMargins(1,1.5,1.5,1);//arriba,abajo,izd.,der.
?>
<?php require_once('Connections/conex2.php'); ?>
<?php
mysql_select_db($database_Conex2, $Conex2);
$query_query_seriales = "SELECT seriales.Id_Serial, CINTAS.Id_Respaldo, cintas.Detalle, cintas.Fecha_Respaldo,".
" cintas.Fecha_Carga, tipos_r.Descripcion_r, computador.Descripcion_c, operadores.descripcion_bpl FROM `seriales`, `cintas`,".
" `tipos_r`, `computador`, `operadores` WHERE seriales.Id_Respaldo = cintas.Id_Respaldo and cintas.Tipo_Respaldo = ".
" tipos_r.Tipo_Respaldo and seriales.Id_Serial >='$_REQUEST[Serial_Ini]'and seriales.Id_Serial <='$_REQUEST[Serial_Fin]' ".
"and cintas.computador = computador.computador and cintas.operador = operadores.bplop ";
$query_seriales = mysql_query($query_query_seriales, $Conex2) or die("Error en el Query para generar el PDF ".mysql_error());
$row_query_seriales = mysql_fetch_assoc($query_seriales);
$totalRows_query_seriales = mysql_num_rows($query_seriales);
if ($totalRows_query_seriales >0){
$rows = mysql_num_rows($query_seriales);
if($rows > 0) {
mysql_data_seek($query_seriales, 0);
$row_query_seriales = mysql_fetch_assoc($query_seriales);
}
do{
$data[] = array_merge($row_query_seriales, array('id_serial'));
} while($row_query_seriales = mysql_fetch_assoc($query_seriales));
$titles = array(
'Id_Serial'=>'<b>Serial</b>',
'Id_Respaldo'=>'<b> Id. </b>',
'Detalle'=>'<b>Detalle del Respaldo</b>',
'Fecha_Respaldo'=>'<b>Desde</b>',
'Fecha_Carga'=>'<b>Hasta</b>',
'Descripcion_r'=>'<b>Tipo de Respaldo</b>',
'Descripcion_c'=>'<b>Computador</b>',
'descripcion_bpl'=>'<b>Realizado por</b>'
);
$options = array(
'shadeCol'=>array(0.9,0.9,0.9),
'xOrientation'=>'center',
'width'=>770
);
?>
<?php
mysql_select_db($database_Conex2, $Conex2);
$query_fecha = "SELECT curdate()";
$fecha = mysql_query($query_fecha, $Conex2) or die(mysql_error());
$row_fecha = mysql_fetch_assoc($fecha);
$totalRows_fecha = mysql_num_rows($fecha);
?>
<?
mysql_select_db($database_Conex2, $Conex2);
$query_hora = "SELECT curtime()";
$hora = mysql_query($query_hora, $Conex2) or die(mysql_error());
$row_hora = mysql_fetch_assoc($hora);
$totalRows_hora = mysql_num_rows($hora);
$hora_act1 = $row_hora['curtime()'];
$hora_act2 = explode(":",$hora_act1);
$hora_act3 = $hora_act2[0];
$minutos_act1 = $hora_act2[1];
$segumdos_act1 = $hora_act2[2];
$fecha_act1 = $row_fecha['curdate()'];
$fecha_act2 = explode("-",$fecha_act1);
$fecha_act = $fecha_act2[2]." - ".$fecha_act2[1]." - ".$fecha_act2[0];
#echo "La fecha es: ".$fecha_act;
$mitad =12;
if ($hora_act3 > 12){
$hora_act4 = $hora_act3-12;
$mediodia = "PM";
}else{
$mediodia = "AM";
}
$hora_act = $hora_act4.":".$minutos_act1.":".$segundos_act1." ".$mediodia;
#echo "<p>"."La hora es: ".$hora_act;
setlocale(LC_TIME,'sp');
$nombre_dia = strftime("%A");
$txttit = "<b>Gerencia de Sistemas</b>\n";
$txttit.= "CINTOTECA \n";
$reporte = "<b>Reporte por Serial</b> \n";
$pdf->ezText($txttit, 12);
$pdf->ezTable($data, $titles, $reporte, $options);
$pdf->ezText("\n\n\n", 04);
$pdf->ezText("<b>Fecha:</b> ".$nombre_dia.", ".$fecha_act." <b>Hora:</b> ".$hora_act, 10);
$pdf->ezStream();
} else {
$pdf->ezText("<b>UNO O AMBOS SERIALES NO EXISTEN</b> "."\n\n", 20);
$pdf->ezText("\n\n\n", 04);
$pdf->ezText("<b>VERIFIQUE E INTENTE DE NUEVO</b> "."\n\n", 20);
$pdf->ezStream();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Reporte por Serial</title>
</head>
<body>
</body>
</html>
<?php
mysql_free_result($query_seriales);
mysql_close($Conex2);
?>