function Cetak() { global $_lf; $whr .= empty($_REQUEST['prodi']) ? '' : "and m.ProdiID='{$_REQUEST['prodi']}'"; $s = "select m.MhswID, ta.Judul, m.Nama, ta.GradeNilai, ta.TahunID, date_format(ta.TglSKYudisium, '%d-%m-%y') as TglSKYudisium,\r\n m.NoProdi, m.NoIdentitas, m.ProdiID, date_format(m.TglSKKeluar, '%d-%m-%Y') as TglSKKeluar\r\n from ta ta\r\n left outer join mhsw m on m.MhswID=ta.MhswID\r\n where ta.Lulus='Y'\r\n and ('{$_REQUEST['tahun1']}-{$_REQUEST['bulan1']}-01' <= ta.TglSKYudisium)\r\n and (ta.TglSKYudisium <= '{$_REQUEST['tahun2']}-{$_REQUEST['bulan2']}-31')\r\n and ta.NA = 'N'\r\n {$whr}\r\n order by m.ProdiID, m.MhswID, ta.TglSKYudisium"; $r = _query($s); $maxcol = 200; $rand = rand(1, 1000); $nmf = HOME_FOLDER . DS . "tmp/{$_SESSION['_Login']}.{$rand}.dwoprn"; $f = fopen($nmf, 'w'); fwrite($f, chr(27) . chr(77) . chr(27) . chr(15) . chr(27) . chr(108) . chr(10)) . $_lf; $div = str_pad('-', $maxcol, '-') . $_lf; $stt = array('10' => "K-S.Ked", '11' => "D-Dokter", '61' => "T-Tesis"); $n = 0; $hal = 0; $nprd = 0; $brs = 72; $maxbrs = 70; $jumlahrec = _num_rows($r); $jumhal = ceil($jumlahrec / $maxbrs); $prodi = ""; $first = 1; while ($w = _fetch_array($r)) { $ss = GetFields("krs krs\r\n left outer join mk mk on krs.MKID=mk.MKID\r\n left outer join jenispilihan jp on mk.JenisPilihanID=jp.JenisPilihanID", "jp.TA='Y' and krs.TahunID='{$w['TahunID']}' and krs.MhswID", $w['MhswID'], "mk.Nama as MKNama, mk.MKKode as MKKode"); $_prodi = GetaField('prodi', 'ProdiID', $w['ProdiID'], 'Nama'); $fak = substr($w['ProdiID'], 0, 1); $_fak = GetaField('fakultas', 'FakultasID', $fak, 'Nama'); $n++; $brs++; if ($brs > $maxbrs) { if ($first == 0) { fwrite($f, $div . chr(12)); } $hd = Headerxx($_fak, $_prodi, $div, $maxcol, $hal); fwrite($f, $hd); $brs = 0; $first = 0; $prodi = $w['ProdiID']; } elseif ($prodi != $w['ProdiID']) { $prodi = $w['ProdiID']; if ($first == 0) { fwrite($f, $div); } fwrite($f, chr(12)); fwrite($f, Headerxx($_fak, $_prodi, $div, $maxcol, $hal)); $brs = 0; $n = 1; } $Judul = PutuskanJudul($w['Judul']); $jd = array(); for ($j = 0; $j < sizeof($Judul); $j++) { $kirinya = $j == 0 ? "" : str_pad(' ', 127, ' '); $sp = $j == 0 ? '' : $_lf; $jd[$j] = $kirinya . $Judul[$j] . $sp; $brs++; } $st = $stt[$w['ProdiID']]; $st = empty($st) ? "S-Skripsi" : $st; //var_dump($jd);exit; $isi = str_pad($n, 5) . str_pad($w['TglSKKeluar'], 12) . str_pad($w['MhswID'], 12) . str_pad($w['Nama'], 40) . str_pad($ss['MKKode'], 10) . str_pad($ss['MKNama'], 16) . str_pad($st, 14) . str_pad($w['GradeNilai'], 6, ' ', STR_PAD_BOTH) . str_pad($w['TglSKYudisium'], 12) . str_pad($jd[0], 50) . str_pad($w['NoProdi'], 5, ' ', STR_PAD_LEFT) . str_pad($w['NoIdentitas'], 8, ' ', STR_PAD_LEFT) . $_lf; fwrite($f, $isi); fwrite($f, $jd[1]); fwrite($f, $jd[2]); fwrite($f, $jd[3]); $Juduls = ''; } fwrite($f, $div); fwrite($f, str_pad("Dicetak oleh : " . $_SESSION['_Login'], 30, ' ') . str_pad("Dicetak : " . date("d-m-Y H:i"), 170, ' ', STR_PAD_LEFT) . $_lf); fwrite($f, str_pad("Akhir laporan", 200, ' ', STR_PAD_LEFT)); fwrite($f, chr(12)); fclose($f); TampilkanFileDWOPRN($nmf, "wisuda.nomer"); }
function TransNilai($mhsw) { global $_lf, $arrBulan; $nmf = HOME_FOLDER . DS . "tmp/{$_SESSION['_Login']}.dwoprn"; $f = fopen($nmf, 'w'); if ($mhsw['ProdiID'] != 61) { if ($_SESSION['_Jns'] == 1) { $jns = "Judul Tugas Akhir : "; $lbr = 20; $pnj = 40; } elseif ($_SESSION['_Jns'] == 0) { $jns = "Judul Skripsi : "; $lbr = 16; $pnj = 45; } } else { $jns = "Judul Thesis : "; $lbr = 15; $pnj = 45; } // deteksi printer if ($_SESSION['bhs'] == 'id') { $_d = substr($mhsw['TanggalLahir'], 8, 2); $_m = substr($mhsw['TanggalLahir'], 5, 2) + 0; $_y = substr($mhsw['TanggalLahir'], 0, 4); $tglLahir = "{$_d} " . $arrBulan[$_m] . " {$_y}"; } else { $tglLahir = $mhsw['TGLLHR']; } if ($_SESSION['_Printer'] == 0) { fwrite($f, chr(27) . chr(80) . chr(15) . chr(27) . chr(67) . chr(66)); $mrg = str_pad(' ', 4); $mrg1 = str_pad(' ', 4); $mrghdr = str_pad(' ', 22); $mrghdr1 = str_pad(' ', 23); if ($mhsw['ProdiID'] == '31' or $mhsw['ProdiID'] == '32') { $mhsw['PRD'] = str_replace('Ekonomi ', '', $mhsw['PRD']); } $hdr = $_lf . $_lf . $mrg . $mrghdr . str_pad($mhsw['MhswID'], 30) . $mrghdr1 . $mhsw['FAK'] . $_lf . $mrg . $mrghdr . str_pad($mhsw['Nama'], 30) . $mrghdr1 . $mhsw['PRD'] . $_lf . $mrg . $mrghdr . $mhsw['TempatLahir'] . ', ' . $tglLahir . $_lf . $_lf . $_lf . $_lf; } else { fwrite($f, chr(27) . chr(38) . chr(107) . chr(50) . chr(83) . chr(27) . chr(38) . chr(108) . chr(54) . chr(68) . chr(27) . chr(40) . chr(115) . chr(51) . chr(66)); // bold & 66 baris $mrg = str_pad(' ', 4); $mrg1 = str_pad(' ', 4); $mrghdr = str_pad(' ', 22); $mrghdr1 = str_pad(' ', 23); if ($mhsw['ProdiID'] == '31' or $mhsw['ProdiID'] == '32') { $mhsw['PRD'] = str_replace('Ekonomi ', '', $mhsw['PRD']); } $hdr = $_lf . $_lf . $_lf . $_lf . $_lf . $mrg . str_pad("N.P.M : ", 21, ' ', STR_PAD_LEFT) . str_pad($mhsw['MhswID'], 30) . str_pad("Fakultas : ", 16, ' ', STR_PAD_LEFT) . $mhsw['FAK'] . $_lf . $mrg . str_pad("Nama : ", 21, ' ', STR_PAD_LEFT) . str_pad($mhsw['Nama'], 30) . str_pad("Jurusan : ", 16, ' ', STR_PAD_LEFT) . $mhsw['PRD'] . $_lf . $mrg . str_pad("Tempat & Tgl.Lahir : ", 21, ' ', STR_PAD_LEFT) . $mhsw['TempatLahir'] . ', ' . $tglLahir . $_lf . $_lf . $_lf . $_lf; } // Tampilkan Header $div = str_pad('-', 79, '-') . $_lf; fwrite($f, $hdr); // Isinya $isi = array(); $maxbrs = 40; for ($i = 0; $i <= $maxbrs; $i++) { $isi[$i] = ''; } //if ($mhsw['ProdiID'] == // Matakuliah $s0 = "select distinct krs.GradeNilai, krs.BobotNilai, krs.SKS,\r\n concat(LEFT(krs.MKKode, 3), ' ', SUBSTRING(krs.MKKode, 4, 3)) as MKKode,\r\n mk.MKKode as Kode,\r\n LEFT(mk.Nama, 40) as NamaMK, LEFT(mk.Nama_en, 40) as NamaMK1, mk.MKSetara\r\n from krs krs\r\n left outer join mk mk on krs.MKID=mk.MKID\r\n left outer join jadwal j on krs.JadwalID=j.JadwalID\r\n left outer join nilai ni on krs.GradeNilai=ni.Nama and ni.ProdiID = mk.ProdiID\r\n where krs.MhswID='{$mhsw['MhswID']}'\r\n and krs.Final='Y'\r\n and krs.GradeNilai not in ('-','')\r\n and (j.JenisJadwalID <> 'R' or j.JenisJadwalID is NULL)\r\n and krs.NA = 'N'\r\n and ni.Lulus ='Y'\r\n order by mk.Sesi asc, krs.MKKode asc, krs.BobotNilai desc"; $s = "select krs.GradeNilai, krs.BobotNilai, krs.SKS,\r\n concat(LEFT(krs.MKKode, 3), ' ', SUBSTRING(krs.MKKode, 4, 3)) as MKKode,\r\n mk.MKKode as Kode,\r\n LEFT(mk.Nama, 40) as NamaMK, LEFT(mk.Nama_en, 40) as NamaMK1, mk.MKSetara\r\n from krsprc krs\r\n left outer join mk mk on krs.MKID=mk.MKID\r\n left outer join nilai n on krs.GradeNilai=n.Nama\r\n where krs.MhswID='{$mhsw['MhswID']}' \r\n and krs.GradeNilai not in ('-', '')\r\n and n.Lulus='Y'\r\n order by mk.Sesi asc, krs.MKKode asc, krs.BobotNilai desc"; $r = _query($s0); $mk = ''; $n = 0; $brs = 0; $_sks = 0; $_bbt = 0; $_nxk = 0; $col = 0; $brs = 0; $MKSetara = ''; $sis = array(); $cek = array(); $isi_2 = array(); while ($w = _fetch_array($r)) { $MKSetara .= $w['MKSetara'] == '' ? '' : $w['MKSetara']; $pos = strpos($MKSetara, ".{$w['Kode']}."); if ($mk != $w['MKKode'] && $pos === false) { $cek = GetFields('krs left outer join mk on krs.MKID=mk.MKID', "INSTR(mk.MKSetara, '.{$w['Kode']}.')>0 and MhswID", $mhsw['MhswID'], "krs.GradeNilai, krs.BobotNilai, krs.SKS,\r\n concat(LEFT(krs.MKKode, 3), ' ', SUBSTRING(krs.MKKode, 4, 3)) as MKKode,\r\n mk.MKKode as Kode,\r\n LEFT(mk.Nama, 40) as NamaMK, LEFT(mk.Nama_en, 40) as NamaMK1, mk.MKSetara"); if (!empty($cek)) { if ($w['BobotNilai'] > $cek['BobotNilai']) { } else { $w['MKKode'] = $cek['MKKode']; $w['SKS'] = $cek['SKS']; $w['BobotNilai'] = $cek['BobotNilai']; $w['NamaMK'] = $cek['NamaMK']; $w['NamaMK1'] = $cek['NamaMK1']; $w['GradeNilai'] = $cek['GradeNilai']; } } $mk = $w['MKKode']; $n++; if ($n > $maxbrs) { $n = 1; $col++; } $nxk = $w['SKS'] * $w['BobotNilai']; $_nxk += $nxk; $_sks += $w['SKS']; $NamaMK = $_SESSION['bhs'] == 'id' ? $w['NamaMK'] : $w['NamaMK1']; $brs++; $isi[$n] .= $mrg . str_pad($w['MKKode'], 8) . ' ' . str_pad($NamaMK, 40) . str_pad($w['SKS'], 3, ' ', STR_PAD_LEFT) . ' ' . str_pad($w['GradeNilai'], 5, ' '); } } echo $brs; $_ipk = $_sks == 0 ? 0 : $_nxk / $_sks; $ipk = number_format($_ipk, 2); // tampilkan footer $_i = $n + 5 > $maxbrs ? 1 : $n + 2; if ($brs >= 73) { $_i = 1; } $tglCetak = date('d') . ' ' . $arrBulan[date('n')] . ' ' . date('Y'); if ($mhsw['StatusMhswID'] == 'L') { $TglSKKeluar = GetaField('ta', "MhswID", $mhsw['MhswID'], 'TglSKYudisium'); //echo $TglSKKeluar; $TglSKKeluar = FormatTanggal($TglSKKeluar, '-'); if ($brs < 73) { $isi[$_i] .= $mrg . "Lulus {$mhsw['Gelar']} tanggal: {$TglSKKeluar}"; } else { $isi_2[$_i] .= $mrg . "Lulus {$mhsw['Gelar']} tanggal: {$TglSKKeluar}"; } if ($mhsw['ProdiID'] == '10' || $mhsw['ProdiID'] == '11') { $j = 0; } else { $ta = GetFields('ta', "NA = 'N' and TAID", $mhsw['TAID'], '*'); $arrTA = PutuskanJudul($ta['Judul'], $pnj); //echo $jdl; //echo $pnj; //echo $lbr; for ($j = 0; $j < sizeof($arrTA); $j++) { $kirinya = $j == 0 ? $jns : str_pad(' ', $lbr, ' '); if ($brs < 73) { $isi[$_i + $j + 1] .= $mrg . $kirinya . $arrTA[$j]; } else { $isi_2[$_i + $j + 1] .= $mrg . $kirinya . $arrTA[$j]; } } } $Predikat = empty($mhsw['Predikat']) ? GetPredikatKelulusan($mhsw['ProdiID'], $ipk, $mhsw['PRDID']) : $mhsw['Predikat']; if ($brs < 73) { $isi[$_i + $j + 2] .= $mrg1 . "Jumlah Kredit Diperoleh : {$_sks}"; $isi[$_i + $j + 3] .= $mrg1 . "Index Prestasi Kumulatif : {$ipk}"; $isi[$_i + $j + 4] .= $mrg1 . "Predikat Kelulusan : {$Predikat}"; } else { $isi_2[$_i + $j + 2] .= $mrg1 . "Jumlah Kredit Diperoleh : {$_sks}"; $isi_2[$_i + $j + 3] .= $mrg1 . "Index Prestasi Kumulatif : {$ipk}"; $isi_2[$_i + $j + 4] .= $mrg1 . "Predikat Kelulusan : {$Predikat}"; } // buat footer //$Rektor = GetaField('pejabat', "KodeID='$_SESSION[KodeID]' and JabatanID", "REKTOR", "Nama"); $Fakul = substr($mhsw['ProdiID'], 0, 1); //echo $Fakul; $Dekan = GetPejabat($Fakul); $footer = $_lf . str_pad(' ', 82) . "Jakarta, {$tglCetak}" . $_lf . str_pad(' ', 25) . str_pad("Rektor", 57) . "Dekan" . $_lf . $_lf . $_lf . $_lf . str_pad(' ', 25) . str_pad($Rektor, 57) . $Dekan; } else { $Maxsksnya = GetaField('prodi', 'ProdiID', $mhsw['ProdiID'], "TotalSKS"); $sisa = $Maxsksnya - $_sks; $sisa = $sisa < 0 ? 0 : $sisa; $BatasStudi = NamaTahun($mhsw['BatasStudi']); $isi[$_i] .= $mrg1 . "Belum Lulus {$mhsw['Gelar']}"; $isi[$_i + 1] .= $mrg1 . "Jumlah Kredit Diperoleh : {$_sks}"; $isi[$_i + 2] .= $mrg1 . "Kredit Belum Ditempuh : {$sisa}"; $isi[$_i + 3] .= $mrg1 . "Index Prestasi Kumulatif : {$ipk}"; $isi[$_i + 4] .= $mrg1 . "Masa studi berakhir pada semester {$BatasStudi}"; // buat footer // $KABAA = GetaField('pejabat', "KodeID='$_SESSION[KodeID]' and JabatanID", "KABAA", "Nama"); $footer = $_lf . str_pad(' ', 82) . "Jakarta, {$tglCetak}" . $_lf . str_pad(' ', 82) . "Biro Administrasi Akademik" . $_lf . $_lf . $_lf . $_lf . str_pad(' ', 82) . $KABAA; } for ($i = 0; $i <= $maxbrs; $i++) { fwrite($f, $isi[$i] . $_lf); } fwrite($f, $footer); if ($brs < 73) { } else { fwrite($f, chr(12)); fwrite($f, $hdr); for ($h = 0; $h <= $maxbrs; $h++) { fwrite($f, $isi_2[$h] . $_lf); } fwrite($f, $_lf . str_pad(' ', 82) . "Jakarta, {$tglCetak}" . $_lf . str_pad(' ', 25) . str_pad("Rektor", 57) . "Dekan" . $_lf . $_lf . $_lf . $_lf . str_pad(' ', 25) . str_pad($Rektor, 57) . $Dekan); } // Tutup file fwrite($f, chr(12)); fclose($f); TampilkanFileDWOPRN($nmf, "transkrip"); }