Skip to content

Instantly share code, notes, and snippets.

@germankatz
Created April 29, 2019 15:05
Show Gist options
  • Save germankatz/957fce76f05e97d80d706b080740fb06 to your computer and use it in GitHub Desktop.
Save germankatz/957fce76f05e97d80d706b080740fb06 to your computer and use it in GitHub Desktop.
// Cabecera de página
function Header(){
// Pongo todos los valores que se deberían repetir acá porque cada vez q se crea una pagina se añade un header
// Arial bold 15
$this->SetFont('Arial','B',12);
$this->Cell(0,10,'Nomina de Asegurados - SEPELIO',0,0,'C');
$this->Ln(15);
// Info
$this->SetFont('Arial','', 10);
// Tipo formulario, las posiciones las pongo a pata
$this->Cell(35, 10, 'CUIT:', 0, 0, 'L');
$this->Cell(65, 6, '20-71187061-6', 'LRTB', 0, 'C');
// Seteo la posicion 35 mas a la izquierda
$this->setXY($this->getX() + 10, $this->getY());
$this->Cell(45, 10, 'Fecha:', 0, 0, 'L');
$this->Cell(35, 6, '01/05/2019', 'LRTB', 0, 'C');
$this->Ln(10);
$this->Cell(35, 10, 'Razon social:', 0, 0, 'L');
$this->Cell(65, 6, 'Mutual Santa Lucia servicios sociales', 'LRTB', 0, 'C');
// Seteo la posicion 35 mas a la izquierda
$this->setXY($this->getX() + 10, $this->getY());
$this->Cell(45, 10, 'Modalidad de cobertura:', 0, 0, 'L');
$this->Cell(35, 6, '', 'LRTB', 0, 'C');
$this->Ln(10);
$this->Cell(35, 10, 'Numero de poliza:', 0, 0, 'L');
$this->Cell(65, 6, '', 'LRTB', 0, 'C');
// Seteo la posicion 35 mas a la izquierda
$this->setXY($this->getX() + 10, $this->getY());
$this->Cell(45, 10, 'Vidas aseguradas:', 0, 0, 'L');
$this->Cell(35, 6, '', 'LRTB', 0, 'C');
$this->Ln(20);
// Header con los parametros de cada una
// Cambio la fuente
$this->SetFont('Arial','',8);
$header = array('Vinculo', 'Tipo dni', 'Numero DNI', 'Apellido', 'Nombre', 'Fecha Nac', 'Sexo', 'N doc titular', 'amb');
// Anchuras de las columnas
$w = array(14,16,20,26,50,18,12,22,12);
// Cabeceras
for($i=0;$i<count($header);$i++)
$this->Cell($w[$i],7,$header[$i],1,0,'C');
$this->Ln();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment