<!--#include file="conn.asp"-->
<!--#include file="INC/md5.asp"-->

<%
	if GetVariable("action")="save" then
	
		'检查旧密码
		OldPassWorld=trim(GetFormVariable("password"))
		OldPassWorld=md5(OldPassWorld)
		NewPassWorld=trim(GetFormVariable("newpwd"))
		strSQL="Select id From member Where id=" & trim(Session("UserID")) & " And m_password='" & OldPassWorld & "'"
		rs.open strSQL,conn,1,1
		if rs.recordcount<=0 then 
			ShowMsg "密码修改失败，旧密码输入不正确！"
		end if
		rs.close
		
		strUserName=trim(Session("UserName"))
		pn=instr(strUserName,"_")
		if pn>0 then
			strUserName=left(strUserName,pn-1)
		end if
	
		'修改所以语言版本的密码，以保证密码同步
		strSQL="Update member Set "
		strSQL=strSQL & "m_password='" & md5(NewPassWorld) & "' Where m_name='" & strUserName & "' Or m_name Like '" & strUserName & "_%'"
		conn.execute strSQL,0,1
		
		msg="提示：密码修改成功！！"
	end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>电子商务自助建站--您理想的助手</title>
<link href="common/styleMain.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="common/JS_CheckForm.js"></script>
<script language="JavaScript">
//检查数据有效性
function checkform(theform){
	if(!CheckEmpty(theform.password, "旧密码")) return false;
	if(!CheckEmpty(theform.newpwd, "新密码")) return false;
	if (theform.newpwd.value!=theform.confirmpwd.value){
		alert("两次输入密码不一致！");
		return false;
	}
}
</script>
</head>
<body leftmargin="0" topmargin="0">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td height="0" align="center">
		  <!--#include file="common/top.asp"-->
          </td>
        </tr>
        <tr> 
          <td height="100%" align="center" valign="top">
<TABLE class=table002 cellSpacing=0 cellPadding=0 border=0>
              <TBODY>
                <TR> 
                  <!--左边开始-->
                  <TD vAlign=top align=right width="20%">
					  <!--#include file="common/left.asp"-->
				  </TD>
                  <!--左边结束-->
                  <TD width="2%" background="images/rowline.gif">&nbsp;</TD>
                  <!--右边开始-->
                  <TD vAlign=top align=middle width="78%">
				  <form name="form1" method="post" action="?action=save" onSubmit="return checkform(this)">
                      <TABLE width="100%" height="100%" border=0 cellPadding=6 cellSpacing=0>
                        <TBODY>
                          <TR> 
                            <TD vAlign=top align=left bgColor=#ffffff><B>密码修改</B><BR> 
                              <HR SIZE=1> 
                              <table width="100%" height="460" border="1" cellpadding="1" cellspacing="1" bgcolor="#bad2f0">
                                <tr> 
                                  <td height="26" bgcolor="#5f8ac5"><font color="#FFFFFF">□ 
                                    密码修改</font></td>
                                </tr>
                                <tr> 
                                  <td height="429" valign="top" bgcolor="#FFFFFF"> 
                                    <table width="100%" border="0" cellspacing="0" cellpadding="2">
                                      <tr> 
                                        <td align="center"> <table width="99%" border="0" cellspacing="0" cellpadding="0">
                                            <tr> 
                                              <td height="40" align="right">您的账号：</td>
                                              <td height="40"><%=Session("UserName")%></td>
                                            </tr>
                                            <tr> 
                                              <td height="40" align="right" bgcolor="#F5F5F5">旧密码：</td>
                                              <td height="40" bgcolor="#F5F5F5"> 
                                                <INPUT name=password type="password" id="password" size=35 maxLength=50> 
                                                <font color="#FF0000">＊</font> 
                                                <span 
                              class=gray>≤ 50个字符</span> </td>
                                            </tr>
                                            <tr> 
                                              <td width="19%" height="40" align="right">新密码：</td>
                                              <td width="81%" height="40"> <input name=newpwd type="password" id="newpwd" 
                              size=35 maxlength=50> <font color="#FF0000">＊</font> 
                                                <span 
                              class=gray>≤ 50个字符</span> </td>
                                            </tr>
                                            <tr> 
                                              <td height="40" align="right" bgcolor="#f5f5f5">确定新密码： 
                                              </td>
                                              <td height="40" bgcolor="#f5f5f5"> 
                                                <INPUT name=confirmpwd type="password" id="confirmpwd" 
                              size=35 maxLength=50> <font color="#FF0000">＊</font> 
                                                <span 
                              class=gray>≤ 50个字符</span> </td>
                                            </tr>
                                          </table></td>
                                      </tr>
                                      <tr> 
                                        <td height="77" align="center"> 
                                          <INPUT type=submit value=" 保存修改 " name=Submit> 
                                          <INPUT type=reset value=" 取消 " name=Submit> 
                                        </td>
                                      </tr>
                                      <tr>
                                        <td height="80" align="center">
										
										<font color="#FF0000"><strong>
										<%=msg%>
										</strong></font>
										</td>
                                      </tr>
                                    </table>
                                  
                                  </td>
                                </tr>
                              </table></TD>
                          </TR>
                        </TBODY>
                      </TABLE>
                    </form></TD>
                </TR>
              </TBODY>
            </TABLE></td>
        </tr>
        <tr> 
          <td height="0" align="center">
		  <!--#include file="common/bottom.asp"-->
		  </td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>
