Ejemplo n.º 1
0
function PRCBIPOT()
{
    include_once "mhswkeu.sav.php";
    $tahun = $_SESSION['BPT-TAHUN'];
    $prid = $_SESSION['BPT-PRID'];
    $prodi = $_SESSION['BPT-PRODI'];
    $jml = $_SESSION['BPT-JML'];
    $pos = $_SESSION['BPT-POS']++;
    $prs = $jml > 0 ? number_format($pos / $jml * 100) : '0';
    echo "<p>{$pos}/{$jml} : <font size=+2>{$prs}%</font></p>";
    // Proses BIPOT
    $_REQUEST['khsid'] = $_SESSION['BPT-KHSID-' . $pos];
    $_REQUEST['mhswid'] = $_SESSION['BPT-MHSWID-' . $pos];
    $_REQUEST['pmbmhswid'] = 1;
    PrcBIPOTSesi();
    // Refresh page
    if ($_SESSION['BPT-POS'] <= $_SESSION['BPT-JML']) {
        echo "<script type='text/javascript'>window.onload=setTimeout('window.location.reload()', 2);</script>";
    } else {
        echo "<p>Proses BIPOT tahun <b>{$tahun}</b> sudah <font size=+2>SELESAI</font></p>";
    }
}
Ejemplo n.º 2
0
function prc0()
{
    include_once "dwo.lib.php";
    include_once "parameter.php";
    include_once "mhswkeu.sav.php";
    $NoRek = GetaField('rekening', 'Def', 'Y', 'RekeningID');
    echo "<body bgcolor=#EEFFFF>";
    $dat = $_SESSION['AD' . $_SESSION['ADPOS']];
    $arr = explode('~', $dat);
    echo "Processing: #" . $_SESSION['ADPOS'] . " : <b>" . $arr[0] . ' (' . $arr[1] . ")</b><hr>";
    $_REQUEST['mhswid'] = $arr[0];
    $_REQUEST['khsid'] = $arr[1];
    $_REQUEST['pmbmhswid'] = 1;
    PrcBIPOTSesi();
    // Ambil data khs
    $khs = GetFields('khs', 'KHSID', $arr[1], '*');
    $balance = $khs['Biaya'] - $khs['Bayar'] - $khs['Potongan'] + $khs['Tarik'];
    // Apakah sudah ada BPM?
    $bpm = GetFields('bayarmhsw', "TahunID='{$khs['TahunID']}' and Autodebet=1 and MhswID", $arr[0], "*");
    $strbpm = '';
    if (empty($bpm)) {
        $strbpm = "<font color=blue>Dibuat</font>";
        $bpm['BayarMhswID'] = GetNextBPM();
        $s = "insert into bayarmhsw (BayarMhswID, TahunID, RekeningID,\r\n      MhswID, Autodebet, TrxID, PMBMhswID,\r\n      Tanggal, Jumlah, Keterangan,\r\n      LoginBuat, TanggalBuat)\r\n      values ('{$bpm['BayarMhswID']}', '{$khs['TahunID']}', '{$NoRek}',\r\n      '{$khs['MhswID']}', 1, 1, 1,\r\n      now(), '{$balance}', 'Autodebet',\r\n      '{$_SESSION['_Login']}', now())";
        $r = _query($s);
    } else {
        $strbpm = "<font color=gray>Diupdate</font>";
        $s = "update bayarmhsw set Jumlah='{$balance}' where BayarMhswID='{$bpm['BayarMhswID']}' ";
        $r = _query($s);
    }
    echo "1. Proses keuangan: OK<br />";
    echo "2. Buat BPM: <b>{$bpm['BayarMhswID']}</b> ~ {$strbpm}<br />";
    if ($_SESSION['ADPOS'] < $_SESSION['MaxData'] - 1) {
        echo "<script type='text/javascript'>window.onload=setTimeout('window.location.reload()', 2);</script>";
    } else {
        echo "<hr><p>Proses Keuangan <b>SELESAI</b>. Lanjutkan ke proses selanjutnya.</p>";
    }
    $_SESSION['ADPOS']++;
}
function prosesbipot()
{
    $prodi = $_SESSION['prodi'];
    $_SESSION['KBK-Pos-' . $prodi]++;
    $pos = $_SESSION['KBK-Pos-' . $prodi];
    $max = $_SESSION['KBK-Max-' . $prodi];
    $KHSID = $_SESSION['KBK-KHSID-' . $prodi . $pos];
    $MhswID = $_SESSION['KBK-MhswID-' . $prodi . $pos];
    $JUM = $_SESSION['KBK-JUM-' . $prodi . $pos];
    $persen = $max == 0 ? 0 : number_format($pos / $max * 100);
    $_REQUEST['mhswid'] = $MhswID;
    $_REQUEST['khsid'] = $KHSID;
    $_REQUEST['pmbmhswid'] = 1;
    if (!empty($MhswID)) {
        PrcBIPOTSesi();
        echo "<p>Processing: <b>{$_REQUEST['mhswid']}</b></p>\r\n    <p>Position: <b>{$pos}/{$max}</b></p>\r\n    <p>Jumlah Mahasiswa: <b>{$_REQUEST['khsid']}</b></p>\r\n    <p><font size=+4>{$persen} %</font></p>";
    }
    if ($pos < $max) {
        echo "<script type='text/javascript'>window.onload=setTimeout('window.location.reload()', 2);</script>";
    } else {
        echo "<hr><p>Proses Selesai</p>";
    }
}
Ejemplo n.º 4
0
function Cetak()
{
    global $_lf;
    // Setup Parameter
    $khsid = $_REQUEST['khsid'];
    $khs = GetFields('khs khs
    left outer join program prg on khs.ProgramID=prg.ProgramID
    left outer join prodi prd on khs.ProdiID=prd.ProdiID
    left outer join mhsw m on khs.MhswID=m.MhswID', 'KHSID', $khsid, "khs.*, m.BatasStudi, m.Nama as NamaMhsw, m.ProdiID, m.Autodebet, prg.Nama as PRG, prd.Nama as PRD");
    $_REQUEST['mhswid'] = $khs['MhswID'];
    $_REQUEST['pmbmhswid'] = 1;
    $_REQUEST['DariKRS'] = 1;
    // Menandai bahwa ini dieksekusi dari modul KRS
    $MhswID = $_REQUEST['mhswid'];
    $thn = GetFields("tahun", "ProgramID='{$khs['ProgramID']}' and ProdiID='{$khs['ProdiID']}' and TahunID", $khs['TahunID'], "*");
    $angmhsw = GetaField('mhsw', 'MhswID', $MhswID, 'TahunID');
    // Menetapkan KRS atau KPRS
    $skrg = date('Y-m-d');
    // Jika autodebet
    if ($khs['Autodebet'] == 'Y') {
        $tglad = FormatTanggal($thn['TglAutodebetSelesai']);
        $tglad2 = FormatTanggal($thn['TglAutodebetSelesai2']);
        $str1 = "Anda harus menyetor ke rekening Anda paling lambat {$tglad}.";
        $str2 = "untuk di-autodebet oleh bank. Lewat tgl tersebut akan didenda 10%";
        $str3 = "dari BPP SKS. Pembayaran BPP & Denda paling lambat tgl {$tglad2}.";
        $str4 = "Lewat tanggal tersebut Anda harus CUTI KULIAH.";
    } else {
        // KRS
        if ($khs['Sesi'] <= 1) {
            $str1 = '';
            $str2 = '';
        } elseif ($angmhsw >= 2002) {
            $tglad = FormatTanggal($thn['TglAutodebetSelesai']);
            $tglad2 = FormatTanggal($thn['TglAutodebetSelesai2']);
            $str1 = "Anda harus menyetor ke rekening Anda paling lambat {$tglad}.";
            $str2 = "untuk di-autodebet oleh bank. Lewat tgl tersebut akan didenda 10%";
            $str3 = "dari BPP SKS. Pembayaran BPP & Denda paling lambat tgl {$tglad2}.";
            $str4 = "Lewat tanggal tersebut Anda harus CUTI KULIAH.";
        } elseif ($thn['TglKRSMulai'] <= $skrg and $skrg <= $thn['TglCetakKSS1']) {
            $tglkrsselesai = FormatTanggal($thn['TglKRSSelesai']);
            $tglcetakkss = FormatTanggal($thn['TglCetakKSS1']);
            $tglbayarselesai = FormatTanggal($thn['TglBayarSelesai']);
            $str1 = "Cetak KSS paling lambat tanggal {$tglcetakkss}";
            $str2 = "dengan menyerahkan KRS ini ke BAA. Lewat tgl tersebut,";
            $str3 = "mahasiswa terkena denda 10% sampai tanggal {$tglbayarselesai}.";
            $str4 = "Sesudah tanggal ini, jika belum cetak KSS, Anda harus CUTI KULIAH.";
        } elseif ($thn['TglUbahKRSMulai'] <= $skrg and $skrg <= $thn['TglCetakKSS2']) {
            $tglkrsselesai = FormatTanggal($thn['TglUbahKRSSelesai']);
            $tglcetakkss = FormatTanggal($thn['TglCetakKSS2']);
            $str1 = "Cetak ulang KSS paling lambat tanggal {$tglcetakkss}";
            $str2 = "dengan menyerahkan KPRS ini ke BAA.";
            $str3 = "Lewat tanggal tersebut tidak ada perubahan rencana studi";
            $str4 = "yang tercetak di KRS.";
        } else {
            $str1 = "Masa pencetakan KRS/KPRS sudah lewat.";
            $str2 = "Anda harus cuti kuliah.";
        }
    }
    // Hitung BIPOT mhsw dulu
    PrcBIPOTSesi();
    // Buat file
    $nmf = HOME_FOLDER . DS . "tmp/{$_SESSION['_Login']}.dwoprn";
    $f = fopen($nmf, 'w');
    fwrite($f, chr(27) . chr(18) . chr(27) . chr(15) . chr(27) . chr(67) . chr(33));
    // chr67+chr33 -> membuat menjadi 33 baris
    // Format Kertas
    $brs = 0;
    $maxbrs = 10;
    // Buat header
    $mrghdr = str_pad(' ', 28);
    $mrg = str_pad(' ', 10);
    $spasihdr = 35;
    $BatasStudi = NamaTahun($khs['BatasStudi'], $khs['ProdiID']);
    $hdr = $_lf . $_lf . $_lf . $_lf . $mrghdr . $khs['TahunID'] . ' ' . $thn['Nama'] . $_lf . $mrghdr . str_pad($khs['PRD'], $spasihdr) . $str1 . $_lf . $mrghdr . str_pad($khs['MhswID'], $spasihdr) . $str2 . $_lf . $mrghdr . str_pad($khs['NamaMhsw'], $spasihdr) . $str3 . $_lf . $mrghdr . str_pad($BatasStudi, $spasihdr) . $str4 . $_lf . $_lf . $_lf . $_lf . $_lf . $_lf;
    fwrite($f, $hdr);
    // Tampilkan isi KRS
    $s = "select krs.*, j.MKKode, j.Nama, j.NamaKelas, j.JenisJadwalID, j.JadwalSer, \r\n    time_format(j.JamMulai, '%H:%i') as JM,\r\n    time_format(j.JamSelesai, '%H:%i') as JS,\r\n    h.Nama as HR\r\n    from krstemp krs\r\n      left outer join jadwal j on krs.JadwalID=j.JadwalID\r\n      left outer join hari h on j.HariID=h.HariID\r\n    where krs.KHSID='{$khsid}' and krs.NA='N'\r\n    order by j.MKKode, j.NamaKelas, j.HariID, j.JenisJadwalID";
    $r = _query($s);
    $sks = 0;
    while ($w = _fetch_array($r)) {
        $brs++;
        if ($brs > $maxbrs) {
            fwrite($f, $mrg . "Bersambung...");
            fwrite($f, chr(12));
            fwrite($f, $hdr);
            $brs = 1;
        }
        $sks += ($w['JenisJadwalID'] == 'R' or $w['StatusKRSID'] == 'S' and $w['JadwalSer'] > 0) ? 0 : $w['SKS'];
        $_sks = $w['JenisJadwalID'] != 'K' ? '' : $w['SKS'];
        $skstampil = $_sks == 0 ? '' : $_sks;
        $w['Nama'] .= $w['JenisJadwalID'] != 'K' ? " ({$w['JenisJadwalID']})" : '';
        if ($w['StatusKRSID'] == 'S' and $w['JadwalSer'] > 0) {
            $w['Nama'] = '';
            $w['MKKode'] = '';
        }
        $isi = $mrg . str_pad($w['MKKode'], 8) . str_pad($w['Nama'], 40) . str_pad($skstampil, 4, ' ', STR_PAD_LEFT) . '     ' . str_pad($w['NamaKelas'], 8) . str_pad($w['HR'], 8) . $w['JM'] . '-' . $w['JS'] . '    ' . $w['CatatanError'] . $_lf;
        fwrite($f, $isi);
    }
    fwrite($f, str_pad("Total SKS : ", 58, ' ', STR_PAD_LEFT) . str_pad($sks, 4, ' ', STR_PAD_LEFT) . $_lf);
    // Ambil KRS GAGAL
    $s = "select krs.*, j.MKKode, j.Nama, j.NamaKelas, j.JenisJadwalID,\r\n    time_format(j.JamMulai, '%H:%i') as JM,\r\n    time_format(j.JamSelesai, '%H:%i') as JS,\r\n    h.Nama as HR\r\n    from krstemp krs\r\n      left outer join jadwal j on krs.JadwalID=j.JadwalID\r\n      left outer join hari h on j.HariID=h.HariID\r\n    where krs.KHSID='{$khsid}' and krs.NA='Y'\r\n    order by j.MKKode, j.JenisJadwalID";
    $r = _query($s);
    if (_num_rows($r) > 0) {
        fwrite($f, $mrg . "KRS GAGAL:" . $_lf);
        $_sks = $w['JenisJadwalID'] != 'K' ? '' : $w['SKS'];
        $w['Nama'] .= $w['JenisJadwalID'] != 'K' ? " ({$w['JenisJadwalID']})" : '';
        while ($w = _fetch_array($r)) {
            $isi = $mrg . str_pad($w['MKKode'], 8) . str_pad($w['Nama'], 40) . str_pad($_sks, 4, ' ', STR_PAD_LEFT) . '       ' . str_pad($w['NamaKelas'], 3) . str_pad($w['HR'], 10) . $w['JM'] . '-' . $w['JS'] . ' ' . $w['CatatanError'] . $_lf;
            fwrite($f, $isi);
        }
        fwrite($f, $_lf);
    }
    // Ambil BIPOT mhsw Lama
    $s = "select bm.*, LEFT(bn.Nama, 14) as BNama\r\n    from bipotmhsw bm\r\n      left outer join bipotnama bn on bm.BIPOTNamaID=bn.BIPOTNamaID\r\n    where bm.MhswID='{$MhswID}' and bm.TahunID='{$khs['TahunID']}'\r\n      and (bm.Jumlah * bm.Besar) > bm.Dibayar\r\n    order by bn.Urutan";
    //fwrite($f, $s);
    if ($khs['Sesi'] <= 1) {
        $s = "select bm.*, LEFT(bn.Nama, 14) as BNama\r\n    from bipotmhsw bm\r\n      left outer join bipotnama bn on bm.BIPOTNamaID=bn.BIPOTNamaID\r\n    where bm.MhswID='{$MhswID}' and bm.TahunID='{$khs['TahunID']}'\r\n    order by bn.Urutan";
    }
    $r = _query($s);
    $tbia = 0;
    $arrbia = array();
    $col = 0;
    $mcol = 4;
    fwrite($f, $_lf);
    while ($w = _fetch_array($r)) {
        $bia = $w['TrxID'] * $w['Jumlah'] * $w['Besar'];
        $tbia += $bia;
        $_bia = number_format($bia);
        $isi = str_pad($w['BNama'], 15) . str_pad($_bia, 12, ' ', STR_PAD_LEFT) . '  ';
        if ($col < $mcol) {
        } else {
            fwrite($f, $_lf);
            $col = 0;
        }
        if ($col == 0) {
            fwrite($f, $mrg);
        }
        $col++;
        fwrite($f, $isi);
    }
    fwrite($f, $_lf . $mrg . "Tot Biaya:  Rp " . str_pad(number_format($tbia), 12, ' ', STR_PAD_LEFT) . $_lf);
    $tgl = date('d-m-Y  H:i');
    fwrite($f, str_pad("Dicetak oleh: {$_SESSION['_Login']}, {$tgl}", 114, ' ', STR_PAD_LEFT) . $_lf);
    // Tutup file
    fwrite($f, chr(12));
    fclose($f);
    // Tambahkan counter cetak KRS
    $s = "update khs set CetakKRS=CetakKRS+1 where KHSID={$khs['KHSID']}";
    $r = _query($s);
    if (empty($_REQUEST['prn'])) {
        TampilkanFileDWOPRN($nmf, "krs");
    } else {
        include_once "dwoprn.php";
        DownloadDWOPRN($nmf);
    }
}
Ejemplo n.º 5
0
function JdwlTtp1()
{
    $JadwalID = $_REQUEST['JadwalID'];
    $jdwl = GetFields('jadwal', 'JadwalID', $JadwalID, '*');
    // Parameter
    $NoSurat = sqling($_REQUEST['NoSurat']);
    $Tgl = "{$_REQUEST['Tgl_y']}-{$_REQUEST['Tgl_m']}-{$_REQUEST['Tgl_d']}";
    $Keterangan = sqling($_REQUEST['Keterangan']);
    // Tutup
    $st = "insert into jadwaltutup (TahunID, ProgramID, ProdiID,\r\n    JadwalID, MKID, MKKode, Nama, DosenID,\r\n    NamaKelas, JenisJadwalID, \r\n    HariID, JamMulai, JamSelesai,\r\n    NoSurat, Tanggal, Keterangan,\r\n    LoginBuat, TanggalBuat)\r\n    values ('{$jdwl['TahunID']}', '{$jdwl['ProgramID']}', '{$jdwl['ProdiID']}',\r\n    '{$JadwalID}', '{$jdwl['MKID']}', '{$jdwl['MKKode']}', '{$jdwl['Nama']}', '{$jdwl['DosenID']}',\r\n    '{$jdwl['NamaKelas']}', '{$jdwl['JenisJadwalID']}',\r\n    '{$jdwl['HariID']}', '{$jdwl['JamMulai']}', '{$jdwl['JamSelesai']}',\r\n    '{$NoSurat}', '{$Tgl}', '{$Keterangan}',\r\n    '{$_SESSION['_Login']}', now())";
    $rt = _query($st);
    // set semua krs menjadi tutup
    echo "<p>KRS Mahasiswa yg dibatalkan:</p>";
    echo "<ol>";
    $s = "select * from krs where JadwalID={$JadwalID}";
    $r = _query($s);
    while ($w = _fetch_array($r)) {
        // batalkan KRS
        $sk = "update krs set StatusKRSID='M', NA='Y', CatatanError='Jadwal dihapus'\r\n      where KRSID={$w['KRSID']} ";
        $rk = _query($sk);
        // update pembayaran
        $_REQUEST['khsid'] = $w['KHSID'];
        $_REQUEST['mhswid'] = $w['MhswID'];
        $_REQUEST['pmbmhswid'] = 1;
        PrcBIPOTSesi();
        echo "<li>{$w['MhswID']}</li>";
    }
    echo "</ol>";
    // Hapus
    $sh = "update jadwal set NA='Y' where JadwalID={$JadwalID} ";
    $rh = _query($sh);
    DftrJdwl();
}