[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
Backup
/
05122024
/
htdocs
/
siakad
/
simpeg
/
kepegawaian
/
Setup
/
New folder
/
[
Home
]
File: ResetPassword.inc.php
<?php $nmForm = "index.php?ResetPassword"; $title = $nmsd." : Reset Password"; // $nmForm = "cp-resetpassword.php"; $nmTable = "login_user"; //hak akses $formnama = "cp-resetpass"; $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_update = " "; //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 $user_id = ""; $user_nama = ""; $user_name = ""; $user_pass = ""; $user_repass = ""; $user_akad = ""; $user_perpus = ""; $user_psb = ""; $id_profil = ""; $alert = 0; //multiple del record if(isset($_POST["Delete"])) { $userid = & $_POST["userid"]; for($a=0,$b=count($userid);$a<$b;$a++) { $exe = _del($nmTable,"user_id",MyIdDecode($userid[$a]),0); } } //cara untuk hapus record if($delete == "active" && isset($_GET["user_id"])) { $exe = _del($nmTable,"user_id",MyIdDecode($_GET["user_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["user_id"])) { $query = "select * from ".$nmTable." where user_id = ".MyIdDecode($_GET["user_id"]); $iData=sAllData($query); for($a=0,$b=count($iData);$a<$b;$a++) { $user_id = $iData[$a]["user_id"]; $user_nama = $iData[$a]["user_nama"]; $user_name = $iData[$a]["user_name"]; $user_pass = $iData[$a]["user_pass"]; $user_repass = $iData[$a]["user_repass"]; $user_akad = $iData[$a]["user_akad"]; $user_perpus = $iData[$a]["user_perpus"]; $user_psb = $iData[$a]["user_psb"]; $id_profil = $iData[$a]["id_profil"]; } } //cara untuk simpan if(isset($_POST["Simpan"]) || isset($_POST["Update"])) { $user_nama = $_POST["user_nama"]; $user_name = $_POST["user_name"]; $user_pass = $_POST["user_pass"]; $user_repass = $_POST["user_repass"]; //validasi data tidak boleh ada yg kosong if($user_nama == "") $alert = 1; if($user_name == "") $alert = 1; if($user_pass == "") $alert = 1; if($user_repass == "") $alert = 1; if($alert == 1) { echo "<script>window.alert('".$esm1."');</script>"; }else{ $tbField[0] = "user_id"; $tbField[1] = "user_nama"; $tbField[2] = "user_name"; $tbField[3] = "user_pass"; $tbField[4] = "user_repass"; if(isset($_POST["Simpan"])) $user_id = maxId($tbField[0],$nmTable); if(isset($_POST["Update"])) $user_id = $_POST["user_id"]; $tbIsi[0] = $user_id; $tbIsi[1] = "'".$_POST["user_nama"]."'"; $tbIsi[2] = "'".$_POST["user_name"]."'"; $tbIsi[3] = "'".$_POST["user_pass"]."'"; $tbIsi[4] = "'".$_POST["user_repass"]."'"; 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 user_id = a; if(confirm('Anda akan menghapus data ini, klik OK untuk memprosesnya.')) window.parent.document.location.href='<?php echo $nmForm;?>&delete=active&user_id='+user_id; else return false; } </script> <section id="content" class="content-alt"> <div class="container"> <div class="card"> <div class="card-header"> <h2>Reset Password Userlogin <small>Form berikut ini berisi tentang reset password semua data pengguna</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>Nama User</b></td>"; echo "<td width=2%>:</td>"; echo "<td width=70%>".iTBox("45","255","user_nama",$user_nama,"style=\"width: 35%;\"")."".iTextH("user_id",$user_id)."</td>"; echo "</tr>"; echo "<tr>"; echo "<td><b>Username</b></td>"; echo "<td>:</td>"; echo "<td>".iTBox("45","255","user_name",$user_name,"style=\"width: 55%;\"")."</td>"; echo "</tr>"; echo "<tr>"; echo "<td><b>Password</b></td>"; echo "<td>:</td>"; echo "<td>".iTBoxPass("45","255","user_pass",$user_pass,"style=\"width: 55%;\"")."</td>"; echo "</tr>"; echo "<tr>"; echo "<td><b>Ulangi</b></td>"; echo "<td>:</td>"; echo "<td>".iTBoxPass("45","255","user_repass",$user_repass,"style=\"width: 55%;\"")."</td>"; echo "</tr>"; echo "<tr>"; echo "<td> </td>"; echo "<td> </td>"; if($edit) { echo "<td>".$bt_update."</td>"; }else{ echo "<td> </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>Edit</th>"; echo "<th width=30% align=center>Nama User</th>"; echo "<th width=30%>Username</th>"; echo "</tr>"; $query="select * from ".$nmTable." order by user_id asc"; $iData=sAllData($query); for($a=0,$b=count($iData);$a<$b;$a++) { if($iData[$a]["user_akad"] == "1") $imakad = iPict($icon_people,16,16,""); else $imakad = " "; if($iData[$a]["user_perpus"] == "1") $imperpus = iPict($icon_people,16,16,""); else $imperpus = " "; if($iData[$a]["user_psb"] == "1") $impsb = iPict($icon_people,16,16,""); else $impsb = " "; echo "<tr>"; if($hakakses[2] == 0) echo "<td> </td>"; else{ echo "<td align=center>".iAPict2($nmForm."&edit=active&user_id=".MyIdEncode($iData[$a]["user_id"]),$icon_edit,16,16)."</td>"; } echo "<td>".$iData[$a]["user_nama"]." </td>"; echo "<td>".$iData[$a]["user_name"]." </td>"; echo "</tr>"; } echo "</table>"; echo "</form>"; ?> </div> </div> </div> </section>