Foros del Web » Programando para Internet » PHP »

Repetir un encabezado en una misma pagina de pdf en php

Estas en el tema de Repetir un encabezado en una misma pagina de pdf en php en el foro de PHP en Foros del Web. Saludos tengo un problema y es el siguiente :: Tengo un encabezado hecho con la clase de PDF en PHP y necesito que ese encabezado ...
  #1 (permalink)  
Antiguo 13/01/2011, 09:28
 
Fecha de Ingreso: marzo-2009
Mensajes: 121
Antigüedad: 15 años
Puntos: 1
Busqueda Repetir un encabezado en una misma pagina de pdf en php

Saludos tengo un problema y es el siguiente ::

Tengo un encabezado hecho con la clase de PDF en PHP y necesito que ese encabezado se repita en la misma página, pero no logro hacerlo.

Les muestro el codigo del encabezado:
Código PHP:
define('FPDF_FONTPATH','fpdf/font/');
require_once(
'fpdf/fpdf.php');
     class 
PDF extends FPDF
    
{
    
//Cabecera de página
    
function Header()
    {  
               
$indice 0;
        
$numero_control $_GET['NUMERO_CONTROL'];
        
$tipo_nomina  $_GET['TIPO_NOMINA'];
        
$matriz_empleados =       bsc_datos_empleados($tipo_nomina,$numero_control);
        foreach(
$matriz_empleados as $matriz) {
    
//    for($i = 0; $i <2; $i++){        
    //    $fecha = date("d/m/Y");
        //Logo
        //$matriz_empleados1 = bsc_datos_empleados($tipo_nomina,$numero_control);
        
        //$indice =0;
        /*-----------------------------------------------*/
        
$this->SetFont('Arial','',9);
        
$this->Image('../imagenes/escudo_xxxx.jpg',10,8,20);
        
$this->SetFont('Arial','',9);
        
$this->Text(30,17,"UNIVERSIDAD xxxxxxxxxx");
        
$this->SetFont('Arial','',8);
        
$this->Text(30,20,"DEPARTAMENTO DE RECURSOS HUMANOS");
        
$this->SetFont('Arial','',7);
        
$this->Text(45,23,"xxxxxx- EDO. xxxxxxx");
        
$this->SetFont('Arial','B',7);
        
$this->Text(52,26,"Rif:J-30400858-9");
        
//Salto de línea
        
$this->SetFillColor(232,232,232);
        
$this->Line(10,31,200,31); // Linea Horizontal
        //$this->Line(10,45,200,45);// Linea horizontal
        // Principal
        
$this->SetFont('Arial','B',8);
        
$this->Text(120,20,"Desde");
        
$this->SetFont('Arial','',7);
        
$this->Text(133,20,date("d/m/Y",fecha_a_mktime($matriz_empleados[$indice]['FECHA_INICIO'])));
        
        
$this->SetFont('Arial','B',8);
        
$this->Text(155,20,"Hasta");
        
$this->SetFont('Arial','',7);
        
$this->Text(165,20,date("d/m/Y",($matriz_empleados[$indice]['FECHA_FIN'])));
        
        
$this->SetFont('Arial','B',8);
        
$this->Text(120,23,'Nro Control');
        
$this->SetFont('Arial','',7);
        
$this->Text(138,23,$numero_control);
        
        
$this->SetFont('Arial','B',8);
        
$this->Text(155,23,'Nro Cuenta');
        
$this->SetFont('Arial','',7);
        
$this->Text(175,23,$matriz_empleados[$indice]['NRO_CUENTA']);
        
        
$this->SetFont('Arial','B',8);
        
$this->Text(155,29,'Fecha Ingreso');
        
$this->SetFont('Arial','',7);
        
$this->Text(175,29,date("d/m/Y",fecha_a_mktime($matriz_empleados[$indice]['FECHA_INGRESO'])));
        
        
        
$this->SetFont('Arial','B',8);
        
$this->Text(12,37,"Cédula");
        
$this->SetFont('Arial','',7);
        
$this->Text(27,37,$empleado);
        
        
$this->SetFont('Arial','B',8);
        
$this->Text(48,37,"Nombres y Apellidos");
        
$this->SetFont('Arial','',7);
        
$this->Text(80,37,$matriz_empleados[$indice]['NOMBRES'].' '.$matriz_empleados[$indice]['APELLIDOS']);
        
        
$this->SetFont('Arial','B',8);
        
$this->Text(155,37,"Sueldo Mensual");
        
$this->SetFont('Arial','',7);
        
$this->Text(180,37,$matriz_empleados[$indice]['SUELDO']);
        
$this->Line(10,39,200,39); // Linea Horizontal
    
        
$this->SetFont('Arial','B',8);
        
$this->Text(12,45,"Departamento");
        
$this->SetFont('Arial','',7);
        
$this->Text(35,45$matriz_empleados[$indice]['DEPARTAMENTO']);
        
        
$this->SetFont('Arial','B',8);
        
$this->Text(122,45,"Cargo");
        
$this->SetFont('Arial','',7);
        
$this->Text(135,45$matriz_empleados[$indice]['CARGO']);
        
$this->Line(10,47,200,47); // Linea Horizontal
    
        
$this->SetFont('Arial','B',8);
        
$this->Text(12,52,"Concepto");
        
$this->SetFont('Arial','B',8);
        
$this->Text(105,52'Asignaciones');
        
$this->SetFont('Arial','B',8);
        
$this->Text(140,52'Deducciones');
        
$this->SetFont('Arial','B',8);
        
$this->Text(177,52'Neto');
        
$this->Line(10,47,200,47); // Linea Horizontal
        
$this->SetFont('Arial','',7);
    
    
$this->Ln(23);
    
$this->Ln(20);
  
// }// fin del for
   
$indice++;
  } 
// fin del foreach 
 
// fin de la funcion header 

Explico necesito generar unos recibos pero se quiere que en la misma pagina exista el recibo que se le entrega al empleado y el que se queda en el departamento de RRHH, es por eso que necesito generar dos encabezados..
Coloque un foreach de la matrz que es la que controla eñ numero de empleados y un for hasta 2 porque es dos veces que necesito hacerlo ....pero no me funciona

Agradeceria a quien me pudiera ayudar.
GRacias

Etiquetas: encabezado, pdf, repetir
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 08:06.