Cluster el código era muy largo aqui esta la segunad parte, , eso como pueden ver va a un popup que se llama reportes, este es el código de la pagina que genera el reporte
Código PHP:
<?php
include "conectar.php"; ?>
<?
$sql=stripslashes($_REQUEST["sql"]);
$buscar_sql=mysql_query($sql);
if (mysql_affected_rows()!=0)
{
require('fpdf.php');
class PDF extends FPDF
{
function Header()
{
$this->Image('imagenes/logo.jpg',10,8,33);
$this->SetFont('Arial','B',15);
$this->Ln(10);
$this->Cell(177,10,'DIRECCION GENERAL SECTORIAL DE ADMINISTRACION SERVICIOS',0,0,'C');
$this->Ln(5);
$this->Cell(105,10,'DIVISION DE LICITACION Y CONTRATOS',0,0,'C');
$this->Cell(80);
$this->Ln(10);
$this->Cell(0,10,$_REQUEST["titulo"],0,0,'C');
$this->Ln(10);
}
function Footer()
{
$this->SetY(-15);
$this->SetFont('Arial','I',8);
$this->Cell(0,10,'Página '.$this->PageNo().'/{nb}',0,0,'C');
}
}
$pdf=new PDF('L');
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Times','B',12);
$pdf->Cell(25,10,'Rif o CI',1,0, 'C');
$pdf->Cell(25,10,'N. O. Pago',1,0, 'C');
$pdf->Cell(30,10,'Monto',1,0, 'C');
$pdf->Cell(60,10,'Beneficiario',1,0, 'C');
$pdf->Cell(60,10,'Concepto',1,0, 'C');
$pdf->Cell(25,10,'Fecha',1,0, 'C');
$pdf->Cell(60,10,'Ubicacion',1,1, 'C');
while (list($n_carta, $n_licitacion, $fecha, $monto, $empresa, $rif_ci, $objetivo, $ubicacion) = mysql_fetch_row($buscar_sql))
{
if ($color=="" || $color=="255,255,255") { $color= "229,229,229"; } else { $color= "255,255,255" ;}
$pdf->SetFillColor($color);
$pdf->SetFont('Times','',12);
$pdf->Cell(25,10, $rif_ci, 1,0, 'C', 1);
$pdf->Cell(25,10, $n_carta, 1,0, 'C', 1);
$pdf->Cell(30,10, $monto, 1,0, 'C', 1);
$pdf->Cell(60,10, $empresa ,1,0, 'C', 1);
$pdf->Cell(60,10, $objetivo ,1,0, 'C', 1);
$pdf->Cell(25,10, $fecha, 1,0, 'C', 1);
$pdf->Cell(60,10, $objetivo ,1,1, 'C', 1);
}
$pdf->Output();
}
else
{
echo '<script>alert("La busqueda no genero resultados.\nIntente de nuevo"); window.close();</script>';
}
?>