[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
Backup
/
14082024
/
Data
/
htdocs
/
htdocs
/
siakad
/
akademik
/
Master
/
[
Home
]
File: MataPelajaran.inc.php
<?php $nmForm = "index.php?MataPelajaran"; $nmForm2 = "index.php?MPdosen"; $title = $nmsd." : Master Mata Kuliah"; // $nmForm = "m-mapel.php"; $nmTable = "m_matapelajaran"; //hak akses $formnama = "m-mp"; $registerform = lastlogin($_SESSION["user-id"],$formnama); if(isset($_SESSION["id-profil"])) $idlogprof = $_SESSION["id-profil"]; else $idlogprof = 0; if($idlogprof == 0) echo "<script>window.alert('".$lsm."');location.href='index.php';</script>"; $hakakses = cekhakakses($idlogprof,$formnama); if($hakakses[0] == 0) echo "<script>window.alert('".$erme."');location.href='mainform.php';</script>"; if($hakakses[1] == 0) $bt_simpan = " "; if($hakakses[3] == 0) $bt_multipledelete = " "; //deskripsikan get variabel $edit = ""; if(!isset($_GET["edit"])) $_GET["edit"] = ""; else $edit = $_GET["edit"]; $delete = ""; if(!isset($_GET["delete"])) $_GET["delete"] = ""; else $delete = $_GET["delete"]; //deskripsikan nama variabel $mp_id = ""; $mp_kode = ""; $mp_nama = ""; $id_kelas = ""; $mp_status = ""; $id_kurikulum = ""; $alert = 0; $mp_status_checked = ""; $mp_alias = ""; $sem_ke = ""; $sem_ke = ""; $mp_sks = ""; //multiple del record if(isset($_POST["Delete"])) { $mpid = & $_POST["mpid"]; for($a=0,$b=count($mpid);$a<$b;$a++) { $exe = _del($nmTable,"mp_id",MyIdDecode($mpid[$a]),0); } } //cara untuk hapus record if($delete == "active" && isset($_GET["mp_id"])) { $exe = _del($nmTable,"mp_id",MyIdDecode($_GET["mp_id"]),0); echo "<script>window.alert('".$deme."');</script>"; echo "<script>window.parent.document.location.href='".$nmForm."';</script>"; } //cara untuk edit record if($edit == "active" && isset($_GET["mp_id"])) { $query = "select * from ".$nmTable." where mp_id = ".MyIdDecode($_GET["mp_id"]); $iData=sAllData($query); for($a=0,$b=count($iData);$a<$b;$a++) { $mp_id = $iData[$a]["mp_id"]; $mp_kode = $iData[$a]["mp_kode"]; $mp_nama = $iData[$a]["mp_nama"]; $id_kelas = $iData[$a]["id_kelas"]; $mp_status = $iData[$a]["mp_status"]; $id_kurikulum = $iData[$a]["id_kurikulum"]; $mp_alias = $iData[$a]["mp_alias"]; $sem_ke = $iData[$a]["sem_ke"]; $sem_ke = $iData[$a]["sem_ke"]; $mp_sks = $iData[$a]["mp_sks"]; } } //cara untuk simpan if(isset($_POST["Simpan"]) || isset($_POST["Update"])) { $mp_alias = $_POST["mp_alias"]; $mp_kode = $_POST["mp_kode"]; $mp_nama = $_POST["mp_nama"]; $id_kelas = $_POST["id_kelas"]; if(isset($_POST["mp_status"])) $mp_status = $_POST["mp_status"]; else $mp_status = ""; $id_kurikulum = $_POST["id_kurikulum"]; $mp_sks = $_POST["mp_sks"]; //validasi data tidak boleh ada yg kosong if($mp_kode == "") $alert = 1; if($mp_nama == "") $alert = 1; // if($id_kelas == "") $alert = 1; // if($mp_status == "") $alert = 1; // if($id_kurikulum == "") $alert = 1; if($alert == 1) { echo "<script>window.alert('".$esm1."');</script>"; }else{ $tbField[0] = "mp_id"; $tbField[1] = "mp_kode"; $tbField[2] = "mp_nama"; $tbField[3] = "id_kelas"; $tbField[4] = "sem_ke"; $tbField[5] = "mp_sks"; if(isset($_POST["Simpan"])) $mp_id = maxId($tbField[0],$nmTable); if(isset($_POST["Update"])) $mp_id = $_POST["mp_id"]; $tbIsi[0] = $mp_id; $tbIsi[1] = "'".$_POST["mp_kode"]."'"; $tbIsi[2] = "'".addslashes($_POST["mp_nama"])."'"; $tbIsi[3] = "'".$_POST["id_kelas"]."'"; $tbIsi[4] = "'".$_POST["sem_ke"]."'"; $tbIsi[5] = "'".$_POST["mp_sks"]."'"; if(isset($_POST["Simpan"])) { $nmField = compile_array($tbField); $isiField = compile_array($tbIsi); $exe = _ins($nmTable,$nmField,$isiField,0); echo "<script>window.alert('".$ssm."');</script>"; } if(isset($_POST["Update"])) { $compileSet = compile_array2($tbField,$tbIsi); $exe = _upd($nmTable,$compileSet,$tbField[0],$tbIsi[0],0); echo "<script>window.alert('".$sum."');</script>"; } echo "<script>window.parent.document.location.href='".$nmForm."';</script>"; } } ?> <script> function hapus(a) { var mp_id = a; if(confirm('Anda akan menghapus data ini, klik OK untuk memprosesnya.')) window.parent.document.location.href='<?php echo $nmForm;?>&delete=active&mp_id='+mp_id; else return false; } </script> <section id="content"> <div class="container"> <div class="card"> <div class="card-header"> <h2>Mata Kuliah <small>Form berikut ini berisi tentang entry, edit & hapus untuk semua data tipe mata pelajaran</small></h2> </div> <div class="card-body"> <?php echo "<form name=\"fanform\" method=\"POST\" action=\"".$nmForm."\">"; echo "<table class=\"table table-striped\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\" margin: 0; width: 100%;\">"; echo "<tr>"; echo "<td width=28%><b>Kode Mata Kuliah</b></td>"; echo "<td width=2%>:</td>"; echo "<td width=70%>".iTBox("45","255","mp_kode",$mp_kode,"style=\"width: 35%;\"")."".iTextH("mp_id",$mp_id)."</td>"; echo "</tr>"; echo "<tr>"; echo "<td><b>Nama Mata Kuliah</b></td>"; echo "<td>:</td>"; echo "<td>".iTBox("45","255","mp_nama",$mp_nama,"style=\"width: 55%;\"")."</td>"; echo "</tr>"; echo "<tr>"; echo "<td><b>Jumlah SKS (1/2/3 sks)</b></td>"; echo "<td>:</td>"; echo "<td>".iTBox("45","255","mp_sks",$mp_sks,"style=\"width: 55%;\"")."</td>"; echo "</tr>"; // echo "<tr>"; // echo "<td><b>Set Alias (Nilai)</b></td>"; // echo "<td>:</td>"; // echo "<td>".iTBox("45","255","sem_ke",$sem_ke,"style=\"width: 55%;\"")."</td>"; // echo "</tr>"; echo "<tr>"; echo "<td><b>Semester ke-</b></td>"; echo "<td>:</td>"; echo "<td>".iTBox("45","255","sem_ke",$sem_ke,"style=\"width: 55%;\"")."</td>"; echo "</tr>"; echo "<tr>"; echo "<td width=28%><b>Program Study</b></td>"; echo "<td width=2%>:</td>"; if(isset($_POST["id_kelas"])) $id_kelas = $_POST["id_kelas"]; $cmbox = "<select class=\"form-control\" name=\"id_kelas\">"; $cmbox .= iComboB(0,0,$id_kelas,""); $query="select * from m_kelas order by kelas_id asc"; $iDataArray=sAllData($query); for($a=0,$b=count($iDataArray);$a<$b;$a++) { $cmbox .= iComboB($iDataArray[$a]["kelas_id"],$iDataArray[$a]["kelas_id"],$id_kelas,$iDataArray[$a]["kelas_nama"]); } $cmbox .= "</select>"; echo "<td width=70%>".$cmbox."</td>"; echo "</tr>"; /* echo "<tr>"; echo "<td><b>Ikut dalam kuliah</b></td>"; echo "<td>:</td>"; if($mp_status == "1") $mp_status_checked = "checked"; echo "<td><input type=checkbox id=mp_status name=mp_status value=\"1\" ".$mp_status_checked."></td>"; echo "</tr>"; */ // echo "<tr>"; // echo "<td><b>Kurikulum</b></td>"; // echo "<td>:</td>"; // if(isset($_POST["id_kurikulum"])) $id_kurikulum = $_POST["id_kurikulum"]; // $cmbox = "<select class=\"form-control\" name=\"id_kurikulum\">"; // $cmbox .= iComboB(0,0,$id_kurikulum,""); // $query="select * from m_kurikulum order by kurikulum_id asc"; // $iDataArray=sAllData($query); // for($a=0,$b=count($iDataArray);$a<$b;$a++) { // $cmbox .= iComboB($iDataArray[$a]["kurikulum_id"],$iDataArray[$a]["kurikulum_id"],$id_kurikulum,$iDataArray[$a]["kurikulum_nama"]); // } // $cmbox .= "</select>"; // echo "<td>".$cmbox."</td>"; // echo "</tr>"; echo "<tr>"; echo "<td> </td>"; echo "<td> </td>"; if($edit) { echo "<td>".iSbmt("Update")."</td>"; }else{ echo "<td>".$bt_simpan."</td>"; } echo "</tr>"; echo "</table>"; ?> <hr> <?php if(isset($_POST["prodi"])) $prodi = $_POST["prodi"]; else $prodi = 0; $cmbox = "<select name=\"prodi\" onchange=\"this.form.submit();\">"; $cmbox .= iComboB(0,0,$id_kelas,""); $query="select * from m_kelas where length(kelas_kode) = 4 order by kelas_id asc"; $iDataArray=sAllData($query); for($a=0,$b=count($iDataArray);$a<$b;$a++) { $cmbox .= iComboB($iDataArray[$a]["kelas_id"],$iDataArray[$a]["kelas_id"],$prodi,$iDataArray[$a]["kelas_nama"]); } $cmbox .= "</select>"; echo "Filter Prodi : ".$cmbox; echo "<table class=\"table table-hover\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\" margin: 0; width: 100%;\">"; echo "<tr>"; echo "<th bgcolor='#00FFFF' width=5% align=center>Hapus</th>"; echo "<th bgcolor='#00FFFF' width=5% align=center>Edit</th>"; echo "<th bgcolor='#00FFFF' width=5% align=center>Dosen</th>"; echo "<th bgcolor='#00FFFF' width=15% align=center>Kode MK</th>"; echo "<th bgcolor='#00FFFF' width=30% align=center>Nama MP</th>"; echo "<th bgcolor='#00FFFF' width=10% align=center>SKS</th>"; echo "<th bgcolor='#00FFFF' width=15% align=center>Dosen</th>"; echo "<th bgcolor='#00FFFF' width=25% align=center>Program Study</th>"; echo "</tr>"; $query="select * from ".$nmTable." a left join m_kelas b on a.id_kelas = b.kelas_id where a.id_kelas <> 0 order by kelas_nama ASC, mp_nama asc"; if(isset($_POST["prodi"])) $query="select * from ".$nmTable." a left join m_kelas b on a.id_kelas = b.kelas_id where a.id_kelas <> 0 and a.id_kelas = ".$_POST["prodi"]." order by kelas_nama ASC, mp_nama asc"; $iData=sAllData($query); $no = 0; for($a=0,$b=count($iData);$a<$b;$a++) { echo "<tr>"; if($hakakses[3] == 0) echo "<td> </td>"; else{ if(isset($_POST["Multiple"])) echo "<td align=center><input type=checkbox id=mpid[] name=mpid[] value=".MyIdEncode($iData[$a]["mp_id"])."></td>"; else echo "<td align=center>".iAPict("hapus('".MyIdEncode($iData[$a]["mp_id"])."');",$icon_del,16,16)."</td>"; } if($hakakses[2] == 0) echo "<td> </td>"; else{ echo "<td align=center>".iAPict2($nmForm."&edit=active&mp_id=".MyIdEncode($iData[$a]["mp_id"]),$icon_edit,16,16)."</td>"; } echo "<td align=center>".iAPict2($nmForm2."&dosen=active&mp_id=".MyIdEncode($iData[$a]["mp_id"]),$icon_add,16,16)."</td>"; echo "<td>".$iData[$a]["mp_kode"]." </td>"; echo "<td>".$iData[$a]["mp_nama"]." </td>"; echo "<td>".$iData[$a]["mp_sks"]." </td>"; echo "<td>"; $query2 ="select * from m_dosen_mk a left join m_pegawai b on a.id_pgw = b.pgw_id where a.id_mk = ".$iData[$a]["mp_id"]." order by pgw_nama ASC"; $iData2=sAllData($query2); for($a2=0,$b2=count($iData2);$a2<$b2;$a2++) { echo "- ".$iData2[$a2]["pgw_nama"]."<br>"; } echo "</td>"; echo "<td align=center>".$iData[$a]["kelas_nama"]." </td>"; echo "</tr>"; } echo "<tr>"; echo "<td colspan=7 align=left>"; if(isset($_POST["Multiple"])) echo iSbmt("Delete"); else echo $bt_multipledelete; echo "</td>"; echo "</tr>"; echo "</table>"; echo "</form>"; ?> </div> </div> </div> </section>