<?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 = 40;
            $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, '', 0, 0, "L");

                $this->setFont('Arial','',10);
                $this->setFillColor(255,255,255);
                $this->setTextColor(0,0,0);
                $this->setX($indent_1);
                $this->cell($kolom_1, 5, 'Tanggal',0, 0, "L");
                $this->cell($kolom_2, $spacing,':', 0, 0,"C");
                $this->MultiCell($kolom_3, $spacing, '', "FJ");
                $this->Ln($ln);

                $this->setFont('Arial','',10);
                $y = $this->getY();
                $this->setX($indent_1);
                $this->cell($kolom_1, $spacing, "Nomor", 0, 0, "L");
                $this->cell($kolom_2, $spacing, ":", 0, 0, "C");
                $this->MultiCell($kolom_3, $spacing, '', "FJ");

                $this->Ln($ln);
                $this->SetY($y);
                $this->cell($kolom_1, $spacing, "Nama", 0, 0, "L");
                $this->cell($kolom_2, $spacing, ":", 0, 0, "C");
                $this->MultiCell($kolom_3, $spacing, '', "FJ");
                $this->Ln(3);
                        
                $this->setFont('Arial','B',8);
                $this->SetWidths(array(20, 20, 45, 15, 30, 15, 20));
                $this->SetAligns(array('L', "C", "C", "C", "C", "C", "R"));
                $this->Row(array("PETENUN", "BOOM", "KETERANGAN", "KWT", "H.SATUAN", "QTY", "JUMLAH"));

                $this->setFont('Arial','',8);
                $this->SetAligns(array('L', "L", "L", "L", "R", "R","R"));

                // DATA
                $this->Row_hide(array("3-TNI", "", "", "", "", "", ""), 5, 0); 
                $this->Row_hide(array("3-TNI", "", "", "", "", "", ""), 5, 0);



                $this->setFont('Arial','B',8);
                $this->SetWidths(array(55, 75, 15, 20));
                $this->SetAligns(array('L', "L", "C", "C"));
                $this->Row(array("", "JUMLAH PEMBAYARAN : ", "", ""));


               /* $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");

?>