<?php
class Pdf extends PDF_MC_Table{
	//Page header
	//public $kas_masuk,$tgl1,$tgl2;
	function __construct() {
		//set Page 
		parent::__construct('P','mm',array(210 ,330 ));
		/*$this->AddFont("tahoma","","tahoma.php");
		$this->AddFont("tahoma","B","tahomabd.php");*/
    }
	function Header(){
        
		if($this->PageNo() != 0){	

            $spacing = 5;
            $kolom_1 = 20;
            $kolom_2 = 5;
            $kolom_3 = 40;
            $ln = 3;

            $indent_1 = $kolom_1+$kolom_2+$kolom_3+20;

                $this->setFont('Arial','B',12);
                $this->setFillColor(255,255,255);
                $this->setTextColor(0,0,0);                
                $this->cell(0, 5, $this->judul, 0, 0, "L");                

                $this->Ln(5);

                $this->setFont('Arial','',10);
                $this->setFillColor(255,255,255);
                $this->setTextColor(0,0,0);
                $this->cell($kolom_1, $spacing, "Periode", 0, 0, "L");
                $this->cell($kolom_2, $spacing, ":", 0, 0, "C");
                $this->Cell(20, $spacing, '02/02/2019',0,0,'L');
                /*$this->setXY($this->getx()+0,$this->getY());*/
                $this->cell(5, $spacing, "s/d", 0, 0, "C");
                $this->MultiCell($kolom_3, $spacing, '02/02/2010', "FJ");
                $this->Ln(3);

                
                $this->setFont('Arial','B',8);
                $this->multicell(20,10,'Tanggal',1,'C',false);
                $this->SetXY($this->GetX()+20,$this->GetY()-10);
                $this->cell(25,10,'No Bukti',1,0,'C',1);
                $this->cell(55,10,'Nama Barang',1,0,'C',1);
                $this->cell(25,5,'Hasil Produksi',1,1,'C',1);
                $this->setX($this->getX()+100);
                $this->cell(25,5,'Qty',1,1,'C',1);
                $this->SetXY($this->GetX()+125,$this->GetY()-10);
                $this->cell(30,5,'Insentif / Pdg',1,1,'C',1);
                $this->setX($this->getX()+125);
                $this->cell(15,5,'Pdg',1,0,'L',1);
                $this->cell(15,5,'Rp',1,0,'L',1);
                $this->Ln();

                $this->setFont('Arial','',8);
                $this->SetWidths(array(20, 25, 55, 25, 15, 15));
                $this->SetAligns(array('R', "L", "L", "R", "L", "R"));

                // DATA
                $this->Row_hide(array("06/12/2019", "", "", "", "", "")); 
                $this->Row_hide(array("06/12/2019", "", "", "", "", ""), 5, 0);

                $this->setFont('Arial','B',8);
                $this->SetWidths(array(30, 70, 25, 15, 15));
                $this->SetAligns(array('L', "L", "R"));
                $this->Row(array("", "Sub Total : ", "", "", ""));

                $this->Row(array("", "Total : ", "", "", ""));


               /* $no = 1;
                if(count($this->keluar) > 0){
                    foreach ($this->keluar as $k) {
                        $nama_barang = get_empty($k->nama_barang).get_empty($k->nama_komposisi).get_empty($k->nama_kualitas_proses).get_empty($k->motif_keterangan).get_empty($k->nama_motif).get_empty($k->nama_kualitas).get_empty($k->kualitas_dudul).get_empty($k->nama_kualitas_periksa).get_empty($k->nama_label).get_empty($k->nama_cap).get_empty($k->nama_kemasan).get_empty($k->nama_kemasansatuan).get_empty($k->nama_kemasansepuluh).get_empty($k->nama_kemasanseratus);

                        $this->Row(array($no, $k->kode_barang, $nama_barang, $k->nama_gudang, $k->jumlah, $k->nama_satuan));

                        $no++;
                    }
                }else{
                    $this->Row(array("", "", "", "", ""));
                }*/
                

            }
				
	}
	
	function Content()
	{   

        $this->setFont('Arial','',9);
        $this->setFillColor(255,255,255);
        $this->setTextColor(0,0,0);
        $this->SetWidths(array(40, 80, 37, 37));
        $this->SetAligns(array('C', 'L', 'R', 'R'));

        
	}
	
	function Footer()
	{
		
	}
}
$Pdf = new Pdf();
/*$Pdf->detail = $data['masuk'];
$Pdf->keluar = $data['barang'];
$Pdf->setor = $data['setor'];*/
$Pdf->judul = $data['header'];
$Pdf->SetAutoPageBreak(true ,15);

$Pdf->SetMargins(10,10,10);
$Pdf->AliasNbPages();
$Pdf->AddPage();
$Pdf->SetFont('Arial','',12);
$Pdf->Content();
$Pdf->SetTitle("Laporan Hasil ");
$Pdf->Output("Laporan Hasil.pdf", "I");

?>