|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /var/www/html/pathumthani_eoffice/application/system/ |
Upload File : |
<?
$org_id = intval($_SESSION[session_dev_id]);
$sex = array("M"=>"ชาย","F"=>"หญิง");
$m1 = array("#default", "user_ht.php");
$m2 = array("เปลี่ยนรหัสผ่าน", "รายละเอียดการเข้าใช้งาน");
?>
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=windows-874" />
<LINK href="../../common/style.css" rel="stylesheet" />
<TITLE>แก้ไขรายละเอียดต่าง ๆ</TITLE>
<STYLE>
.p_border{
border-bottom:2 solid #DADCED;
}
.shadetabs{
padding : 3px 0px ;
margin-left : 0;
margin-top : 1px;
margin-bottom : 0;
font : bold 12px tahoma;
list-style-type : none;
text-align : left; /*set to left, center, or right to align the menu as desired*/
}
.shadetabs li{
display : inline;
margin : 0;
background-color:#F2F4F7;
}
.shadetabs li a{
text-decoration : none;
padding : 3px 7px;
margin-right : 0px;
border : 1px solid #cccccc;
color : #666666;
text-decoration :underline;
}
.shadetabs li a:visited{
color : #666666;
}
.shadetabs li a:hover{
color : #666666;
}
.shadetabs li.selected{
position : relative;
top : 1px;
}
.shadetabs li.selected a{ /*selected main tab style */
background-color : #DADCED;
border-bottom-color : #DADCED;
}
.shadetabs li.selected a:hover{ /*selected main tab style */
text-decoration : none;
}
.contentstyle{
border : 1px solid #cccccc;
width : 700px;
margin-bottom : 1em;
padding : 10px;
background-color : #DADCED;
}
body {
margin-left: 5px;
margin-top: 5px;
margin-right: 5px;
}
</STYLE>
<SCRIPT language="javascript" src="ajaxtabs.js"></SCRIPT>
<SCRIPT language="javascript">
function ChangePass() {
if(document.post.old_pwd.value.length==0) {
alert("กรุณากรอกรหัสผ่าน");
document.post.old_pwd.focus();
return false;
} else if(document.post.new_pwd1.value.length==0) {
alert("โปรดใส่รหัสผ่านใหม่");
document.post.new_pwd1.focus();
return false;
} else if(document.post.new_pwd1.value.length != document.post.new_pwd2.value.length) {
alert("รหัสผ่านทั้งสองไม่ตรงกัน กรุณายืนยันรหัสผ่านให้ถูกต้อง") ;
document.post.new_pwd2.focus() ;
return false ;
}
var rnd = "rnd=" + Math.random();
var pwd_old = "&pwd_old=" + document.post.old_pwd.value;
var pwd_new = "&pwd_new=" + document.post.new_pwd1.value;
var param = rnd + pwd_old + pwd_new;
var txt = " <img src=\"../../images/indicator.gif\" align=\"absmiddle\" height=\"16\" width=\"16\"> Updating...";
document.getElementById("Status").innerHTML= txt;
xmlHttp.open('POST', 'user_cpwd.php', true);
xmlHttp.onreadystatechange = function() {
if (xmlHttp.readyState==4) {
if (xmlHttp.status==200) { document.getElementById("Status").innerHTML = xmlHttp.responseText }
}
};
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
xmlHttp.send(param);
document.post.reset();
}
function UpdateProfile() {
if(document.profile.staffname.value.length==0) {
alert("โปรดระบุชื่อภาษาไทย");
document.profile.staffname.focus();
return false;
} else if(document.profile.staffsurname.value.length==0) {
alert("โปรดระบุนามสกุลภาษาไทย");
document.profile.staffsurname.focus();
return false;
} else if(document.profile.engname.value.length==0) {
alert("โปรดระบุชื่อภาษาอังกฤษ");
document.profile.engname.focus();
return false;
} else if(document.profile.engsurname.value.length==0) {
alert("โปรดระบุนามสกุลภาษาอังกฤษ");
document.profile.engsurname.focus();
return false;
} else if(document.profile.email.value.length != 0) {
if(profile.email.value.indexOf('@')==-1) {
alert("อีเมล์ของคุณไม่ถูกต้องครับ") ;
document.profile.email.focus() ;
return false ;
} else if(profile.email.value.indexOf('.')==-1) {
alert("อีเมล์ของคุณไม่ถูกต้องครับ") ;
document.profile.email.focus() ;
return false ;
}
}
var rnd = "rnd=" + Math.random();
var prename = "&prename=" + document.profile.prename.value;
var staffname = "&staffname=" + document.profile.staffname.value;
var staffsurname = "&staffsurname=" + document.profile.staffsurname.value;
var engprename = "&engprename=" + document.profile.engprename.value;
var engname = "&engname=" + document.profile.engname.value;
var engsurname = "&engsurname=" + document.profile.engsurname.value;
var email = "&email=" + document.profile.email.value;
var sex = "&sex=" + document.profile.sex.value;
var title = "&title=" + document.profile.title.value;
var telno = "&telno=" + document.profile.telno.value;
//var address = "&address=" + document.profile.address.value;
var comment = "&comment=" + document.profile.comment.value;
var param = rnd + prename + staffname + staffsurname + engprename + engname + engsurname + email + sex + title + telno + comment ;
var txt = " <img src=\"../../images/indicator.gif\" align=\"absmiddle\" height=\"16\" width=\"16\"> Updating...";
document.getElementById("Status").innerHTML= txt;
xmlHttp.open('POST', 'user_profile.php', true);
xmlHttp.onreadystatechange = function() {
if (xmlHttp.readyState==4) {
if (xmlHttp.status==200) { document.getElementById("Status").innerHTML = xmlHttp.responseText }
}
};
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
xmlHttp.send(param);
}
function uplImage() {
var url = "user_image.php?rnd=" + Math.random() ;
var newwin = window.open(url ,'popup','location=0,status=no,scrollbars=no,resizable=no,width=400,height=120,top=200');
newwin.focus();
}
</SCRIPT>
</HEAD>
<BODY>
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0" >
<TR valign="top">
<TD>
<UL id="maintab" class="shadetabs">
<?
for($i=0;$i<count($m1);$i++){
$showtab = ($i<=0) ? " class=\"selected\" " : "" ;
echo "<li $showtab><a href=\"".$m1[$i]."\" rel=\"ajaxcontentarea\">".$m2[$i]."</a></li>";
}
?>
</UL>
<DIV id="ajaxcontentarea" class="contentstyle" align="left" style="width:100%">
<FORM name="post">
<TABLE width="100%" border="0" cellpadding="5" cellspacing="0" bgcolor="#F2F4F7">
<TR>
<TD align="left" bgcolor="#DADCED"><SPAN style="font-size:11pt; font-weight:bold">เปลี่ยนข้อมูลรหัสผ่าน</SPAN></TD>
</TR>
<TR>
<TD align="center">
<TABLE width="100%" border="0" cellspacing="0" cellpadding="3">
<TR align="center">
<TD colspan="2"><DIV id="Status"></DIV></TD>
</TR>
<TR>
<TD width="171" height="20" align="left" class="p_border" ><STRONG>รหัสผ่านเดิม</STRONG> </TD>
<TD width="754" class="p_border" ><INPUT name="old_pwd" type="password" style="width:150;" size="20" maxlength="20"></TD>
</TR>
<TR>
<TD height="20" align="left"><STRONG>รหัสผ่านใหม่</STRONG> </TD>
<TD><INPUT name="new_pwd1" type="password" style="width:150;" size="20" maxlength="20"></TD>
</TR>
<TR>
<TD height="20" align="left"><STRONG>ยืนยันรหัสผ่านใหม่</STRONG> </TD>
<TD><INPUT name="new_pwd2" type="password" style="width:150;" size="20" maxlength="20"></TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD align="left" bgcolor="#DADCED"><BUTTON style="width:60px; font-weight:bold" onClick="ChangePass();">OK</BUTTON></TD>
</TR>
</TABLE>
</FORM>
</DIV>
</TD>
</TR>
</TABLE>
<SCRIPT type="text/javascript">startajaxtabs("maintab")</SCRIPT>
</BODY>
</HTML>