<?php
	class MYPDF extends TCPDF {
		  function Header(){} 
		  function Footer(){} 
	}
	 $pdf = new MYPDF('L', 'mm', 'A4', true, 'UTF-8', false);
	
	$pdf->SetTitle($detail->nama);
	
	$pdf->AddPage();

// set bacground image depan
$img_file = 'sertifikat/'.$detail->gbr_sert_depan;
$pdf->SetAutoPageBreak(false, 0);
$pdf->Image($img_file,0,0,297,210);

//QR CODE
$msg = "https://loa.iel-education.org/verify/no/".$detail->unik;
$style = array(
    'border' => 1,
    'padding' => '1px',
    'fgcolor' => 1,
    'bgcolor' => false
);
$pdf->write2DBarcode($msg, 'QRCODE,L', 90, 165, 30,30, $style, 'Y');  
//LOGO DIATAS QR CODE
$pdf->Image('assets/img/lpmpjogja.gif',100,178,10,5);

//KODE SERTIFIKAT
	
	$pdf->SetFont('helvetica', 'B', 11);
	$pdf->Ln(44);
	$pdf->Cell(460, 0, 'NO :'.$detail->unik,0, $ln=8, 'C', 0, '', 0, false, 'D', 'T');

$pdf->SetY(90);
$pdf->SetFont('helvetica', 'B', 25);
$pdf->MultiCell(276, 1.5, $detail->nama, 0, 'C');
$pdf->Ln(1);
$pdf->SetFont('helvetica', 'B', 16);
$pdf->MultiCell(276, 3, $detail->unit_kerja, 0, 'C');
$pdf->Ln(1);
$pdf->SetFont('helvetica', 'B', 16);
$pdf->MultiCell(276, 3, $detail->kategori, 0, 'C');
$pdf->Ln(35);
$pdf->SetFont('helvetica', 'B', 13);
$pdf->MultiCell(276, 6, $detail->judul, 0, 'C');
$pdf->Ln(37);


//Secon page
$pdf->AddPage('L', 'A4');
// set bacground image
$img_file = 'sertifikat/'.$detail->gbr_sert_blk;
$pdf->SetAutoPageBreak(false, 0);
$pdf->Image($img_file,0,0,297,210);

$pdf->lastPage();

//OUTPUT NAMA FILE
$pdf->Output($detail->nama.'.pdf', 'I');
?>