solo metí la consultas dentro de una sola función y el bucle que la repite ya esta, funciona a la perfección
Código PHP:
Ver original<?php
include('../../conexion.php');
include('fpdf/fpdf.php');
header("Content-Type: text/html; charset=iso-8859-1 "); class PDF extends FPDF
{
{
//Variables para consulta
$id_salidas = $_GET['id_item'];
//Consulta sql encabezado
$query1 = mysql_query("SELECT * FROM salida_ingreso WHERE id_salida_ingreso = '$id_salidas'"); //Variables para encabezado
$destino = $encabezado['destino'];
$tipo = $encabezado['tipo_solicitud'];
$fecha = $encabezado['fecha2'];
$id = $encabezado['id_salida_ingreso'];
//Logo
$this->Image("images/logo.jpg",12,11,35,19,"JPG");
//Arial bold 15
$this->SetFont('Arial','',12);
//Encabezado
$this->Cell(40,20,'',1,0,'r');
$this->Cell(88,10,'Sistema Integrado de Gestion',1,0,'C');
$this->Cell(30,5,'Vigencia',1,0,'C');
$this->Cell(33,5,'Marzo 26 de 2014',1,0,'C');
$this->Ln(5);
$this->Cell(128);
$this->Cell(30,5,'Pagina',1,0,'C');
$this->Cell(32,5,'1 de 1',1,0,'C');
$this->Ln(5);
$this->Cell(40);
$this->Cell(88,10,'Salida e ingreso de almacen',1,0,'C');
$this->Cell(30,5,'Codigo',1,0,'C');
$this->Cell(32,5,'GANA-RE-002',1,0,'C');
$this->Ln(5);
$this->Cell(128);
$this->Cell(30,5,'Version',1,0,'C');
$this->Cell(32,5,'001',1,0,'C');
//Contenido del formulario
$this->Ln(8);
$this->SetFont('Arial','',12);
$this->SetFillColor(200,220,255);
$this->Cell(25,5,'Uso/destino:',0,0,'C');
$this->Cell(50,5,$destino,1,0,'C');
$this->Cell(8,5,'',0,0,'C');
$this->Cell(10,5,'Tipo:',0,0,'C');
$this->Cell(30,5,$tipo,1,0,'C');
$this->Cell(6,5,'',0,0,'C');
$this->Cell(12,5,'fecha:',0,0,'C');
$this->Cell(25,5,$fecha,1,0,'C');
$this->Cell(7,5,'',0,0,'C');
$this->Cell(7,5,'No:',0,0,'C');
$this->Cell(10,5,$id,1,0,'C');
$this->Ln(8);
//Encabezado de la tabla
$this->SetFont('Arial','',10);
$this->SetFillColor(200,220,255);
$this->Cell(15,5,'ITEM',1,0,'C','T');
$this->Cell(68,5,'DESCRIPCION',1,0,'C','T');
$this->Cell(12,5,'CANT.',1,0,'C','T');
$this->Cell(15,5,'UNID.',1,0,'C','T');
$this->Cell(27,5,'ESTADO',1,0,'C','T');
$this->Cell(53,5,'OBSERVACIONES',1,0,'C','T');
//ciclo de repeticion celdas
//Consulta para cuerpo tabla
$sql = "SELECT * FROM items_2 WHERE id_acta = '$id'";
//celdas de la tabla
$this->Ln();
$this->SetFont('Arial','',10);
$this->SetFillColor(200,220,255);
$this->Cell(15,5,$row[0],1,0,'C');
$this->Cell(68,5,$row[2],1,0,'C');
$this->Cell(12,5,$row[3],1,0,'C');
$this->Cell(15,5,$row[4],1,0,'C');
$this->Cell(27,5,$row[5],1,0,'C');
$this->Cell(53,5,$row[6],1,0,'C');
}
}
function Footer()
{
//Variables para consulta
$id_salidas = $_GET['id_item'];
//Consulta sql pie de pagina
$query1 = mysql_query("SELECT * FROM salida_ingreso WHERE id_salida_ingreso = '$id_salidas'"); //Variables para pie de pagina
$entrega = $encabezado['entrega'];
$recibe = $encabezado['recibe'];
//Posición
$this->SetY(-27);
//Fuente
$this->SetFont('Arial','',10);
//Número de página
$this->Cell(95,9,'ENTREGO',1,0,'C');
$this->Cell(95,9,'RECIBIO',1,0,'C');
$this->Ln();
$this->Cell(20,5,'NOMBRE',1,0,'C');
$this->SetFont('Arial','',12);
$this->Cell(75,5,$entrega,1,0,'C');
$this->Cell(20,5,'NOMBRE',1,0,'C');
$this->SetFont('Arial','',12);
$this->Cell(75,5,$recibe,1,0,'C');
$this->SetFont('Arial','',10);
$this->Ln();
$this->Cell(20,5,'CARGO',1,0,'C');
$this->Cell(75,5,'',1,0,'C');
$this->Cell(20,5,'CARGO',1,0,'C');
$this->Cell(75,5,'',1,0,'C');
$this->Ln();
$this->Cell(20,5,'FIRMA',1,0,'C');
$this->Cell(75,5,'',1,0,'C');
$this->Cell(20,5,'FIRMA',1,0,'C');
$this->Cell(75,5,'',1,0,'C');
}
}
//Impresion
$pdf=new PDF();
$pdf->Output();
?>