<?php
include "../../konfig/dbconnect.php";
include "../../model/viewskp.php";
include "library.php";
include "fungsi_thumb.php";
include "fungsi_seo.php";
include "fpdf.php";
ob_clean();
error_reporting(0);

class PDF extends FPDF{
var $widths;
var $no;
var $jenis;
var $nama;
var $tgl;
var $total;
var $header;
var $inggris;
    //var $aligns;
    
function Header(){
    
    if($this->jenis=='pengujian'){
        //include "library.php";
            $detail =mysql_query("SELECT permohonan.* ,detail_user.nama ,detail_user.telp ,detail_user.alamat_kantor ,detail_user.email FROM permohonan ,detail_user WHERE permohonan.id_user = detail_user.id_user AND permohonan.no_permohonan = $this->no");
            $dt = mysql_fetch_array($detail);


            //Column widths
            $this->SetFont('Arial','',12);
            $this->Image("../../file/Jatim.jpg",15,8,18);
            //$this->Cell(50);
            $this->Cell(27);
            $this->Cell(10,7,"UPT PENGENDALIAN DAN PENGUJIAN MUTU HASIL PERIKANAN SURABAYA",0,0,'L');
            $this->Ln();
            $this->Cell(40);
            $this->Cell(10,7,"DINAS PERIKANAN DAN KELAUTAN PROPINSI JAWA TIMUR",0,0,'L');
            $this->Ln();
            $this->Cell(58);
            $this->Cell(10,7,"JL. PAGESANGAN II NO 58. B SURABAYA",0,0,'L');
            $this->Ln(10);
            $this->Cell(200,0,'','T');
            $this->Ln(3);
            $this->Cell(45);
            $this->Cell(10,7,"FORMULIR PERMOHONAN PENGUJIAN CONTOH",0,0,'L');
            $this->Ln(10);
            $this->SetFont('Arial','',9);
            $this->Cell(40,7,"Nama Pemohon",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$dt[nama_pemohon]",0,0,'L');
            $this->Cell(30,7,"Telepon",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[telp]",0,0,'L');
            $this->Ln();
            $this->Cell(40,7,"Nama Perusahaan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$dt[nama]",0,0,'L');
            $this->Cell(30,7,"Alamat",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[alamat_kantor]",0,0,'L');
            $this->Ln();
            $this->Cell(40,7,"Nama Produk",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$dt[nama_produk]",0,0,'L');
            $this->Cell(30,7,"Email",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[email]",0,0,'L');
            $this->Ln();
            $this->Cell(40,7,"Jenis Produk",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$dt[produk]",0,0,'L');
            $this->Cell(30,7,"Jenis Olahan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[jenis_olahan]",0,0,'L');
            $this->Ln();
            $this->Cell(40,7,"Jumlah dan Type Kemasan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$dt[type_kemasan]",0,0,'L');
            $this->Cell(30,7,"Kode Produksi",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[kode_produksi]",0,0,'L');
            $this->Ln();
            $this->Cell(40,7,"Nomer Permohonan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$dt[no_permohonan]",0,0,'L');
            $this->Cell(30,7,"Kelompok Olahan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[kelompok_olahan]",0,0,'L');
            $this->Ln();
            $this->Cell(40,7,"Jenis Permohonan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$dt[jenis_permohonan]",0,0,'L');
            $this->Cell(30,7,"Nama Latin",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[nama_latin]",0,0,'L');
            $this->Ln();
            $this->Cell(40,7,"Metode Sampling",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$dt[metode_sampling]",0,0,'L');
            $this->Cell(30,7,"Jenis Pelanggan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[jenis_pelanggan]",0,0,'L');
            if($dt[metode_sampling]=='AQL 6.5'){
                $this->Ln();
                $this->Cell(40,7,"Jumlah Kemasan Besar",0,0,'L');
                $this->Cell(5,7,":",0,0,'L');
                $this->Cell(60,7,"$dt[jml_kemasan_besar]",0,0,'L');
                $this->Cell(30,7,"Berat Inner(Kg)",0,0,'L');
                $this->Cell(5,7,":",0,0,'L');
                $this->Cell(10,7,"$dt[berat_inner] Kg",0,0,'L');
                $this->Ln();
                $this->Cell(40,7,"Jumlah Inner",0,0,'L');
                $this->Cell(5,7,":",0,0,'L');
                $this->Cell(60,7,"$dt[jml_inner]",0,0,'L');
                $this->Cell(30,7,"Hasil",0,0,'L');
                $this->Cell(5,7,":",0,0,'L');
                $this->Cell(10,7,"$dt[hasil] Titik Uji",0,0,'L');
            }
            $this->Ln(10);
    }
    elseif($this->jenis=='harian'){
        //include "library.php";
            //Column widths
            $this->SetFont('Arial','',12);
            $this->Image("../../file/Jatim.jpg",15,8,18);
            //$this->Cell(50);
            $this->Cell(30);
            $this->Cell(10,7,"UPT PENGENDALIAN DAN PENGUJIAN MUTU HASIL PERIKANAN SURABAYA",0,0,'L');
            $this->Ln();
            $this->Cell(40);
            $this->Cell(10,7,"DINAS PERIKANAN DAN KELAUTAN PROPINSI JAWA TIMUR",0,0,'L');
            $this->Ln();
            $this->Cell(58);
            $this->Cell(10,7,"JL. PAGESANGAN II NO 58. B SURABAYA",0,0,'L');
            $this->Ln(10);
            $this->Cell(200,0,'','T');
            $this->Ln(3);
            $this->Cell(80);
            $this->Cell(10,7,"$this->nama",0,0,'L');
            $this->Ln(10);
    }
    elseif($this->jenis=='hasil'){
        //include "library.php";
            $detail =mysql_query("SELECT permohonan.* ,detail_user.nama  FROM permohonan ,detail_user WHERE permohonan.id_user = detail_user.id_user AND permohonan.no_permohonan = $this->no");
            $dt = mysql_fetch_array($detail);


            //Column widths
            $this->SetFont('Arial','',12);
            $this->Image("../../file/Jatim.jpg",15,8,18);
            //$this->Cell(50);
            $this->Cell(25);
            $this->Cell(10,7,"UPT PENGENDALIAN DAN PENGUJIAN MUTU HASIL PERIKANAN SURABAYA",0,0,'L');
            $this->Ln();
            $this->Cell(40);
            $this->Cell(10,7,"DINAS PERIKANAN DAN KELAUTAN PROPINSI JAWA TIMUR",0,0,'L');
            $this->Ln();
            $this->Cell(58);
            $this->Cell(10,7,"JL. PAGESANGAN II NO 58. B SURABAYA",0,0,'L');
            $this->Ln(10);
            $this->Cell(200,0,'','T');
            $this->Ln(3);
            $this->Cell(70);
            $this->Cell(10,7,"LEMBAR HASIL UJI",0,0,'L');
            $this->Ln(10);
            $this->SetFont('Arial','',9);
            $this->Cell(40,7,"Nomer Lab",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$dt[no_lab]",0,0,'L');
            $this->Ln();
            $this->Cell(40,7,"Nama barang",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$dt[nama_produk]",0,0,'L');
            $this->Ln();
            $this->Cell(40,7,"Tanggal pemeriksaan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$dt[tanggal_edit]",0,0,'L');
            $this->Ln();
            $this->Cell(40,7,"Hasil pemeriksaan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Ln(10);
    }
    elseif($this->jenis=='hasilakreditasi'){
        //include "library.php";
            $detail =mysql_query("SELECT permohonan.* ,detail_user.nama  FROM permohonan ,detail_user WHERE permohonan.id_user = detail_user.id_user AND permohonan.no_permohonan = $this->no");
            $dt = mysql_fetch_array($detail);


            //Column widths
            $this->SetFont('Arial','',10);
            $this->Image("../../file/Jatim.jpg",15,8,18);
            $this->Image("../../file/kan.jpg",170,10,30);
            //$this->Cell(50);
            $this->Cell(25);
            $this->Cell(10,7,"UPT PENGENDALIAN DAN PENGUJIAN MUTU HASIL PERIKANAN SURABAYA",0,0,'L');
            $this->Ln();
            $this->Cell(40);
            $this->Cell(10,7,"DINAS PERIKANAN DAN KELAUTAN PROPINSI JAWA TIMUR",0,0,'L');
            $this->Ln();
            $this->Cell(58);
            $this->Cell(10,7,"JL. PAGESANGAN II NO 58. B SURABAYA",0,0,'L');
            $this->Ln(10);
            $this->Cell(200,0,'','T');
            $this->Ln(3);
            $this->Cell(65);
            $this->Cell(10,7,"KETERANGAN HASIL ANALISA",0,0,'L');
            $this->Ln();
            $this->Cell(65);
            $this->Cell(54,0,'','T');
            $this->Ln();
            $this->Cell(75);
            $this->Cell(10,7,"Certificate of analysis",0,0,'L');
            $this->Ln(10);
            $this->SetFont('Arial','',9);
            $this->Cell(50,7,"Menerangkan bahwa",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Ln(6);
            $this->Cell(50,0,'','T');
            $this->Ln(0);
            $this->Cell(10,7,"This is to contify that",0,0,'L');
            $this->Ln(4);
            $this->Cell(50,7,"Nama barang",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$dt[nama_produk]",0,0,'L');
            $this->Ln();
            $this->Cell(50,0,'','T');
            $this->Ln();
            $this->Cell(10,7,"Comodity",0,0,'L');
            $this->Ln(4);
            $this->Cell(50,7,"Kode Produksi",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$dt[kode_produksi]",0,0,'L');
            $this->Ln();
            $this->Cell(50,0,'','T');
            $this->Ln();
            $this->Cell(10,7,"Code of batch",0,0,'L');
            $this->Ln(4);
            $this->Cell(50,7,"Jumlah dan Type Kemasan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$dt[type_kemasan]",0,0,'L');
            $this->Ln();
            $this->Cell(50,0,'','T');
            $this->Ln();
            $this->Cell(10,7,"Number and type packaging",0,0,'L');
            $this->Ln(4);
            $this->Cell(50,7,"Pemilik",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$dt[nama]",0,0,'L');
            $this->Ln();
            $this->Cell(50,0,'','T');
            $this->Ln();
            $this->Cell(10,7,"Owner",0,0,'L');
            $this->Ln(4);
            $this->Cell(50,7,"Nomer Bukti Penerimaan Contoh",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$dt[no_permohonan]",0,0,'L');
            $this->Ln();
            $this->Cell(50,0,'','T');
            $this->Ln();
            $this->Cell(10,7,"Number of sample received",0,0,'L');
            $this->Ln(4);
            $this->Cell(50,7,"Tanggal pemeriksaan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$dt[tanggal_pemeriksaan]",0,0,'L');
            $this->Ln();
            $this->Cell(50,0,'','T');
            $this->Ln();
            $this->Cell(10,7,"Date of examination",0,0,'L');
            $this->Ln(4);
            $this->Cell(50,7,"Hasil pemeriksaan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Ln();
            $this->Cell(50,0,'','T');
            $this->Ln();
            $this->Cell(10,7,"Result of examination",0,0,'L');
            $this->Ln(10);
            
            $this->SetFont('Arial','U',9);
            $w=array(10,45,10,20,25,30,20,35); 
            //for($i=0;$i<count($header);$i++)
            //$this->Cell($w[$i],7,$header[$i],1,0,'C');
            //$this->Ln();
            //$this->SetFont('Arial','',9);
            //for($i=0;$i<count($inggris);$i++)
            //$this->Cell($w[$i],7,$inggris[$i],1,0,'C');
            $this->Cell(array_sum($w),0,'','T');
            $this->Ln();
            $this->SetWidths(array(10,45,10,20,25,30,20,35));
            $this->SetAligns(array('LR','LR','LR','LR','LR','LR','LR','LR'));
            $this->Row($this->header);
            $this->Cell(array_sum($w),0,'','');
            $this->Ln();
            $this->SetFont('Arial','',9);
            $this->Row($this->inggris);
            $this->Cell(array_sum($w),0,'','');
            $this->Ln();
            $this->Cell(array_sum($w),0,'','T');
            $this->Ln();
    }
    elseif($this->jenis=='hasiltidakakreditasi'){
        //include "library.php";
            $detail =mysql_query("SELECT permohonan.* ,detail_user.nama  FROM permohonan ,detail_user WHERE permohonan.id_user = detail_user.id_user AND permohonan.no_permohonan = $this->no");
            $dt = mysql_fetch_array($detail);


            //Column widths
            $this->SetFont('Arial','',10);
            $this->Image("../../file/Jatim.jpg",15,8,18);
            //$this->Cell(50);
            $this->Cell(25);
            $this->Cell(10,7,"UPT PENGENDALIAN DAN PENGUJIAN MUTU HASIL PERIKANAN SURABAYA",0,0,'L');
            $this->Ln();
            $this->Cell(40);
            $this->Cell(10,7,"DINAS PERIKANAN DAN KELAUTAN PROPINSI JAWA TIMUR",0,0,'L');
            $this->Ln();
            $this->Cell(58);
            $this->Cell(10,7,"JL. PAGESANGAN II NO 58. B SURABAYA",0,0,'L');
            $this->Ln(10);
            $this->Cell(200,0,'','T');
            $this->Ln(3);
            $this->Cell(65);
            $this->Cell(10,7,"KETERANGAN HASIL ANALISA",0,0,'L');
            $this->Ln(10);
            $this->SetFont('Arial','',9);
            $this->Cell(40,7,"Menerangkan bahwa",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Ln();
            $this->Cell(40,7,"Nama barang",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$dt[nama_produk]",0,0,'L');
            $this->Ln();
            $this->Cell(40,7,"Jumlah dan type kemasan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"",0,0,'L');
            $this->Ln();
            $this->Cell(40,7,"Kode produksi",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"",0,0,'L');
            $this->Ln();
            $this->Cell(40,7,"Pemilik",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$dt[nama]",0,0,'L');
            $this->Ln();
            $this->Cell(40,7,"Tanggal pemeriksaan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$dt[tanggal_edit]",0,0,'L');
            $this->Ln();
            $this->Cell(40,7,"Hasil pemeriksaan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Ln(10);
            
            $this->SetFont('Arial','U',9);
            $w=array(10,45,10,20,25,30,20,35); 
            //for($i=0;$i<count($header);$i++)
            //$this->Cell($w[$i],7,$header[$i],1,0,'C');
            //$this->Ln();
            //$this->SetFont('Arial','',9);
            //for($i=0;$i<count($inggris);$i++)
            //$this->Cell($w[$i],7,$inggris[$i],1,0,'C');
            $this->Cell(array_sum($w),0,'','T');
            $this->Ln();
            $this->SetWidths(array(10,45,10,20,25,30,20,35));
            $this->SetAligns(array('LR','LR','LR','LR','LR','LR','LR','LR'));
            $this->Row($this->header);
            $this->Cell(array_sum($w),0,'','');
            $this->Ln();
            $this->SetFont('Arial','',9);
            $this->Row($this->inggris);
            $this->Cell(array_sum($w),0,'','');
            $this->Ln();
            $this->Cell(array_sum($w),0,'','T');
            $this->Ln();
    }
    elseif($this->jenis=='order'){
        //include "library.php";
            $detail =mysql_query("SELECT permohonan.* ,detail_user.nama  FROM permohonan ,detail_user WHERE permohonan.id_user = detail_user.id_user AND permohonan.no_permohonan = $this->no");
            $dt = mysql_fetch_array($detail);


            //Column widths
            $this->SetFont('Arial','',12);
            $this->Image("../../file/Jatim.jpg",15,8,18);
            //$this->Cell(50);
            $this->Cell(25);
            $this->Cell(10,7,"UPT PENGENDALIAN DAN PENGUJIAN MUTU HASIL PERIKANAN SURABAYA",0,0,'L');
            $this->Ln();
            $this->Cell(40);
            $this->Cell(10,7,"DINAS PERIKANAN DAN KELAUTAN PROPINSI JAWA TIMUR",0,0,'L');
            $this->Ln();
            $this->Cell(58);
            $this->Cell(10,7,"JL. PAGESANGAN II NO 58. B SURABAYA",0,0,'L');
            $this->Ln(10);
            $this->Cell(200,0,'','T');
            $this->Ln(3);
            $this->Cell(65);
            $this->Cell(10,7,"LAPORAN ORDER UJI HARIAN",0,0,'L');
            $this->Ln(10);
            $this->Cell(40,7,"Tanggal Pengujian",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$this->tgl",0,0,'L');
            $this->Ln(10);
    }
    elseif($this->jenis=='bayar'){
        //include "library.php";
            $detail =mysql_query("SELECT permohonan.* ,detail_user.nama ,detail_user.telp ,detail_user.alamat_kantor ,detail_user.email FROM permohonan ,detail_user WHERE permohonan.id_user = detail_user.id_user AND permohonan.no_permohonan = $this->no");
            $dt = mysql_fetch_array($detail);


            //Column widths
            $this->SetFont('Arial','',12);
            $this->Image("../../file/Jatim.jpg",15,8,18);
            //$this->Cell(50);
            $this->Cell(25);
            $this->Cell(10,7,"UPT PENGENDALIAN DAN PENGUJIAN MUTU HASIL PERIKANAN SURABAYA",0,0,'L');
            $this->Ln();
            $this->Cell(40);
            $this->Cell(10,7,"DINAS PERIKANAN DAN KELAUTAN PROPINSI JAWA TIMUR",0,0,'L');
            $this->Ln();
            $this->Cell(58);
            $this->Cell(10,7,"JL. PAGESANGAN II NO 58. B SURABAYA",0,0,'L');
            $this->Ln(10);
            $this->Cell(200,0,'','T');
            $this->Ln(3);
            $this->Cell(50);
            $this->Cell(10,7,"SURAT KETERANGAN RETRIBUSI DAERAH",0,0,'L');
            $this->Ln();
            $this->Cell(40);
            $this->Cell(10,7,"PEMAKAIAN SARANA LABORATORIUM PERIKANAN",0,0,'L');
            $this->Ln(10);
            $this->SetFont('Arial','',9);
            $this->Cell(35,7,"Nomer Permohonan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$dt[no_permohonan]",0,0,'L');
            $this->Cell(40,7,"Tanggal Terima Contoh",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[tanggal]",0,0,'L');
            $this->Ln();
            $this->Cell(35,7,"Nama Perusahaan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$dt[nama]",0,0,'L');
            $this->Cell(40,7,"Jenis Barang",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[nama_produk]",0,0,'L');
            $this->Ln(10);
            $this->Cell(100,7,"Untuk melakukan pembayaran retribusi pemakaian sarana laboratorium dengan rincian",0,0,'L');
            $this->Ln(10);
    }
    elseif($this->jenis=='verregister'){
        //include "library.php";
            //Column widths
            $this->SetFont('Arial','',12);
            $this->Image("../../file/Jatim.jpg",15,8,18);
            //$this->Cell(50);
            $this->Cell(27);
            $this->Cell(10,7,"UPT PENGENDALIAN DAN PENGUJIAN MUTU HASIL PERIKANAN SURABAYA",0,0,'L');
            $this->Ln();
            $this->Cell(40);
            $this->Cell(10,7,"DINAS PERIKANAN DAN KELAUTAN PROPINSI JAWA TIMUR",0,0,'L');
            $this->Ln();
            $this->Cell(58);
            $this->Cell(10,7,"JL. PAGESANGAN II NO 58. B SURABAYA",0,0,'L');
            $this->Ln(10);
            $this->Cell(200,0,'','T');
            $this->Ln(3);
            $this->Cell(62);
            $this->Cell(10,7,"VERIFIKASI PERMOHONAN UJI",0,0,'L');
            $this->Ln(10);
    }
    elseif($this->jenis=='ambilcontoh'){
        //include "library.php";
            //Column widths
            $this->SetFont('Arial','',12);
            $this->Image("../../file/Jatim.jpg",15,8,18);
            //$this->Cell(50);
            $this->Cell(27);
            $this->Cell(10,7,"UPT PENGENDALIAN DAN PENGUJIAN MUTU HASIL PERIKANAN SURABAYA",0,0,'L');
            $this->Ln();
            $this->Cell(40);
            $this->Cell(10,7,"DINAS PERIKANAN DAN KELAUTAN PROPINSI JAWA TIMUR",0,0,'L');
            $this->Ln();
            $this->Cell(58);
            $this->Cell(10,7,"JL. PAGESANGAN II NO 58. B SURABAYA",0,0,'L');
            $this->Ln(10);
            $this->Cell(200,0,'','T');
            $this->Ln(3);
            $this->Cell(62);
            $this->Cell(10,7,"VERIFIKASI PENGAMBILAN CONTOH",0,0,'L');
            $this->Ln(10);
    }
    elseif($this->jenis=='terimacontoh'){
        //include "library.php";
            //Column widths
            $this->SetFont('Arial','',12);
            $this->Image("../../file/Jatim.jpg",15,8,18);
            //$this->Cell(50);
            $this->Cell(27);
            $this->Cell(10,7,"UPT PENGENDALIAN DAN PENGUJIAN MUTU HASIL PERIKANAN SURABAYA",0,0,'L');
            $this->Ln();
            $this->Cell(40);
            $this->Cell(10,7,"DINAS PERIKANAN DAN KELAUTAN PROPINSI JAWA TIMUR",0,0,'L');
            $this->Ln();
            $this->Cell(58);
            $this->Cell(10,7,"JL. PAGESANGAN II NO 58. B SURABAYA",0,0,'L');
            $this->Ln(10);
            $this->Cell(200,0,'','T');
            $this->Ln(3);
            $this->Cell(62);
            $this->Cell(10,7,"VERIFIKASI PENERIMAAN CONTOH",0,0,'L');
            $this->Ln(10);
    }
}  
    
    
function Tablepengujian($header,$data){
    //Header
    $this->SetFont('Arial','',9);
    $w=array(57,15,53,24,20,30); 
    for($i=0;$i<count($header);$i++)
    $this->Cell($w[$i],7,$header[$i],1,0,'C');
    $this->Ln();
    //Data
    $this->SetWidths(array(57,15,53,24,20,30));
    $this->SetAligns(array('LR','LR','LR','LR','LR','LR'));
    $no = 1;
    for($i=0;$dtl=mysql_fetch_array($data);$i++){
        $this->Row(
            array(
                $dtl[parameter_uji],
                $dtl[jml_titik_uji],
                $dtl[metode_uji],
                $dtl[waktu_uji],
                $dtl[harga_total],
                $dtl[status_uji]
            ));
            $no++;
            $this->Cell(array_sum($w),0,'','T');
            $this->Ln();
        }
    //Closure line
}  

function Tablebayar($header,$data,$total){
    //Header
    $this->SetFont('Arial','',9);
    $w=array(107,15,57,20); 
    for($i=0;$i<count($header);$i++)
    $this->Cell($w[$i],7,$header[$i],1,0,'C');
    $this->Ln();
    //Data
    $this->SetWidths(array(107,15,57,20));
    $this->SetAligns(array('LR','LR','LR','LR'));
    $no = 1;
    for($i=0;$dtl=mysql_fetch_array($data);$i++){
        $this->Row(
            array(
                $dtl[parameter_uji],
                $dtl[jml_titik_uji],
                $dtl[harga],
                $dtl[harga_total]
            ));
            $no++;
            $this->Cell(array_sum($w),0,'','T');
            $this->Ln();
        }
        $this->SetWidths(array(179,20));
        $this->SetAligns(array('LR','LR'));
        $this->Row(array('Jumlah',$total));
        $this->Cell(array_sum($w),0,'','T');
        $this->Ln();
    //Closure line
}  

function Tableharian1($header,$data){
    //Header
    $this->SetFont('Arial','',9);
    $w=array(12,40,15,60,60); 
    for($i=0;$i<count($header);$i++)
    $this->Cell($w[$i],7,$header[$i],1,0,'C');
    $this->Ln();
    //Data
    $this->SetWidths(array(12,40,15,60,60));
    $this->SetAligns(array('LR','LR','LR','LR','LR'));
    $no = 1;
    for($i=0;$dtl=mysql_fetch_array($data);$i++){
        
            if($dtl[titik_uji]==1){
                $this->Row(
                        array(
                            $no,
                            $dtl[no_lab],
                            $dtl[titik_uji],
                            "",
                            ""
                        ));
            }else{
                $this->Row(
                        array(
                            "",
                            "",
                            $dtl[titik_uji],
                            "",
                            ""
                        ));
            }
            $this->Cell(array_sum($w),0,'','T');
            $this->Ln();
        }
            $no++;
          
    //Closure line
}

function Tableharian2($header,$data){
    //Header
    $this->SetFont('Arial','',9);
    $w=array(12,40,15,24,24,24,24,24); 
    for($i=0;$i<count($header);$i++)
    $this->Cell($w[$i],7,$header[$i],1,0,'C');
    $this->Ln();
    //Data
    $this->SetWidths(array(12,40,15,24,24,24,24,24));
    $this->SetAligns(array('LR','LR','LR','LR','LR','LR','LR','LR','LR'));
    $no = 1;
    for($i=0;$dtl=mysql_fetch_array($data);$i++){
        
            if($dtl[titik_uji]==1){
                $this->Row(
                        array(
                            $no,
                            $dtl[no_lab],
                            $dtl[titik_uji],
                            "",
                            "",
                            "",
                            "",
                            ""
                        ));
            }else{
                $this->Row(
                        array(
                            "",
                            "",
                            $dtl[titik_uji],
                            "",
                            "",
                            "",
                            "",
                            ""
                        ));
            }
            $this->Cell(array_sum($w),0,'','T');
            $this->Ln();
        }
            $no++;
          
    //Closure line
}

function Tableharian3($header,$data){
    //Header
    $this->SetFont('Arial','',9);
    $w=array(12,40,15,40,40,40); 
    for($i=0;$i<count($header);$i++)
    $this->Cell($w[$i],7,$header[$i],1,0,'C');
    $this->Ln();
    //Data
    $this->SetWidths(array(12,40,15,40,40,40));
    $this->SetAligns(array('LR','LR','C','LR','LR','LR'));
    $no = 1;
    for($i=0;$dtl=mysql_fetch_array($data);$i++){
        
            if($dtl[titik_uji]==1){
                $this->Row(
                        array(
                            $no,
                            $dtl[no_lab],
                            $dtl[titik_uji],
                            "",
                            "",
                            ""
                        ));
            }else{
                $this->Row(
                        array(
                            "",
                            "",
                            $dtl[titik_uji],
                            "",
                            "",
                            ""
                        ));
            }
            $this->Cell(array_sum($w),0,'','T');
            $this->Ln();
            $no++;
    }
    //Closure line
}

function Tableharian4($header,$data){
    //Header
    $this->SetFont('Arial','',9);
    $w=array(12,40,15,30,30,30,30); 
    for($i=0;$i<count($header);$i++)
    $this->Cell($w[$i],7,$header[$i],1,0,'C');
    $this->Ln();
    //Data
    $this->SetWidths(array(12,40,15,30,30,30,30));
    $this->SetAligns(array('LR','LR','LR','LR','LR','LR','LR'));
    $no = 1;
    for($i=0;$dtl=mysql_fetch_array($data);$i++){
        
            if($dtl[titik_uji]==1){
                $this->Row(
                        array(
                            $no,
                            $dtl[no_lab],
                            $dtl[titik_uji],
                            "",
                            "",
                            "",
                            ""
                        ));
            }else{
                $this->Row(
                        array(
                            "",
                            "",
                            $dtl[titik_uji],
                            "",
                            "",
                            "",
                            ""
                        ));
            }
            $this->Cell(array_sum($w),0,'','T');
            $this->Ln();
            $no++;
            
        }
    //Closure line
}

function Tableharian5($header,$data){
    //Header
    $this->SetFont('Arial','',9);
    $w=array(12,40,15,40,40,40); 
    for($i=0;$i<count($header);$i++)
    $this->Cell($w[$i],7,$header[$i],1,0,'C');
    $this->Ln();
    $this->Cell(57,7,"",1,0,'C');
    $this->Cell(15,7,"",1,0,'C');
    $this->Cell(57,7,"",1,0,'C');
    $this->Cell(10,7,"0",1,0,'C');
    $this->Cell(10,7,"1",1,0,'C');
    $this->Cell(10,7,"2",1,0,'C');
    $this->Cell(10,7,"3",1,0,'C');
    $this->Cell(10,7,"4",1,0,'C');
    $this->Cell(10,7,"5",1,0,'C');
    $this->Cell(10,7,"0",1,0,'C');
    $this->Cell(10,7,"1",1,0,'C');
    $this->Cell(10,7,"2",1,0,'C');
    $this->Cell(20,7,"",1,0,'C');
    $this->Ln();
    //Data
    $this->SetWidths(array(12,40,15,11,11,11,11,11,11,11,11,11,20));
    $this->SetAligns(array('LR','LR','LR','LR','LR','LR','LR','LR','LR','LR','LR','LR','LR'));
    $no = 1;
    for($i=0;$dtl=mysql_fetch_array($data);$i++){
        
            if($dtl[titik_uji]==1){
                $this->Row(
                        array(
                            $no,
                            $dtl[no_lab],
                            $dtl[titik_uji],
                            "",
                            "",
                            "",
                            "",
                            "",
                            "",
                            "",
                            "",
                            "",
                            ""
                        ));
            }else{
                $this->Row(
                        array(
                            "",
                            "",
                            $dtl[titik_uji],
                            "",
                            "",
                            "",
                            "",
                            "",
                            "",
                            "",
                            "",
                            "",
                            ""
                        ));
            }
            $this->Cell(array_sum($w),0,'','T');
            $this->Ln();
            $no++;
            
        }
    //Closure line
}

function Tablehasil($header,$data){
    //Header
    $this->SetFont('Arial','',9);
    $w=array(15,40,15,30,30,20,45); 
    for($i=0;$i<count($header);$i++)
    $this->Cell($w[$i],7,$header[$i],1,0,'C');
    $this->Ln();
    //Data
    $this->SetWidths(array(15,40,15,30,30,20,45));
    $this->SetAligns(array('LR','LR','LR','LR','LR','LR','LR'));
    $no = 1;
    for($i=0;$dtl=mysql_fetch_array($data);$i++){
        
            if($dtl[titik_uji]==1){
                $this->Rowhasil(
                        array(
                            $no,
                            $dtl[parameter_uji],
                            $dtl[titik_uji],
                            $dtl[hasil],
                            $dtl[standart_uji],
                            $dtl[satuan],
                            $dtl[metode_uji]
                        ),$dtl[pangkat],$dtl[pangkat_su]);
                
                $no++;
            }else{
                $this->Rowhasil(
                        array(
                            "",
                            "",
                            $dtl[titik_uji],
                            $dtl[hasil],
                            $dtl[standart_uji],
                            $dtl[satuan]    ,
                            $dtl[metode_uji]
                        ),$dtl[pangkat],$dtl[pangkat_su]);
            }
            $this->Cell(array_sum($w),0,'','');
            $this->Ln();
            
        }
        $this->Cell(array_sum($w),0,'','T');
        $this->Ln();
    //Closure line
}

function Tableca($data){
    //Header
    $this->SetFont('Arial','U',9);
    $w=array(10,45,10,20,25,30,20,35); 
    //for($i=0;$i<count($header);$i++)
    //$this->Cell($w[$i],7,$header[$i],1,0,'C');
    //$this->Ln();
    //$this->SetFont('Arial','',9);
    //for($i=0;$i<count($inggris);$i++)
    //$this->Cell($w[$i],7,$inggris[$i],1,0,'C');
    
    //Data
    $this->SetFont('Arial','',9);
    $this->SetWidths(array(10,45,10,20,25,30,20,35));
    $this->SetAligns(array('LR','LR','LR','LR','LR','LR','LR','LR'));
    $no = 1;
    for($i=0;$dtl=mysql_fetch_array($data);$i++){
        
            //$html = "$dtl[hasil]<sup>$dtl[pangkat]</sup>";
            //$hasil = $this->WriteHTML($html);
        
            if($dtl[titik_uji]==1){
                $this->Rowca(
                        array(
                            $no,
                            $dtl[parameter_uji],
                            $dtl[kode_ca],
                            $dtl[titik_uji],
                            $dtl[hasil],
                            $dtl[standart_uji],
                            $dtl[satuan],
                            $dtl[metode_uji]
                        ),$dtl[pangkat],$dtl[pangkat_su]);
                
                $no++;
            }else{
                $this->Rowca(
                        array(
                            "",
                            "",
                            $dtl[kode_ca],
                            $dtl[titik_uji],
                            $dtl[hasil],
                            $dtl[standart_uji],
                            $dtl[satuan]    ,
                            $dtl[metode_uji]
                        ),$dtl[pangkat],$dtl[pangkat_su]);
            }
            $this->Cell(array_sum($w),0,'','');
            $this->Ln();
            
        }
        $this->Cell(array_sum($w),0,'','T');
        $this->Ln();
    //Closure line
}

function Tableorder($header,$data){
    //Header
    $this->SetFont('Arial','',9);
    $w=array(15,40,40,30,60); 
    for($i=0;$i<count($header);$i++)
    $this->Cell($w[$i],7,$header[$i],1,0,'C');
    $this->Ln();
    //Data
    $this->SetWidths(array(15,40,40,30,60));
    $this->SetAligns(array('LR','LR','LR','LR','LR'));
    $nolab = '';
    $lab = '';
    $no = 1;
    for($i=0;$dtl=mysql_fetch_array($data);$i++){
        
            if($nolab==$dtl[no_lab] and $lab==$dtl[nama]){
                $this->Row(
                        array(
                            "",
                            "",
                            "",
                            $dtl[jml_titik_uji],
                            $dtl[parameter_uji]
                        ));
                
                $nolab = $dtl[no_lab];
                $lab = $dtl[nama];
            }
            elseif($nolab==$dtl[no_lab] and $lab!=$dtl[nama]){
                $this->Row(
                        array(
                            "",
                            "",
                            $dtl[nama],
                            $dtl[jml_titik_uji],
                            $dtl[parameter_uji]
                        ));
                
                $nolab = $dtl[no_lab];
                $lab = $dtl[nama];
            }
            elseif($nolab!=$dtl[no_lab] and $lab!=$dtl[nama]){
                $this->Row(
                        array(
                            $no,
                            $dtl[no_lab],
                            $dtl[nama],
                            $dtl[jml_titik_uji],
                            $dtl[parameter_uji]
                        ));
                
                $nolab = $dtl[no_lab];
                $lab = $dtl[nama];
                $no++;
            }
            $this->Cell(array_sum($w),0,'','');
            $this->Ln();
            
        }
        $this->Cell(array_sum($w),0,'','T');
        $this->Ln();
    //Closure line
}

function verregister(){
        //include "library.php";
            $detail =mysql_query("SELECT * FROM verifikasi WHERE verifikasi.no_permohonan = $this->no");
            $dt = mysql_fetch_array($detail);


            //Column widths
            //$this->Image("../../file/Jatim.jpg",25,7,18);
            //$this->Cell(50);
            $this->SetFont('Arial','',9);
            $this->Cell(62,7,"Kesusaian metode sampling dengan titik Uji ",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(40,7,"$dt[kesesuaian_metode]",0,0,'L');
            $this->Cell(40,7,"Tanggal",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[tanggal]",0,0,'L');
            $this->Ln();
            $this->Cell(62,7,"Ketersediaan Media dan reagensia",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(40,7,"$dt[ketersediaan_media]",0,0,'L');
            $this->Cell(40,7,"Analis dan Metode Uji",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[analis]",0,0,'L');
            $this->Ln();
            $this->Cell(62,7,"Kondisi Instrumen dan Peralatan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(40,7,"$dt[kondisi_instrumen]",0,0,'L');
            $this->Cell(40,7,"Status Permohonan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[status_pemohonan]",0,0,'L');
            $this->Ln();
            $this->Cell(62,7,"Keterangan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Ln();
            $this->Cell(90,7,"$dt[keterangan]",1,0,'L');
            $this->Ln();
}

function terimacontoh(){
        //include "library.php";
            $detail =mysql_query("SELECT permohonan.nama_produk ,permohonan.kelompok_olahan ,penerimaan_contoh.* FROM permohonan ,penerimaan_contoh WHERE penerimaan_contoh.no_permohonan = permohonan.no_permohonan AND penerimaan_contoh.no_permohonan = $this->no");
            $dt = mysql_fetch_array($detail);


            //Column widths
            //$this->Image("../../file/Jatim.jpg",25,7,18);
            //$this->Cell(50);
            $this->SetFont('Arial','',9);
            $this->Cell(66,7,"Jenis Contoh",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(40,7,"$dt[nama_produk]",0,0,'L');
            $this->Cell(28,7,"Transportasi",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[transportasi]",0,0,'L');
            $this->Ln();
            $this->Cell(66,7,"Kelompok Olahan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(40,7,"$dt[kelompok_olahan]",0,0,'L');
            $this->Cell(28,7,"Kondisi Contoh",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[kondisi_contoh]",0,0,'L');
            $this->Ln();
            $this->Cell(66,7,"Kesesuaian Contoh Dengan Permohonan Uji",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(40,7,"$dt[kesesuaian_contoh]",0,0,'L');
            $this->Cell(28,7,"Suhu(c) ",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[suhu]",0,0,'L');
            $this->Ln();
            $this->Cell(66,7,"Jenis Kemasan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(40,7,"$dt[jenis_kemasan]",0,0,'L');
            $this->Cell(28,7,"Arsip",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[arsip]",0,0,'L');
            $this->Ln();
            $this->Cell(66,7,"Tanggal",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[tanggal]",0,0,'L');
            $this->Ln();
            $this->Cell(66,7,"Keterangan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Ln();
            $this->Cell(90,7,"$dt[keterangan]",1,0,'L');
            $this->Ln(30);
            $this->SetFont('Arial','',9);
            $this->Cell(127);
            $this->Cell(40,7,'Petugas Penerima Contoh',0,0,'L');
            $this->Ln(30);
            $this->Cell(125);
            $this->Cell(40,7,'_________________________',0,0,'L');
            $this->Ln();
}

function ambilcontoh(){
        //include "library.php";
            $detail =mysql_query("SELECT permohonan.nama_produk ,permohonan.kelompok_olahan ,permohonan.jenis_olahan ,permohonan.berat_contoh ,pengambilan_contoh.* FROM permohonan ,pengambilan_contoh WHERE pengambilan_contoh.no_permohonan = permohonan.no_permohonan AND pengambilan_contoh.no_permohonan = $this->no");
            $dt = mysql_fetch_array($detail);


            //Column widths
            //$this->Image("../../file/Jatim.jpg",25,7,18);
            //$this->Cell(50);
            $this->SetFont('Arial','',9);
            $this->Cell(50,7,"Nama Contoh",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(40,7,"$dt[nama_produk]",0,0,'L');
            $this->Cell(40,7,"Jenis Kemasan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[jenis_kemasan]",0,0,'L');
            $this->Ln();
            $this->Cell(50,7,"Jenis Contoh",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(40,7,"$dt[jenis_olahan]",0,0,'L');
            $this->Cell(40,7,"Kondisi Contoh",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[kondisi_contoh]",0,0,'L');
            $this->Ln();
            $this->Cell(50,7,"Kelompok Olahan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(40,7,"$dt[kelompok_olahan]",0,0,'L');
            $this->Cell(40,7,"Suhu(c) ",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[suhu]",0,0,'L');
            $this->Ln();
            $this->Cell(50,7,"Jumlah Contoh(Kg)",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(40,7,"$dt[berat_contoh]",0,0,'L');
            $this->Cell(40,7,"Arsip",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[arsip]",0,0,'L');
            $this->Ln();
            $this->Cell(50,7,"Tanggal",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[tanggal]",0,0,'L');
            $this->Ln();
            $this->Cell(50,7,"Keterangan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Ln();
            $this->Cell(90,7,"$dt[keterangan]",1,0,'L');
            $this->Ln(30);
            $this->SetFont('Arial','',9);
            $this->Cell(127);
            $this->Cell(40,7,'Petugas Pengambil Contoh',0,0,'L');
            $this->Ln(30);
            $this->Cell(125);
            $this->Cell(40,7,'_________________________',0,0,'L');
            $this->Ln();
}

function Footer(){
    if($this->jenis=='bayar'){
            $tandatangan = mysql_query("SELECT tanda_tangan.nama FROM tanda_tangan WHERE tanda_tangan.id_tt = 1");
            $tt = mysql_fetch_array($tandatangan);
            
            //Column widths
            //$this->Image("../../file/Jatim.jpg",25,7,18);
            //$this->Cell(50);
            $this->Ln(30);
            $this->SetFont('Arial','',9);
            $this->Cell(95);
            $this->Cell(40,7,'Kepala UPT Pengujian Mutu dan Pengembangan Produk',0,0,'L');
            $this->Ln();
            $this->Cell(100);
            $this->Cell(40,7,'Hasil Kelautan dan Perikanan Provinsi Jawa Timur',0,0,'L');
            $this->Ln(30);
            $this->Cell(125);
            $this->Cell(40,7,"$tt[nama]",0,0,'L');
            $this->Ln();
    }
    elseif($this->jenis=='hasil'){
        //Column widths
            //$this->Image("../../file/Jatim.jpg",25,7,18);
            //$this->Cell(50);
            $this->Ln(30);
            $this->SetFont('Arial','',9);
            $this->Cell(120);
            $this->Cell(40,7,'Kepala Seksi Pengujian Mutu',0,0,'L');
            $this->Ln();
            $this->Cell(119);
            $this->Cell(40,7,'Kepala UPT-PPMHP Surabaya',0,0,'L');
            $this->Ln(30);
            $this->Cell(125);
            $this->Cell(40,7,'M.Suhad S.pi,M.si',0,0,'L');
            $this->Ln();
    }
    elseif($this->jenis=='hasilakreditasi'){
        //Column widths
            //$this->Image("../../file/Jatim.jpg",25,7,18);
            //$this->Cell(50);
            $tandatangan = mysql_query("SELECT tanda_tangan.nama FROM tanda_tangan WHERE tanda_tangan.id_tt = 1");
            $tt = mysql_fetch_array($tandatangan);
            
            //Column widths
            //$this->Image("../../file/Jatim.jpg",25,7,18);
            //$this->Cell(50);
            $this->Ln(10);
            $this->SetFont('Arial','',9);
            $this->Cell(95);
            $this->Cell(40,7,'Kepala UPT Pengujian Mutu dan Pengembangan Produk',0,0,'L');
            $this->Ln();
            $this->Cell(100);
            $this->Cell(40,7,'Hasil Kelautan dan Perikanan Provinsi Jawa Timur',0,0,'L');
            $this->Ln(30);
            $this->Cell(125);
            $this->Cell(40,7,"$tt[nama]",0,0,'L');
            $this->Ln();
    } 
    elseif($this->jenis=='hasiltidakakreditasi'){
        //Column widths
            //$this->Image("../../file/Jatim.jpg",25,7,18);
            //$this->Cell(50);
            $tandatangan = mysql_query("SELECT tanda_tangan.nama FROM tanda_tangan WHERE tanda_tangan.id_tt = 1");
            $tt = mysql_fetch_array($tandatangan);
            
            //Column widths
            //$this->Image("../../file/Jatim.jpg",25,7,18);
            //$this->Cell(50);
            $this->Ln(10);
            $this->SetFont('Arial','',9);
            $this->Cell(95);
            $this->Cell(40,7,'Kepala UPT Pengujian Mutu dan Pengembangan Produk',0,0,'L');
            $this->Ln();
            $this->Cell(100);
            $this->Cell(40,7,'Hasil Kelautan dan Perikanan Provinsi Jawa Timur',0,0,'L');
            $this->Ln(30);
            $this->Cell(125);
            $this->Cell(40,7,"$tt[nama]",0,0,'L');
            $this->Ln();
    }
    elseif($this->jenis=='pengujian'){
        //include "library.php";
            $detail =mysql_query("SELECT permohonan.* ,detail_user.nama ,detail_user.telp ,detail_user.alamat_kantor ,detail_user.email FROM permohonan ,detail_user WHERE permohonan.id_user = detail_user.id_user AND permohonan.no_permohonan = $this->no");
            $dt = mysql_fetch_array($detail);


            //Column widths
            $this->SetFont('Arial','',16);
            //$this->Image("../../file/Jatim.jpg",25,7,18);
            //$this->Cell(50);
            $this->Ln(7);
            $this->Cell(30,7,"Total Harga",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$this->total",0,0,'L');
            $this->Ln(10);
            $this->SetFont('Arial','',9);
            $this->Cell(50,7,"Berat Contoh Yang Harus Dibawa",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(40,7,"$dt[berat_contoh] Kg",0,0,'L');
            $this->Cell(40,7,"Tanggal Ambil Contoh",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[tgl_ambil]",0,0,'L');
            $this->Ln();
            $this->Cell(50,7,"Pendistribusian Contoh",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(40,7,"$dt[distribusi_contoh]",0,0,'L');
            $this->Cell(40,7,"Pendistribusian Hasil Uji",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[distribusi_hasil]",0,0,'L');
            $this->Ln();
            $this->Cell(50,7,"Tanggal Permohonan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(40,7,"$dt[tanggal]",0,0,'L');
            $this->Ln();
            $this->Cell(50,7,"Keterangan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Ln();
            $this->Cell(90,7,"$dt[keterangan]",1,0,'L');
            $this->Ln();
    }
    elseif($this->jenis=='verregister'){
        //include "library.php";
            $detail =mysql_query("SELECT permohonan.* ,detail_user.nama ,detail_user.telp ,detail_user.alamat_kantor ,detail_user.email FROM permohonan ,detail_user WHERE permohonan.id_user = detail_user.id_user AND permohonan.no_permohonan = $this->no");
            $dt = mysql_fetch_array($detail);


            //Column widths
            $this->SetFont('Arial','',16);
            //$this->Image("../../file/Jatim.jpg",25,7,18);
            //$this->Cell(50);
            $this->Ln(7);
            $this->Cell(30,7,"Total Harga",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$this->total",0,0,'L');
            $this->Ln(10);
            $this->SetFont('Arial','',9);
            $this->Cell(50,7,"Berat Contoh Yang Harus Dibawa",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(40,7,"$dt[berat_contoh] Kg",0,0,'L');
            $this->Cell(40,7,"Tanggal Ambil Contoh",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[tgl_ambil]",0,0,'L');
            $this->Ln();
            $this->Cell(50,7,"Pendistribusian Contoh",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(40,7,"$dt[distribusi_contoh]",0,0,'L');
            $this->Cell(40,7,"Pendistribusian Hasil Uji",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[distribusi_hasil]",0,0,'L');
            $this->Ln();
            $this->Cell(50,7,"Tanggal Permohonan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(40,7,"$dt[tanggal]",0,0,'L');
            $this->Ln();
            $this->Cell(50,7,"Keterangan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Ln();
            $this->Cell(90,7,"$dt[keterangan]",1,0,'L');
            $this->Ln();
    }
    elseif($this->jenis=='ambilcontoh'){
        //include "library.php";
            $detail =mysql_query("SELECT permohonan.* ,detail_user.nama ,detail_user.telp ,detail_user.alamat_kantor ,detail_user.email FROM permohonan ,detail_user WHERE permohonan.id_user = detail_user.id_user AND permohonan.no_permohonan = $this->no");
            $dt = mysql_fetch_array($detail);


            //Column widths
            $this->SetFont('Arial','',16);
            //$this->Image("../../file/Jatim.jpg",25,7,18);
            //$this->Cell(50);
            $this->Ln(7);
            $this->Cell(30,7,"Total Harga",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$this->total",0,0,'L');
            $this->Ln(10);
            $this->SetFont('Arial','',9);
            $this->Cell(50,7,"Berat Contoh Yang Harus Dibawa",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(40,7,"$dt[berat_contoh]",0,0,'L');
            $this->Cell(40,7,"Tanggal Ambil Contoh",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[tgl_ambil]",0,0,'L');
            $this->Ln();
            $this->Cell(50,7,"Pendistribusian Contoh",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(40,7,"$dt[distribusi_contoh]",0,0,'L');
            $this->Cell(40,7,"Pendistribusian Hasil Uji",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[distribusi_hasil]",0,0,'L');
            $this->Ln();
            $this->Cell(50,7,"Tanggal Permohonan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(40,7,"$dt[tanggal]",0,0,'L');
            $this->Ln();
            $this->Cell(50,7,"Keterangan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Ln();
            $this->Cell(90,7,"$dt[keterangan]",1,0,'L');
            $this->Ln();
    }
    elseif($this->jenis=='terimacontoh'){
        //include "library.php";
            $detail =mysql_query("SELECT permohonan.* ,detail_user.nama ,detail_user.telp ,detail_user.alamat_kantor ,detail_user.email FROM permohonan ,detail_user WHERE permohonan.id_user = detail_user.id_user AND permohonan.no_permohonan = $this->no");
            $dt = mysql_fetch_array($detail);


            //Column widths
            $this->SetFont('Arial','',16);
            //$this->Image("../../file/Jatim.jpg",25,7,18);
            //$this->Cell(50);
            $this->Ln(7);
            $this->Cell(30,7,"Total Harga",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(60,7,"$this->total",0,0,'L');
            $this->Ln(10);
            $this->SetFont('Arial','',9);
            $this->Cell(50,7,"Berat Contoh Yang Harus Dibawa",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(40,7,"$dt[berat_contoh]",0,0,'L');
            $this->Cell(40,7,"Tanggal Ambil Contoh",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[tgl_ambil]",0,0,'L');
            $this->Ln();
            $this->Cell(50,7,"Pendistribusian Contoh",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(40,7,"$dt[distribusi_contoh]",0,0,'L');
            $this->Cell(40,7,"Pendistribusian Hasil Uji",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(10,7,"$dt[distribusi_hasil]",0,0,'L');
            $this->Ln();
            $this->Cell(50,7,"Tanggal Permohonan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Cell(40,7,"$dt[tanggal]",0,0,'L');
            $this->Ln();
            $this->Cell(50,7,"Keterangan",0,0,'L');
            $this->Cell(5,7,":",0,0,'L');
            $this->Ln();
            $this->Cell(90,7,"$dt[keterangan]",1,0,'L');
            $this->Ln();
    }
}

function SetWidths($w)
    {
    //Set the array of column widths
    $this->widths=$w;
    }
    

    function SetAligns($a)
    {
    //Set the array of column alignments
    $this->aligns=$a;
    }

    function CheckPageBreak($h)
    {
        //If the height h would cause an overflow, add a new page immediately
        if($this->GetY()+$h>$this->PageBreakTrigger)
            $this->AddPage($this->CurOrientation);
    }

    function NbLines($w,$txt)
    {
        //Computes the number of lines a MultiCell of width w will take
        $cw=&$this->CurrentFont['cw'];
        if($w==0)
            $w=$this->w-$this->rMargin-$this->x;
        $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
        $s=str_replace("\r",'',$txt);
        $nb=strlen($s);
        if($nb>0 and $s[$nb-1]=="\n")
            $nb--;
        $sep=-1;
        $i=0;
        $j=0;
        $l=0;
        $nl=1;
        while($i<$nb)
        {
            $c=$s[$i];
            if($c=="\n")
            {
                $i++;
                $sep=-1;
                $j=$i;
                $l=0;
                $nl++;
                continue;
            }
            if($c==' ')
                $sep=$i;
            $l+=$cw[$c];
            if($l>$wmax)
            {
                if($sep==-1)
                {
                    if($i==$j)
                        $i++;
                }
                else
                    $i=$sep+1;
                $sep=-1;
                $j=$i;
                $l=0;
                $nl++;
            }
            else
                $i++;
        }
        return $nl;
    }

    function Row($data){
        //Calculate the height of the row
        $nb=0;
        for($i=0;$i<count($data);$i++)
            $nb=max($nb,$this->NbLines($this->widths[$i],$data[$i]));
        $h=5*$nb;
        //Issue a page break first if needed
        $this->CheckPageBreak($h);
        //Draw the cells of the row
        for($i=0;$i<count($data);$i++){
            $w=$this->widths[$i];
            $a=isset($this->aligns[$i]) ? $this->aligns[$i] : 'C';
            //Save the current position
            $x=$this->GetX();
            $y=$this->GetY();
            //Draw the border
            $this->Rect($x,$y,0,$h);
            //Print the text
            $this->MultiCell($w,5,$data[$i],$a);
            //Put the position to the right of the cell
            $this->SetXY($x+$w,$y);
        }
        
        //Go to the next line
        $this->Ln($h);
    }
    
    function Rowca($data,$pangkat,$pangkatsu){
        //Calculate the height of the row
        $nb=0;
        for($i=0;$i<count($data);$i++)
            $nb=max($nb,$this->NbLines($this->widths[$i],$data[$i]));
        $h=5*$nb;
        //Issue a page break first if needed
        $this->CheckPageBreak($h);
        //Draw the cells of the row
        for($i=0;$i<count($data);$i++){
            $w=$this->widths[$i];
            $a=isset($this->aligns[$i]) ? $this->aligns[$i] : 'C';
            //Save the current position
            $x=$this->GetX();
            $y=$this->GetY();
            //Draw the border
            $this->Rect($x,$y,0,$h);
            
            $jml_kata = strlen($data[$i]);
            $space = 1.7*$jml_kata;
            //Print the text
            if($i==4){
                $this->MultiCell($w,5,$data[$i],$a);
                $this->SetFont('Arial','',7);
                $this->Text($x+$space, $y+2, $pangkat);
                $this->SetFont('Arial','',9);
            }elseif ($i==5){
                $this->MultiCell($w,5,$data[$i],$a);
                $this->SetFont('Arial','',7);
                $this->Text($x+$space, $y+2, $pangkat);
                $this->SetFont('Arial','',9);
            }else{
                $this->MultiCell($w,5,$data[$i],$a);
            }
            
            //Put the position to the right of the cell
            $this->SetXY($x+$w,$y);
        }
        
        //Go to the next line
        $this->Ln($h);
    } 
    
    function Rowhasil($data,$pangkat,$pangkatsu){
        //Calculate the height of the row
        $nb=0;
        for($i=0;$i<count($data);$i++)
            $nb=max($nb,$this->NbLines($this->widths[$i],$data[$i]));
        $h=5*$nb;
        //Issue a page break first if needed
        $this->CheckPageBreak($h);
        //Draw the cells of the row
        for($i=0;$i<count($data);$i++){
            $w=$this->widths[$i];
            $a=isset($this->aligns[$i]) ? $this->aligns[$i] : 'C';
            //Save the current position
            $x=$this->GetX();
            $y=$this->GetY();
            //Draw the border
            $this->Rect($x,$y,0,$h);
            
            $jml_kata = strlen($data[$i]);
            $space = 1.7*$jml_kata;
            //Print the text
            if($i==3){
                $this->MultiCell($w,5,$data[$i],$a);
                $this->SetFont('Arial','',7);
                $this->Text($x+$space, $y+2, $pangkat);
                $this->SetFont('Arial','',9);
            }elseif ($i==4){
                $this->MultiCell($w,5,$data[$i],$a);
                $this->SetFont('Arial','',7);
                $this->Text($x+$space, $y+2, $pangkat);
                $this->SetFont('Arial','',9);
            }else{
                $this->MultiCell($w,5,$data[$i],$a);
            }
            
            //Put the position to the right of the cell
            $this->SetXY($x+$w,$y);
        }
        
        //Go to the next line
        $this->Ln($h);
    }
}


$aksi=$_GET['aksi'];
$act=$_GET['act'];
$kode=$_GET['kode'];


if ($aksi=='pdf')
{
	$pdf=new PDF('P','mm', array(216, 330));
	$pdf->AliasNbPages();
	//Data loading
	$temp=mysql_query("SELECT temp.gambar FROM temp ,tb_ipem WHERE temp.sertifikat = tb_ipem.sertifikat AND tb_ipem.kd_sertifikat = $_GET[id]");
	$tm = mysql_fetch_array($temp);
	//$data=mysql_query("SELECT * FROM laboratorium WHERE id_pemeriksaan = $_GET[id] AND pemeriksaan = '$_GET[periksa]' ORDER BY orders");
	$pdf->SetFont('Arial','',9);
	$pdf->AddPage();
	$pdf->Image("../temp/$tm[gambar]", 0, 0, 200, 319);
	$pdf->Sertifikat();
	$pdf->Output();
}
elseif ($aksi=='pdfcetak')
{
	$pdf=new PDF('P','mm', array(216, 330));
	$pdf->AliasNbPages();
	//Data loading
	//$temp=mysql_query("SELECT temp.gambar FROM temp ,tb_ipem WHERE temp.sertifikat = tb_ipem.sertifikat AND tb_ipem.kd_sertifikat = $_GET[id]");
	//$tm = mysql_fetch_array($temp);
	//$data=mysql_query("SELECT * FROM laboratorium WHERE id_pemeriksaan = $_GET[id] AND pemeriksaan = '$_GET[periksa]' ORDER BY orders");
	$pdf->SetFont('Arial','',9);
	$pdf->AddPage();
        //$pdf->Image("../../file/skp.jpg", 0, 0, 200, 319);
	$pdf->Sertifikat();
	$pdf->Output();
}
elseif ($aksi=='pdfpengujian')
{
	
	$pdf=new PDF('P','mm', array(216, 330));
	//Column titles
	$pdf->AliasNbPages();
	$header=array('Parameter Uji','Titik Uji','Metode Uji','Waktu Uji(Hari)','Harga(IDR)','Status Uji');
	//Data loading
	$data=mysql_query("SELECT * FROM pengujian WHERE pengujian.no_permohonan = $_GET[no] GROUP BY pengujian.parameter_uji ORDER BY pengujian.id_pengujian DESC");
        $harga=mysql_query("SELECT pengujian.harga_total FROM pengujian WHERE pengujian.no_permohonan = $_GET[no] GROUP BY pengujian.parameter_uji");
        
        $total = 0;
        while ($p = mysql_fetch_array($harga)){
            $total = $total + $p[harga_total];
        }
        $pdf->jenis = 'pengujian';
        $pdf->no = $_GET[no];
        $pdf->total = $total;
	
	$pdf->AddPage();
	$pdf->TablePengujian($header,$data);
	$pdf->Output("Formpermohonan.pdf",I);
}
elseif ($aksi=='pdfverregister')
{
	
	$pdf=new PDF('P','mm', array(216, 330));
	//Column titles
	$pdf->AliasNbPages();
        
        $header=array('Parameter Uji','Titik Uji','Metode Uji','Waktu Uji(Hari)','Harga(IDR)','Status Uji');
	//Data loading
	$data=mysql_query("SELECT * FROM pengujian WHERE pengujian.no_permohonan = $_GET[no] GROUP BY pengujian.parameter_uji ORDER BY pengujian.id_pengujian DESC");
        $harga=mysql_query("SELECT pengujian.harga_total FROM pengujian WHERE pengujian.no_permohonan = $_GET[no] GROUP BY pengujian.parameter_uji");
        
        $total = 0;
        while ($p = mysql_fetch_array($harga)){
            $total = $total + $p[harga_total];
        }
        $pdf->jenis = 'pengujian';
        $pdf->no = $_GET[no];
        $pdf->total = $total;
	
	$pdf->AddPage();
	$pdf->TablePengujian($header,$data);
        $pdf->jenis = 'verregister';
	$pdf->AddPage();
        $pdf->verregister();
        $pdf->jenis = '';
	$pdf->Output("Formverifikasipermohonan.pdf",I);
}
elseif ($aksi=='pdfterimacontoh')
{
	
	$pdf=new PDF('P','mm', array(216, 330));
	//Column titles
	$pdf->AliasNbPages();
        
        $header=array('Parameter Uji','Titik Uji','Metode Uji','Waktu Uji(Hari)','Harga(IDR)','Status Uji');
	//Data loading
	$data=mysql_query("SELECT * FROM pengujian WHERE pengujian.no_permohonan = $_GET[no] GROUP BY pengujian.parameter_uji ORDER BY pengujian.id_pengujian DESC");
        $harga=mysql_query("SELECT pengujian.harga_total FROM pengujian WHERE pengujian.no_permohonan = $_GET[no] GROUP BY pengujian.parameter_uji");
        
        $total = 0;
        while ($p = mysql_fetch_array($harga)){
            $total = $total + $p[harga_total];
        }
        $pdf->jenis = 'pengujian';
        $pdf->no = $_GET[no];
        $pdf->total = $total;
	
	$pdf->AddPage();
	$pdf->TablePengujian($header,$data);
        $pdf->jenis = 'terimacontoh';
	$pdf->AddPage();
        $pdf->terimacontoh();
        $pdf->jenis = '';
	$pdf->Output("Formpenerimaancontoh.pdf",I);
}
elseif ($aksi=='pdfambilcontoh')
{
	
	$pdf=new PDF('P','mm', array(216, 330));
	//Column titles
	$pdf->AliasNbPages();
        
        $header=array('Parameter Uji','Titik Uji','Metode Uji','Waktu Uji(Hari)','Harga(IDR)','Status Uji');
	//Data loading
	$data=mysql_query("SELECT * FROM pengujian WHERE pengujian.no_permohonan = $_GET[no] GROUP BY pengujian.parameter_uji ORDER BY pengujian.id_pengujian DESC");
        $harga=mysql_query("SELECT pengujian.harga_total FROM pengujian WHERE pengujian.no_permohonan = $_GET[no] GROUP BY pengujian.parameter_uji");
        
        $total = 0;
        while ($p = mysql_fetch_array($harga)){
            $total = $total + $p[harga_total];
        }
        $pdf->jenis = 'pengujian';
        $pdf->no = $_GET[no];
        $pdf->total = $total;
	
	$pdf->AddPage();
	$pdf->TablePengujian($header,$data);
        $pdf->jenis = 'ambilcontoh';
	$pdf->AddPage();
        $pdf->ambilcontoh();
        $pdf->jenis = '';
	$pdf->Output("Formpengambilancontoh.pdf",I);
}
elseif ($aksi=='pdfbayar')
{
	
	$pdf=new PDF('P','mm', array(216, 330));
	//Column titles
	$pdf->AliasNbPages();
	$header=array('Parameter Uji','Titik Uji','Harga(IDR)','Jumlah(IDR)');
	//Data loading
	$data=mysql_query("SELECT * FROM pengujian WHERE pengujian.no_permohonan = $_GET[no] GROUP BY pengujian.parameter_uji ORDER BY pengujian.id_pengujian DESC");
        $harga=mysql_query("SELECT pengujian.harga_total FROM pengujian WHERE pengujian.no_permohonan = $_GET[no] GROUP BY pengujian.parameter_uji");
        
        $total = 0;
        while ($p = mysql_fetch_array($harga)){
            $total = $total + $p[harga_total];
        }
        
        $pdf->jenis = 'bayar';
        $pdf->no = $_GET[no];
        $pdf->total = $total;
	
	$pdf->AddPage();
	$pdf->Tablebayar($header,$data,$total);
	$pdf->Output("Formpembayaran.pdf",I);
}
elseif ($aksi=='pdfharian1')
{
	
	$pdf=new PDF('P','mm', array(216, 330));
	//Column titles
	$pdf->AliasNbPages();
	$header=array('Nomer','Nomer Lab','Titik Uji','CAP(mg/kg)','Keterangan');
	//Data loading
	$data=mysql_query("SELECT permohonan.no_lab ,pengujian.titik_uji FROM permohonan ,pengujian WHERE permohonan.no_permohonan = pengujian.no_permohonan AND pengujian.kode = '$_GET[nama]' AND permohonan.tanggal_pemeriksaan = '$_GET[tgl]' ORDER BY permohonan.no_lab, pengujian.titik_uji");
	
        $pdf->jenis = 'harian';
        $pdf->nama = $_GET[nama];
        
	$pdf->AddPage();
        $pdf->Tableharian1($header,$data);
        //$pdf->Footerbayar($_GET[no]);
	$pdf->Output("Formharian.pdf",I);
}
elseif ($aksi=='pdfharian2')
{
	
	$pdf=new PDF('P','mm', array(216, 330));
	//Column titles
	$pdf->AliasNbPages();
	$header=array('Nomer','Nomer Lab','Titik Uji','AOZ','AMOZ','SEM','AHD','Keterangan');
	//Data loading
	$data=mysql_query("SELECT permohonan.no_lab ,pengujian.titik_uji FROM permohonan ,pengujian WHERE permohonan.no_permohonan = pengujian.no_permohonan AND pengujian.parameter_uji = '$_GET[nama]' AND permohonan.tanggal_pemeriksaan = '$_GET[tgl]' ORDER BY permohonan.no_lab, pengujian.titik_uji");
	
	$pdf->jenis = 'harian';
        $pdf->nama = $_GET[nama];
        
        $pdf->AddPage();
	$pdf->Tableharian2($header,$data);
        //$pdf->Footerbayar($_GET[no]);
	$pdf->Output("Formharian.pdf",I);
}
elseif ($aksi=='pdfharian3')
{
	
	$pdf=new PDF('P','mm', array(216, 330));
	//Column titles
	$pdf->AliasNbPages();
	$header=array('Nomer','Nomer Lab','Titik Uji','Hg(mg/kg)','Keterangan');
	//Data loading
	$data=mysql_query("SELECT permohonan.no_lab ,pengujian.titik_uji FROM permohonan ,pengujian WHERE permohonan.no_permohonan = pengujian.no_permohonan AND pengujian.parameter_uji = '$_GET[nama]' AND permohonan.tanggal_pemeriksaan = '$_GET[tgl]' ORDER BY permohonan.no_lab, pengujian.titik_uji");
	
	$pdf->jenis = 'harian';
        $pdf->nama = $_GET[nama];
        
        $pdf->AddPage();
	$pdf->Tableharian1($header,$data);
        //$pdf->Footerbayar($_GET[no]);
	$pdf->Output("Formharian.pdf",I);
}
elseif ($aksi=='pdfharian4')
{
	
	$pdf=new PDF('P','mm', array(216, 330));
	//Column titles
	$pdf->AliasNbPages();
	$header=array('Nomer','Nomer Lab','Titik Uji','Cd(mg/kg)','Pb(mg/kg)','Keterangan');
	//Data loading
	$data=mysql_query("SELECT permohonan.no_lab ,pengujian.titik_uji FROM permohonan ,pengujian WHERE permohonan.no_permohonan = pengujian.no_permohonan AND pengujian.parameter_uji = '$_GET[nama]' AND permohonan.tanggal_pemeriksaan = '$_GET[tgl]' ORDER BY permohonan.no_lab, pengujian.titik_uji");
	
	$pdf->jenis = 'harian';
        $pdf->nama = $_GET[nama];
        
        $pdf->AddPage();
	$pdf->Tableharian3($header,$data);
        //$pdf->Footerbayar($_GET[no]);
	$pdf->Output("Formharian.pdf",I);
}
elseif ($aksi=='pdfharian5')
{
	
	$pdf=new PDF('P','mm', array(216, 330));
	//Column titles
	$pdf->AliasNbPages();
	$header=array('Nomer','Nomer Lab','Titik Uji','Absorban','Konsentrasi','Keterangan');
	//Data loading
	$data=mysql_query("SELECT permohonan.no_lab ,pengujian.titik_uji FROM permohonan ,pengujian WHERE permohonan.no_permohonan = pengujian.no_permohonan AND pengujian.parameter_uji = '$_GET[nama]' AND permohonan.tanggal_pemeriksaan = '$_GET[tgl]' ORDER BY permohonan.no_lab, pengujian.titik_uji");
	
	$pdf->jenis = 'harian';
        $pdf->nama = $_GET[nama];
        
        $pdf->AddPage();
	$pdf->Tableharian3($header,$data);
        //$pdf->Footerbayar($_GET[no]);
	$pdf->Output("Formharian.pdf",I);
}
elseif ($aksi=='pdfharian6')
{
	
	$pdf=new PDF('P','mm', array(216, 330));
	//Column titles
	$pdf->AliasNbPages();
	$header=array('Nomer','Nomer Lab','Titik Uji','Kadar Air(%)','Keterangan');
	//Data loading
	$data=mysql_query("SELECT permohonan.no_lab ,pengujian.titik_uji FROM permohonan ,pengujian WHERE permohonan.no_permohonan = pengujian.no_permohonan AND pengujian.parameter_uji = '$_GET[nama]' AND permohonan.tanggal_pemeriksaan = '$_GET[tgl]' ORDER BY permohonan.no_lab, pengujian.titik_uji");
	
	$pdf->jenis = 'harian';
        $pdf->nama = $_GET[nama];
        
        $pdf->AddPage();
	$pdf->Tableharian1($header,$data);
        //$pdf->Footerbayar($_GET[no]);
	$pdf->Output("Formharian.pdf",I);
}
elseif ($aksi=='pdfharian7')
{
	
	$pdf=new PDF('P','mm', array(216, 330));
	//Column titles
	$pdf->AliasNbPages();
	$header=array('Nomer','Nomer Lab','Titik Uji','KCSN Awal(Ml)','KCSN Akhir(Ml)','Kadar Garam(%)','Keterangan');
	//Data loading
	$data=mysql_query("SELECT permohonan.no_lab ,pengujian.titik_uji FROM permohonan ,pengujian WHERE permohonan.no_permohonan = pengujian.no_permohonan AND pengujian.parameter_uji = '$_GET[nama]' AND permohonan.tanggal_pemeriksaan = '$_GET[tgl]' ORDER BY permohonan.no_lab, pengujian.titik_uji");
	
	$pdf->jenis = 'harian';
        $pdf->nama = $_GET[nama];
        
        $pdf->AddPage();
	$pdf->Tableharian4($header,$data);
        //$pdf->Footerbayar($_GET[no]);
	$pdf->Output("Formharian.pdf",I);
}
elseif ($aksi=='pdfharian8')
{
	
	$pdf=new PDF('P','mm', array(216, 330));
	//Column titles
	$pdf->AliasNbPages();
	$header=array('Nomer','Nomer Lab','Titik Uji','TC','OTC','CTC','Keterangan');
	//Data loading
	$data=mysql_query("SELECT permohonan.no_lab ,pengujian.titik_uji FROM permohonan ,pengujian WHERE permohonan.no_permohonan = pengujian.no_permohonan AND pengujian.parameter_uji = '$_GET[nama]' AND permohonan.tanggal_pemeriksaan = '$_GET[tgl]' ORDER BY permohonan.no_lab, pengujian.titik_uji");
	
	$pdf->jenis = 'harian';
        $pdf->nama = $_GET[nama];
        
        $pdf->AddPage();
	$pdf->Tableharian7($header,$data);
        //$pdf->Footerbayar($_GET[no]);
	$pdf->Output("Formharian.pdf",I);
}
elseif ($aksi=='pdfharian9')
{
	
	$pdf=new PDF('L','mm', array(330, 216));
	//Column titles
	$pdf->AliasNbPages();
	$header=array('Nomer','Nomer Lab','Titik Uji','Aerob','Anaerob','Kesimpulan');
	//Data loading
	$data=mysql_query("SELECT permohonan.no_lab ,pengujian.titik_uji FROM permohonan ,pengujian WHERE permohonan.no_permohonan = pengujian.no_permohonan AND pengujian.parameter_uji = '$_GET[nama]' AND permohonan.tanggal_pemeriksaan = '$_GET[tgl]' ORDER BY permohonan.no_lab, pengujian.titik_uji");
	
	$pdf->jenis = 'harian';
        $pdf->nama = $_GET[nama];
        
        $pdf->AddPage();
	$pdf->Tableharian3($header,$data);
        //$pdf->Footerbayar($_GET[no]);
	$pdf->Output("Formharian.pdf",I);
}
elseif ($aksi=='pdfhasil')
{
	
	$pdf=new PDF('P','mm', array(216, 330));
	//Column titles
	$pdf->AliasNbPages();
	$header=array('Nomer','Parameter Uji','Titik Uji','Hasil Pengujian','Batas Standart','Satuan','Metode Pengujian');
	//Data loading
	$data=mysql_query("SELECT * FROM pengujian WHERE pengujian.no_permohonan = $_GET[no] ORDER BY pengujian.id_pengujian");
        
        $pdf->jenis = 'hasil';
        $pdf->no = $_GET[no];
	
	$pdf->AddPage();
	$pdf->Tablehasil($header,$data);
        //$pdf->Footerhasil();
	$pdf->Output("Lembarhasiluji.pdf",I);
}
elseif ($aksi=='pdfhasilakreditasi')
{
	
	$pdf=new PDF('P','mm', array(216, 330));
	//Column titles
	$pdf->AliasNbPages();
	$header=array('No','Parameter Uji','kode','Titik Uji','Hasil Pengujian','Batas Standart','Satuan','Metode Pengujian');
        $inggris=array('No','Testing Parameter','code','Test Points','Test Result','Limit of Standart','Unit','Test Methods');
	//Data loading
	$data=mysql_query("SELECT * FROM pengujian WHERE pengujian.status_uji = 'Terakreditasi' AND pengujian.no_permohonan = $_GET[no] ORDER BY pengujian.id_pengujian");
        
        $pdf->jenis = 'hasilakreditasi';
        $pdf->no = $_GET[no];
        $pdf->header = $header;
        $pdf->inggris = $inggris;
	
	$pdf->AddPage();
	$pdf->Tableca($data);
	$pdf->Output("Lembarhasiluji.pdf",I);
}
elseif ($aksi=='pdfhasiltidakakreditasi')
{
	
	$pdf=new PDF('P','mm', array(216, 330));
	//Column titles
	$pdf->AliasNbPages();
	$header=array('Nomer','Parameter Uji','Titik Uji','Hasil Pengujian','Batas Standart','Satuan','Metode Pengujian');
        $header=array('No','Parameter Uji','kode','Titik Uji','Hasil Pengujian','Batas Standart','Satuan','Metode Pengujian');
        $inggris=array('No','Testing Parameter','code','Test Points','Test Result','Limit of Standart','Unit','Test Methods');
	//Data loading
	$data=mysql_query("SELECT * FROM pengujian WHERE pengujian.status_uji = '' AND pengujian.no_permohonan = $_GET[no] ORDER BY pengujian.id_pengujian");
        
        $pdf->jenis = 'hasiltidakakreditasi';
        $pdf->no = $_GET[no];
        $pdf->header = $header;
        $pdf->inggris = $inggris;
	
	$pdf->AddPage();
	$pdf->Tableca($data);
	$pdf->Output("Lembarhasiluji.pdf",I);
}
elseif ($aksi=='pdforder')
{
	
	$pdf=new PDF('P','mm', array(216, 330));
	//Column titles
	$pdf->AliasNbPages();
	$header=array('No','Nomer Lab','Laboratorium','Titik Uji','Parameter Uji');
	//Data loading
	$data=mysql_query("SELECT permohonan.no_lab ,lab.nama ,pengujian.jml_titik_uji ,pengujian.parameter_uji FROM permohonan ,lab ,pengujian WHERE permohonan.no_permohonan = pengujian.no_permohonan AND lab.id_lab = pengujian.lab AND permohonan.tanggal_pemeriksaan = '$_GET[tgl]' AND permohonan.kirim = 'Y' AND permohonan.verifikasi = 'Y' AND permohonan.pembayaran = 'Y' AND permohonan.contoh = 'Y' GROUP BY pengujian.parameter_uji ORDER BY no_lab ,nama");
        
        $pdf->jenis = 'order';
        $pdf->tgl = $_GET[tgl];
	
	$pdf->AddPage();
	$pdf->Tableorder($header,$data);
        //$pdf->Footerhasil();
	$pdf->Output("Lembarorderuji.pdf",I);
}
?>