Skip to content

Commit

Permalink
refactor: imprimir_orc file using fpdf library
Browse files Browse the repository at this point in the history
  • Loading branch information
elfiservice committed Mar 15, 2018
1 parent ba3e466 commit 80cc354
Show file tree
Hide file tree
Showing 4 changed files with 186 additions and 449 deletions.
2 changes: 1 addition & 1 deletion classes/Config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
//AUTO LOAD DE CALSSES ###################
spl_autoload_register(function ($pClass) {

$cDir = array('model', 'controller', 'dao', 'util');
$cDir = array('model', 'controller', 'dao', 'util', 'util/FPDF');
$iDir = null; //se houve a inclusao do diretorio caso não, lança um ERRO
//__DIR__ => pega o nome do diretorio deste Arquivo Config.inc.php no caso _app

Expand Down
57 changes: 57 additions & 0 deletions classes/util/Pdf.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

/**
* PDF [ UTIL ]
* Gerar PDFs Papel timbrado da Empresa ELFI
* @copyright (c) 2018, Armando JR. ELFISERVICE
* by biblioteca fpdf
*/

class PDF extends FPDF
{
private $textoRodaPe;

function __construct($textoRodaPe, $orientation = 'P', $unit = 'mm', $size = 'A4') {
parent::__construct($orientation, $unit, $size);
$this->textoRodaPe = $textoRodaPe;

}

function setRodapeTexto($rodape) {
$this->textoRodaPe = $rodape;
}

// Page header
function Header()
{
// Logo
$this->Image('../../../imagens/logo_elfi.jpg',10,12,30);
// Arial bold 15
$this->SetFont('Arial','',10);
// Move to the right
$this->Cell(40);
// Title
$this->MultiCell(0,4, utf8_decode('Montagens e Manutenções de: Subestações, Transformadores, Grupo Geradores, Disjuntores Banco de Capacitores Fixo e Automático, Quadros de Comando, Força e Luz, S.P.D.A., Tratamento de Óleo Isolante pelo processo Termo-Vácuo, Comissionamento de Subestação, Termografia. Desde 1993 trazendo soluções para sua empresa.'),0,'L');
$this->Ln(8);
}

function Footer()
{
// Position at 1.5 cm from bottom
$this->SetY(-15);
// Arial italic 8
$this->SetFont('Arial','',8);

$this->MultiCell(190, 4, utf8_decode($this->textoRodaPe),0,'C');
// Page number
$this->Cell(0,5,'Pg '.$this->PageNo().'/{nb}',0,0,'R');
}

function divisorHeader($texto) {
$this->Ln(2);
$this->SetFont('Arial','B',10);
$this->Cell(0,6,$texto,1,1,'C');
$this->SetFont('Arial','',9);
$this->Ln(2);
}
}
File renamed without changes.
Loading

0 comments on commit 80cc354

Please sign in to comment.