Beispiel #1
0
function JdwlEdt()
{
    $md = $_REQUEST['md'] + 0;
    if ($md == 0) {
        $w = GetFields('jadwal', "JadwalID", $_REQUEST['jadwalid'], '*');
        $jdl = "Edit Jadwal";
    } else {
        $w = $_REQUEST['gagal'] == 1 ? AmbilArrJadwal() : ResetArrJadwal();
        $jdl = "Tambah Jadwal";
    }
    $w['JadwalRef'] = empty($_REQUEST['JadwalRef']) ? $w['JadwalRef'] : $_REQUEST['JadwalRef'];
    //GetCheckboxes($table, $key, $Fields, $Label, $Nilai='', $Separator=',') {
    $hakprodi = TRIM($_SESSION['_ProdiID'], ',');
    $optprodi = GetCheckboxes("prodi", "ProdiID", "concat(ProdiID, ' - ', Nama) as NM", "NM", $w['ProdiID'], '.', "ProdiID in ({$hakprodi})");
    $optprid = GetCheckboxes("program", "ProgramID", "concat(ProgramID, ' - ', Nama) as NM", "NM", $w['ProgramID'], ',');
    $opthari = GetOption2('hari', "Nama", "HariID", $w['HariID'], '', 'HariID');
    $optmk = GetOption2('mk', "concat(MKKode, ' - ', Nama, ' (', SKS, ' SKS)')", 'MKKode', $w['MKID'], "ProdiID='{$_SESSION['prodi']}'", 'MKID');
    $optdsn = GetOption2('dosen', "concat(Nama, ', ', Gelar)", 'Login', $w['DosenID'], "INSTR(ProdiID, '.{$_SESSION['prodi']}.')", 'Login');
    $ckHargaStandar = $w['HargaStandar'] == 'Y' ? 'checked' : '';
    // Tampilkan form
    CariRuangScript();
    echo "<p><table class=box cellspacing=1 cellpadding=4>\r\n  <form action='?' name='data' method=POST>\r\n  <input type=hidden name='JadwalID' value='{$w['JadwalID']}'>\r\n  <input type=hidden name='JadwalRef' value='{$w['JadwalRef']}'>\r\n  <input type=hidden name='md' value='{$md}'>\r\n  <input type=hidden name='mnux' value='jadwal'>\r\n  <input type=hidden name='gos' value='JdwlSav'>\r\n  <input type=hidden name='prodi' value='{$_SESSION['prodi']}'>\r\n\r\n  <tr><th class=ttl colspan=2>{$jdl}</th></tr>\r\n\r\n  <tr><td class=inp1>Berlaku untuk<br />Program :</td><td class=ul>{$optprid}</td></tr>\r\n  <tr><td class=inp1>Berlaku untuk<br />Program Studi :</td><td class=ul>{$optprodi}</td></tr>\r\n  <tr><td class=inp1>Hari :</td><td class=ul><select name='HariID'>{$opthari}</select></td></tr>\r\n  <tr><td class=inp1>Jam Kuliah :</td><td class=ul>\r\n    <input type=text name='JamMulai' value='{$w['JamMulai']}' size=5 maxlength=5> s/d\r\n    <input type=text name='JamSelesai' value='{$w['JamSelesai']}' size=5 maxlength=5>\r\n    </td></tr>\r\n  <tr><td class=inp1>Matakuliah :</td><td class=ul><select name='MKID'>{$optmk}</select></td></tr>\r\n  <tr><td class=inp1>Nama Kelas :</td><td class=ul><input type=text name='NamaKelas' value='{$w['NamaKelas']}' size=10 maxlength=20></td></tr>\r\n  <tr><td class=inp1>Ruang Kuliah :</td><td class=ul><input type=text name='RuangID' value='{$w['RuangID']}' size=40 maxlength=255>\r\n    <a href='javascript:cariruang(data)'>Cari</a></td></tr>\r\n  <tr><td class=inp1>Dosen Pengampu :</td><td class=ul><select name='DosenID'>{$optdsn}</select></td></tr>\r\n  <tr><td class=inp1>Rencana Jml Kehadiran :</td><td class=ul><input type=text name='RencanaKehadiran' value='{$w['RencanaKehadiran']}' size=3 maxlength=3></td></tr>\r\n  <tr><td class=inp1>Harga :</td><td class=ul><input type=checkbox name='HargaStandar' value='Y' {$ckHargaStandar}> Apakah harga standar?<hr size=1 color=silver />\r\n    Jika tidak, harganya adalah: Rp. <input type=text name='Harga' value='{$w['Harga']}' size=15 maxlength=15></td></tr>\r\n  <tr><td colspan=2 class=ul><input type=submit name='Simpan' value='Simpan'>\r\n    <input type=reset name='Reset' value='Reset'>\r\n    <input type=button name='Batal' value='Batal' onClick=\"location='?mnux=jadwal'\"></td></tr>\r\n  </table></p>";
}
Beispiel #2
0
function JdwlEdt()
{
    global $LevelAksesHarga;
    CheckFormScript('MKKode,NamaKelas,DosenID,HariID,JamMulai,JamSelesai');
    CariMKScript();
    CariDosenAjax();
    PhpAutocomplete($_SESSION['prodi']);
    $md = $_REQUEST['md'] + 0;
    $hari = $_REQUEST['hari'];
    if ($md == 0) {
        $w = $_REQUEST['GAGAL'] == 1 ? AmbilArrJadwal() : GetFields('jadwal', "JadwalID", $_REQUEST['JadwalID'], '*');
        $jdl = "Edit Jadwal";
    } else {
        $w = $_REQUEST['GAGAL'] == 1 ? AmbilArrJadwal() : ResetArrJadwal();
        $jdl = "Tambah Jadwal";
        $w['DosenID'] = 5000;
        $w['RencanaKehadiran'] = 14;
        $w['HariID'] = $hari;
    }
    // cek jika kelas serial
    if (!empty($w['JadwalSer'])) {
        $serial = GetFields('jadwal', 'JadwalID', $w['JadwalSer'], 'JadwalID, MKID, MKKode, Nama, NamaKelas, JenisJadwalID, DosenID');
        $w['MKID'] = $serial['MKID'];
        $w['MKKode'] = $serial['MKKode'];
        $w['Nama'] = $serial['Nama'];
        $w['NamaKelas'] = $serial['NamaKelas'];
        $w['JenisJadwalID'] = $serial['JenisJadwalID'];
        $w['DosenID'] = $serial['DosenID'];
    }
    if ($_SESSION['prodi'] == '99') {
        // Daftar prodi yg bisa diakses
        $_ProdiID = trim($_SESSION['_ProdiID'], ',');
        //echo $_ProdiID;
        $arrProdi = explode(',', $_ProdiID);
        $_prodi = '';
        for ($i = 0; $i < sizeof($arrProdi); $i++) {
            $_prodi .= ",'" . $arrProdi[$i] . "'";
        }
        $_prodi = trim($_prodi, ',');
        $_prodi = empty($arrProdi) ? '-1' : $_prodi;
        //implode(', ', $arrProdi);
    } else {
        $_prodi = "'{$_SESSION['prodi']}'";
    }
    // sekarang hanya 1 prodi saja kecuali prodi -99
    $optprodi = GetCheckboxes("prodi", "ProdiID", "concat(ProdiID, ' - ', Nama) as NM", "NM", $w['ProdiID'], '.', "ProdiID in ({$_prodi})");
    $optprid = GetCheckboxes("program", "ProgramID", "concat(ProgramID, ' - ', Nama) as NM", "NM", $w['ProgramID'], '.');
    $opthari = GetOption2('hari', "Nama", "HariID", $w['HariID'], '', 'HariID');
    //$optmk = GetOption2('mk', "concat(MKKode, ' - ', Nama, ' (', SKS, ' SKS)')",
    //  'MKKode', $w['MKID'], "ProdiID='$_SESSION[prodi]'", 'MKID');
    //$optdsn = GetOption2('dosen', "concat(Nama, ', ', Gelar)",
    //  'Login', $w['DosenID'], "INSTR(ProdiID, '.$_SESSION[prodi].')", 'Login');
    $NamaDosen = empty($w['DosenID']) ? '' : GetaField('dosen', "Login", $w['DosenID'], 'Nama');
    $optrg = GetOption2('ruang', "concat(RuangID, ' - ', Nama)", 'KampusID, RuangID', $w['RuangID'], '', 'RuangID');
    $ckHargaStandar = $w['HargaStandar'] == 'Y' ? 'checked' : '';
    $optjenjad = GetOption2('jenisjadwal', "concat(JenisJadwalID, ' - ', Nama)", "JenisJadwalID", $w['JenisJadwalID'], '', 'JenisJadwalID');
    // Dapatkah mengedit harga matakuliah?
    if (strpos($LevelAksesHarga, ".{$_SESSION['_LevelID']}.") === false) {
        $EdtHrg = "<input type=hidden name='HargaStandar' value='{$w['HargaStandar']}'>\r\n      <input type=hidden name='Harga' value='{$w['Harga']}'>";
    } else {
        $EdtHrg = "<tr><td class=inp1>Harga :</td><td class=ul><input type=checkbox name='HargaStandar' value='Y' {$ckHargaStandar}> Apakah harga standar?<hr size=1 color=silver />\r\n    Jika tidak tidak standar, harganya adalah: <br />\r\n    Rp. <input type=text name='Harga' value='{$w['Harga']}' size=15 maxlength=15></td></tr>";
    }
    //<tr><td class=inp1>Matakuliah :</td><td class=ul><select name='MKID'>$optmk</select></td></tr>
    // Tampilkan form
    GabungkanScript();
    echo "<p><table class=box cellspacing=1 cellpadding=4>\r\n  <form action='?' name='data' method=POST onSubmit=\"return CheckForm(this);\">\r\n  <input type=hidden name='JadwalID' value='{$w['JadwalID']}'>\r\n  <input type=hidden name='JadwalPar' value='{$w['JadwalPar']}'>\r\n  <input type=hidden name='JadwalSer' value='{$w['JadwalSer']}'>\r\n  <input type=hidden name='TahunID' value='{$w['TahunID']}'>\r\n  <input type=hidden name='md' value='{$md}'>\r\n  <input type=hidden name='mnux' value='jadwal'>\r\n  <input type=hidden name='gos' value='JdwlSav'>\r\n  <input type=hidden id='prodi' name='prodi' value='{$_SESSION['prodi']}'>\r\n  <input type=hidden id='MKID' name='MKID' value='{$w['MKID']}'>\r\n  <input type=hidden name='bypass' value=0>\r\n\r\n  <tr><th class=ttl colspan=2>{$jdl}</th></tr>\r\n\r\n  <tr><td class=inp1>Berlaku untuk<br />Program :</td><td class=ul>{$optprid}</td></tr>\r\n  <tr><td class=inp1>Berlaku untuk<br />Program Studi :</td><td class=ul>{$optprodi}</td></tr>\r\n  <tr><td class=inp1>Hari :</td><td class=ul><select name='HariID'>{$opthari}</select></td></tr>\r\n  <tr><td class=inp1>Jam Kuliah :</td><td class=ul>\r\n    <input type=text name='JamMulai' value='{$w['JamMulai']}' size=5 maxlength=5> s/d\r\n    <input type=text name='JamSelesai' value='{$w['JamSelesai']}' size=5 maxlength=5>\r\n    </td></tr>\r\n  <tr><td class=inp1>Mata kuliah :</td><td class=ul><input type=text id='MKKode' name='MKKode' value='{$w['MKKode']}' size=10 maxlength=20>\r\n    <a href=\"javascript:carimkajax(data)\">Cari Matakuliah</a><br />\r\n    <input type=text name='Nama' autocomplete='off' id='NamaMK' value='{$w['Nama']}' size=50 maxlength=50></td></tr>\r\n  <tr><td class=inp1>Nama Kelas :</td><td class=ul><input type=text name='NamaKelas' value='{$w['NamaKelas']}' size=5 maxlength=1></td></tr>\r\n  <tr><td class=inp1>Jenis Jadwal :</td><td class=ul><select name='JenisJadwalID'>{$optjenjad}</select></td></tr>\r\n  <tr><td class=inp1>SKS :</td><td class=ul><input type=text name='SKS' value='{$w['SKS']}' size=3 maxlength=3>\r\n    Isikan dengan -1 jika jumlah SKS menggunakan SKS asli dari matakuliah.</td></tr>\r\n  <tr><td class=inp1>SKS Honor :</td>\r\n    <td class=ul><input type=text name='SKSHonor' value='{$w['SKSHonor']}' size=3 maxlength=3>\r\n    Isikan dengan -1 jika jumlah SKS honor menggunakan SKS asli dari matakuliah.</td></tr>\r\n  <tr><td class=inp1>Ruang Kuliah :</td><td class=ul>\r\n    <select name='RuangID'>{$optrg}</select></td></tr>\r\n  <tr><td class=inp1>Kapasitas/Target :</td><td class=ul>\r\n    <input type=text name='Kapasitas' value='{$w['Kapasitas']}' size=5 maxlength=4>\r\n    Jika diisi dengan nilai -1, maka nilai kapasitas akan diambil dari nilai kapasitas ruang.</td></tr>\r\n  <tr><td class=inp1>Dosen Pengampu :</td><td class=ul><input type=text name='DosenID' id='DosenID' value='{$w['DosenID']}' size=10 maxlength=20>\r\n    <a href='javascript:caridosenajax(data)'>Cari Dosen</a><br />\r\n    <input type=text autocomple='off' id='NamaDosen' name='NamaDosen' value='{$NamaDosen}' size=50 maxlength=50></td></tr>\r\n  <tr><td class=inp1>Rencana Tatap Muka :</td><td class=ul><input type=text name='RencanaKehadiran' value='{$w['RencanaKehadiran']}' size=3 maxlength=3></td></tr>\r\n  <tr><td class=inp1>Minimal Kehadiran Mhsw :</td><td class=ul><input type=text name='KehadiranMin' value='{$w['KehadiranMin']}' size=3 maxlength=3></td></tr>\r\n  {$EdtHrg}\r\n  <tr><td colspan=2 class=ul><input type=submit name='Simpan' value='Simpan'>\r\n    <input type=reset name='Reset' value='Reset'>\r\n    <input type=button name='Batal' value='Batal' onClick=\"location='?mnux=jadwal'\"></td></tr>\r\n  </table></p>";
}