$pdf->AddPage(); $pdf->SetFont('Arial', 'B', 12); $pdf->SetX(2); $pdf->Cell(0, 0, 'ANALISIS MINERAL BUTIR (AYAK)', 0, 0, 'C'); $pdf->Ln(1); /* * KETERANGAN */ $pdf->SetFont('Arial', 'B', 9); $pdf->Cell(3.1, 1, 'No. Conto', 1); $pdf->SetFont('Arial', '', 9); $pdf->Cell(2.6, 1, no_conto($conto->id_conto), 1); $pdf->SetFont('Arial', 'B', 9); $pdf->Cell(2.5, 1, 'Pemilik', 1); $pdf->SetFont('Arial', '', 9); $pdf->Cell(6, 1, nama_pemohon($id_pemohon), 1); $pdf->SetFont('Arial', 'B', 9); $pdf->Cell(2.5, 1, 'Pemeriksa', 1); $pdf->SetFont('Arial', '', 9); $pdf->Cell(3, 1, 'PSDG', 1); $pdf->Ln(1); $pdf->SetFont('Arial', 'B', 9); $pdf->Cell(3.1, 1, 'Lokasi Daerah', 1); $pdf->SetFont('Arial', '', 9); $pdf->Cell(4, 1, $lokasi, 1); $pdf->SetFont('Arial', 'B', 9); $pdf->Cell(2.5, 1, 'Nama Batuan', 1); $pdf->SetFont('Arial', '', 9); $pdf->Cell(4.6, 1, $jenis_conto, 1); $pdf->SetFont('Arial', 'B', 9); $pdf->Cell(2.5, 1, 'Tanggal', 1);
function tabel_kimia($list_conto, $id, $nomor_analisis, $jumlah_conto, $jenis_conto, $lokasi, $id_pemohon, $kode_conto = 'KC') { $CI =& get_instance(); $CI->load->model('hasil_analisis_m'); $this->addpage(); $this->SetFont('Arial', 'B', 12); $this->Cell(0, 0, 'HASIL ANALISIS KIMIA', 0, 0, 'C'); $this->Ln(1); /* * Keterangan */ $this->SetX(3); $this->SetFont('Arial', 'B', 9); $this->Cell(6.1, 0.5, 'NOMOR ANALISIS'); $this->Cell(2.6, 0.5, ': ' . $nomor_analisis); $this->ln(); $this->SetX(3); $this->Cell(6.1, 0.5, 'CONTO YANG DIANALISIS'); $this->Cell(2.6, 0.5, ': ' . $jumlah_conto . ' Conto ' . $jenis_conto); $this->ln(); $this->SetX(3); $this->Cell(6.1, 0.5, 'LOKASI'); $this->Cell(2.6, 0.5, ': ' . $lokasi); $this->ln(); $this->SetX(3); $this->Cell(6.1, 0.5, 'ANALISIS UNTUK'); $this->Cell(2.6, 0.5, ': ' . nama_pemohon($id_pemohon)); $this->ln(1); /* * END KETERANGAN */ // $this->cell(3.1,1,'KODE CONTO',1,0,'C'); $i = 1; // foreach($list_conto as $data=>$val): // $this->cell(2.8,1,$kode_conto.' - '.str_pad($i++, 3, 0, STR_PAD_LEFT),1,0,'C'); // endforeach; $parameter = $CI->hasil_analisis_m->pakai_satuan($id); $th = array('KODE CONTO'); $wth = array(3.1); $ath = array('C'); $parameter_nonsatuan = array('KMKGB01', 'KMKGB02', 'KMBAK01', 'KPBTH02'); // kolom parameter foreach ($parameter as $param) { $nama = $param->nama; // singkatan if ($nama == 'Drilling Mud Test (Viskositas Relatif)' or $nama == 'Drilling Mud Test (CEC, Ca &Mg)' or $nama == 'Drilling Mud Test (Viskositas Absolut)') { $nama = 'DMT'; } elseif ($nama == 'Methylene Blue Test') { $nama = 'MBT'; } // parameter dipakai // tampilkan jika parameter ada satuan dan parameter bukan bagian dari parameter tanpa satuan if (!empty($param->satuan) or in_array(strtoupper($param->id_parameter), $parameter_nonsatuan)) { if (empty($param->satuan)) { $satuan = ''; } else { $satuan = "\n (" . $param->satuan . ")"; } $cek_sign_fix = iconv("UTF-8", "windows-1252", $nama); $satuan = iconv("UTF-8", "windows-1252", $satuan); $cek_sign_fix = $cek_sign_fix . $satuan; array_push($th, $cek_sign_fix); // width th array_push($wth, 1.5); array_push($ath, 'C'); } } $this->SetWidths($wth); $this->SetAligns($ath); $this->Row($th); // end kolom parameter // kolom conto $metoda_dipakai = array(); $list_conto = $CI->hasil_analisis_m->get_conto_by_no_analisis($id); foreach ($list_conto as $conto) { $this->cell(3.1, 1, $kode_conto . ' - ' . str_pad($i++, 3, 0, STR_PAD_LEFT), 1, 0, 'C'); foreach ($parameter as $param) { // tampilkan jika parameter ada satuan // dan parameter bukan bagian dari parameter tanpa satuan if (!empty($param->satuan) or in_array(strtoupper($param->id_parameter), $parameter_nonsatuan)) { $nilai = nilai($conto->id, $param->id_parameter, FALSE, $param->satuan); $this->SetFont('Arial', '', 9); $this->cell(1.5, 1, $nilai[0], 1, 0, 'C'); $this->SetFont('Arial', 'B', 9); } // ambil 5 karakter dari id parameter karena merupakan id type analisis array_push($metoda_dipakai, substr($param->id_parameter, 0, 5)); } $this->ln(); } // end kolom conto // type analisis jika type = kml if (substr($id, 5, 3) == 'kml') { $metoda_dipakai_unique = array_unique($metoda_dipakai); foreach ($metoda_dipakai_unique as $key => $metoda) { $nama_metoda = $CI->type_analisis_m->get_nama($metoda); $this->SetFont('Arial', 'B', 8); // width metoda $w_m = 3.5; // jika fmbse size = 5 if ($metoda == 'FMBSE') { $w_m = 6; } $this->cell($w_m, 0.5, $nama_metoda . ":", 0, 0, ''); $uji_parameter_by_metode = $CI->hasil_analisis_m->get_uji_param_by_type_analisis($metoda); $this->SetFont('Arial', '', 8); foreach ($uji_parameter_by_metode as $uji_param) { $this->cell(0.8, 0.5, implode(",", $uji_param), 0, 0); } $this->ln(); } } // catatan $this->SetFont('Arial', 'BU', 8); $this->cell(4, 0.5, "Catatan:", 0, 0); $this->SetFont('Arial', '', 8); $this->ln(); $this->cell(4, 0.5, "1 % = 10.000 ppm", 0, 0); $this->ln(); $this->cell(4, 0.5, "1 ppm (gr/ton) = 1000 ppb", 0, 0); }