<?php
require_once(PATH_CODE . 'tcpdf/tcpdf.php');


class RequestPdf extends TCPDF {
    public $companyName;
    
    // set font
    // public $fontname = "garudabook";
    public $fontname = "lomabook";
     
    public function setData($companyName){
    $this->companyName = $companyName;
    }

    public function Header() {
        $this->SetFillColor(255, 255, 255);
        $headerY = 10 ;//set header init Y position
        $this->SetFont($this->fontname, 'B', 16);
        $this->MultiCell(100, 5, $this->companyName, '', 'L', 1, 1, PDF_MARGIN_LEFT, $headerY, true);
        $headerY += 5 ;
        $this->SetFont($this->fontname, 'B', 9);
        $this->MultiCell(100, 5, "Journal Listing Report", '', 'L', 1, 1, PDF_MARGIN_LEFT, $headerY, true);
        $headerY += 5 ;
        $this->SetFont($this->fontname, '', 9);
        $this->MultiCell(100, 5, "Period From: ", '', 'L', 1, 1, PDF_MARGIN_LEFT, $headerY, true);
        $headerY += 5 ;
        $this->MultiCell(100, 5, "Extracted on ".date('d M Y H:i'), '', 'L', 1, 1, PDF_MARGIN_LEFT, $headerY, true);
        $this->SetY($headerY);
    }

    public function Footer() {
        // Position at 15 mm from bottom
        $this->SetY(-15);
        // Set font
        $this->SetFont($this->fontname, '', 8);
        // Page number
        $this->MultiCell(0, 0       , 'This is a computer generated printout, no signature is required.', '', 'L'           , 0, 1, PDF_MARGIN_LEFT, '', true);
        $this->MultiCell(0, 8       , 'E & O.E', '', 'L'           , 0, 0, PDF_MARGIN_LEFT, '', true);
        $this->SetY(-15);
        $this->MultiCell(0, 8       , 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), '', 'R'           , 0, 0, '', '', true);
    }
}
?>
