-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathplantilla.php
50 lines (41 loc) · 1.12 KB
/
plantilla.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* Plantilla para encabezado y pie de página
*
* Fecha: 17/01/2023
* Autor: Marco Robles
* Web: https://github.com/mroblesdev
*/
require 'fpdf/fpdf.php';
class PDF extends FPDF
{
// Cabecera de página
function Header()
{
global $nombreGrado;
global $tituloReporte;
// Logo
$this->Image("images/logo.png", 10, 5, 13);
// Arial bold 15
$this->SetFont("Arial", "B", 12);
// Título
$this->Cell(25);
$this->Cell(140, 5, mb_convert_encoding($tituloReporte, 'ISO-8859-1', 'UTF-8'), 0, 0, "C");
//Fecha
$this->SetFont("Arial", "", 9);
$this->Cell(25, 5, "Fecha: " . date("d/m/Y"), 0, 1, "C");
$this->Cell(0, 5, "Grado: " . $nombreGrado, 0, 1, "C");
// Salto de línea
$this->Ln(10);
}
// Pie de página
function Footer()
{
// Posición: a 1,5 cm del final
$this->SetY(-15);
// Arial italic 8
$this->SetFont('Arial', 'I', 8);
// Número de página
$this->Cell(0, 10, 'Pagina ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
}
}