Пример #1
0
function CetakKehadiranMhsw($mhsw)
{
    global $_lf;
    $s = "select pm.*, j.Kehadiran, j.JadwalSer, \n    j.MKKode, LEFT(j.Nama, 30) as NamaMK, j.NamaKelas, j.JenisJadwalID, j.SKS,\n    sum(pm.Nilai) as JML\n    from presensimhsw pm\n      left outer join jadwal j on pm.JadwalID=j.JadwalID\n    where pm.MhswID='{$mhsw['MhswID']}' and j.TahunID='{$_SESSION['tahun']}' \n    group by pm.JadwalID";
    $r = _query($s);
    // buat file
    $nmf = "tmp\\{$_SESSION['_Login']}.dwoprn";
    $f = fopen($nmf, 'w');
    // parameter
    $mxc = 114;
    $mxb = 60;
    $grs = str_pad('-', $mxc, '-') . $_lf;
    $thn = GetaField('tahun', "ProgramID='{$mhsw['ProgramID']}' and ProdiID='{$mhsw['ProdiID']}' and TahunID", $_SESSION['tahun'], 'Nama');
    $hdr = str_pad('*** Rekap Kehadiran per Mahasiswa ***', $mxc, ' ', STR_PAD_BOTH) . $_lf . "Tahun Akd : {$_SESSION['tahun']} - {$thn} " . $_lf . "Mahasiswa : {$mhsw['MhswID']} - {$mhsw['Nama']} " . $_lf . $grs . str_pad('No.', 4) . str_pad('Kode', 8) . str_pad('Matakuliah', 31) . str_pad('Kls', 4) . str_pad("Dosen", 6) . str_pad('  Hadir', 10) . $_lf . $grs;
    fwrite($f, $hdr);
    $n = 0;
    while ($w = _fetch_array($r)) {
        $n++;
        $persen = $w['Kehadiran'] == 0 ? 0 : $w['JML'] / $w['Kehadiran'] * 100;
        $Jen = $w['JenisJadwalID'] == 'R' ? "(R)" : '';
        $_persen = number_format($persen, 2);
        fwrite($f, str_pad($n . '.', 4) . str_pad($w['MKKode'], 8) . str_pad($w['NamaMK'] . $Jen, 31) . str_pad($w['NamaKelas'], 4) . str_pad($w['Kehadiran'] . ' X', 5, ' ', STR_PAD_LEFT) . str_pad($_persen . '%', 9, ' ', STR_PAD_LEFT) . $_lf);
        AmbilDetail($f, $mhsw, $w);
    }
    fwrite($f, $grs);
    fwrite($f, chr(12));
    fclose($f);
    TampilkanFileDWOPRN($nmf, 'lap.hadir.permhsw');
}
Пример #2
0
function DetailBIPOT()
{
    global $_lf;
    $bipotid = $_REQUEST['bipotid'];
    $bpt = GetFields('bipot', 'BIPOTID', $bipotid, '*');
    $prg = GetaField('program', 'ProgramID', $bpt['ProgramID'], 'Nama');
    $prd = GetaField('prodi', 'ProdiID', $bpt['ProdiID'], 'Nama');
    $nmf = HOME_FOLDER . DS . "tmp/{$_SESSION['_Login']}.bipot.dwoprn";
    $f = fopen($nmf, 'w');
    $mxc = 114;
    $grs = str_pad('-', $mxc, '-') . $_lf;
    $hdr = str_pad("Daftar Biaya & Potongan {$bpt['TahunID']}", $mxc, ' ', STR_PAD_BOTH) . $_lf . str_pad($bpt['Nama'], $mxc, ' ', STR_PAD_BOTH) . $_lf . str_pad("Program: {$prg}, Prodi: {$prd}", $mxc, ' ', STR_PAD_BOTH) . $_lf . $grs . "No. Prio " . str_pad("Nama", 30) . str_pad("Jumlah", 12, ' ', STR_PAD_LEFT) . ' ' . str_pad("Penarikan", 12) . str_pad("Oto?", 5) . ' ' . str_pad("St.Awal", 12) . ' ' . str_pad("St.Mhsw", 12) . ' ' . str_pad("Grade", 5) . ' ' . $_lf . $grs;
    $s = "select b2.*, bn.Nama, format(b2.Jumlah, 0) as JML,\r\n      t.Nama as NMTRX, s.Nama as SAAT\r\n      from bipot2 b2\r\n      left outer join bipotnama bn on b2.BIPOTNamaID=bn.BIPOTNamaID\r\n      left outer join saat s on b2.SaatID=s.SaatID\r\n      left outer join trx t on b2.TrxID=t.TrxID\r\n      where b2.BIPOTID='{$bipotid}' and KodeID='{$_SESSION['KodeID']}'\r\n      order by b2.TrxID, b2.Prioritas, b2.GradeNilai";
    $r = _query($s);
    $n = 0;
    fwrite($f, $hdr);
    while ($w = _fetch_array($r)) {
        $n++;
        $jml = number_format($w['Jumlah']);
        $sa = TRIM($w['StatusAwalID'], '.');
        $sa = str_replace('.', ',', $sa);
        $sm = TRIM($w['StatusMhswID'], '.');
        $sm = str_replace('.', ',', $sm);
        fwrite($f, str_pad($n, 4) . str_pad($w['Prioritas'], 5) . str_pad($w['Nama'], 30) . str_pad($jml, 12, ' ', STR_PAD_LEFT) . ' ' . str_pad($w['SAAT'], 12) . str_pad($w['Otomatis'], 5, ' ', STR_PAD_BOTH) . ' ' . str_pad($sa, 12) . ' ' . str_pad($sm, 12) . ' ' . str_pad($w['GradeNilai'], 5, ' ', STR_PAD_BOTH) . $_lf);
    }
    fwrite($f, $grs);
    fclose($f);
    TampilkanFileDWOPRN($nmf);
}
Пример #3
0
function Daftar()
{
    global $_lf, $arrID;
    if (!empty($_SESSION['pmbid']) && !empty($_SESSION['Cari'])) {
        $s = "select p.* \r\n      from pmb p\r\n      left outer join program prg on p.ProgramID=prg.ProgramID\r\n      left outer join prodi prd on p.ProdiID=prd.ProdiID\r\n      left outer join statusawal sa on p.StatusAwalID=sa.StatusAwalID\r\n      where p.{$_SESSION['Cari']} like '%{$_SESSION['pmbid']}%'\r\n      order by p.{$_SESSION['Cari']}";
        $r = _query($s);
        $maxcol = 114;
        $nmf = HOME_FOLDER . DS . "tmp/{$_SESSION['_Login']}.dwoprn";
        $f = fopen($nmf, 'w');
        fwrite($f, chr(27) . chr(15) . chr(27) . chr(108) . chr(14));
        $namatemplate = "template/form.undurdiri.txt";
        $ft = fopen($namatemplate, 'r');
        $tpl = fread($ft, filesize($namatemplate));
        fclose($ft);
        $mhsw = _fetch_array($r);
        //if ($mhsw['LulusUjian'] == 'Y') {
        $NamaFakJur = GetFields('prodi p left outer join fakultas f on f.FakultasID = p.FakultasID', "p.ProdiID", $mhsw['ProdiID'], "f.Nama as Fnama, p.Nama as Pnama");
        // Pakai template
        $_t = $tpl . chr(12);
        $_t = str_replace('#TGL#', date('d/m/Y'), $_t);
        $_t = str_replace('#NAMA#', $mhsw['Nama'], $_t);
        $_t = str_replace('#ALAMAT#', $mhsw['Alamat'], $_t);
        $_t = str_replace('#PMBID#', $mhsw['PMBID'], $_t);
        $_t = str_replace('#FAKJUR#', $NamaFakJur['Fnama'] . '/' . $NamaFakJur['Pnama'], $_t);
        $_t = str_replace('#PERIODE#', $mhsw['PMBPeriodID'] . "/" . $mhsw['TanggalUjian'], $_t);
        $_t = str_replace('#GRADE#', $mhsw['GradeNilai'], $_t);
        $_t = str_replace('#ORTU#', $mhsw['NamaAyah'], $_t);
        $_t = str_replace('#ALORTU#', $mhsw['AlamatOrtu'], $_t);
        fwrite($f, $_t);
        fwrite($f, $_lf . $_lf . "Dicetak tanggal : " . date("d-m-Y") . " ; Jam " . Date("H:i") . " Oleh " . $_SESSION['_Login']);
        fwrite($f, chr(12));
        fclose($f);
        TampilkanFileDWOPRN($nmf, "form.undurdiri");
    }
}
function CetakPindahan()
{
    global $_lf;
    $s = "select mps.*, mk.Nama as NamaMK\r\n    from mhswpindahansetara mps\r\n    left outer join mk mk on mps.MKID=mk.MKID\r\n    where MhswPindahanID='{$_REQUEST['pin']}'\r\n    order by mps.SetaraKode";
    $r = _query($s);
    $maxcol = 135;
    $nmf = HOME_FOLDER . DS . "tmp/p.{$_SESSION['_Login']}.dwoprn";
    $f = fopen($nmf, 'w');
    fwrite($f, chr(27) . chr(15) . chr(27) . chr(108) . chr(20));
    $div = str_pad('-', $maxcol, '-') . $_lf;
    $n = 0;
    $hal = 0;
    $brs = 56;
    $maxbrs = 49;
    $dt = GetFields('mhswpindahan', 'MhswPindahanID', $_REQUEST['pin'], "Nama");
    $prd = GetaField('prodi', 'ProdiID', $_REQUEST['prodi'], 'Nama');
    $hdr = str_pad('*** DAFTAR PENYETARAAN MATA KULIAH PINDAHAN **', $maxcol, ' ', STR_PAD_BOTH) . $_lf . $_lf . $_lf;
    $hdr .= "Tahun Akademik : " . NamaTahun($_REQUEST['tahun']) . $_lf;
    $hdr .= "Prodi          : {$prd}" . $_lf;
    $hdr .= "Mahasiswa      : {$dt['Nama']}" . $_lf;
    $hdr .= $div;
    $hdr .= str_pad("NO", 5) . str_pad("KODE", 10) . str_pad("MATA KULIAH", 35) . str_pad('SKS', 6) . str_pad('NILAI', 6) . str_pad('GRADE', 6) . str_pad('>>>', 5) . str_pad("KODE", 8) . str_pad("MATA KULIAH", 40) . str_pad('SKS', 6) . str_pad('GRADE', 4) . $_lf;
    $hdr .= $div;
    fwrite($f, $hdr);
    while ($w = _fetch_array($r)) {
        $n++;
        fwrite($f, str_pad($n, 5) . str_pad($w['SetaraKode'], 10) . str_pad($w['SetaraNama'], 37) . str_pad($w['SetaraSKS'], 5) . str_pad($w['NilaiAkhir'], 7) . str_pad($w['SetaraGrade'], 4) . str_pad('>>>>', 5) . str_pad($w['MKKode'], 8) . str_pad($w['NamaMK'], 40) . str_pad($w['SKS'], 8) . str_pad($w['GradeNilai'], 4) . $_lf);
    }
    fwrite($f, $div);
    fwrite($f, $_lf . "Dicetak Oleh : " . $_SESSION['_Login'] . ', ' . Date("d-m-Y H:i"));
    fwrite($f, chr(12));
    fclose($f);
    TampilkanFileDWOPRN($nmf);
}
Пример #5
0
function ProsesIPK()
{
    global $_lf;
    // Ambil data mahasiswa
    $s = "select m.MhswID\r\n    from mhsw m\r\n      left outer join statusmhsw sm on m.StatusMhswID=sm.StatusMhswID\r\n    where sm.Keluar='N'\r\n      and m.ProgramID='{$_REQUEST['prid']}'\r\n      and m.ProdiID='{$_REQUEST['prodi']}'\r\n    order by m.MhswID";
    $r = _query($s);
    $div = str_pad('-', 79, '-') . $_lf;
    // Buat file
    $nmf = HOME_FOLDER . DS . "tmp/prcipkbatch.dwoprn";
    $f = fopen($nmf, 'w');
    fwrite($f, "Proses Batch IPK: " . date('d-m-Y') . $_lf);
    fwrite($f, "Program: {$_REQUEST['prid']}, Program Studi: {$_REQUEST['prodi']}" . $_lf . $div);
    // Mulai proses
    $jmlMhsw = 0;
    while ($w = _fetch_array($r)) {
        $jmlMhsw++;
        $hsl = ProsesIndividu($w['MhswID']);
        $isi = $jmlMhsw . '. ' . $w['MhswID'] . ' : ' . $hsl . $_lf;
        fwrite($f, $isi);
    }
    fwrite($f, $div);
    fwrite($f, "Selesai proses. Jumlah diproses: {$jmlMhsw} Mahasiswa");
    // Tutup file
    fclose($f);
    TampilkanFileDWOPRN($nmf);
}
function Cetak()
{
    $_lf = chr(13) . chr(10);
    $id = $_REQUEST['id'];
    $jdwl = GetFields("jadwal j\r\n    left outer join dosen d on j.DosenID=d.Login", "j.JadwalID", $id, "j.*, concat(d.Nama, ', ', d.Gelar) as DSN");
    $_prodi = TRIM($jdwl['ProdiID'], '.');
    $_prodi = explode('.', $_prodi);
    $_prodi = $_prodi[0];
    $prodi = GetFields('prodi', 'ProdiID', $_prodi, "ProdiID, Nama, FakultasID");
    $fak = GetaField('fakultas', 'FakultasID', $prodi['FakultasID'], 'Nama');
    $nmf = "tmp/{$_SESSION['_Login']}.jdwl.php";
    $f = fopen($nmf, 'w');
    fwrite($f, chr(27) . chr(15));
    fwrite($f, chr(27) . chr(108) . chr(5));
    $mxc = 135;
    $mxb = 21;
    $grs = str_pad("-", $mxc, "-") . $_lf;
    $s = "select k.MhswID, left(m.Nama, 31) as Nama\r\n    from krs k\r\n      left outer join mhsw m on k.MhswID=m.MhswID\r\n      left outer join khs khs on k.KHSID=khs.KHSID\r\n    where k.JadwalID={$id}\r\n    order by k.MhswID";
    $r = _query($s);
    //echo "<pre>$r</pre>";
    //exit;
    $n = 0;
    $brs = 0;
    $hal = 1;
    $satu = Garis(12, '-');
    $dua = Garis(12);
    $header0 = str_pad('** Daftar Penilaian Portofolio & Performance ***', $mxc, ' ', STR_PAD_BOTH) . $_lf;
    $header = $grs . str_pad(' ', 50, ' ') . GarisHeader(12) . $_lf . str_pad(' ', 50, ' ') . $satu . $_lf . str_pad("No.  N.P.M        Nama Mahasiswa ", 50, ' ') . Kosong(12) . str_pad('=', 50, '=') . Garis(12, '=') . $_lf;
    fwrite($f, $header0);
    $header1 = BuatHeader($mxc, $jdwl, $prodi, $fak, $hal);
    fwrite($f, $header1);
    fwrite($f, $header);
    while ($w = _fetch_array($r)) {
        $n++;
        $brs++;
        if ($brs >= $mxb) {
            $hal++;
            $brs = 1;
            fwrite($f, "Dicetak oleh: {$_SESSION['_Login']}");
            fwrite($f, chr(12));
            fwrite($f, $header0);
            fwrite($f, BuatHeader($mxc, $jdwl, $prodi, $fak, $hal));
            fwrite($f, $header1);
            fwrite($f, $header);
        }
        fwrite($f, str_pad($n, 5) . str_pad($w['MhswID'], 13) . str_pad($w['Nama'], 32) . $dua . $_lf);
        fwrite($f, str_pad('-', 50, '-') . $satu . $_lf);
    }
    fwrite($f, str_pad("Akhir cetakan", $mxc, ' ', STR_PAD_LEFT) . $_lf);
    for ($i = $brs; $i <= $mxb; $i++) {
        fwrite($f, $_lf . $_lf);
    }
    fwrite($f, "Dicetak oleh: {$_SESSION['_Login']}");
    fwrite($f, chr(12));
    fclose($f);
    TampilkanFileDWOPRN($nmf);
}
Пример #7
0
function Daftar()
{
    global $_lf;
    if (empty($_SESSION['prodi'])) {
        $__prodi = '';
    } else {
        $__prodi = "and prd.ProdiID = '{$_SESSION['prodi']}'";
    }
    $__prg = empty($_SESSION['prid']) ? '' : "and prg.ProgramID = '{$_SESSION['prid']}'";
    $s = "select p.PMBID, p.Nama, p.NIM, p.ProdiID, p.LulusUjian, p.NilaiUjian,\r\n      prg.Nama as PRG, prd.Nama as PRODI, sa.Nama as STT, sa.TanpaTest,\r\n      bp.Nama as BPT\r\n      from pmb p\r\n      left outer join program prg on p.ProgramID=prg.ProgramID\r\n      left outer join prodi prd on p.ProdiID=prd.ProdiID\r\n      left outer join statusawal sa on p.StatusAwalID=sa.StatusAwalID\r\n      left outer join bipot bp on p.BIPOTID=bp.BIPOTID\r\n      where p.PMBPeriodID like '%{$_SESSION['tahun']}%' and p.NIM <> 0 {$__prodi} {$__prg}\r\n      order by prd.ProdiID, p.NIM";
    $r = _query($s);
    $maxcol = 90;
    $maxbrs = 53;
    $hal = 0;
    $brs = 54;
    $first = 1;
    $nmf = HOME_FOLDER . DS . "tmp/{$_SESSION['_Login']}.dwoprn";
    $f = fopen($nmf, 'w');
    fwrite($f, chr(27) . chr(15) . chr(27) . chr(108) . chr(10));
    $div = str_pad('-', $maxcol, '-') . $_lf;
    $n = 0;
    while ($w = _fetch_array($r)) {
        $_prodi = GetaField('prodi', 'ProdiID', $w['ProdiID'], 'Nama');
        $n++;
        $brs++;
        if ($brs > $maxbrs) {
            if ($first == 0) {
                fwrite($f, $div . chr(12));
            }
            $hd = Headerxx($_SESSION['tahun'], $_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($_SESSION['tahun'], $_prodi, $div, $maxcol, $hal));
            $brs = 0;
            $n = 1;
        }
        $isi = str_pad($n . '.', 5) . str_pad($w['PMBID'], 12) . str_pad($w['NIM'], 12) . str_pad($w['Nama'], 35) . str_pad($w['PRG'], 12) . str_pad($w['STT'], 10) . $_lf;
        fwrite($f, $isi);
    }
    fwrite($f, $div);
    //fwrite($f, str_pad('Halaman : '.$hal."/".$jumhal,10,' ').$_lf);
    fwrite($f, str_pad("Dicetak oleh : " . $_SESSION['_Login'], 20, ' ') . str_pad("Dicetak Tgl : " . date("d-m-Y H:i"), 70, ' ', STR_PAD_LEFT) . $_lf . $_lf);
    fwrite($f, str_pad("Akhir laporan", 90, ' ', STR_PAD_LEFT));
    fwrite($f, chr(12));
    fclose($f);
    TampilkanFileDWOPRN($nmf, "baa.lap");
}
Пример #8
0
function Cetak()
{
    global $_lf;
    // Parameters
    $jdwlid = $_REQUEST['JadwalID'];
    $jdwl = GetFields("jadwal", 'JadwalID', $jdwlid, "*");
    if (empty($jdwl)) {
        die("Data tidak ditemukan.");
    }
    // Buat File
    $nmf = HOME_FOLDER . DS . "tmp/{$_SESSION['_Login']}.dwoprn";
    $f = fopen($nmf, 'w');
    fwrite($f, chr(27) . chr(15));
    $hal = 0;
    $n = 0;
    $brs = 0;
    $maxbaris = 20;
    $mrgisi = str_pad(' ', 11, ' ');
    //$hdr = BuatHeader($jdwl, $);
    // Daftar mhsw
    $s = "select m.Nama as NamaM,krs.Mhswid as IDM \r\n    from krstemp as krs left outer join mhsw m on m.MhswID = krs.MhswID\r\n        where \r\n\tkrs.JadwalID = '{$jdwlid}' \r\n\tand krs.NA = 'N'\r\n\torder by krs.Mhswid";
    $r = _query($s);
    $jumrec = _num_rows($r);
    $jumhal = ceil($jumrec / $maxbaris);
    $hdr = BuatHeader($jdwl, $jumhal, $hal);
    fwrite($f, $hdr);
    while ($w = _fetch_array($r)) {
        if ($brs >= $maxbaris) {
            fwrite($f, chr(12));
            fwrite($f, BuatHeader($jdwl, $jumhal, $hal));
            $brs = 0;
        }
        //$brs++; $n++;
        //fwrite($f, str_pad($n.'. ', 4) . $w['IDM'] . ' » ' . $w['NamaM']);
        //fwrite($f, $_lf);
        $brs++;
        $n++;
        $item = $mrgisi . str_pad($n . '. ', 5) . str_pad($w['IDM'], 12) . $w['NamaM'];
        //if ($brs == 2) $item2 = "                   Jumlah Tatap Muka : " . $jdwl['Kehadiran'] . 'x';
        // else $item2 = '';
        //fwrite($f, $mrgisi . str_pad($n.'. ', 5) . $w['MhswID']. '   ' . str_pad($NamaMhsw, 50));
        if (!empty($item)) {
            fwrite($f, $item . $item2 . $_lf . $_lf);
        }
    }
    //fclose($f);
    //TampilkanFileDWOPRN($nmf);
    for ($i = $brs; $i < $maxbaris; $i++) {
        fwrite($f, $mrgisi . str_pad(' ', 5) . "** Tidak diperkenankan menambah pada baris ini **" . $_lf . $_lf);
    }
    fwrite($f, $_lf . "Dicetak Oleh : " . $_SESSION['_Login'] . ', ' . Date("d-m-Y H:i"));
    fwrite($f, chr(12));
    fclose($f);
    TampilkanFileDWOPRN($nmf);
}
Пример #9
0
function daftar()
{
    global $_lf;
    $whr = array();
    if (!empty($_SESSION['dsnkeycr']) && !empty($_SESSION['dsncr'])) {
        $whr[] = "{$_SESSION['dsnkeycr']} like '%{$_SESSION['dsncr']}%'";
    }
    $where = implode(' and ', $whr);
    $where = empty($where) ? '' : "and {$where}";
    $hom = empty($_SESSION['prodi']) ? '' : "and Homebase = '{$_SESSION['prodi']}'";
    $s = "select * from dosen\r\n    where KodeID='{$_SESSION['KodeID']}' {$where} {$hom}\r\n    order by {$_SESSION['dsnurt']} ";
    $r = _query($s);
    $Nhom = GetaField("prodi", "ProdiID", $_SESSION['prodi'], 'Nama');
    $nmf = HOME_FOLDER . DS . "tmp/{$_SESSION['_Login']}.dwoprn";
    $maxcol = 155;
    $f = fopen($nmf, 'w');
    fwrite($f, chr(27) . chr(15) . chr(77) . chr(27) . chr(108) . chr(5));
    $div = str_pad('-', $maxcol, '-') . $_lf;
    // parameter2
    $n = 0;
    $hal = 1;
    $brs = 0;
    $maxbrs = 52;
    $_Tgl = date("d-m-Y");
    $hdr = str_pad("** LAPORAN DAFTAR DOSEN **", $maxcol, ' ', STR_PAD_BOTH) . $_lf . $_lf . $_lf;
    $hdr .= str_pad("Urut Berdasarkan : " . $_SESSION['dsnurt'], 30, ' ') . $_lf;
    $hdr .= str_pad("Homebase         : " . $_SESSION['prodi'] . " - " . $Nhom, 30, ' ') . $_lf;
    $hdr .= $div;
    $hdr .= "No.   KODE    NAMA                                GELAR              HOMEBASE   TELEPON      ALAMAT" . $_lf . $div;
    $jumlahrec = _num_rows($r);
    $jumhal = ceil($jumlahrec / $maxbrs);
    fwrite($f, $hdr);
    while ($w = _fetch_array($r)) {
        $n++;
        $brs++;
        if ($brs > $maxbrs) {
            fwrite($f, $div);
            fwrite($f, str_pad('Halaman : ' . $hal . "/" . $jumhal, 10, ' ') . $_lf);
            $hal++;
            $brs = 1;
            fwrite($f, chr(12));
            fwrite($f, $hdr . $_lf);
        }
        $isi = str_pad($n . ".", 5, ' ') . ' ' . str_pad($w['Login'], 8, ' ') . str_pad($w['Nama'], 35, ' ') . ' ' . str_pad($w['Gelar'], 22, ' ') . str_pad($w['Homebase'], 6, ' ') . str_pad($w['Telephone'], 15, ' ') . str_pad($w['Alamat'], 50, ' ') . $_lf;
        fwrite($f, $isi);
    }
    fwrite($f, $div);
    fwrite($f, str_pad('Halaman : ' . $hal . "/" . $jumhal, 10, ' ') . $_lf);
    fwrite($f, str_pad("Dicetak oleh : " . $_SESSION['_Login'], 20, ' ') . str_pad("Dicetak Tgl : " . $_Tgl, 130, ' ', STR_PAD_LEFT) . $_lf . $_lf);
    fwrite($f, str_pad("Akhir laporan", 149, ' ', STR_PAD_LEFT));
    fwrite($f, chr(12));
    fclose($f);
    TampilkanFileDWOPRN($nmf, "dosen");
}
Пример #10
0
function CetakTandaTerima()
{
    global $_lf;
    $_whr = array();
    if (!empty($_SESSION['prodi'])) {
        $_whr[] = "m.ProdiID='{$_SESSION['prodi']}'";
    }
    $whr = empty($_whr) ? '' : " and " . implode(' and ', $_whr);
    $s = "select ta.MhswID, m.*\r\n    from ta ta\r\n      left outer join mhsw m on m.MhswID = ta.MhswID\r\n      left outer join prodi p on m.ProdiID=p.ProdiID \r\n      left outer join wisudawan w on w.MhswID = ta.MhswID\r\n    where m.KodeID='{$_SESSION['KodeID']}'\r\n    and m.noijazah != ' '\r\n    and m.TglSKKeluar = '{$_SESSION['TglSK']}'\r\n    and ta.Lulus = 'Y'\r\n    {$whr}\r\n    order by ta.MhswID";
    $r = _query($s);
    $maxcol = 114;
    $nmf = HOME_FOLDER . DS . "tmp/{$_SESSION['_Login']}.dwoprn";
    $f = fopen($nmf, 'w');
    $prn = $_SESSION['_Printer'] == 0 ? chr(27) . chr(15) . chr(27) . chr(108) . chr(5) : 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);
    fwrite($f, $prn);
    $div = str_pad('-', $maxcol, '-') . $_lf;
    // parameter2
    $n = 0;
    $hal = 1;
    $brs = 0;
    $maxbrs = 46;
    $Njur = GetFields("prodi p left outer join Fakultas f on f.FakultasID = p.FakultasID", "p.ProdiID", $_SESSION['prodi'], "p.Nama as pnama, f.Nama as fnama");
    $NamaFakJur = !empty($Njur) ? $Njur['fnama'] . '/' . $Njur['pnama'] : "Semua Prodi";
    $hdr = str_pad("** TANDA TERIMA PENGAMBILAN IJAZAH **", $maxcol, ' ', STR_PAD_BOTH) . $_lf . $_lf . $_lf . "SEMESTER       : " . NamaTahun($_SESSION['tahun']) . $_lf . "Fak/Jur        : " . $NamaFakJur . $_lf . "TGL SK REKTOR  : " . $_SESSION['TglSK'] . $_lf . $div . "No   NIM       NAMA                             NO.IJAZAH      TGL.TERIMA    TTD IJAZAH    TTD TRANSKRIP" . $_lf . $div . $_lf;
    $jump = 0;
    $jumw = 0;
    $Titik = "...........";
    fwrite($f, $hdr);
    while ($w = _fetch_array($r)) {
        $n++;
        $brs++;
        if ($brs > $maxbrs) {
            fwrite($f, $div);
            fwrite($f, str_pad('Halaman : ' . $hal . "/" . $jumhal, 10, ' ') . $_lf);
            $hal++;
            $brs = 1;
            fwrite($f, chr(12));
            fwrite($f, $hdr . $_lf);
        }
        $isi = str_pad($n . '.', 4, ' ') . str_pad($w['MhswID'], 11, ' ') . str_pad($w['Nama'], 33, ' ') . str_pad($w['NoIjazah'], 15, ' ') . str_pad($Titik, 14, ' ') . str_pad($Titik, 15, ' ') . str_pad($Titik, 13, ' ') . $_lf . $_lf;
        fwrite($f, $isi);
    }
    //$jumtotP = GetaField('wisudawan w left outer join mhsw m on w.MhswID = m.MhswID',"m.Kelamin = 'P' and WisudaID", $wsd['WisudaID'], "count(m.MhswID)");
    //$jumtotW = GetaField('wisudawan w left outer join mhsw m on w.MhswID = m.MhswID',"m.Kelamin = 'W' and WisudaID", $wsd['WisudaID'], "count(m.MhswID)");
    fwrite($f, $div);
    // fwrite($f, "Jumlah Seluruh Peserta/Jurusan : - Pria = $jump  - Wanita = $jumw" . $_lf);
    //fwrite($f, $div);
    //fwrite($f, "Jumlah Seluruh Peserta Seluruhnya : - Pria = $jumtotP  - Wanita = $jumtotW" . $_lf);
    //fwrite($f, $div);
    fwrite($f, str_pad("Dicetak oleh : {$_SESSION['_Login']}, " . date("d-m-Y H:i"), 50, ' ') . str_pad("Akhir Laporan", 60, ' ', STR_PAD_LEFT));
    fwrite($f, chr(12));
    fclose($f);
    TampilkanFileDWOPRN($nmf, "form.tandaterima");
}
Пример #11
0
function TampilkanDeposit()
{
    global $_lf;
    $mxb = 55;
    $mxc = 112;
    $grs = str_pad('-', $mxc, '-') . $_lf;
    $DariTanggal = FormatTanggal($_SESSION['DTGL']);
    $SampaiTanggal = FormatTanggal($_SESSION['STGL']);
    $hdr = str_pad("Daftar Deposit Mahasiswa", $mxc, ' ', STR_PAD_BOTH) . $_lf . str_pad("Periode: {$DariTanggal} sampai {$SampaiTanggal}", $mxc, ' ', STR_PAD_BOTH) . $_lf . $grs . str_pad('No.', 5) . str_pad('Tanggal', 12) . str_pad('N.P.M', 15) . str_pad('Nama Mahasiswa', 30) . str_pad('Jumlah', 15, ' ', STR_PAD_LEFT) . str_pad('Dipakai', 15, ' ', STR_PAD_LEFT) . str_pad('Sisa', 15, ' ', STR_PAD_LEFT) . $_lf . $grs;
    // Query
    $s = "select dm.DepositMhswID, dm.Tanggal, dm.MhswID,\r\n    dm.Jumlah, dm.Dipakai, (dm.Jumlah - dm.Dipakai) as Sisa, dm.Tutup,\r\n    LEFT(m.Nama, 29) as Nama, m.ProdiID\r\n    from depositmhsw dm\r\n      left outer join mhsw m on dm.MhswID=m.MhswID\r\n    where '{$_SESSION['DTGL']}' <= dm.Tanggal and dm.Tanggal <= '{$_SESSION['STGL']}'\r\n    order by dm.Tanggal";
    $r = _query($s);
    $n = 0;
    $b = 0;
    $nmf = HOME_FOLDER . DS . "tmp/{$_SESSION['_Login']}.dwoprn";
    $f = fopen($nmf, 'w');
    fwrite($f, $hdr);
    $_Jumlah = 0;
    $_Dipakai = 0;
    $_Sisa = 0;
    while ($w = _fetch_array($r)) {
        $n++;
        $b++;
        if ($b >= $mxb) {
            $mxb = 0;
            fwrite($f, $grs . chr(12));
            fwrite($f, $hdr);
        }
        $TGL = FormatTanggal($w['Tanggal']);
        // Jumlahkan
        $_Jumlah += $w['Jumlah'];
        $_Dipakai += $w['Dipakai'];
        $_Sisa += $w['Sisa'];
        // Format tampilan
        $Jumlah = number_format($w['Jumlah']);
        $Dipakai = number_format($w['Dipakai']);
        $Sisa = number_format($w['Sisa']);
        $Tutup = $w['Sisa'] == 0 ? chr(215) : '';
        fwrite($f, str_pad($n, 5) . str_pad($TGL, 12) . str_pad($w['MhswID'], 15) . str_pad($w['Nama'], 30) . str_pad($Jumlah, 15, ' ', STR_PAD_LEFT) . str_pad($Dipakai, 15, ' ', STR_PAD_LEFT) . str_pad($Sisa, 15, ' ', STR_PAD_LEFT) . str_pad($Tutup, 4, ' ', STR_PAD_LEFT) . $_lf);
    }
    $__Jumlah = number_format($_Jumlah);
    $__Dipakai = number_format($_Dipakai);
    $__Sisa = number_format($_Sisa);
    fwrite($f, $grs);
    fwrite($f, str_pad("Jumlah : ", 62, ' ', STR_PAD_LEFT) . str_pad($__Jumlah, 15, ' ', STR_PAD_LEFT) . str_pad($__Dipakai, 15, ' ', STR_PAD_LEFT) . str_pad($__Sisa, 15, ' ', STR_PAD_LEFT) . $_lf);
    fclose($f);
    TampilkanFileDWOPRN($nmf, 'klinik.lap');
}
Пример #12
0
function DaftarMhswTA()
{
    global $_lf;
    $whr = array();
    if (!empty($_SESSION['prodi'])) {
        $whr[] = "m.ProdiID='{$_SESSION['prodi']}' ";
    }
    if (!empty($_SESSION['DariNPM']) && !empty($_SESSION['SampaiNPM'])) {
        $whr[] = "'{$_SESSION['DariNPM']}' <= k.MhswID and k.MhswID <= '{$_SESSION['SampaiNPM']}' ";
    }
    $_whr = empty($whr) ? '' : 'and ' . implode(' and ', $whr);
    $s = "select k.MhswID, k.MKKode, LEFT(m.Nama, 30) as Nama,\r\n    khs.JumlahMK, khs.TotalSKS,\r\n    khs.Biaya, khs.Bayar, khs.Tarik, khs.Potongan, khs.JumlahLain\r\n    from krs k\r\n      left outer join mk mk on k.MKID=mk.MKID\r\n      left outer join jenispilihan jp on mk.JenisPilihanID=jp.JenisPilihanID\r\n      left outer join mhsw m on k.MhswID=m.MhswID\r\n      left outer join khs khs on k.KHSID=khs.KHSID\r\n    where jp.TA='Y' and k.TahunID='{$_SESSION['tahun']}' and khs.JumlahMK=1\r\n      {$_whr}\r\n    order by k.MhswID";
    $r = _query($s);
    $nmf = "tmp/{$_SESSION['_Login']}.dwoprn";
    $f = fopen($nmf, 'w');
    fwrite($f, chr(27) . chr(15));
    // Buat header
    $mxc = 80;
    $mxb = 50;
    $_prd = empty($_SESSION['prodi']) ? "Semua" : GetaField('prodi', "ProdiID", $_SESSION['prodi'], "concat(ProdiID, ' - ', Nama)");
    $grs = str_pad('-', $mxc, '-') . $_lf;
    $hdr = str_pad("** Daftar Mhsw Yang Hanya Ambil Skripsi/TA **", $mxc, ' ', STR_PAD_BOTH) . $_lf . str_pad("Tahun Akd : " . $_SESSION['tahun'], $mxc / 2) . $_lf . str_pad("Prodi     : " . $_prd, $mxc / 2) . $_lf;
    $hdr1 = $grs . str_pad('No', 5) . str_pad('N.P.M', 12) . str_pad('Nama Mhsw', 30) . str_pad('Kode MK', 8) . 'Jml MK' . str_pad('SKS', 4, ' ', STR_PAD_LEFT) . str_pad('Balance', 15, ' ', STR_PAD_LEFT) . $_lf . $grs;
    $n = 0;
    $b = 0;
    fwrite($f, $hdr . $hdr1);
    while ($w = _fetch_array($r)) {
        $n++;
        if ($b >= $mxb) {
            fwrite($f, $grs . chr(12));
            fwrite($f, $hdr . $hdr1);
            $b = 0;
        }
        $b++;
        $_bal = $w['Biaya'] - $w['Potongan'] + $w['Tarikan'] - $w['Bayar'];
        $bal = number_format($_bal);
        fwrite($f, str_pad($n, 5) . str_pad($w['MhswID'], 12) . str_pad($w['Nama'], 30) . str_pad($w['MKKode'], 10) . str_pad($w['JumlahMK'], 4, ' ', STR_PAD_LEFT) . str_pad($w['TotalSKS'], 4, ' ', STR_PAD_LEFT) . str_pad($bal, 15, ' ', STR_PAD_LEFT) . $_lf);
    }
    fwrite($f, $grs);
    $tgl = date('d-m-Y');
    fwrite($f, "Dicetak oleh: {$_SESSION['_Login']}, {$tgl}" . $_lf);
    fwrite($f, chr(12));
    fclose($f);
    TampilkanFileDWOPRN($nmf, 'akd.lap');
}
Пример #13
0
function CetakLabelMHSW()
{
    global $_lf, $_HeaderPrn;
    $tahun = $_REQUEST['tahun'];
    $darinpm = $_REQUEST['DariNPM'];
    $sampainpm = $_REQUEST['SampaiNPM'];
    $alamat = $_REQUEST['alamat'] + 0;
    $labelmhsw = HOME_FOLDER . DS . "tmp/labelmhswt.dwoprn";
    $mrg = str_pad(' ', 5, ' ');
    $Aktif = $darinpm == $sampainpm ? "" : "and k.StatusMhswID = 'A'";
    $s = "select m.MhswID, m.Nama, m.Alamat, m.AlamatAsal, m.Kota, m.KodePos\r\n\t     from mhsw m left outer join khs k on k.MhswID = m.MhswID\r\n    where ('{$darinpm}' <= m.MhswID)\r\n      and (m.MhswID <= '{$sampainpm}') \r\n      and k.TahunID = '{$tahun}' {$aktif}";
    $r = _query($s);
    //echo "<pre>$s</pre>";
    //exit;
    $f = fopen($labelmhsw, 'w');
    $n = 0;
    fwrite($f, $_HeaderPrn);
    while ($w = _fetch_array($r)) {
        $Alamat = empty($w['Alamat']) ? $w['AlamatAsal'] : $w['Alamat'];
        $Kota = empty($w['Kota']) ? $w['KotaAsal'] : $w['Kota'];
        $KodePos = empty($w['KodePos']) ? $w['KodePosAsal'] : $w['KodePos'];
        if ($alamat == 1) {
            fwrite($f, chr(27) . chr(15));
            fwrite($f, $mrg . $w['Nama'] . ' ' . $w['MhswID'] . $_lf);
            fwrite($f, $mrg . $Alamat . $_lf);
            fwrite($f, $mrg . $Kota . ' /' . $KodePos . $_lf);
            fwrite($f, chr(27) . chr(18));
            fwrite($f, $_HeaderPrn);
            fwrite($f, $_lf . $_lf . $_lf . $_lf . $_lf . $_lf);
        } else {
            fwrite($f, chr(27) . chr(15));
            fwrite($f, $mrg . $w['Nama'] . ' ' . $w['MhswID'] . $_lf);
            fwrite($f, chr(27) . chr(18));
            fwrite($f, $_HeaderPrn);
            fwrite($f, $_lf . $_lf);
        }
    }
    fwrite($f, chr(27) . chr(18) . chr(67) . chr(66));
    fclose($f);
    TampilkanFileDWOPRN($labelmhsw, "cetak.label");
    //include_once "dwoprn.php";
    //DownloadDWOPRN($labelmhsw);
}
function Daftar()
{
    global $_lf;
    if (!empty($_SESSION['DariNPM'])) {
        $_SESSION['SampaiNPM'] = empty($_SESSION['SampaiNPM']) ? $_SESSION['DariNPM'] : $_SESSION['SampaiNPM'];
        $_npm = "and '{$_SESSION['DariNPM']}' <= m.MhswID and m.MhswID <= '{$_SESSION['SampaiNPM']}' ";
    } else {
        $_npm = '';
    }
    $prd = empty($_SESSION['prodi']) ? '' : "and m.ProdiID = '{$_SESSION['prodi']}'";
    $s = "select m.* from mhsw m \r\n        where m.StatusMhswID = '{$_SESSION['status']}' {$prd} {$_npm} ";
    $r = _query($s);
    $nmf = "tmp/{$_SESSION['_Login']}.dwoprn";
    $f = fopen($nmf, 'w');
    fwrite($f, chr(27) . chr(15) . chr(27) . chr(77));
    // parameter
    $mxc = 160;
    $mxb = 50;
    $brs = 1;
    $grs = str_pad('-', $mxc, '-') . $_lf;
    $n = 0;
    $NamJur = GetaField('prodi', "ProdiID", $_SESSION['prodi'], "Nama");
    $NamaJudul = $_SESSION['status'] == 'D' ? "Drop Out (DO)" : "Keluar";
    $hdr = str_pad("** Daftar Mahasiswa {$NamaJudul}", $mxc, ' ', STR_PAD_BOTH) . $_lf . $_lf . "SEMESTER         : " . NamaTahun($_SESSION['tahun']) . $_lf . "JURUSAN          : " . $NamJur . $_lf . $grs . "No.   NIM         NAMA                                        NO SK                 TANGGAL SK     CATATAN" . $_lf . $grs;
    fwrite($f, $hdr);
    while ($w = _fetch_array($r)) {
        $n++;
        $brs++;
        if ($brs >= $mxb) {
            $brs = 0;
            fwrite($f, str_pad("Bersambung...", $mxc, ' ', STR_PAD_LEFT) . $_lf);
            fwrite($f, chr(12));
            fwrite($f, $hdr);
        }
        $isi = str_pad($n . '. ', 4) . str_pad($w['MhswID'], 10) . str_pad($w['Nama'], 40) . str_pad($w['SKKeluar'], 30) . str_pad($w['TglSKKeluar'], 15) . str_pad($w['CatatanKeluar'], 30) . $_lf;
        fwrite($f, $isi);
    }
    fwrite($f, $grs);
    fwrite($f, str_pad("Dicetak Oleh : {$_SESSION['_Login']}, " . date("d-m-Y H:i"), 60) . str_pad("Akhir Laporan", 100));
    fwrite($f, chr(12));
    fclose($f);
    TampilkanFileDWOPRN($nmf, 'akd.lap', 0);
}
Пример #15
0
function DaftarDosenAktif()
{
    global $_lf;
    $mxc = 80;
    $hal = 1;
    $mxb = 55;
    $grs = str_pad('=', $mxc, '=') . $_lf;
    $NamaProdi = empty($_SESSION['prodi']) ? "Semua" : GetaField('prodi', 'ProdiID', $_SESSION['prodi'], 'Nama');
    $hdr = str_pad("Daftar Dosen : Tahun {$_SESSION['tahun']}", $mxc, ' ', STR_PAD_BOTH) . $_lf . str_pad("Program Studi: {$NamaProdi}", $mxc, ' ', STR_PAD_BOTH) . $_lf . $grs . str_pad('No.', 5) . str_pad('Kode', 10) . str_pad('Nama Dosen', 44) . str_pad('Status', 10) . $_lf . $grs;
    $nmf = "tmp/{$_SESSION['_Login']}.dwoprn";
    $f = fopen($nmf, 'w');
    fwrite($f, chr(27) . chr(15));
    $whrprd = empty($_SESSION['prodi']) ? '' : "and INSTR(j.ProdiID, '.{$_SESSION['prodi']}.') > 0";
    $status = empty($_SESSION['statusdosen']) ? '' : "and d.StatusDosenID = '{$_SESSION['statusdosen']}'";
    $s = "select d.Login, concat(d.Nama, ', ', d.Gelar) as DSN, sd.Nama as STTDSN\r\n    from jadwal j\r\n      left outer join dosen d on j.DosenID=d.Login\r\n      left outer join statusdosen sd on d.StatusDosenID=sd.StatusDosenID\r\n    where j.NamaKelas<>'KLINIK' {$whrprd} {$status}\r\n    group by d.Login";
    $r = _query($s);
    $n = 0;
    $brs = 0;
    fwrite($f, $hdr);
    $jumlahrec = _num_rows($r);
    $jumhal = ceil($jumlahrec / $mxb);
    while ($w = _fetch_array($r)) {
        $brs++;
        $n++;
        if ($brs > $mxb) {
            $brs = 0;
            $hal++;
            fwrite($f, $grs);
            fwrite($f, str_pad('Halaman : ' . $hal . "/" . $jumhal, 10, ' ') . $_lf);
            fwrite($f, chr(12));
            fwrite($f, $hdr);
        }
        fwrite($f, str_pad($n, 5) . str_pad($w['Login'], 10) . str_pad($w['DSN'], 44) . str_pad($w['STTDSN'], 10) . $_lf);
    }
    fwrite($f, $grs);
    $_n = number_format($n);
    fwrite($f, "Jumlah dosen: {$_n} orang" . $_lf);
    fwrite($f, str_pad('Halaman : ' . $hal . "/" . $jumhal, 10, ' ') . $_lf);
    fwrite($f, chr(12));
    fclose($f);
    TampilkanFileDWOPRN($nmf, 'akd.lap');
}
function DaftarHonorer()
{
    global $_lf;
    $mxb = 55;
    $hal = 1;
    $mxc = 80;
    $grs = str_pad("-", $mxc, '-') . $_lf;
    $hdr = str_pad("Daftar Semua Dosen Honorer (Urut Nama)", $mxc, ' ', STR_PAD_BOTH) . $_lf . $grs . str_pad('No.', 5) . str_pad('Kode', 10) . str_pad('Nama Dosen', 50) . str_pad('Homebase', 10) . $_lf . $grs;
    $nmf = "tmp/{$_SESSION['_Login']}.dwoprn";
    $f = fopen($nmf, 'w');
    fwrite($f, chr(27) . chr(15) . $_lf);
    fwrite($f, $hdr);
    $Urut = $_REQUEST['Urut'] + 0 == 0 ? "order by d.Nama" : "order by d.Login";
    $s = "select d.Login, d.Nama, d.Gelar, d.Homebase\r\n    from dosen d\r\n    where d.StatusDosenID='H'\r\n    {$Urut}";
    $r = _query($s);
    $n = 0;
    $brs = 0;
    $jumlahrec = _num_rows($r);
    $jumhal = ceil($jumlahrec / $mxb);
    while ($w = _fetch_array($r)) {
        $n++;
        $brs++;
        if ($brs > $mxb) {
            $brs = 0;
            $hal++;
            fwrite($f, $grs);
            fwrite($f, str_pad('Halaman : ' . $hal . "/" . $jumhal, 10, ' ') . $_lf);
            fwrite($f, chr(12));
            fwrite($f, $hdr);
        }
        fwrite($f, str_pad($n, 5) . str_pad($w['Login'], 10) . str_pad($w['Nama'] . ', ' . $w['Gelar'], 50) . str_pad($w['Homebase'], 10) . $_lf);
    }
    fwrite($f, $grs);
    fwrite($f, "Jumlah Dosen: {$n} orang {$_lf}");
    fwrite($f, str_pad('Halaman : ' . $hal . "/" . $jumhal, 10, ' ') . $_lf);
    fwrite($f, str_pad("Dicetak oleh : " . $_SESSION['_Login'], 45, ' ') . str_pad("Dicetak Tgl : " . date("d-m-Y H:i"), 35, ' ', STR_PAD_LEFT) . $_lf . $_lf);
    fwrite($f, chr(12));
    fclose($f);
    TampilkanFileDWOPRN($nmf, "akd.lap");
}
Пример #17
0
function CetakBPM($bpm)
{
    global $_lf;
    $NamaBank = GetaField('rekening', 'RekeningID', $bpm['RekeningID'], 'Nama');
    $NamaMhsw = GetaField('mhsw', 'MhswID', $bpm['MhswID'], 'Nama');
    // Buat cetakannya
    $mrg = str_pad(' ', 8, ' ');
    $isi = $_lf;
    // header
    $mrg = str_pad(' ', 8, ' ');
    $isi .= str_pad($bpm['BayarMhswID'], 50, ' ', STR_PAD_LEFT) . $_lf . $_lf . $_lf . $_lf . $_lf;
    $isi .= $mrg . $mrg . $bpm['RekeningID'] . $_lf . $_lf;
    $isi .= $mrg . $mrg . $bpm['TahunID'] . $_lf;
    $isi .= $mrg . $mrg . $bpm['MhswID'] . ' / ' . $NamaMhsw . $_lf . $_lf;
    $isi .= $mrg . $mrg . $NamaBank . $_lf . $_lf . $_lf . $_lf;
    // cetak di posisi ke-10
    for ($i = 0; $i <= 9; $i++) {
        $isi .= $_lf . $_lf;
    }
    $ket = substr($bpm['Keterangan'], 0, 20);
    $jml = number_format($bpm['JumlahLain']);
    $isi .= $mrg . str_pad(' ', 10) . str_pad($ket, 20) . str_pad($jml, 15, ' ', STR_PAD_LEFT) . $_lf . $_lf;
    $isi .= $mrg . str_pad(' ', 30) . str_pad($jml, 15, ' ', STR_PAD_LEFT);
    // footer
    $isi .= $mrg . $isi_ . $_lf;
    $isi .= $_lf . $_lf . $_lf;
    $tgl = date('d-m-Y');
    $isi .= $mrg . "Dicetak oleh: {$_SESSION['_Login']}, {$tgl}" . $_lf;
    $isi .= $_lf . $_lf . $_lf . $_lf . $_lf;
    // Buat Tujuan
    $nmf = HOME_FOLDER . DS . "tmp/{$_SESSION['_Login']}.dwoprn";
    $f = fopen($nmf, 'w');
    fwrite($f, chr(27) . chr(18) . chr(27) . chr(67) . chr(60));
    fwrite($f, $isi);
    fwrite($f, chr(12));
    fclose($f);
    TampilkanFileDWOPRN($nmf);
}
function AlamatMhsw1()
{
    global $_lf;
    $s = "select m.MhswID, LEFT(m.Nama, 30) as Nama, m.StatusMhswID,\r\n    LEFT(m.Alamat, 50) as Alamat, m.Kota, m.Propinsi, m.Telepon, m.Telephone, m.Email,\r\n    m.RT, m.RW, m.KodePos\r\n    from mhsw m\r\n    where '{$_SESSION['DariNPM']}' <= m.MhswID\r\n      and m.MhswID <= '{$_SESSION['SampaiNPM']}'\r\n    order by m.MhswID";
    $r = _query($s);
    // Buat file
    $nmf = HOME_FOLDER . DS . "tmp/{$_SESSION['_Login']}.dwoprn";
    $f = fopen($nmf, 'w');
    fwrite($f, chr(27) . chr(15) . chr(27) . chr(77));
    // parameter
    $mxc = 160;
    $mxb = 50;
    $grs = str_pad('-', $mxc, '-') . $_lf;
    // header
    $hdr = str_pad("** Daftar Mahasiswa **", $mxc, ' ', STR_PAD_BOTH) . $_lf . str_pad("Rentang NPM: {$_SESSION['DariNPM']} s/d {$_SESSION['SampaiNPM']}", $mxc, ' ', STR_PAD_BOTH) . $_lf . $grs . str_pad("No", 6) . str_pad("N.P.M", 15) . str_pad("Nama Mahasiswa", 30) . str_pad("Telepon", 20) . str_pad("Alamat", 50) . str_pad("RT/RW", 10) . str_pad("Kodepos", 10) . str_pad("Kota", 20) . $_lf . $grs;
    fwrite($f, $hdr);
    // Data mhsw
    $n = 0;
    $hal = 1;
    $brs = 0;
    while ($w = _fetch_array($r)) {
        if ($brs >= $mxb) {
            $brs = 0;
            fwrite($f, str_pad("Bersambung...", $mxc, ' ', STR_PAD_LEFT) . $_lf);
            fwrite($f, chr(12));
            fwrite($f, $hdr);
        }
        $n++;
        $brs++;
        fwrite($f, str_pad($n . '.', 6) . str_pad($w['MhswID'], 15) . str_pad($w['Nama'], 30) . str_pad($w['Telephone'], 20) . str_pad($w['Alamat'], 50) . str_pad($w['RT'] . '/' . $w['RW'], 10) . str_pad($w['KodePos'], 10) . str_pad($w['Kota'], 20) . $_lf);
    }
    fwrite($f, $grs);
    fwrite($f, "Dicetak oleh: {$_SESSION['_Login']}" . $_lf);
    fwrite($f, chr(12) . chr(27));
    fclose($f);
    TampilkanFileDWOPRN($nmf, 'baa.lap', 0);
}
Пример #19
0
function Daftar()
{
    global $_lf;
    $s = "select p.Nama, pm.* from pmbmundur pm\r\n        left outer join pmb p on p.PMBID = pm.PMBID\r\n        where pm.PMBPeriodID = '{$_SESSION['pmbperiod']}'\r\n        order by pm.PMBID";
    $r = _query($s);
    $maxcol = 120;
    $nmf = HOME_FOLDER . DS . "tmp/{$_SESSION['_Login']}.dwoprn";
    $f = fopen($nmf, 'w');
    fwrite($f, chr(27) . chr(15));
    $div = str_pad('-', $maxcol, '-') . $_lf;
    $n = 0;
    $brs = 0;
    $maxbrs = 50;
    $hdr = str_pad('*** Validitas PMB Mundur ***', $maxcol, ' ', STR_PAD_BOTH) . $_lf . $_lf;
    $hdr .= "Periode : " . NamaTahunPMB($_SESSION['pmbperiod']) . $_lf;
    $hdr .= $div;
    $hdr .= str_pad('NO.', 4) . str_pad('PMBID', 12) . str_pad('NAMA', 30) . str_pad('TGL PROSES', 12) . str_pad('NO SURAT', 10) . str_pad('TGL SURAT', 12) . str_pad('ALASAN', 20) . str_pad('BIAYA ADMINISTRASI', 18) . $_lf . $div;
    fwrite($f, $hdr);
    while ($w = _fetch_array($r)) {
        $n++;
        $brs++;
        if ($brs >= $maxbrs) {
            fwrite($f, $div);
            fwrite($f, "Bersambung ke ...");
            fwrite($f, chr(12));
            $brs = 1;
            fwrite($f, $hdr);
        }
        $isi = str_pad($n . '.', 4) . str_pad($w['PMBID'], 12) . str_pad($w['Nama'], 30) . str_pad($w['TglProses'], 12) . str_pad($w['NoSurat'], 10) . str_pad($w['TglSurat'], 12) . str_pad($w['Alasan'], 20) . str_pad(number_format($w['BiayaAdministrasi']), 18, ' ', STR_PAD_LEFT) . $_lf;
        fwrite($f, $isi);
    }
    fwrite($f, $div);
    fwrite($f, str_pad("Dicetak Oleh : " . $_SESSION['_Login'] . ', ' . date("d-m-Y H:i"), 40) . str_pad("Akhir Laporan", 73, ' ', STR_PAD_LEFT) . $_lf);
    fwrite($f, chr(12));
    fclose($f);
    TampilkanFileDWOPRN($nmf, "?");
}
function DaftarRekapDeposit()
{
    global $_lf;
    $mxb = 55;
    $mxc = 80;
    $grs = str_pad('-', $mxc, '-') . $_lf;
    // query
    $s = "select dm.MhswID, sum(dm.Jumlah-dm.Dipakai) as Sisa, LEFT(m.Nama, 39) as Nama\r\n    from depositmhsw dm\r\n      left outer join mhsw m on dm.MhswID=m.MhswID\r\n    where (dm.Jumlah-dm.Dipakai) >0\r\n    group by dm.MhswID";
    $r = _query($s);
    $n = 0;
    $b = 0;
    $ttl = 0;
    // Header
    $hdr = str_pad("Rekapitulasi Deposit Mahasiswa", $mxc, ' ', STR_PAD_BOTH) . $_lf . $grs . str_pad('No.', 5) . str_pad('N.P.M', 15) . str_pad('Nama', 40) . str_pad('Deposit', 20, ' ', STR_PAD_LEFT) . $_lf . $grs;
    // buat isi
    $nmf = HOME_FOLDER . DS . "tmp/{$_SESSION['_Login']}.dwoprn";
    $f = fopen($nmf, 'w');
    fwrite($f, $hdr);
    while ($w = _fetch_array($r)) {
        $n++;
        $b++;
        if ($b >= $mxb) {
            $b = 0;
            fwrite($f, $grs . chr(12));
            fwrite($f, $hdr);
        }
        $Sisa = number_format($w['Sisa']);
        $ttl += $w['Sisa'];
        fwrite($f, str_pad($n, 5) . str_pad($w['MhswID'], 15) . str_pad($w['Nama'], 40) . str_pad($Sisa, 20, ' ', STR_PAD_LEFT) . $_lf);
    }
    $_ttl = number_format($ttl);
    fwrite($f, $grs);
    fwrite($f, str_pad("Total : ", 60, ' ', STR_PAD_LEFT) . str_pad($_ttl, 20, ' ', STR_PAD_LEFT) . $_lf);
    fclose($f);
    TampilkanFileDWOPRN($nmf, 'klinik.lap');
}
Пример #21
0
function KoreksiNilai()
{
    global $_lf;
    $nmf = "tmp/{$_SESSION['_Login']}.dwoprn";
    $f = fopen($nmf, 'w');
    $mxc = 80;
    $mxb = 50;
    $grs = str_pad('-', $mxc, '-') . $_lf;
    $_prd = empty($_SESSION['prodi']) ? "Semua" : GetaField("prodi", 'ProdiID', $_SESSION['prodi'], 'Nama');
    $hdr = str_pad("Daftar SK Koreksi Nilai {$_SESSION['tahun']}", $mxc, ' ', STR_PAD_BOTH) . $_lf . str_pad("Program Studi: {$_prd} ({$_SESSION['prodi']})", $mxc, ' ', STR_PAD_BOTH) . $_lf . $grs . str_pad("No.", 5) . str_pad("Nomer SK", 25) . str_pad("N P M", 15) . str_pad("Nama Mahasiswa", 26) . str_pad("Lama", 5) . str_pad("Baru", 5) . $_lf . $grs;
    fwrite($f, $hdr);
    $whr = empty($_SESSION['prodi']) ? "" : "and m.ProdiID='{$_SESSION['prodi']}' ";
    $s = "select kn.*, LEFT(m.Nama, 25) as Nama, \r\n    m.ProdiID, m.ProgramID, mk.MKKode, mk.Nama as NamaMK\r\n    from koreksinilai kn\r\n      left outer join mhsw m on kn.MhswID=m.MhswID\r\n      left outer join mk mk on kn.MKID=mk.MKID\r\n    where kn.TahunID='{$_SESSION['tahun']}'\r\n      {$whr}\r\n    order by SK";
    $r = _query($s);
    $n = 0;
    while ($w = _fetch_array($r)) {
        $n++;
        fwrite($f, str_pad($n, 5) . str_pad($w['SK'], 25) . str_pad($w['MhswID'], 15) . str_pad($w['Nama'], 26) . str_pad($w['GradeLama'], 5) . str_pad($w['GradeNilai'], 5) . $_lf);
    }
    fwrite($f, $grs);
    fwrite($f, chr(12));
    fclose($f);
    TampilkanFileDWOPRN($nmf, 'akd.lap');
}
Пример #22
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);
    }
}
Пример #23
0
function CetakPilihanWajib1($kur)
{
    global $_lf;
    $mxc = 80;
    $mxb = 50;
    $grs = str_pad('-', $mxc, '-') . $_lf;
    $prd = GetaField('prodi', 'ProdiID', $_SESSION['prodi'], 'Nama');
    $hdr = str_pad("Daftar Matakuliah {$prd} ({$_SESSION['prodi']})", $mxc, ' ', STR_PAD_BOTH) . $_lf . str_pad("Kurikulum: {$kur['KurikulumKode']}, {$kur['Nama']}", $mxc, ' ', STR_PAD_BOTH) . $_lf;
    $hdr1 = $grs . str_pad('No.', 6) . str_pad('Kode', 10) . str_pad('Nama', 45) . str_pad('SKS', 5) . str_pad('Wajib', 5) . $_lf . $grs;
    $nmf = HOME_FOLDER . DS . "tmp/{$_SESSION['_Login']}.dwoprn";
    $f = fopen($nmf, 'w');
    fwrite($f, $hdr . $hdr1);
    $s = "select MKKode, Nama, Sesi, SKS, Wajib, JenisPilihanID\r\n    from mk\r\n    where mk.KurikulumID={$kur['KurikulumID']} and mk.NA='N'\r\n    order by mk.JenisPilihanID, mk.Sesi, mk.MKKode";
    $r = _query($s);
    $n = 0;
    $brs = 0;
    $jen = "xhajskhdasiuhdlfkas hdlkfajhsdl faksjdh falksdjhf laksjdhf lkasdhf";
    while ($w = _fetch_array($r)) {
        if ($jen != $w['JenisPilihanID']) {
            $brs += 3;
            $jen = $w['JenisPilihanID'];
            $_k = GetaField('jenispilihan', 'JenisPilihanID', $w['JenisPilihanID'], 'Nama');
            fwrite($f, "\r\nJenis Pilihan: {$_k} \r\n");
        }
        if ($brs >= $mxb) {
            $brs = 0;
            fwrite($f, chr(12));
            fwrite($f, $hdr . $hdr1);
        }
        $brs++;
        $n++;
        $wjb = $w['Wajib'] == 'Y' ? '*' : '';
        fwrite($f, str_pad($n, 6) . str_pad($w['MKKode'], 10) . str_pad($w['Nama'], 45) . str_pad($w['SKS'], 5) . str_pad($wjb, 5) . $_lf);
    }
    fwrite($f, $grs);
    fclose($f);
    TampilkanFileDWOPRN($nmf, "matakuliah");
}
Пример #24
0
<?php

//function Preview();
include "../sisfokampus.php";
include "dwo.lib.php";
$nmf = $_REQUEST['nmf'];
TampilkanFileDWOPRN($nmf);
function DftrAkdLapKRSMhswDispen()
{
    global $_HeaderPrn, $_lf;
    $whr = array();
    if (!empty($_SESSION['prodi'])) {
        $whr[] = "m.ProdiID='{$_SESSION['prodi']}'";
    }
    if (!empty($_SESSION['prid'])) {
        $whr[] = "m.ProgramID='{$_SESSION['prid']}'";
    }
    if (!empty($_SESSION['DariNPM']) && !empty($_SESSION['SampaiNPM'])) {
        $whr[] = " '{$_SESSION['DariNPM']}' <= m.MhswID and m.MhswID <= '{$_SESSION['SampaiNPM']}' ";
    }
    $_whr = implode(" and ", $whr);
    if (!empty($_whr)) {
        $_whr = " and " . $_whr;
    }
    // query
    $s = "select krs.KRSID, krs.MKID, krs.StatusKRSID, mk.MKKode, j.JenisJadwalID, \r\n    LEFT(mk.Nama, 25) as NamaMK, mk.SKS, krs.CatatanDispensasi, krs.TanggalDispensasi, \r\n    krs.MhswID, LEFT(m.Nama, 15) as NamaMhsw,\r\n    m.ProdiID, m.ProgramID, prd.Nama as PRD, m.TotalSKS\r\n    from krs krs\r\n      left outer join mhsw m on krs.MhswID=m.MhswID\r\n      left outer join prodi prd on m.ProdiID=prd.ProdiID\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    where krs.StatusKRSID='A' and krs.TahunID='{$_SESSION['tahun']}' {$_whr} \r\n    and krs.CatatanDispensasi <> ''\r\n    order by m.ProdiID, m.MhswID, mk.MKKode";
    $r = _query($s);
    // Buat file
    $nmf = "tmp/{$_SESSION['_Login']}.dwoprn";
    $f = fopen($nmf, 'w');
    // parameter2
    //$_prodi = GetaField('prodi', 'ProdiID', $_SESSION['prodi'], 'Nama');
    //$_prid = GetaField('program', 'ProgramID', $_SESSION['prid'], 'Nama');
    $hal = 0;
    $brs = 45;
    $maxbrs = 45;
    $maxcol = 150;
    $div = str_pad('-', $maxcol, '-') . $_lf;
    $tgl = date('d-m-Y h:i');
    fwrite($f, chr(27) . chr(15) . chr(27) . chr(77));
    // --> set 66 baris (kuarto)
    // Buat header
    $RentangNPM = !empty($_SESSION['DariNPM']) && !empty($_SESSION['SampaiNPM']) ? "Dari NPM: {$_SESSION['DariNPM']} s/d {$_SESSION['SampaiNPM']} " : '';
    $_npm = '';
    $prd = '';
    $jumlahrec = _num_rows($r);
    $jumhal = ceil($jumlahrec / $maxbrs);
    $first = 1;
    $n_ = 0;
    while ($w = _fetch_array($r)) {
        // Tampilkan Prodi
        $n++;
        $brs++;
        $_prodi = GetaField('prodi', 'ProdiID', $w['ProdiID'], 'Nama');
        $_prid = GetaField('program', 'ProgramID', $w['ProgramID'], 'Nama');
        if ($brs > $maxbrs) {
            if ($first == 0) {
                fwrite($f, $div . chr(12));
            }
            $hd = HeaderKrs($_SESSION['tahun'], $_prid, $_prodi, $div, $maxcol, $hal, $RentangNPM);
            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, HeaderKrs($_SESSION['tahun'], $_prid, $_prodi, $div, $maxcol, $hal, $RentangNPM));
            $brs = 0;
            $_n = 0;
        }
        if ($_npm != $w['MhswID']) {
            $_npm = $w['MhswID'];
            $_mhswid = $w['MhswID'];
            $_mhswnm = $w['NamaMhsw'];
            $_TOTSKS = $w['TotalSKS'];
            $_n++;
            $_strn = str_pad($_n, 3, '0', STR_PAD_LEFT);
            $_SKS = GetaField('krs left outer join jadwal j on j.JadwalID = krs.JadwalID', "krs.TahunID='{$_SESSION['tahun']}' and j.JenisJadwalID = 'K' and krs.MhswID", $w['MhswID'], "sum(krs.SKS)") + 0;
            $_IPS = '0,00';
        } else {
            $_mhswid = '';
            $_mhswnm = '';
            $_str = '';
            $_strn = '   ';
            $_SKS = '  ';
            $_IPS = '    ';
            $_TOTSKS = ' ';
        }
        $Catatan = str_replace(chr(13), ' ', $w['CatatanDispensasi']);
        $Catatan = str_replace(chr(10), '', $Catatan);
        // Tuliskan
        $jj = $w['JenisJadwalID'] != 'K' ? " ({$w['JenisJadwalID']})" : '';
        $isi = $_strn . ' ';
        $isi .= str_pad($_mhswid, 12, ' ') . ' ';
        $isi .= str_pad($_mhswnm, 15, ' ') . ' ';
        $isi .= str_pad($w['MKKode'], 7) . ' ';
        $isi .= str_pad($w['NamaMK'] . $jj, 30) . ' ';
        $isi .= str_pad($w['SKS'], 2, ' ', STR_PAD_LEFT) . ' ';
        $isi .= str_pad($w['TanggalDispensasi'], 12, ' ', STR_PAD_LEFT) . '   ';
        $isi .= str_pad($Catatan, 30, ' ') . ' ';
        $isi .= $_lf;
        fwrite($f, $isi);
    }
    $hal++;
    fwrite($f, $div);
    fwrite($f, str_pad("Dicetak oleh: " . $_SESSION['_Login'] . ', ' . date("d-m-Y H:i"), 50, ' '));
    //str_pad("(Akhir Laporan) Hal. : ".$hal.'/'.$jumhal, 100, ' ', STR_PAD_LEFT));
    // Tutup & tampilkan
    fwrite($f, chr(12));
    fclose($f);
    TampilkanFileDWOPRN($nmf, 'akd.lap');
}
Пример #26
0
function Daftar()
{
    global $_HeaderPrn, $_lf;
    $whr = array();
    if (!empty($_SESSION['prodi'])) {
        $whr[] = "m.ProdiID='{$_SESSION['prodi']}'";
    }
    if (!empty($_SESSION['prid'])) {
        $whr[] = "m.ProgramID='{$_SESSION['prid']}'";
    }
    if (!empty($_SESSION['DariNPM']) && !empty($_SESSION['SampaiNPM'])) {
        $whr[] = " '{$_SESSION['DariNPM']}' <= m.MhswID and m.MhswID <= '{$_SESSION['SampaiNPM']}' ";
    }
    $_whr = implode(" and ", $whr);
    if (!empty($_whr)) {
        $_whr = " and " . $_whr;
    }
    // Query
    $s = "select m.MhswID, m.Nama, m.IPK, m.TotalSKS, m.BatasStudi, m.Telepon, m.Alamat\r\n    from khs \r\n      left outer join mhsw m on khs.MhswID=m.MhswID\r\n      left outer join statusmhsw sm on m.StatusMhswID=sm.StatusMhswID\r\n    where khs.TahunID='{$_SESSION['tahun']}' and khs.JumlahMK=0 {$_whr}\r\n      and khs.StatusMhswID='P'\r\n      and sm.Keluar='N'\r\n    order by khs.MhswID ";
    $r = _query($s);
    //echo "<pre>$s</pre>";
    // Buat file
    $MaxCol = 114;
    $nmf = "tmp/{$_SESSION['_Login']}.dwoprn";
    $f = fopen($nmf, 'w');
    fwrite($f, chr(27) . chr(15));
    $div = str_pad('-', $MaxCol, '-') . $_lf;
    // parameter2
    $_prodi = GetaField('prodi', 'ProdiID', $_SESSION['prodi'], 'Nama');
    $_prid = GetaField('program', 'ProgramID', $_SESSION['prid'], 'Nama');
    $n = 0;
    $hal = 1;
    $brs = 0;
    $maxbrs = 23;
    // Buat header
    $RentangNPM = !empty($_SESSION['DariNPM']) && !empty($_SESSION['SampaiNPM']) ? "Dari NPM : {$_SESSION['DariNPM']} s/d {$_SESSION['SampaiNPM']} " : '';
    $hdr = str_pad("*** Daftar Mahasiswa Bolos KRS {$_SESSION['tahun']} ***", $MaxCol, ' ', STR_PAD_BOTH) . $_lf . $_lf;
    $hdr .= "Program  : {$_prid}" . $_lf;
    $hdr .= "Prodi    : {$_prodi}" . $_lf;
    $hdr .= $RentangNPM . $_lf;
    $hdr .= $div;
    $hdr .= "No.  NPM          Nama                         Total   IPK Batas  Sesi   Telp & Alamat" . $_lf . "                                                 SKS       Studi  Aktif" . $_lf . $div;
    fwrite($f, $hdr);
    // Status yg aktif
    //$aktif = GetArrayTable("select concat('\"', StatusMhswID, '\"') as SM
    //  from statusmhsw where Nilai=1", "SM", "SM");
    // Tampilkan
    $jumlahrec = _num_rows($r);
    $jumhal = ceil($jumlahrec / $maxbrs);
    while ($w = _fetch_array($r)) {
        $n++;
        $brs++;
        if ($brs > $maxbrs) {
            fwrite($f, $div);
            fwrite($f, str_pad("Hal. : " . $hal . '/' . $jumhal, $maxcol, ' ', STR_PAD_LEFT) . $_lf);
            $hal++;
            $brs = 1;
            fwrite($f, chr(12) . $_lf);
            fwrite($f, $hdr);
        }
        $smtaktif = GetaField('khs', "StatusMhswID in ('A', 'T', 'W') and MhswID", $w['MhswID'], "max(TahunID)");
        //echo $smtaktif;
        $isi = str_pad($n . '.', 4, ' ') . ' ' . str_pad($w['MhswID'], 12) . ' ' . str_pad($w['Nama'], 30) . ' ' . str_pad($w['TotalSKS'], 3, ' ', STR_PAD_LEFT) . ' ' . str_pad($w['IPK'], 5, ' ', STR_PAD_LEFT) . ' ' . str_pad($w['BatasStudi'], 6) . ' ' . str_pad($smtaktif, 6) . ' ' . str_pad($w['Telepon'], 20) . $_lf . str_pad(' ', 72, ' ') . ' ' . str_pad($w['Alamat'] . ', ' . $w['Kota'], 30);
        fwrite($f, $isi . $_lf);
    }
    fwrite($f, $div);
    fwrite($f, str_pad("Hal. : " . $hal . '/' . $jumhal, $maxcol, ' ', STR_PAD_LEFT) . $_lf);
    fwrite($f, $_lf . $_lf . str_pad('Dicetak oleh : ' . $_SESSION['_Login'], 85, ' ') . str_pad('Dibuat : ' . date("d-m-Y H:i"), 29, ' '));
    fwrite($f, chr(12));
    fclose($f);
    TampilkanFileDWOPRN($nmf, "akd.lap");
}
function Daftar()
{
    global $_HeaderPrn, $_lf;
    $whr = array();
    if (!empty($_SESSION['prodi'])) {
        $whr[] = "m.ProdiID='{$_SESSION['prodi']}'";
    }
    if (!empty($_SESSION['prid'])) {
        $whr[] = "m.ProgramID='{$_SESSION['prid']}'";
    }
    if (!empty($_SESSION['DariNPM']) && !empty($_SESSION['SampaiNPM'])) {
        $whr[] = " '{$_SESSION['DariNPM']}' <= m.MhswID and m.MhswID <= '{$_SESSION['SampaiNPM']}' ";
    }
    $_whr = implode(" and ", $whr);
    if (!empty($_whr)) {
        $_whr = " and " . $_whr;
    }
    // Query
    $s = "select m.MhswID, m.Nama, sum(krs.SKS) as TSKS, m.IPK, m.BatasStudi, krs.KHSID, m.ProdiID, m.ProgramID\r\n    from krstemp krs\r\n      left outer join mhsw m on krs.MhswID=m.MhswID\r\n    where krs.TahunID='{$_SESSION['tahun']}'\r\n    {$_whr}\r\n    group by krs.MhswID ";
    $r = _query($s);
    // Buat file
    $nmf = "tmp/{$_SESSION['_Login']}.dwoprn";
    $f = fopen($nmf, 'w');
    $div = str_pad('-', 79, '-') . $_lf;
    // parameter2
    //$_prodi = GetaField('prodi', 'ProdiID', $_SESSION['prodi'], 'Nama');
    //$_prid = GetaField('program', 'ProgramID', $_SESSION['prid'], 'Nama');
    $n = 0;
    $hal = 1;
    $brs = 56;
    $maxbrs = 55;
    $maxcol = 79;
    $first = 1;
    // Buat header
    $RentangNPM = !empty($_SESSION['DariNPM']) && !empty($_SESSION['SampaiNPM']) ? "Dari NPM : {$_SESSION['DariNPM']} s/d {$_SESSION['SampaiNPM']} " : '';
    // Tampilkan
    $jumlahrec = _num_rows($r);
    $jumhal = ceil($jumlahrec / $maxbrs);
    while ($w = _fetch_array($r)) {
        $Cek = GetaField('khs', 'KHSID', $w['KHSID'], 'StatusMhswID');
        if ($Cek == 'A') {
        } else {
            $n++;
            $brs++;
            $_prodi = GetaField('prodi', 'ProdiID', $w['ProdiID'], 'Nama');
            $_prid = GetaField('program', 'ProgramID', $w['ProgramID'], 'Nama');
            if ($brs > $maxbrs) {
                if ($first == 0) {
                    fwrite($f, $div . chr(12));
                }
                $hd = HeaderKrs($_SESSION['tahun'], $_prid, $_prodi, $div, $maxcol, $hal, $RentangNPM);
                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, HeaderKrs($_SESSION['tahun'], $_prid, $_prodi, $div, $maxcol, $hal, $RentangNPM));
                $brs = 0;
                $n = 1;
            }
            $isi = str_pad($n . '.', 4, ' ') . ' ' . str_pad($w['MhswID'], 12) . ' ' . str_pad($w['Nama'], 30) . ' ' . str_pad($w['TSKS'], 3, ' ', STR_PAD_LEFT) . ' ' . str_pad($w['IPK'], 6, ' ', STR_PAD_LEFT) . ' ' . str_pad($w['BatasStudi'], 6);
            fwrite($f, $isi . $_lf);
        }
    }
    fwrite($f, $div);
    //fwrite($f, str_pad('Halaman : '.$hal."/".$jumhal,10,' ').$_lf);
    fwrite($f, str_pad('Dicetak oleh : ' . $_SESSION['_Login'], 55, ' ') . str_pad('Dibuat : ' . date("d-m-Y H:i"), 29, ' '));
    fwrite($f, chr(12));
    fclose($f);
    TampilkanFileDWOPRN($nmf, "akd.lap");
}
function Daftar(){
  global $_lf;
  $prodix = (empty($_SESSION['prodi'])) ? '' : "and k.prodiid = '$_SESSION[prodi]'";
  if ((!empty($_SESSION['DariNPM'])) and (!empty($_SESSION['SampaiNPM']))) {
    $_SESSION['SampaiNPM'] = (empty($_SESSION['SampaiNPM']))? $_SESSION['DariNPM'] : $_SESSION['SampaiNPM'];
    $_npm = "and '$_SESSION[DariNPM]' <= k.MhswID and k.MhswID <= '$_SESSION[SampaiNPM]' ";
  } else $_npm = '';
  $jen = $_REQUEST['jen'];
  if ($jen == 1) { /*$Qjen = "and (Biaya - Bayar - Potongan + Tarik) > 0";*/ $p='>'; $jdls = "Hutang";}
  elseif ($jen == -1) {$Qjen = /*"and (Biaya - Bayar - Potongan + Tarik) < 0";*/ $p='<='; $jdls = "Deposit";}
  else {$Qjen = ''; $jdls = 'Hutang/Deposit';}
  $s1 = "select k.*, m.Nama from khs k 
         left outer join mhsw m on k.mhswid = m.mhswid where k.tahunid = '$_SESSION[tahun]' 
         and k.statusmhswid in ('A') 
         
         $_npm
         $prodix
         order by k.MhswID";
  BuatArrayHeader($hdr, $hdrid);
  for ($i=0; $i<sizeof($hdr); $i++) {
    $gab[$i] = "$hdr[$i]"; 
  }
  $MaxCol = 262;
  $maxbrs = 11;
  $brs = 0;
  //var_dump($gab);
  $nmf = HOME_FOLDER  .  DS . "tmp/rinci.$_SESSION[_Login].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;
  $margin = str_pad(' ',33,' ');
  //$tes = str_
  $sprhdr = str_pad("*** Laporan Rincian Kewajiban dan Pembayaran Mahasiswa ***",$MaxCol,' ',STR_PAD_BOTH).$_lf.$_lf.$_lf;
  $hdr  = $margin.                                                          str_pad($gab[1],16,' ').str_pad($gab[4],16,' ').str_pad($gab[3],16,' ').str_pad($gab[15],16,' ').str_pad($gab[19],16,' ').str_pad(substr("Pot.U.K",0,11),16,' ').str_pad('|',3,' ').str_pad($gab[1],16,' ').str_pad($gab[4],16,' ').str_pad($gab[3],16,' ').str_pad($gab[15],16,' ').str_pad($gab[19],16,' ').str_pad("Ujian Skripsi",16,' ').str_pad(' ',16,' ').str_pad(' ',16,' ').$_lf;
  $hdr .= str_pad("No.",5,' ').str_pad("NPM",10,' ').str_pad('Nama',18,' ').str_pad($gab[7],16,' ').str_pad($gab[2],16,' ').str_pad($gab[8],16,' ').str_pad($gab[16],16,' ').str_pad(substr($gab[20],0,17),16,' ').str_pad("Pot Mhsw Baru",16,' ').str_pad("|",3,' ').str_pad($gab[7],16,' ').str_pad($gab[2],16,' ').str_pad($gab[8],16,' ').str_pad($gab[16],16,' ').str_pad(substr($gab[20],0,17),16,' ').str_pad("Lain-Lain",16,' ').str_pad('     TARIK',16,' ').str_pad($jdls,15,' ',STR_PAD_LEFT).$_lf;
  $hdr .= $margin.                                                          str_pad($gab[0],16,' ').str_pad($gab[17],16,' ').str_pad($gab[13],16,' ').str_pad($gab[18],16,' ').str_pad($gab[9],16,' ').str_pad("Total Tagih",16,' ').str_pad('|',3,' ').str_pad($gab[0],16,' ').str_pad($gab[17],16,' ').str_pad($gab[13],16,' ').str_pad($gab[18],16,' ').str_pad($gab[9],16,' ').str_pad("Total Bayar",16,' ').str_pad(' ',16,' ').str_pad(' ',30,' ').$_lf;
  $hdr2  = "                                                                            TAGIHAN                                              |                                                         PEMBAYARAN                                                                  ".$_lf;
  $n = 0;
  $r1 = _query($s1);
  $pec = array();
  $pec2 = array();
  //$_hdr = implode('', $gab); 
  //$idnya = Getafield('bipotnama','trxid',1,'Bipotnamaid');
  //$ff2 = str_pad("No.",4,' ') . str_pad("NPM",11,' ').$_hdr.str_pad("Total",12,' ').str_pad('Bayar',12,' ').str_pad('Saldo',12,' ').$_lf;
  if (empty($_SESSION['prodi'])){}
  else {
    $prodis = GetaField('prodi','ProdiID',$_SESSION['prodi'],'Nama');
    $prodiini = "Fakultas : " . str_pad($_SESSION['prodi']. " - " . $prodis, 30,' '). $_lf;
  }
  fwrite($f, $sprhdr);
  fwrite($f, str_pad("Jenis    : ". $jdls, 30, ' ').$_lf);
  fwrite($f, str_pad("Periode  : ". NamaTahun($_SESSION['tahun']),30,' ').$_lf);
  fwrite($f, $prodiini);
  fwrite($f, str_pad("Tanggal  : ". date("d-m-Y"),30,' ').$_lf);
  fwrite($f, $div);
  fwrite($f, $hdr2);
  fwrite($f, $div);
  fwrite($f, $hdr);
  fwrite($f, $div);
  while ($w = _fetch_array($r1)){
    //$detail = GetDetailBayar($w['MhswID'], $w['khsid'], $_SESSION['tahun'], $hdrid);
    //$detailb = GetDetailBayar2($w['MhswID'], $w['khsid'], $_SESSION['tahun'], $hdrid);
    $detail = GetDetailBayar($w['MhswID'], $w['khsid'], $_SESSION['tahun'], $hdrid);
    $detail2 = GetDetailBayar2($w['MhswID'], $w['khsid'], $_SESSION['tahun'], $hdrid);
    $totw = array_sum($detail);
    $totq = array_sum($detail2);
    $diskon = GetaField('bipotmhsw', "TrxID=-1 and TahunID='$_SESSION[tahun]' and MhswID", $w['MhswID'], 'Jumlah')+0;
    $saldo = $totw - $totq - $diskon;
    
    if ($saldo > 0) { 
    
    $n++; $brs++;
    if($brs > $maxbrs){
        $hal++; $brs = 1;
        fwrite($f, chr(12));
        fwrite($f, $sprhdr);
        fwrite($f,$div);
        fwrite($f, $hdr2);
			  fwrite($f,$div);
			  fwrite($f,$hdr);
			  fwrite($f,$div);
				 
		}
		$Pot = GetFields("bipotmhsw","trxid = -1 and tahunid = '$_SESSION[tahun]' and mhswid",$w['MhswID'],"Besar,Dibayar");
		$lain = GetFields("bayarmhsw","tahunid = '$_SESSION[tahun]' and MhswID",$w['MhswID'],"Sum(JumlahLain) as JML");
    
    //$totw = array_sum($detail);
    //$totq = array_sum($detail2);
    $angkatan = Getafield('mhsw',"mhswid",$w['MhswID'],'left(Nama,16)');
    $bm = GetFields("khs","TahunID = '$_SESSION[tahun]' and mhswid",$w['MhswID'],"Biaya, Potongan, Bayar");
    //$saldo = $totw - $totq; //$bm['Bayar']- $bm['Biaya'] + $bm['Potongan'] - $w['Tarik'];
    $isi_ = str_pad($w['MhswID'],11,' ').str_pad($angkatan,34).$_lf;
    $isi_ .= str_pad(' ',11,' ').str_pad(' ',22,' ').$_lf;
    $isi_ .= str_pad(' ',11,' ').str_pad(' ',22,' ').$_lf;
     
    $isi  = str_pad("$n.",5,' ').str_pad($w['MhswID'],10,' ').str_pad($angkatan,16).str_pad(number_format($detail[1]),15,' ',STR_PAD_LEFT).str_pad(number_format($detail[4]),16,' ',STR_PAD_LEFT).str_pad(number_format($detail[3]),15,' ',STR_PAD_LEFT).str_pad(number_format($detail[15]),16,' ',STR_PAD_LEFT).str_pad(number_format($detail[19]),16,' ',STR_PAD_LEFT).str_pad(number_format($Pot['Dibayar']),16,' ',STR_PAD_LEFT).str_pad(number_format($detail2[1]),17,' ',STR_PAD_LEFT).str_pad(number_format($detail2[4]),16,' ',STR_PAD_LEFT).str_pad(number_format($detail2[3]),16,' ',STR_PAD_LEFT).str_pad(number_format($detail2[15]),19,' ',STR_PAD_LEFT).str_pad(number_format($detail2[19]),16,' ',STR_PAD_LEFT).str_pad(number_format($detail2[14]),16,' ',STR_PAD_LEFT).str_pad(number_format(0),16,' ',STR_PAD_LEFT).str_pad(' ',16,' ',STR_PAD_LEFT).$_lf;
    $isi .= str_pad(' ',11,' ').str_pad(' ',20,' ').                                str_pad(number_format($detail[7]),15,' ',STR_PAD_LEFT).str_pad(number_format($detail[2]),16,' ',STR_PAD_LEFT).str_pad(number_format($detail[8]),15,' ',STR_PAD_LEFT).str_pad(number_format($detail[16]),16,' ',STR_PAD_LEFT).str_pad(number_format($detail[20]),16,' ',STR_PAD_LEFT).str_pad(number_format($detail[12]),16,' ',STR_PAD_LEFT).str_pad(number_format($detail2[7]),17,' ',STR_PAD_LEFT).str_pad(number_format($detail2[2]),16,' ',STR_PAD_LEFT).str_pad(number_format($detail2[8]),16,' ',STR_PAD_LEFT).str_pad(number_format($detail2[16]),19,' ',STR_PAD_LEFT).str_pad(number_format($detail2[20]),16,' ',STR_PAD_LEFT).str_pad(number_format($lain['JML']),16,' ',STR_PAD_LEFT).str_pad(number_format($w['Tarik']),16,' ',STR_PAD_LEFT).str_pad(number_format($saldo),16,' ',STR_PAD_LEFT).$_lf;
    $isi .= str_pad(' ',11,' ').str_pad(' ',20,' ').                                str_pad(number_format($detail[0]),15,' ',STR_PAD_LEFT).str_pad(number_format($detail[17]),16,' ',STR_PAD_LEFT).str_pad(number_format($detail[13]),15,' ',STR_PAD_LEFT).str_pad(number_format($detail[18]),16,' ',STR_PAD_LEFT).str_pad(number_format($detail[9]),16,' ',STR_PAD_LEFT).str_pad(number_format($bm['Biaya']),16,' ',STR_PAD_LEFT).str_pad(number_format($detail2[0]),17,' ',STR_PAD_LEFT).str_pad(number_format($detail2[17]),16,' ',STR_PAD_LEFT).str_pad(number_format($detail2[13]),16,' ',STR_PAD_LEFT).str_pad(number_format($detail2[18]),19,' ',STR_PAD_LEFT).str_pad(number_format($detail2[9]),16,' ',STR_PAD_LEFT).str_pad(number_format($bm['Bayar']),16,' ',STR_PAD_LEFT).str_pad(number_format(0),16,' ',STR_PAD_LEFT).str_pad(' ',16,' ',STR_PAD_LEFT).$_lf.$div;
    $tot = array_sum($detail);
    $GTot += $tot;
    $Gbayar += $w['Bayar'];
    
    fwrite($f,$isi); //.str_pad(number_format($tot),12,' ',STR_PAD_LEFT).str_pad(number_format($w['Bayar']),12,' ',STR_PAD_LEFT).str_pad(number_format($saldo),12,' ',STR_PAD_LEFT).$_lf;
    $total1 += $detail[1] + $detail[7] + $detail[0];
    $total2 += $detail[4] + $detail[2] + $detail[17];
    $total3 += $detail[3] + $detail[8] + $detail[13];
    $total4 += $detail[15] + $detail[16] + $detail[18];
    $total5 += $detail[19] + $detail[20] + $detail[9];
    $total6 += $detail[14] + $detail[12] + ($bm['Biaya']- $bm['Potongan']);
    $totalb1 += $detail2[1] + $detail2[7] + $detail2[0];
    $totalb2 += $detail2[4] + $detail2[2] + $detail2[17];
    $totalb3 += $detail2[3] + $detail2[8] + $detail2[13];
    $totalb4 += $detail2[15] + $detail2[16] + $detail2[18];
    $totalb5 += $detail2[19] + $detail2[20] + $detail2[9];
    $totalb6 += $detail2[14] + $detail2[12] + $bm['Bayar'];
    $gtotal += $saldo;
    $tar += $w['Tarik'];
  }
  }
  for ($k=0; $k<sizeof($totl);$k++) $tott[$k] = str_pad(number_format($totl[$k]),12,' ',STR_PAD_LEFT);
  $gsal = $gtot - $Gbayar;
  
  $ffs = str_pad(' ',4,' ').str_pad("Jumlah Total",25,' ').str_pad(number_format($total1),17,' ',STR_PAD_LEFT).
                                                           str_pad(number_format($total2),16,' ',STR_PAD_LEFT).
                                                           str_pad(number_format($total3),16,' ',STR_PAD_LEFT).
                                                           str_pad(number_format($total4),16,' ',STR_PAD_LEFT).
                                                           str_pad(number_format($total5),16,' ',STR_PAD_LEFT).
                                                           str_pad(number_format($total6),16,' ',STR_PAD_LEFT).
                                                           
                                                           
                                                           str_pad(number_format($totalb1),16,' ',STR_PAD_LEFT).
                                                           str_pad(number_format($totalb2),16,' ',STR_PAD_LEFT).
                                                           str_pad(number_format($totalb3),16,' ',STR_PAD_LEFT).
                                                           str_pad(number_format($totalb4),19,' ',STR_PAD_LEFT).
                                                           str_pad(number_format($totalb5),17,' ',STR_PAD_LEFT).
                                                           str_pad(number_format($totalb6),15,' ',STR_PAD_LEFT).
                                                           str_pad(number_format($tar),16,' ',STR_PAD_LEFT).
                                                           str_pad(number_format($gtotal),16,' ',STR_PAD_LEFT).
                                                           $_lf;
  //fwrite($f, $div);
  fwrite($f, $ffs);
  fwrite($f, $div);
  fwrite($f, str_pad("Dicetak : ".date("d-m-Y H:i"),10,' ').str_pad("Akhir laporan",236, ' ', STR_PAD_LEFT).$_lf);
  fwrite($f, chr(12));
  fclose($f);
  TampilkanFileDWOPRN($nmf, "keu.lap.rincimahasiswa");
}
Пример #29
0
function Daftar()
{
    global $_HeaderPrn, $_lf;
    $whr = array();
    if (!empty($_SESSION['prodi'])) {
        $whr[] = "p.ProdiID='{$_SESSION['prodi']}'";
    }
    if (!empty($_SESSION['prid'])) {
        $whr[] = "p.ProgramID='{$_SESSION['prid']}'";
    }
    $_whr = implode(" and ", $whr);
    if (!empty($_whr)) {
        $_whr = " and " . $_whr;
    }
    // Query
    $s = "select byr.*, LEFT(p.Nama, 25) as Nama,\r\n    p.ProdiID\r\n    from bayarmhsw byr\r\n      left outer join pmb p on byr.PMBID=p.PMBID\r\n      left outer join prodi prd on p.ProdiID=prd.ProdiID\r\n    where p.PMBPeriodID='{$_SESSION['tahun']}'\r\n      and byr.PMBMhswID=0\r\n    {$_whr}\r\n    order by p.ProdiID, byr.PMBID ";
    $r = _query($s);
    //echo "<pre>$s</pre>";
    $MaxCol = 114;
    // Buat file
    $nmf = HOME_FOLDER . DS . "tmp/{$_SESSION['_Login']}.dwoprn";
    $f = fopen($nmf, 'w');
    fwrite($f, chr(27) . chr(15));
    $div = str_pad('-', $MaxCol, '-') . $_lf;
    // parameter2
    $n = 0;
    $hal = 0;
    $brs = 0;
    $maxbrs = 50;
    // Buat header
    $hdr = str_pad("*** Daftar Pembayaran Mahasiswa Baru ***", $MaxCol, ' ', STR_PAD_BOTH) . $_lf;
    $hdr .= $div;
    $hdr .= "No.  PMB ID       Nama                      NPM             Tanggal            Nilai BPM     Total Bayar" . $_lf . $div;
    fwrite($f, $hdr);
    // Tampilkan
    $pmbid = '';
    $prd = '';
    $TotalBiaya = 0;
    $TotalBayar = 0;
    while ($w = _fetch_array($r)) {
        $brs++;
        if ($prd != $w['ProdiID']) {
            $brs++;
            $prd = $w['ProdiID'];
            $_prd = GetaField('prodi', "ProdiID", $prd, "Nama");
            fwrite($f, $_lf . chr(187) . " {$prd} - {$_prd}" . $_lf);
        }
        if ($brs >= $maxbrs) {
            $brs = 0;
            fwrite($f, chr(12));
            fwrite($f, $hdr);
        }
        if ($pmbid != $w['PMBID']) {
            $n++;
            $_n = $n;
            $pmbid = $w['PMBID'];
            $_pmbid = $pmbid;
            $_nama = $w['Nama'];
            $BiayaMhsw = GetaField('pmb', 'PMBID', $pmbid, "TotalBiayaMhsw") + 0;
            $TBIA = number_format($BiayaMhsw);
            $TotalBiaya += $BiayaMhsw;
        } else {
            $_n = '';
            $_pmbid = '';
            $_nama = '';
            $TBIA = '';
        }
        $TotalBayar += $w['Jumlah'];
        $TBYR = number_format($w['Jumlah']);
        $Tgl = FormatTanggal($w['Tanggal']);
        $isi = str_pad($_n, 4, ' ') . ' ' . str_pad($_pmbid, 12, ' ') . ' ' . str_pad($_nama, 25) . ' ' . str_pad($w['MhswID'], 15, ' ') . ' ' . str_pad($Tgl, 12) . ' ' . str_pad($TBIA, 15, ' ', STR_PAD_LEFT) . ' ' . str_pad($TBYR, 15, ' ', STR_PAD_LEFT);
        fwrite($f, $isi . $_lf);
    }
    fwrite($f, $div);
    $_TotalBiaya = number_format($TotalBiaya);
    $_TotalBayar = number_format($TotalBayar);
    fwrite($f, str_pad('Total :', 72, ' ', STR_PAD_LEFT) . ' ' . str_pad($_TotalBiaya, 15, ' ', STR_PAD_LEFT) . ' ' . str_pad($_TotalBayar, 15, ' ', STR_PAD_LEFT) . $_lf);
    fwrite($f, $div);
    fwrite($f, str_pad("Dicetak Oleh : {$_SESSION['_Login']}, " . date("d-m-Y H:i"), 100) . str_pad("Akhir Laporan", 100) . $_lf);
    fclose($f);
    TampilkanFileDWOPRN($nmf, "keu.lap");
}
Пример #30
0
function CetakFormulirCuti($mhswid, $mhsw, $tahun)
{
    global $_lf, $KodeID;
    // Data mhsw
    //$krs = GetFields("krs", "StatusKRSID='A' and MhswID", $mhsw['MhswID'], "sum(SKS) as TSKS, format(sum(SKS*BobotNilai)/sum(SKS), 2) as IPK");
    //$_ips = GetFields('krs left join jadwal j on krs.JadwalID = j.JadwalID', "(j.JenisJadwalID is null or j.JenisJadwalID <> 'R') and StatusKRSID='A' and (GradeNilai<>'-' or GradeNilai <> '' and not GradeNilai is NULL) and krs.Final = 'Y' and krs.MhswID",$mhswid,
    //"sum(krs.SKS * BobotNilai)/sum(krs.SKS) as IPS, sum(krs.SKS) as SKS");
    $thn = GetFields('tahun', "ProgramID='{$mhsw['ProgramID']}' and ProdiID='{$mhsw['ProdiID']}' and TahunID", $tahun, "*");
    $khs = GetFields('khs', "TahunID='{$tahun}' and MhswID", $mhswid, "*");
    $regakhr = GetaField('khs', "TahunID < '{$tahun}' and StatusMhswID='A' and MhswID", $mhswid, 'TahunID', "Order By TahunID DESC");
    //$_Balance = $khs['Biaya'] - $khs['Potongan'] + $khs['Tarik'] - $khs['Bayar'];
    $bolos = GetAfield('khs left outer join tahun on tahun.TahunID = khs.TahunID', "khs.TahunID < '{$tahun}' and tahun.ProdiID = '{$khs['ProdiID']}' and khs.TahunID > '{$regakhr}' and tahun.SP = 'N' and StatusMhswID = 'P' and MhswID", $mhswid, "count(khs.TahunID)");
    $_Balance = HitungHutang($mhswid, $regakhr);
    if ($_Balance >= 0) {
        $jdl = "Kewajiban Keuangan";
    } else {
        $jdl = "Deposit Sebesar";
        $_Balance = str_replace('-', '', $_Balance);
    }
    $bls = $bolos != 0 ? "(Bolos {$bolos} semester)" : '';
    $Balance = number_format($_Balance);
    $pernah = GetArrayTable("select TahunID from khs where MhswID='{$mhswid}' and StatusMhswID='C' order by TahunID", "TahunID", "TahunID", ', ');
    $pernah = empty($pernah) ? '-' : $pernah;
    $TglLahir = FormatTanggal($mhsw['TanggalLahir']);
    // Buat file
    $nmf = HOME_FOLDER . DS . "tmp/cuti.dwoprn";
    $f = fopen($nmf, 'w');
    fwrite($f, chr(27) . chr(18));
    fwrite($f, chr(27) . chr(108) . chr(5));
    // margin
    fwrite($f, $_lf . $_lf);
    // Tuliskan data
    $mrg = '   ';
    fwrite($f, str_pad("Formulir Permohonan Cuti Kuliah", 79, ' ', STR_PAD_BOTH) . $_lf . $_lf);
    fwrite($f, "Saya, yang bertandatangan di bawah ini:" . $_lf);
    fwrite($f, $mrg . str_pad("Nama Mahasiswa", 25, ' ') . " : " . $mhsw['Nama'] . $_lf);
    fwrite($f, $mrg . str_pad("NPM", 25, ' ') . " : " . $mhsw['MhswID'] . $_lf);
    fwrite($f, $mrg . str_pad("Tempat, Tgl Lahir", 25, ' ') . " : " . $mhsw['TempatLahir'] . ', ' . $TglLahir . $_lf);
    fwrite($f, $mrg . str_pad("SKS yang telah diambil", 25, ' ') . " : " . $mhsw['TotalSKS'] . ' SKS' . $_lf);
    fwrite($f, $mrg . str_pad("Registrasi Akhir", 25, ' ') . " : " . NamaTahun($regakhr) . " {$bls}" . $_lf);
    fwrite($f, $mrg . str_pad("IPK (Index Prestasi Kum.)", 25, ' ') . " : " . $mhsw['IPK'] . $_lf);
    fwrite($f, $mrg . str_pad("Alamat", 25, ' ') . " : " . $mhsw['Alamat'] . $_lf);
    fwrite($f, $mrg . str_pad(' ', 25, ' ') . '   ' . $mhsw['Kota'] . ' ' . $mhsw['KodePos'] . $_lf);
    fwrite($f, $mrg . str_pad($jdl, 25, ' ') . " : Rp. " . $Balance . $_lf);
    fwrite($f, $mrg . str_pad("Pernah cuti kuliah", 25, ' ') . " : " . $pernah . $_lf . $_lf);
    fwrite($f, "Mengajukan permohonan cuti kuliah pada semester {$thn['Nama']} karena:" . $_lf . $_lf);
    $garis = $mrg . str_pad('_', 75, '_');
    fwrite($f, $garis . $_lf . $_lf . $garis . $_lf . $_lf);
    // footer 1
    fwrite($f, str_pad(' ', 45, ' ') . "Jakarta, " . date('d-m-Y') . $_lf);
    fwrite($f, str_pad("Disetujui/Tidak Disetujui", 45, ' ') . "Mahasiswa" . $_lf);
    fwrite($f, "Pimpinan Fakultas," . $_lf . $_lf . $_lf . $_lf . $_lf);
    fwrite($f, str_pad("(                            )", 45, ' ') . "( {$mhsw['Nama']} )" . $_lf . $_lf);
    // footer 2
    $pa = GetaField('dosen', 'Login', $mhsw['PenasehatAkademik'], "concat(Nama, ', ', Gelar)");
    $kaperpus = GetaField('pejabat', 'JabatanID', 'KAPERPUS', 'Nama');
    fwrite($f, str_pad("Mengetahui :", 45, ' ') . $_lf);
    fwrite($f, str_pad("Perpustakaan {$KodeID} :", 45, ' ') . $_lf);
    fwrite($f, str_pad("Mahasiswa ini tidak memiliki ", 45, ' ') . "Mengetahui :" . $_lf);
    fwrite($f, str_pad("pinjaman buku yg belum dikembalikan.", 45, ' ') . "P.A." . $_lf);
    fwrite($f, $_lf . $_lf . $_lf . $_lf);
    fwrite($f, str_pad("({$kaperpus})", 45, ' ') . "({$pa})" . $_lf);
    fwrite($f, $_lf . $_lf);
    fwrite($f, "Catatan: Formulir ini harus dikembalikan ke TU Fakultas untuk dibuatkan" . $_lf);
    fwrite($f, "SK Cuti Kuliah");
    fwrite($f, chr(12));
    // Jangan lupa tutup file
    fclose($f);
    TampilkanFileDWOPRN($nmf, 'cuti');
}