<?php
class Pdf extends PDF_MC_Table{
	//Page header
	public $paper_w = 210, $paper_h = 297;
    function __construct() {
        //set Page 
        parent::__construct('L','mm',array($this->paper_w ,$this->paper_h));
        /*$this->AddFont("tahoma","","tahoma.php");
        $this->AddFont("tahoma","B","tahomabd.php");*/
    }

	function Header(){
        
		if($this->PageNo() != 0){		
            $this->setFont('Arial','B',12);
            
            $this->cell(100, 5, $this->judul, 0, 0, "L");
            $this->Ln();

            $this->setFont('Arial','',10);
            $this->cell(25, 5, "Nama Barang", 0, 0, "L");
            $this->cell(5, 5, ":", 0, 0, "L");

            $this->MultiCell(100, 5, "", "FJ");

            $this->setFont('Arial','',10);
            $this->cell(25, 5, "Dari Tanggal", 0, 0, "L");
            $this->cell(5, 5, ":", 0, 0, "L");
            $this->MultiCell(100, 5, $this->periode, "FJ");

            $this->Ln();

            $this->setFont('Arial','B',11);

            $x = $this->GetX();
            $y = $this->GetY();

            $this->SetWidths([
                $this->paper_h*10/100, 
                $this->paper_h*10/100, 
                $this->paper_h*17/100, 
                $this->paper_h*6/100,
                $this->paper_h*12/100,
                $this->paper_h*12/100,
                $this->paper_h*12/100,
                $this->paper_h*12/100,
            ]);
            $this->SetAligns(["C", "C", "C", "C", "C", "C", "C", "C"]);
            $this->Row(["Tanggal", "No. Faktur", "Pelanggan", "Qty", "Harga", "Jumlah", "Diskon", "Netto"], 7);
        }
				
        $this->SetAligns(["L", "L", "L", "C", "R", "R", "R", "R"]);
	}
	
	function Content()
	{
        
        
	}
	
	function Footer()
	{
		$this->SetY(-15);
        $this->SetFont('Arial','',9);
        $this->Cell(0,10, $this->PageNo(),0,0,'C');
	}
}
$Pdf = new Pdf();
$Pdf->judul=$data['judul'];
$Pdf->periode=$data['periode'];
$Pdf->akun=$data['akun'];
$Pdf->data=$data['data'];

$Pdf->SetAutoPageBreak(true ,15);

$Pdf->SetMargins(10,10,10);
$Pdf->AliasNbPages();
$Pdf->AddPage();
$Pdf->SetFont('Arial','',12);
$Pdf->Content();
$Pdf->SetTitle("$data['judul'] ".$data['periode']);
$Pdf->AutoPrint(false);
$Pdf->Output("$data['judul'] ".$data['periode'].".pdf", "I");

?>