[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
Backup
/
05122024
/
htdocs
/
siakad
/
c-panel
/
SetupFirst
/
[
Home
]
File: TahunAjaran.inc.php
<?php $nmForm = "index.php?TahunAjaran"; $title = $nmsd." : Master Tahun Ajaran"; // $nmForm = "m-ta.php"; $nmTable = "m_tahun_ajaran"; //hak akses $formnama = "m-ta"; $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 $ta_id = ""; $ta_nama = ""; $ta_mulai = ""; $ta_sampai = ""; $alert = 0; //multiple del record if(isset($_POST["Delete"])) { $taid = & $_POST["taid"]; for($a=0,$b=count($taid);$a<$b;$a++) { $exe = _del($nmTable,"ta_id",MyIdDecode($taid[$a]),0); } } //cara untuk hapus record if($delete == "active" && isset($_GET["ta_id"])) { $exe = _del($nmTable,"ta_id",MyIdDecode($_GET["ta_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["ta_id"])) { $query = "select * from ".$nmTable." where ta_id = ".MyIdDecode($_GET["ta_id"]); $iData=sAllData($query); for($a=0,$b=count($iData);$a<$b;$a++) { $ta_id = $iData[$a]["ta_id"]; $ta_nama = $iData[$a]["ta_nama"]; $ta_mulai = format_date($iData[$a]["ta_mulai"]); $ta_sampai = format_date($iData[$a]["ta_sampai"]); } } //cara untuk simpan if(isset($_POST["Simpan"]) || isset($_POST["Update"])) { $ta_nama = $_POST["ta_nama"]; $ta_mulai = $_POST["ta_mulai"]; $ta_sampai = $_POST["ta_sampai"]; //validasi data tidak boleh ada yg kosong if($ta_nama == "") $alert = 1; if($ta_mulai == "") $alert = 1; if($ta_sampai == "") $alert = 1; if($alert == 1) { echo "<script>window.alert('".$esm1."');</script>"; }else{ $tbField[0] = "ta_id"; $tbField[1] = "ta_nama"; $tbField[2] = "ta_mulai"; $tbField[3] = "ta_sampai"; if(isset($_POST["Simpan"])) $ta_id = maxId($tbField[0],$nmTable); if(isset($_POST["Update"])) $ta_id = $_POST["ta_id"]; $tbIsi[0] = $ta_id; $tbIsi[1] = "'".$_POST["ta_nama"]."'"; $tbIsi[2] = "'".format_date($_POST["ta_mulai"])."'"; $tbIsi[3] = "'".format_date($_POST["ta_sampai"])."'"; 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>"; } } ?> <link type="text/css" rel="stylesheet" href="<?php echo $mdkdatelib;?>/dhtmlgoodies_calendar.css?random=20051112" media="screen"></LINK> <SCRIPT type="text/javascript" src="<?php echo $mdkdatelib;?>/dhtmlgoodies_calendar.js?random=20060118"></script> <script> function hapus(a) { var ta_id = a; if(confirm('Anda akan menghapus data ini, klik OK untuk memprosesnya.')) window.parent.document.location.href='<?php echo $nmForm;?>&delete=active&ta_id='+ta_id; else return false; } </script> <section id="content" class="content-alt"> <div class="container"> <div class="card"> <div class="card-header"> <h2>Setup Tahun Ajaran <small>Form berikut ini berisi tentang entry, edit & hapus untuk semua data tahun ajaran</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>Tahun Ajaran</b></td>"; echo "<td width=2%>:</td>"; echo "<td width=70%>".iTBox("45","255","ta_nama",$ta_nama,"style=\"width: 35%;\"")."".iTextH("ta_id",$ta_id)."</td>"; echo "</tr>"; echo "<tr>"; echo "<td><b>Mulai</b></td>"; echo "<td>:</td>"; echo "<td>".iTextDate("ta_mulai",$ta_mulai)." s/d ".iTextDate("ta_sampai",$ta_sampai)."</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>"; ?> <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>Tahun Ajaran</th>"; echo "<th width=30% align=center>Mulai</th>"; echo "<th width=30% align=center>Sampai</th>"; echo "</tr>"; $query="select * from ".$nmTable." order by ta_id 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=taid[] name=taid[] value=".MyIdEncode($iData[$a]["ta_id"])."></td>"; else echo "<td align=center>".iAPict("hapus('".MyIdEncode($iData[$a]["ta_id"])."');",$icon_del,16,16)."</td>"; } if($hakakses[2] == 0) echo "<td> </td>"; else{ echo "<td align=center>".iAPict2($nmForm."&edit=active&ta_id=".MyIdEncode($iData[$a]["ta_id"]),$icon_edit,16,16)."</td>"; } echo "<td align=center>".$iData[$a]["ta_nama"]." </td>"; echo "<td align=center>".format_date($iData[$a]["ta_mulai"])." </td>"; echo "<td align=center>".format_date($iData[$a]["ta_sampai"])." </td>"; echo "</tr>"; } echo "<tr>"; echo "<td colspan=5 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>