function CetakLaporan($prevtahun, $tahun, $nexttahun, $urutan, $gel) { include_once "../fpdf.php"; require_once "../phplot.php"; $lbr = 190; // Buat Graph dan dimasukkan ke file dulu $piepath = '../tmp/data_fakta_pmb_pie_graph.png'; BuatPieGraph($piepath, $prevtahun, $tahun, $urutan, $gel); // *** Cetak *** $pdf = new FPDF('P', 'mm', 'A4'); $pdf->SetTitle("LAPORAN SUMBER INFORMASI PMB TAHUN AJARAN {$tahun}/{$nexttahun} GELOMBANG " . UbahKeRomawiLimit99($urutan)); $pdf->AddPage('P'); BuatHeaderLap($prevtahun, $tahun, $pdf); TampilkanGraph($piepath, 20, 30, 144, 96, $pdf); TampilkanSumberInformasi(30, 150, $prevtahun, $tahun, $urutan, $gel, $pdf); $pdf->Output(); }
function TampilkanIsinya($prevtahun, $tahun, $arrStatusAplikan, $arrGelombang, $p) { $t = 3; $lebar = 9; $arrCurTotal = array(); $arrPrevTotal = array(); BuatHeaderTabel($arrStatusAplikan, $lebar, $prevtahun, $tahun, $p); for ($i = 0; $i < sizeof($arrGelombang); $i++) { $p->SetFont('Helvetica', 'B', 6); $p->Cell($lebar, $t, UbahKeRomawiLimit99($arrGelombang[$i]), 1, 0, 'C'); $p->SetFont('Helvetica', '', 6); BuatEntry($arrGelombang[$i], $arrStatusAplikan, $arrPrevTotal, $arrCurTotal, $t, $lebar, $prevtahun, $tahun, $p); $p->Ln($t); } BuatTotal($arrStatusAplikan, $arrPrevTotal, $arrCurTotal, $lebar, $tahun, $p); return $arrTotal; }
function BuatHeaderTabel($arrPejabatID, $arrGelombang, $lebar, $prevtahun, $tahun, $p) { $t = 6; $p->SetFont('Helvetica', 'B', 8); // Baris 1 $p->Cell(8, $t, "", 'LT', 0); $p->Cell($lebar, $t, '', 'LTR', 0); $p->Cell(sizeof($arrGelombang) * $lebar, $t, 'TGL UJIAN', 'T', 0, 'C'); $p->Cell($lebar + 4, $t, "", 'LT', 0); $p->Cell($lebar + 4, $t, "", 'LT', 0); $p->Cell($lebar + 4, $t, "TOTAL", 'LTR', 0, 'C'); $p->Ln($t); // Baris 2 $p->Cell(8, $t, "NO", 'L', 0); $p->Cell($lebar, $t, 'NAMA', 'LR', 0, 'C'); foreach ($arrGelombang as $stat) { $p->Cell($lebar, $t, UbahKeRomawiLimit99($stat), 1, 0, 'C'); } $p->Cell($lebar + 4, $t, "WAWANCARA", 'L', 0, 'C'); $p->Cell($lebar + 4, $t, "SUPPORTING", 'L', 0, 'C'); $p->Cell($lebar + 4, $t, "SEMUA", 'LR', 0, 'C'); $p->Ln($t); //Baris 3 $p->Cell(8, $t, "", 'L', 0); $p->Cell($lebar, $t, '', 'LR', 0); foreach ($arrGelombang as $stat) { $tglujian = GetaField('pmbperiod', "Tahun='{$tahun}' and Urutan='{$stat}' and KodeID", KodeID, "date_format(UjianMulai, '%d-%b-%Y')"); $p->Cell($lebar, $t, $tglujian, 1, 0, 'C'); } $p->Cell($lebar + 4, $t, "", 'L', 0); $p->Cell($lebar + 4, $t, "", 'L', 0); $p->Cell($lebar + 4, $t, "KEHADIRAN", 'LR', 0, 'C'); $p->Ln($t); }
function Isinya($pmbformulir, $p) { $t = 3.8; $lettersize = 8; //$style = array('width' => 0.5, 'cap' => 'round', 'join' => 'round', 'dash' => '0, 10', 'color' => array(0, 0, 0)); //SetLineStyle($style, $p); $arrBaris = array(); // I. Indentifikasi Pendaftaran $arrBaris[] = array('R', 'Indentifikasi Pendaftaran'); $arrBaris[] = array(); $arrBaris[] = array('N', 'No. Formulir', ':', '=LINES=', '=LINES=', '=LINES='); $arrBaris[] = array('N', 'Nama Calon Mahasiswa', ':', '=LINES=', '=LINES=', '=LINES='); $arrBaris[] = array('N', 'Alamat Lengkap', ':', '=LINES=', '=LINES=', '=LINES='); $arrBaris[] = array('', '', '', '=LINES=', 'RT =LINES=', 'RW =LINES='); $arrBaris[] = array('', '', '', 'Kota =LINES=', 'Propinsi =LINES=', 'Kode Pos =LINES='); $arrBaris[] = array('N', 'Telepon Rumah / HP', ':', '=LINES=', '=LINES=', '=LINES='); $arrBaris[] = array('N', 'Alamat Email', ':', '=LINES=', '=LINES=', '=LINES='); $arrBaris[] = array('N', 'Khusus untuk calon dari luar kota'); $arrBaris[] = array('', 'Alamat yang bisa dihubungi', ':', '=LINES=', '=LINES=', '=LINES='); $arrBaris[] = array('', '', '', '=LINES=', 'RT=LINES=', 'RW=LINES='); $arrBaris[] = array('', '', '', 'Kota=LINES=', 'Propinsi=LINES=', 'Kode Pos=LINES='); $arrBaris[] = array('N', 'Tempat Tinggal', ':', 'Asrama/Sendiri/Keluarga/Indekos/Lain-lain *)'); $arrBaris[] = array('N', 'Status', ':', 'Belum Menikah/Menikah/Janda/Duda *)'); $arrBaris[] = array('N', 'Jenis Kelamin', ':', 'Pria/Wanita *)'); $arrBaris[] = array('N', 'Agama', ':', '=LINES=', '=LINES=', '=LINES='); $arrBaris[] = array('N', 'Kewarganegaraan', ':', 'WNI/WNA *)'); $arrBaris[] = array(); // II . Data Otang Tua/ Wali $arrBaris[] = array('R', 'Data Orang Tua/Wali'); $arrBaris[] = array(); $arrBaris[] = array('N', 'Nama Orang Tua/Wali', ':', '=LINES=', '=LINES=', '=LINES='); $arrBaris[] = array('N', 'Alamat Lengkap', ':', '=LINES=', '=LINES=', '=LINES='); $arrBaris[] = array('', '', '', '=LINES=', 'RT=LINES=', 'RW=LINES='); $arrBaris[] = array('', '', '', 'Kota=LINES=', 'Propinsi=LINES=', 'Kode Pos=LINES='); $arrBaris[] = array('N', 'Telepon Rumah/HP', ':', '=LINES=', '=LINES=', '=LINES='); $arrBaris[] = array('N', 'Pekerjaan Orang Tua/Wali', ':', '=LINES=', '=LINES=', '=LINES='); $arrBaris[] = array('N', 'Pendidikan Orang Tua/Wali', ':', '=LINES=', '=LINES=', '=LINES='); $arrBaris[] = array('N', 'Keadaan Ayah/Ibu', ':', 'Ayah', ': Masih Hidup/Sudah Meninggal *)'); $arrBaris[] = array('', '', '', 'Ibu', ': Masih Hidup/Sudah Meninggal *)'); $arrBaris[] = array('N', 'Biaya Studi', ':', 'Orang Tua/Wali/Ikatan Dinas/Sendiri/Beasiswa/Lain2 *)'); $arrBaris[] = array(); // III. Data Ijazah Terakhir $arrBaris[] = array('R', 'Data Ijazah Terakhir'); $arrBaris[] = array(); $arrBaris[] = array('N', 'Nama Asal Sekolah', ':', '=LINES=', '=LINES=', '=LINES='); $arrBaris[] = array('N', 'Alamat Sekolah', ':', '=LINES=', '=LINES=', '=LINES='); $arrBaris[] = array('N', 'Nilai UAN', ':', '=LINES=', '=LINES=', '=LINES='); $arrBaris[] = array('N', 'Tahun Ijazah', ':', '=LINES=', '=LINES=', '=LINES='); $arrBaris[] = array(); $arrBaris[] = array('R', 'Detail Pekerjaan (Bila sudah bekerja)'); $arrBaris[] = array(); $arrBaris[] = array('N', 'Nama Perusahaan', ':', '=LINES=', '=LINES=', '=LINES='); $arrBaris[] = array('N', 'Alamat Perusahaan', ':', '=LINES=', '=LINES=', '=LINES='); $arrBaris[] = array('N', 'No. Telepon dan Fax', ':', '=LINES=', '=LINES=', '=LINES='); $arrBaris[] = array('N', 'Jabatan Saat Ini', ':', '=LINES=', '=LINES=', '=LINES='); $arrBaris[] = array(); $Kolom1 = 50; $IndenKolom1 = 5; $Kolom2 = 5; $Kolom3 = 45; $Kolom4 = 45; $Kolom5 = 45; $n = 0; $nr = 0; foreach ($arrBaris as $baris) { $type = @$baris[0]; if ($type == 'R') { $style = 'B'; $Kolom1x = $Kolom1; $nr++; $numbering = UbahKeRomawiLimit99($nr) . '.'; } else { if ($type == 'N') { $style = ''; $Kolom1x = $Kolom1 - $IndenKolom1; $p->Cell($IndenKolom1, $t, '', 0, 0); $n++; $numbering = $n . '.'; } else { $style = ''; $Kolom1x = $Kolom1 - $IndenKolom1; $p->Cell($IndenKolom1, $t, '', 0, 0); $numbering = ''; } } $p->SetFont('Helvetica', $style, $lettersize); // Print kolom 1 $p->Cell($Kolom1x, $t, $numbering . ' ' . @$baris[1], 0, 0); // Print kolom 2 $p->Cell($Kolom2, $t, @$baris[2], 0, 0); // Print kolom 3 $arrLines = array(); $baris[3] = isset($baris[3]) ? $baris[3] : ''; if ($baris[3] == '=LINES=') { $arrLines[] = array($p->GetX(), $Kolom3); } else { if (strpos($baris[3], '=LINES=') > 0) { $stringwidth = $p->GetStringWidth(TRIM(str_replace('=LINES=', '', $baris[3]))); $arrLines[] = array($p->GetX() + $stringwidth, $Kolom3 - $stringwidth); } } $p->Cell($Kolom3, $t, str_replace('=LINES=', '', $baris[3]), 0, 0); // Print kolom 4 $baris[4] = isset($baris[4]) ? $baris[4] : ''; if (TRIM($baris[4]) == '=LINES=') { $arrLines[] = array($p->GetX(), $Kolom4); } else { if (strpos($baris[4], '=LINES=') > 0) { $stringwidth = $p->GetStringWidth(TRIM(str_replace('=LINES=', '', $baris[4]))); $arrLines[] = array($p->GetX() + $stringwidth, $Kolom4 - $stringwidth); } } $p->Cell($Kolom4, $t, TRIM(str_replace('=LINES=', '', $baris[4])), 0, 0); $baris[5] = isset($baris[5]) ? $baris[5] : ''; if (TRIM($baris[5]) == '=LINES=') { $arrLines[] = array($p->GetX(), $Kolom5); } else { if (strpos($baris[5], '=LINES=') > 0) { $stringwidth = $p->GetStringWidth(TRIM(str_replace('=LINES=', '', $baris[5]))); $arrLines[] = array($p->GetX() + $stringwidth, $Kolom5 - $stringwidth); } } // Print kolom 5 $p->Cell($Kolom5, $t, TRIM(str_replace('=LINES=', '', $baris[5])), 0, 0); // Print garis if (!empty($arrLines)) { $Y = $p->GetY(); $count = count($arrLines); foreach ($arrLines as $line) { $p->SetXY($line[0] + 1, $Y); $p->Cell($line[1], $t - 1.3, '', 'B', 0); } } $p->Ln($t); } // Tambahkan Pas Foto dann Tanda Tanda Tangan di bagian paling bawah $p->Ln($t); $p->Cell(10, $t, '', 0, 0); $p->Cell(30, 40, '4X6', 1, 0, 'C'); $p->Cell(100, $t, '', 0, 0); $p->Cell(20, $t, GetaField('identitas', 'Kode', KodeID, 'Kota') . ', ______________'); $p->Ln(8); $p->Cell(140, $t, '', 0, 0); $p->Cell(20, $t, 'Tanda Tangan Pendaftar', 0, 0); $p->Ln(27); $p->Cell(140, $t, '', 0, 0); $p->Cell(20, $t, '(______________________)', 0, 0); $p->Ln(12); $p->SetFont('Helvetica', 'B', $lettersize); $p->Cell(0, $t, 'Keterangan : *) : Lingkari pilihan anda', 0, 0); $p->Ln($t); $arrLampirkan = array(); if ($pmbformulir['Prasyarat'] == 'Y') { $arrPrasyarat = explode('|', $pmbformulir['PrasyaratExtra']); foreach ($arrPrasyarat as $persyarat) { $arr = explode('~', $persyarat); // $arr[0] adalah PMBFormSyaratID, $arr[1] adalah 'Y' atau 'N' digunakan, $arr[2] adalah Tambahan input untuk prasyarat $pmbformsyarat = GetFields('pmbformsyarat', "PMBFormSyaratID='{$arr['0']}' and KodeID", KodeID, "*"); if ($arr[1] == 'Y') { if ($pmbformsyarat['AdaScript'] == 'N') { $arrLampirkan[] = $pmbformsyarat['Nama']; } } } } $p->Cell(20, $t, 'Lampirkan :', 0, 0); $n = 0; foreach ($arrLampirkan as $lampirkan) { $n++; if ($n == 1) { $p->Cell(0, $t, $lampirkan, 0, 0); } else { $p->Cell(20, $t, '', 0, 0); $p->Cell(0, $t, $lampirkan, 0, 0); } $p->Ln($t); } }