Exemplo n.º 1
0
function DftrKuliah()
{
    // Buat Header
    echo "<table class=box cellspacing=1 align=center width=960>";
    $hdr = "<tr><th class=ttl width=50 colspan=2>#</th>\r\n      <th class=ttl width=60>Ruang</th>\r\n      <th class=ttl width=75>Jam</th>\r\n      <th class=ttl width=80>Kode <sup>Smt</sup></th>\r\n      <th class=ttl>Matakuliah</th>\r\n      <th class=ttl width=50>Kelas</th>\r\n      <th class=ttl width=20>SKS</th>\r\n      <th class=ttl width=200>Dosen</th>\r\n      <th class=ttl width=40>Cetak</th>\r\n      <th class=ttl width=20 title='Hapus Jadwal'>Del</th>\r\n      </tr>";
    $whr_prg = empty($_SESSION['_jdwlProg']) ? '' : "and j.ProgramID = '{$_SESSION['_jdwlProg']}'";
    $whr_hr = $_SESSION['_jdwlHari'] == '' ? '' : "and j.HariID = '{$_SESSION['_jdwlHari']}'";
    $whr_smt = empty($_SESSION['_jdwlSemester']) ? '' : "and mk.Sesi = '{$_SESSION['_jdwlSemester']}' ";
    $whr_kls = $_SESSION['_jdwlKelas'] == '' ? '' : "and j.NamaKelas like '{$_SESSION['_jdwlKelas']}%' ";
    $whr_kd = $_SESSION['_jdwlMKKode'] == '' ? '' : "and j.MKKode like '{$_SESSION['_jdwlMKKode']}%' ";
    $s = "select j.JadwalID, j.JadwalRefID, j.ProdiID, j.ProgramID, j.HariID, j.AdaResponsi,\r\n      j.RuangID, j.MKKode, j.Nama, j.NamaKelas, j.DosenID, j.SKS, j.JenisJadwalID, \r\n      concat(d.Nama, ' <sup>', d.Gelar, '</sup>') as DSN,\r\n      LEFT(j.JamMulai, 5) as _JM, LEFT(j.JamSelesai, 5) as _JS,\r\n      h.Nama as HR, mk.Sesi, j.Final,\r\n      j.JumlahMhsw, j.Kapasitas,\r\n      j.BiayaKhusus, j.Biaya, format(j.Biaya, 0) as _Biaya,\r\n\t  k.Nama as _NamaKelas\r\n    from jadwal j\r\n      left outer join hari h on j.HariID = h.HariID\r\n      left outer join dosen d on d.Login = j.DosenID and d.KodeID = '" . KodeID . "'\r\n      left outer join mk mk on mk.MKID = j.MKID\r\n\t  left outer join kelas k on k.KelasID = j.NamaKelas\r\n    where j.KodeID = '" . KodeID . "'\r\n      and j.TahunID = '{$_SESSION['_jdwlTahun']}'\r\n      and j.ProdiID = '{$_SESSION['_jdwlProdi']}'\r\n      {$whr_prg} {$whr_hr} {$whr_smt} {$whr_kls} {$whr_kd}\r\n      and j.NA = 'N'\r\n    order by j.HariID, j.RuangID, j.JamMulai, j.JamSelesai";
    $r = _query($s);
    $n = 0;
    $HariID = -320;
    $kanan = "<img src='img/kanan.gif' />";
    while ($w = _fetch_array($r)) {
        $n++;
        if ($HariID != $w['HariID']) {
            $HariID = $w['HariID'];
            echo "<tr>\r\n        <td class=ul1 colspan=15><font size=+1>{$w['HR']}</font> <sup><a name='Hari_{$HariID}'>{$HariID}</a></sup></td>\r\n        </tr>";
            echo $hdr;
        }
        if ($w['Final'] == 'Y') {
            $edt = "<img src='img/lock.jpg' width=26 title='Sudah difinalisasi. Sudah tidak dapat diedit.' />";
            $del = "&times;";
            $c = "class=nac";
            $pindah = '&nbsp;';
            $dosen = '&nbsp;';
            $print = '&nbsp;';
            $LabTag = '';
        } else {
            if ($w['JenisJadwalID'] != 'K') {
                $edt = "<a href='#' onClick=\"javascript:JdwlLabEdt(0, '{$w['JadwalRefID']}', '{$w['JadwalID']}')\" title='Edit jadwal'><img src='img/edit.jpg' width=20 /></a>";
                $del = "&times;";
                $c = "class=cnaY";
                $pindah = "<a href='#' onClick=\"javascript:PindahLabKelas({$w['JadwalID']})\" title='Pindahkan peserta kuliah ke Jadwal Lain'>&#8904;</a>";
                $dosen = '&nbsp;';
                $print = '&nbsp;';
                $LabTag = "<b>( " . GetaField('jenisjadwal', "JenisJadwalID", $w['JenisJadwalID'], 'Nama') . " )</b>";
            } else {
                $edt = "<a href='#' onClick=\"javascript:JdwlEdt(0, {$w['JadwalID']})\" title='Edit jadwal'><img src='img/edit.jpg' width=20 /></a>";
                // Jika sudah ada mahasiswa yang mendaftar, maka jadwal tidak boleh dihapus
                $del = $w['JumlahMhsw'] > 0 ? "<abbr title='Tidak dapat dihapus karena sudah ada Mhsw yang mendaftar'>&times;</abbr>" : "<a href='#' onClick=\"javascript:JdwlDel({$w['JadwalID']})\" title='Hapus jadwal'><img src='img/del.gif' /></a>";
                $c = "class=ul";
                $pindah = "<a href='#' onClick=\"javascript:PindahKelas({$w['JadwalID']})\" title='Pindahkan peserta kuliah ke Jadwal Lain'>&#8904;</a>";
                $dosen = "<a href='#' onClick=\"javascript:JdwlDsnEdt({$w['JadwalID']})\"><img src='img/edit.png' /></a>";
                $print = "{$kanan} <a href='#' onClick=\"javascript:CetakDPNA({$w['JadwalID']})\">Daftar</a><br />\r\n        {$kanan} <a href='#' onClick=\"javascript:CetakKursiUAS({$w['JadwalID']})\">Kursi UAS</a>";
                $LabTag = '';
            }
        }
        // Ambil dosen2
        $dsn = AmbilDosen2($w['JadwalID']);
        // Tampilkan data
        //&#8904;
        $HRG = $w['BiayaKhusus'] == 'Y' ? "<div align=right><sup>Biaya: Rp. <b>{$w['_Biaya']}</b></sup></div>" : '';
        if ($w['AdaResponsi'] == 'Y') {
            $FieldResponsi = AmbilResponsi($w['JadwalID']);
            $FieldResponsi .= "<br><a href='#' onClick=\"JdwlLabEdt(1, '{$w['JadwalID']}', '0')\"><font size=0.8m>Tambah Jadwal Ekstra(Lab, Responsi, dll.)</font></a>";
        } else {
            $FieldResponsi = '';
        }
        echo "<tr>\r\n      <td class=inp width=20>{$n}</td>\r\n      <td class=ul width=26 align=center>\r\n        {$edt}\r\n        <br />\r\n        <sub title='ID Jadwal'>#{$w['JadwalID']}</sub>\r\n        </td>\r\n      <td {$c}>\r\n        {$w['RuangID']}\r\n        <div align=right><sub align=right>{$w['ProgramID']}</sub></div>\r\n        </td>\r\n      <td {$c} align=center>\r\n        <sup>{$w['_JM']}</sup>&#8594;<sub>{$w['_JS']}</sub>\r\n        </td>\r\n      <td {$c}>{$w['MKKode']}<sup>{$w['Sesi']}</sup>\r\n\t\t</td>\r\n      <td {$c}>\r\n        {$w['Nama']} {$LabTag}\r\n        {$FieldResponsi}\r\n\t\t{$HRG}\r\n        </td>\r\n      <td {$c} align=center>\r\n        {$w['_NamaKelas']}&nbsp;<br />\r\n        {$w['JumlahMhsw']}<sup title='Kapasitas Kelas'>&#8594;{$w['Kapasitas']}</sup><br />\r\n        </td>\r\n      <td {$c} align=right>{$w['SKS']}</td>\r\n      <td {$c}>\r\n        {$w['DSN']}\r\n        {$dsn}\r\n        <div align=right>\r\n        {$dosen}\r\n        </div>\r\n        </td>\r\n      <td {$c} align=left valign=bottom nowrap>\r\n        {$print}\r\n        </td>\r\n      <td class=ul1 align=center valign=bottom>\r\n        {$del}\r\n      </tr>";
    }
    echo "</table></p>";
}
Exemplo n.º 2
0
function TampilkanDaftarKRSMhsw($thn, $mhsw, $khs)
{
    // Edit: Ilham
    // kl.Nama AS NamaKelas line: 194
    // line: 205 - 206
    $whr_hari = $_SESSION['_krsHariID'] == '' ? '' : "and j.HariID='{$_SESSION['_krsHariID']}'";
    $s = "SELECT k.*, j.JadwalID,\r\n    j.MKID, j.Nama AS MKNama, j.HariID, j.NamaKelas,\r\n    LEFT(j.JamMulai, 5) AS JM, LEFT(j.JamSelesai, 5) AS JS,\r\n    j.RuangID, mk.Sesi, j.AdaResponsi,\r\n    CONCAT(d.Nama, ' <sup>', d.Gelar, '</sup>') AS DSN, j.JenisJadwalID, jj.Nama AS _NamaJenisJadwal, jj.Tambahan, kl.Nama AS NamaKelas\r\n    FROM krs k\r\n         LEFT OUTER JOIN jadwal j \r\n         ON j.JadwalID = k.JadwalID \r\n            LEFT OUTER JOIN dosen d\r\n            ON d.Login = j.DosenID and d.KodeID = '" . KodeID . "'\r\n                LEFT OUTER JOIN mk \r\n                ON mk.MKID = k.MKID \r\n                    LEFT OUTER JOIN jenisjadwal jj \r\n                    ON jj.JenisJadwalID = j.JenisJadwalID\r\n                        LEFT OUTER JOIN kelas kl\r\n                        ON kl.KelasID = j.NamaKelas       \r\n\tWHERE k.KHSID = '{$khs['KHSID']}'\r\n      AND k.NA = 'N'\r\n      {$whr_hari}\r\n    ORDER BY j.HariID,j.JamMulai";
    $r = _query($s);
    //die("<pre>$s</pre>");
    // Apakah sudah melebihi batas waktu ambil/ubah KRS?
    $skrg = date('Y-m-d');
    if ($thn['TglKRSMulai'] <= $skrg && $skrg <= $thn['TglKRSSelesai']) {
        //indra 18 juni 2013
        // pengecekan pembayaran spp , apabila belum melunasi SPP maka tidak dapat mengisi KRS.
        $cek_query = "SELECT TagihanID, Jumlah,Besar, Dibayar  FROM bipotmhsw WHERE \r\n            TahunID='" . $_SESSION['_krsTahunID'] . "' and \r\n            MhswID ='" . $_SESSION['_krsMhswID'] . "' and \r\n            BIPOTNamaID='2' and NA='N'";
        $r_query = _query($cek_query);
        $d_query = _fetch_array($r_query);
        $cek_query2 = "select sum(Jumlah*Besar) as potongan from bipotmhsw where TagihanID='" . $d_query['TagihanID'] . "' and TRXID='-1'";
        $r_query2 = _query($cek_query2);
        $d_query2 = _fetch_array($r_query2);
        //cek bypassKRS
        $BypassKRS = GetaField('khs', 'KHSID', $khs[KHSID], 'BypassKRS');
        if ($BypassKRS == 0 and $d_query['Jumlah'] * $d_query['Besar'] > $d_query['Dibayar'] + $d_query2['potongan']) {
            TampilkanPesanSPPBelumLunas();
            $boleh = false;
            $ambil = '';
            $paket = '';
            $hapus = '';
        } else {
            KRSScript();
            $ambil = "<input type=button name='TambahMK' value='Ambil MK' onClick=\"javascript:AmbilKRS('{$mhsw['MhswID']}', '{$khs['KHSID']}')\" />";
            $paket = "<input type=button name='AmbilPaket' value='Ambil Paket' onClick=\"javascript:AmbilPaket('{$mhsw['MhswID']}', '{$khs['KHSID']}')\" />";
            $hapus = "<input type=button name='HapusSemua' value='Hapus Semua' onClick=\"javascript:HapusSemua('{$khs['KHSID']}')\" />";
            $boleh = true;
        }
        //end indra 18 juni 2013
    } else {
        TampilkanPesanKRSSelesai();
        $boleh = false;
        $ambil = '';
        $paket = '';
        $hapus = '';
    }
    // Tampilkan
    $opthari = GetOption2('hari', 'Nama', 'HariID', $_SESSION['_krsHariID'], '', 'HariID');
    echo "<table class=box cellspacing=1 align=center width=800>";
    echo "<tr>\r\n    <script>\r\n    function KeHari(frm) {\r\n      window.location = '?mnux={$_SESSION['mnux']}&_krsHariID='+frm[frm.selectedIndex].value;\r\n    }\r\n    </script>\r\n    <td class=ul1 colspan=10>\r\n      <select name='_krsHariID' onChange=\"javascript:KeHari(this)\">{$opthari}</select>\r\n      {$ambil}\r\n      {$paket}\r\n      {$hapus}\r\n      <img src='img/kanan.gif' /> <b>Daftar Matakuliah Yang Diambil Mahasiswa:</b>\r\n    </td></tr>";
    $hdr = "<tr>\r\n    <th class=ttl width=30>#</th>\r\n    <th class=ttl width=80>Jam Kuliah</th>\r\n    <th class=ttl width=50>Ruang</th>\r\n\t<th class=ttl width=80>Kode <sup>Smt</sup></th>\r\n    <th class=ttl>Matakuliah</th>\r\n    <th class=ttl width=20>SKS</th>\r\n    <th class=ttl width=200>Dosen</th>\r\n    <th class=ttl width=40>Kelas</th>\r\n    <th class=ttl width=20 title='Hapus KRS'>Del</th>\r\n    </tr>";
    $n = 0;
    $hr = -3;
    while ($w = _fetch_array($r)) {
        if ($w['Setara'] != "Y") {
            if ($hr != $w['HariID']) {
                $hr = $w['HariID'];
                $_hr = GetaField('hari', 'HariID', $hr, 'Nama');
                echo "<tr><td class=ul1 colspan=10><b>{$_hr}</b> <sup>{$hr}</sup></td></tr>";
                echo $hdr;
            }
            $n++;
            $del = $boleh ? "<a href='#' onClick=\"javascript:HapusKRS({$w['KHSID']},{$w['KRSID']})\" title='Hapus KRS' /><img src='img/del.gif' /></a>" : '&times;';
            // Bila ditandai bukan kuliah biasa, diarsir....
            if ($w['Tambahan'] == 'Y') {
                $class = 'cnaY';
                $TagTambahan = "<b>( {$w['_NamaJenisJadwal']} ) </b>";
                $FieldResponsi = '';
            } else {
                $class = 'ul1';
                $TagTambahan = '';
                $FieldResponsi = '<br>';
                if ($w['AdaResponsi'] == 'Y') {
                    $FieldResponsi .= AmbilResponsi($w['JadwalID'], $w['KRSID'], $w['MhswID'], $thn['TahunID']);
                }
            }
            echo "<tr>\r\n      <td class=inp>{$n}</td>\r\n      <td class={$class}><sup>{$w['JM']}</sup>&#8594;<sub>{$w['JS']}</sub></td>\r\n      <td class={$class} align=center>{$w['RuangID']}&nbsp;</td>\r\n\t  <td class={$class}>{$w['MKKode']}<sup>{$w['Sesi']}</sup></td>\r\n      <td class={$class}>{$w['Nama']} {$TagTambahan} {$FieldResponsi}</td>\r\n      <td class={$class} align=right>{$w['SKS']}</td>\r\n      <td class={$class}>{$w['DSN']}</td>\r\n      <td class={$class} align=center>{$w['NamaKelas']}&nbsp;</td>\r\n      <td class={$class} align=center>{$del}</td>\r\n      </tr>";
        }
    }
    echo "</table></p>";
}