[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
Backup
/
14082024
/
Data
/
htdocs
/
htdocs
/
simpeg
/
administrator
/
[
Home
]
File: ubah_password.php
<?php require_once("../lib/konek.php"); require_once("../lib/konfigurasi_semua.php"); //konfigurasi nama file $thisForm = "view.php"; $actionForm = "action.php"; //actionnya if($_POST["user_id"]) $userId = $_POST["user_id"]; if($_POST["mode"]) $mode = $_POST["mode"]; if($_GET["mode"]) { $mode = "edit"; } if($_POST["btnSimpan"] || $_POST["btnUpdate"] || $_POST["btnApply"] || $_POST["btnApply2"]) { $nmTable = "hrd_user_login"; $tbField[0] = "user_id"; $tbField[1] = "user_name"; $tbField[2] = "user_password"; $tbIsi[0] = $userId; $tbIsi[1] = "'".$_POST["user_name"]."'"; $tbIsi[2] = "'".$_POST["user_password"]."'"; for($start=0, $end=count($tbIsi); $start<$end; $start++) { if($start!=0) { $isiField = $isiField.",".$tbField[$start]."=".$tbIsi[$start]; }else{ $isiField = $tbField[$start]."=".$tbIsi[$start]; } } $sql = "update ".$nmTable." set ".$isiField." where ".$tbField[0]." = ".$tbIsi[0]; $Qrs = mysql_query($sql); if($Qrs) { $mode = "edit"; } } if($_SESSION["hrd-id"] != 0) { $userId = $_SESSION["hrd-id"]; $sql = "select * from hrd_user_login where user_id = ".$userId; $qId = mysql_query($sql); $dataUser = mysql_fetch_array($qId); $_POST["user_id"] = $dataUser["user_id"]; $_POST["user_name"] = $dataUser["user_name"]; $_POST["user_password"] = $dataUser["user_password"]; $_POST["id_pgw"] = $dataUser["id_pgw"]; $_POST["id_lj"] = $dataUser["id_lj"]; } //end $dir_img = "../img"; ?> <html> <head> <title><?php echo $header;?></title> </head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" type="text/css" href="lib/lib-style.css"> <script language="JavaScript" type="text/javascript" src="lib/ew.js"></script> <script language="JavaScript" type="text/javascript" src="lib/func_curr.js"></script> <script language="JavaScript" type="text/javascript" src="lib/elements.js"></script> <body> <form name="frmEdit" method="POST" action="ubah_password.php"> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td colspan="2" align="left" valign="middle" bgcolor="#000000" height="28"> <font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="white"> <?php echo $header;?></font> </td> </tr> <tr> <td colspan="2" align="left" bgcolor="#DEDBE7" height="20"> <?php include("menu_atas.php"); ?> </td> </tr> <tr> <td colspan="2"> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr valign="middle" height="50"> <td height="50" width="10"> </td> <td height="50" width="300"> </td> <td height="50" width="100"> </td> <td> <?php echo $defFont;?> </font> </td> <td height="50" width="5"> </td> <td height="50" width="48" align="center"> </td> <td height="50" width="5"> </td> <td height="50" width="48" align="center"> <input type="image" name="<?php if($mode=="edit") { ?>btnApply2<?php }else{ ?>btnApply<?php } ?>" value="<?php if($mode=="edit") { ?>btnApply2<?php }else{ ?>btnApply<?php } ?>" src="<?php echo $dir_img;?>/apply_f2.png"> </td> <td height="50" width="5"> </td> <td height="50" width="50" align="center"> <input type="image" name="<?php if($mode=="edit") { ?>btnUpdate<?php }else{ ?>btnSimpan<?php } ?>" value="<?php if($mode=="edit") { ?>btnUpdate<?php }else{ ?>btnSimpan<?php } ?>" src="<?php echo $dir_img;?>/save_f2.png"> </td> </tr> <tr bgcolor="#FFF8DC" valign="middle"> <td width="10"> </td> <td width="300"> </td> <td width="100"> </td> <td> </td> <td width="5"> </td> <td width="48" align="center" onmouseover="this.style.backgroundColor='#FF6666'" onmouseout="this.style.backgroundColor='#FFF8DC'"> </td> <td width="5"> </td> <td width="48" align="center" onmouseover="this.style.backgroundColor='#FF6666'" onmouseout="this.style.backgroundColor='#FFF8DC'"> <?php echo $defFont;?>Apply</font> </td> <td width="5"> </td> <td width="50" align="center" onmouseover="this.style.backgroundColor='#FF6666'" onmouseout="this.style.backgroundColor='#FFF8DC'"> <?php echo $defFont;?>Simpan</font> </td> </tr> </table> </td> </tr> </table> <table border="0" cellspacing="0" cellpadding="0" width="100%" align="left"> <tr bgcolor="#FFF8DC"> <td align="right" width="35%"><?php echo $defFont;?>Username <?php echo $tFont;?></td> <td width="65%"> <input size="35" maxlength="35" type="teks" name="user_name" value="<?php echo $_POST["user_name"];?>" class="textField" onKeyDown="return tabOnEnter_select(this, event);"> <input type="hidden" name="user_id" value="<?php echo $_POST["user_id"];?>"> <input type="hidden" name="mode" value="<?php echo $mode;?>"> <?php if(!$_POST["user_name"]) echo "*";?> </td> </tr> <tr bgcolor="#FFF8DC"> <td align="right"><?php echo $defFont;?>Password <?php echo $tFont;?></td> <td> <input size="35" maxlength="35" type="teks" name="user_password" value="<?php echo $_POST["user_password"];?>" class="textField" onKeyDown="return tabOnEnter_select(this, event);"> </td> </tr> <tr bgcolor="#FFF8DC"> <td align="right"><?php echo $defFont;?> <?php echo $tFont;?></td> <td> </td> </tr> <tr> <td colspan="2"> <font color="yellow"> <?php if($stat_err==true || $hint) echo "Periksa lagi inputan yang bertanda (*)";?><br> <?php if($stat_err==true) echo "<i>Ada field yang belum terisi. Silahkan mengisi terlebih dahulu</i><br>";?> <?php for($start=0, $end=count($hint); $start<$end; $start++) {?> <i><?php echo $defFont;?><?php echo $hint[$start];?> <?php echo $tFont;?></i> <?php } ?> <?php echo $tFont;?> </td> </tr> </table> </form> </body> </html>