| Server IP : 61.19.30.66 / Your IP : 216.73.216.15 Web Server : Apache/2.2.22 (Ubuntu) System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 User : www-data ( 33) PHP Version : 5.3.10-1ubuntu3.48 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /var/www/cooperative/sell/ |
Upload File : |
<?
ob_start();
session_start();
if($_SESSION["adminlogin"]=="")
{
header('location:index.php');
exit();
}
//============ Start Session และทำการเรียก Function ติดต่อฐานข้อมูล
require_once('../connect/connect.php');
require_once('../connect/function.php');
//=========== เปลี่ยนรหัสผ่าน
if($_GET["Action"]=="Save")
{
if($_SESSION["status"]=="admin")
{
//=========== บันทึกข้อมุลการแก้ไข admin
update("admin","user='".($_POST["txtUsername"])."',pass='".($_POST["txtPassword"])."' "," where 1");
$_SESSION["user"]=$_POST[txtUsername];
$_SESSION["pass"]=$_POST[txtPassword];
$_SESSION["adminlogin"]=true;
session_write_close();
echo"<script language='JavaScript'>";
echo"alert('แก้ไขข้อมูลเรียบร้อยแล้ว');";
echo"window.location='head.php';";
echo"</script>";
}
}
?>
<html>
<head>
<title>Administrator</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../css/styles.css" type="text/css">
</head>
<body>
<br>
<br>
<table width="406" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="10" height="10" background="../image/top_left_corner.png"></td>
<td background="../image/top_line.png"></td>
<td width="10" height="10" background="../image/top_right_corner.png"></td>
</tr>
<tr>
<td background="../image/left_line.png"></td>
<td>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="27">
<table cellspacing=1 cellpadding=4 width="100%" bgcolor=#FFFFFF border=0 align="center" height="190">
<tbody>
<tr bgcolor="#FFFFFF">
<td height="5" valign="top">
<div align="center">
<table width="100%" height="29" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" height="19" colspan="3"><div align="left"><b>
</b> <b>เปลี่ยนรหัสผ่าน </b></div></td>
</tr>
</table>
<script language="JavaScript">
function checkvalue()
{
if(document.all.txtUsername.value=="")
{
alert('กรุณากรอก Username');
document.all.txtUsername.focus();
return false;
}
if(document.all.txtPassword.value=="")
{
alert('กรุณากรอก Password');
document.all.txtPassword.focus();
return false;
}
}
</script>
<form action="<?=$_SERVER['PHP_SELF'];?>?Action=Save" method="post" name="frmEditPass" id="frmEditPass" onSubmit="return checkvalue()">
<table width="95%" border="0">
<tr>
<td width="30%">Username</td>
<td width="70%">
<input name="txtUsername" type="text" class="txtbox" id="txtUsername" value="<?=$_SESSION["user"];?>">
</td>
</tr>
<tr>
<td>Password</td>
<td>
<input name="txtPassword" type="password" class="txtbox" id="txtPassword" value="<?=$_SESSION["pass"];?>">
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>
<input name="btnSave" type="submit" class="InputButton" id="btnSave" style="cursor:hand" value="บันทึก">
<input name="btnCancel" type="button" class="InputButton" id="btnCancel" style="cursor:hand" onClick="window.location='head.php';" value="ยกเลิก">
</td>
</tr>
</table>
</form>
<br>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</td>
<td background="../image/right_line.png"></td>
</tr>
<tr>
<td width="10" height="10" background="../image/bottom_left_corner.png"></td>
<td background="../image/bottom_line.png"></td>
<td width="10" height="10" background="../image/bottom_right_corner.png"></td>
</tr>
</table>
</body>
</html>