<?php 
if (!defined('BASEPATH')) exit('No direct script access allowed');  
 
require_once APPPATH."third_party/TCPDF/tcpdf.php";
 
class PDF extends TCPDF {
	protected $_title = NULL;
	protected $_subtitle = NULL;
	
	public function __construct() {
			parent::__construct();
	}
	
	public function Header() {
    $this->Rect(0, 0, 2000, 30,'F',array(),array(44, 62, 80));
		
		$image_file = base_url().'dist/img/logo/logooo.png';			
		$this->Image($image_file, 5, 5, 35, '', 'PNG', '', 'T', false, 300, '', false, false, 0, false, false, false);
		
		$this->SetTextColor(255, 255, 255);
		
		$header = "<h1 style=\"text-align: right; margin: 0px; padding: 0px;\">".$this->_title."</h1>";
		$header .= "<h5 style=\"font-size: 12px; text-align: right; margin: 0px; padding: 0px;\">".$this->_subtitle."</h5>";
		
		$this->SetFont('helvetica', '', 14);
		$this->writeHTMLCell(0, 0, '', '', $header, 0, 0, 0, true, '', true);
	}
	
	public function setTitle($title) {
		$this->_title = $title;
	}
	
	public function setSubTitle($subtitle) {
		$this->_subtitle = $subtitle;
	}
	
	public function Footer() {
		$this->SetY(-15);
		$this->SetFont('helvetica', 'I', 8);
		$this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
	}
}

?>