[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
Backup
/
05122024
/
htdocs
/
siakad
/
kepegawaian
/
Setup
/
New folder
/
[
Home
]
File: ProfilSekolah.inc.php
<?php $nmForm = "index.php?ProfilSekolah"; $title = $nmsd." : Data Sekolah"; // $nmForm = "cp-schooldata.php"; $nmTable = "data_sekolah"; //hak akses $formnama = "cp-schooldata"; $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 = " "; //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 $sekolah_id = ""; $sekolah_nama = ""; $sekolah_slogan = ""; $sekolah_alamat = ""; $sekolah_telp = ""; $sekolah_fax = ""; $sekolah_status = ""; $sekolah_nss = ""; $sekolah_npsn = ""; $sekolah_email = ""; $sekolah_web = ""; $sekolah_kel = ""; $sekolah_kec = ""; $sekolah_kab = ""; $sekolah_prop = ""; $alert = 0; //multiple del record if(isset($_POST["Delete"])) { $sekolahid = & $_POST["sekolahid"]; for($a=0,$b=count($sekolahid);$a<$b;$a++) { $exe = _del($nmTable,"sekolah_id",MyIdDecode($sekolahid[$a]),0); } } //cara untuk hapus record if($delete == "active" && isset($_GET["sekolah_id"])) { $exe = _del($nmTable,"sekolah_id",MyIdDecode($_GET["sekolah_id"]),0); echo "<script>window.alert('".$deme."');</script>"; echo "<script>window.parent.document.location.href='".$nmForm."';</script>"; } //cara untuk edit record $_GET["sekolah_id"] = "MTEtMS0wNg=="; if(isset($_GET["sekolah_id"])) { $query = "select * from ".$nmTable." where sekolah_id = ".MyIdDecode($_GET["sekolah_id"]); $iData=sAllData($query); for($a=0,$b=count($iData);$a<$b;$a++) { $sekolah_id = $iData[$a]["sekolah_id"]; $sekolah_nama = $iData[$a]["sekolah_nama"]; $sekolah_slogan = $iData[$a]["sekolah_slogan"]; $sekolah_alamat = $iData[$a]["sekolah_alamat"]; $sekolah_telp = $iData[$a]["sekolah_telp"]; $sekolah_fax = $iData[$a]["sekolah_fax"]; $sekolah_status = $iData[$a]["sekolah_status"]; $sekolah_nss = $iData[$a]["sekolah_nss"]; $sekolah_npsn = $iData[$a]["sekolah_npsn"]; $sekolah_email = $iData[$a]["sekolah_email"]; $sekolah_web = $iData[$a]["sekolah_web"]; $sekolah_kel = $iData[$a]["sekolah_kel"]; $sekolah_kec = $iData[$a]["sekolah_kec"]; $sekolah_kab = $iData[$a]["sekolah_kab"]; $sekolah_prop = $iData[$a]["sekolah_prop"]; } } //cara untuk simpan if(isset($_POST["Simpan"]) || isset($_POST["Update"])) { $sekolah_nama = $_POST["sekolah_nama"]; $sekolah_slogan = $_POST["sekolah_slogan"]; $sekolah_alamat = $_POST["sekolah_alamat"]; $sekolah_telp = $_POST["sekolah_telp"]; $sekolah_fax = $_POST["sekolah_fax"]; $sekolah_email = $_POST["sekolah_email"]; $sekolah_kel = $_POST["sekolah_kel"]; $sekolah_kec = $_POST["sekolah_kec"]; $sekolah_kab = $_POST["sekolah_kab"]; $sekolah_prop = $_POST["sekolah_prop"]; if(isset($_POST["sekolah_status"])) $sekolah_status = $_POST["sekolah_status"]; if(isset($_POST["sekolah_nss"])) $sekolah_nss = $_POST["sekolah_nss"]; if(isset($_POST["sekolah_npsn"])) $sekolah_npsn = $_POST["sekolah_npsn"]; $sekolah_web = $_POST["sekolah_web"]; //validasi data tidak boleh ada yg kosong if($sekolah_nama == "") $alert = 1; if($sekolah_alamat == "") $alert = 1; if($sekolah_telp == "") $alert = 1; if($sekolah_fax == "") $alert = 1; if($sekolah_email == "") $alert = 1; if($alert == 1) { echo "<script>window.alert('".$esm1."');</script>"; }else{ $nw_file = $_FILES["file"]["name"]; $rename = explode(".",$nw_file); if(count($rename) > 1) { $nw_file = "sch_".$_POST["sekolah_nama"]."_ll.".$rename[1]; move_uploaded_file($_FILES["file"]["tmp_name"],"mediamanager/" . $nw_file); } $nw_file2 = $_FILES["file2"]["name"]; $rename2 = explode(".",$nw_file2); if(count($rename2) > 1) { $nw_file2 = "sch_".$_POST["sekolah_nama"]."_ls.".$rename2[1]; move_uploaded_file($_FILES["file2"]["tmp_name"],"mediamanager/" . $nw_file2); } $tbField[0] = "sekolah_id"; $tbField[1] = "sekolah_nama"; $tbField[2] = "sekolah_slogan"; $tbField[3] = "sekolah_alamat"; $tbField[4] = "sekolah_telp"; $tbField[5] = "sekolah_fax"; $tbField[6] = "sekolah_status"; $tbField[7] = "sekolah_nss"; $tbField[8] = "sekolah_npsn"; $tbField[9] = "sekolah_email"; $tbField[10] = "sekolah_web"; $tbField[11] = "sekolah_kel"; $tbField[12] = "sekolah_kec"; $tbField[13] = "sekolah_kab"; $tbField[14] = "sekolah_prop"; if(count($rename) > 1) $tbField[15] = "sekolah_logo_laporan"; if((count($rename) < 1) && (count($rename2) > 1)) $tbField[15] = "sekolah_logo_sekolah"; if((count($rename) > 1) && (count($rename2) > 1)) $tbField[16] = "sekolah_logo_sekolah"; if(isset($_POST["Simpan"])) $sekolah_id = maxId($tbField[0],$nmTable); if(isset($_POST["Update"])) $sekolah_id = $_POST["sekolah_id"]; $tbIsi[0] = $sekolah_id; $tbIsi[1] = "'".$_POST["sekolah_nama"]."'"; $tbIsi[2] = "'".$_POST["sekolah_slogan"]."'"; $tbIsi[3] = "'".$_POST["sekolah_alamat"]."'"; $tbIsi[4] = "'".$_POST["sekolah_telp"]."'"; $tbIsi[5] = "'".$_POST["sekolah_fax"]."'"; $tbIsi[6] = "'".$sekolah_status."'"; $tbIsi[7] = "'".$sekolah_nss."'"; $tbIsi[8] = "'".$sekolah_npsn."'"; $tbIsi[9] = "'".$_POST["sekolah_email"]."'"; $tbIsi[10] = "'".$_POST["sekolah_web"]."'"; $tbIsi[11] = "'".$sekolah_kel."'"; $tbIsi[12] = "'".$sekolah_kec."'"; $tbIsi[13] = "'".$sekolah_kab."'"; $tbIsi[14] = "'".$sekolah_prop."'"; if(count($rename) > 1) $tbIsi[15] = "'".$nw_file."'"; if((count($rename) < 1) && (count($rename2) > 1)) $tbIsi[15] = "'".$nw_file2."'"; if((count($rename) > 1) && (count($rename2) > 1)) $tbIsi[16] = "'".$nw_file2."'"; 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 sekolah_id = a; if(confirm('Anda akan menghapus data ini, klik OK untuk memprosesnya.')) window.parent.document.location.href='<?php echo $nmForm;?>&delete=active&sekolah_id='+sekolah_id; else return false; } </script> <section id="content" class="content-alt"> <div class="container"> <div class="card"> <div class="card-header"> <h2>Setup Sekolah <small>Form berikut ini berisi tentang entry, edit & hapus untuk data sekolah</small></h2> </div> <div class="card-body"> <?php echo "<form name=\"fanform\" method=\"POST\" action=\"".$nmForm."\" enctype=\"multipart/form-data\">"; echo "<table class=\"table table-striped\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\" margin: 0; width: 100%;\">"; echo "<tr>"; echo "<td width=28%><b>Nama Sekolah</b></td>"; echo "<td width=2%>:</td>"; echo "<td width=70%>".iTBox("45","255","sekolah_nama",$sekolah_nama,"style=\"width: 100%;\"")."".iTextH("sekolah_id",$sekolah_id)."</td>"; echo "</tr>"; echo "<tr>"; echo "<td width=28%><b>Slogan Sekolah</b></td>"; echo "<td width=2%>:</td>"; echo "<td width=70%>".iTBox("45","255","sekolah_slogan",$sekolah_slogan,"style=\"width: 100%;\"")."</td>"; echo "</tr>"; echo "<tr>"; echo "<td><b>Alamat</b></td>"; echo "<td>:</td>"; echo "<td>".iTBox("45","255","sekolah_alamat",$sekolah_alamat,"style=\"width: 100%;\"")."</td>"; echo "</tr>"; echo "<tr>"; echo "<td><b>Keluruhan</b></td>"; echo "<td>:</td>"; echo "<td>".iTBox("45","255","sekolah_kel",$sekolah_kel,"style=\"width: 100%;\"")."</td>"; echo "</tr>"; echo "<tr>"; echo "<td><b>Kecamatan</b></td>"; echo "<td>:</td>"; echo "<td>".iTBox("45","255","sekolah_kec",$sekolah_kec,"style=\"width: 100%;\"")."</td>"; echo "</tr>"; echo "<tr>"; echo "<td><b>Kabupaten</b></td>"; echo "<td>:</td>"; echo "<td>".iTBox("45","255","sekolah_kab",$sekolah_kab,"style=\"width: 100%;\"")."</td>"; echo "</tr>"; echo "<tr>"; echo "<td><b>Provinsi</b></td>"; echo "<td>:</td>"; echo "<td>".iTBox("45","255","sekolah_prop",$sekolah_prop,"style=\"width: 100%;\"")."</td>"; echo "</tr>"; echo "<tr>"; echo "<td><b>Telp.</b></td>"; echo "<td>:</td>"; echo "<td>".iTBox("45","255","sekolah_telp",$sekolah_telp,"style=\"width: 100%;\"")."</td>"; echo "</tr>"; echo "<tr>"; echo "<td><b>Fax</b></td>"; echo "<td>:</td>"; echo "<td>".iTBox("45","255","sekolah_fax",$sekolah_fax,"style=\"width: 100%;\"")."</td>"; echo "</tr>"; echo "<tr>"; echo "<td><b>Status Sekolah</b></td>"; echo "<td>:</td>"; $cmbox = "<select name=\"sekolah_status\" class=\"form-control\">"; $cmbox .= iComboB("Akreditasi A","Akreditasi A",$sekolah_status,"Akreditasi A"); $cmbox .= iComboB("Akreditasi B","Akreditasi B",$sekolah_status,"Akreditasi B"); $cmbox .= iComboB("Akreditasi C","Akreditasi C",$sekolah_status,"Akreditasi C"); $cmbox .= iComboB("Belum Terakreditasi","Belum Terakreditasi",$sekolah_status,"Belum Terakreditasi"); $cmbox .= "</select>"; echo "<td>".$cmbox."</td>"; echo "</tr>"; echo "<tr>"; echo "<td><b>NSS</b></td>"; echo "<td>:</td>"; echo "<td>".iTBox("45","255","sekolah_nss",$sekolah_nss,"style=\"width: 100%;\"")."</td>"; echo "</tr>"; echo "<tr>"; echo "<td><b>NPSN</b></td>"; echo "<td>:</td>"; echo "<td>".iTBox("45","255","sekolah_npsn",$sekolah_npsn,"style=\"width: 100%;\"")."</td>"; echo "</tr>"; echo "<tr>"; echo "<td><b>Email</b></td>"; echo "<td>:</td>"; echo "<td>".iTBox("45","255","sekolah_email",$sekolah_email,"style=\"width: 100%;\"")."</td>"; echo "</tr>"; echo "<tr>"; echo "<td><b>Website</b></td>"; echo "<td>:</td>"; echo "<td>".iTBox("45","255","sekolah_web",$sekolah_web,"style=\"width: 100%;\"")."</td>"; echo "</tr>"; echo "<tr>"; echo "<td><b>Browse Logo Laporan</b></td>"; echo "<td>:</td>"; echo "<td><input type=\"file\" name=\"file\" id=\"file\" class=\"textField\" size=\"70\"></td>"; echo "</tr>"; echo "<tr>"; echo "<td><b>Browse Logo Sekolah</b></td>"; echo "<td>:</td>"; echo "<td><input type=\"file\" name=\"file2\" id=\"file2\" class=\"textField\" size=\"70\"></td>"; echo "</tr>"; echo "<tr>"; echo "<td> </td>"; echo "<td> </td>"; if($edit) { echo "<td>".iSbmt("Update")."</td>"; }else{ echo "<td>".iSbmt("Update")."</td>"; // echo "<td>".$bt_simpan."</td>"; } echo "</tr>"; echo "</table>"; ?> <br> <?php echo "<table class=\"table table-hover\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\" margin: 0; width: 100%;\">"; echo "<tr>"; // echo "<th width=5% align=center>Hapus</th>"; echo "<th width=5% align=center>Edit</th>"; echo "<th width=30% align=center>Nama Sekolah</th>"; echo "<th width=30%>Alamat</th>"; echo "</tr>"; $query="select * from ".$nmTable." where sekolah_id = 1 order by sekolah_id asc"; $iData=sAllData($query); for($a=0,$b=count($iData);$a<$b;$a++) { echo "<tr>"; // if(isset($_POST["Multiple"])) echo "<td align=center><input type=checkbox id=sekolahid[] name=sekolahid[] value=".MyIdEncode($iData[$a]["sekolah_id"])."></td>"; // else echo "<td align=center>".iAPict("hapus('".MyIdEncode($iData[$a]["sekolah_id"])."');",$icon_del,16,16)."</td>"; if($hakakses[2] == 0) echo "<td> </td>"; else{ echo "<td align=center>".iAPict2($nmForm."&edit=active&sekolah_id=".MyIdEncode($iData[$a]["sekolah_id"]),$icon_edit,16,16)."</td>"; } echo "<td>".$iData[$a]["sekolah_nama"]." </td>"; echo "<td>".$iData[$a]["sekolah_alamat"]." </td>"; echo "</tr>"; } // echo "<tr>"; // echo "<td colspan=7 align=left>"; // if(isset($_POST["Multiple"])) echo iSbmt("Delete"); // else echo iSbmt("Multiple"); // echo "</td>"; // echo "</tr>"; echo "</table>"; echo "</form>"; ?> </div> </div> </div> </section>