$r = _query($s); $n = _num_rows($r); while ($w = _fetch_array($r)) { if ($countToThree == 3) { $countToThree = 0; $pdf->AddPage('P', 'A4'); } $currentheight = $cardheight * $countToThree; $pdf->SetFont('Helvetica', 'B', 9); $pdf->SetY($currentheight + 28); $pdf->Cell($lbr1, 9, "KARTU UJIAN SELEKSI MASUK", 0, 0, 'C'); $pdf->Cell($lbr2, 9, "JADWAL UJIAN SELEKSI MASUK", 0, 1, 'C'); $pdf->Ln(9); // Tampilkan datanya HeaderLogo($currentheight, $pdf); AmbilKartu($w['PMBID'], $w['Nama'], $w['Alamat'], $w['Kota'], $w['Pilihan1'], $w['Pilihan2'], 37 + $currentheight, $pdf); AmbilJadwal($w['RuangID'], $w['Pilihan1'], $gelombang, 37 + $currentheight, $pdf); $pdf->SetY($currentheight + $cardheight); if ($countToThree != 2) { $pdf->Cell(190, 0, "", 1, 1); } $countToThree++; } $pdf->Output(); // *** Functions *** function AmbilKartu($PMBID, $Nama, $Alamat, $Kota, $Pilihan1, $Pilihan2, $Y, $p) { if (!empty($Pilihan1)) { $s1 = "select ProdiID, Nama from `prodi` where ProdiID='{$Pilihan1}' "; $r1 = _query($s1); $w1 = _fetch_array($r1);
$pdf->SetTitle("Kartu Ujian Seleksi Masuk"); $pdf->AddPage('P', 'A4'); $pdf->SetFont('Helvetica', 'B', 9); $pdf->SetY(28); $pdf->Cell($lbr1, 9, "KARTU UJIAN SELEKSI MASUK", 0, 0, 'C'); $pdf->Cell($lbr2, 9, "JADWAL UJIAN SELEKSI MASUK", 0, 0, 'C'); $pdf->Ln(9); $s = "select PMBID, Nama, Alamat, RuangID, Pilihan1, Pilihan2, Pilihan3, PMBFormulirID, Foto from `pmb` where PMBID='{$PMBID}' and KodeID='" . KodeID . "'"; $r = _query($s); $w = _fetch_array($r); $prodi1 = $w['Pilihan1']; $s = "update pmb set CetakKartu = CetakKartu+1 where PMBID='{$PMBID}' and KodeID='" . KodeID . "'"; $r = _query($s); // Tampilkan datanya HeaderLogo($pdf); AmbilKartu($w['PMBID'], $w['Nama'], $w['Alamat'], $w['Kota'], $w['Pilihan1'], $w['Pilihan2'], $w['Pilihan3'], $w['Foto'], 37, $pdf); AmbilJadwal($w, $gelombang, 37, $pdf); $pdf->SetY(98); $pdf->Cell(190, 0, "", 1, 1); $pdf->Output(); // *** Functions *** function AmbilKartu($PMBID, $Nama, $Alamat, $Kota, $Pilihan1, $Pilihan2, $Pilihan3, $Foto, $Y, $p) { if (!empty($Pilihan1)) { $s1 = "select ProdiID, Nama from `prodi` where ProdiID='{$Pilihan1}' "; $r1 = _query($s1); $w1 = _fetch_array($r1); $Pilihan1String = $Pilihan1 . ' - ' . $w1['Nama']; } else { $Pilihan1String = '<Belum pilih>'; }