<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Dim NCheck:NCheck=true
Dim rs
Dim eStr:eStr=""
%>
<!--#include file="cgi/Config.asp"-->
<%


Dim act:act=Request("act")


if act="save" then 
	oldpass				=trim(Request("oldpass"))
	newpass				=trim(Request("newpass"))
	newpass1				=trim(Request("newpass1"))
	if oldpass="" then eStr="原始密码不能为空"
	if newpass="" then eStr=eStr&"<br />新密码不能为空"
	if newpass<>newpass1 then eStr=eStr&"<br />两次输入的密码不一致"		
	if eStr="" then			
			mobj.crs rs
			rs.open "select * from b2c_admin where  a_id="&Session("a_id")&" and a_userpass='"&md5(oldpass)&"'",dstr,1,3
			if rs.eof and rs.bof then
				mobj.drs rs
				mobj.JsCheck "原始密码错误",1
				act="error"		
			else
				rs("a_userpass")=MD5(newpass)
				
				rs.update
				act="ok"
				eStr="用户修改成功"
			end if
	else
		act="error"		
	end if
			
end if
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
<title>管理页面</title>
<meta http-equiv="Expires" Content="0"/>
<meta http-equiv="Cache-Control" Content="no-cache"/>
<meta http-equiv="Pragma" Content="no-cache"/>
<link href="/images/skin_1/style.css" type="text/css" rel="stylesheet"/>

<script language=javascript type="text/javascript" src="/js/jquery-1.7.1.min.js"></script>
<script language="javascript" src="js/comm.js"></script>

<base target="_self"/>
</head>
<body class="htmlbody">

<table class="table1" cellspacing="1" cellpadding="3" align="center" border="0">
	<tr>
		<td class="tableline linetitle" width="200" align="left">用户管理</td>
		<td class="tableline" width="*" align="right">&nbsp;</td>
	</tr>
</table>




<div>
<%
if act="edit" then 
%>
<table  border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
        <tr>
          <th colspan="4">修改密码</th>
        </tr>
		<form action="admin_pass.asp" method="Post" name="myform" id="passform">
<input type="Hidden" name="act" value="save">
        <tr>
          <td width="15%" align="right" class="tablerow2"><b>原始密码：</b></td>
          <td width="85%" colspan="3" class="tablerow2"><span style="position:relative"><input name="oldpass" type="password" id="oldpass" value="" size="30" maxlength="120">
          <font color="red">*</font></span>
           
            <label></label></td>
        </tr>
        <tr>
          <td align="right" class="tablerow1"><b>新密码：</b></td>
          <td colspan="3" class="tablerow1">
            <input name="newpass" type="password" id="newpass" value="" size="30" maxlength="80" />          </td>
        </tr>
		<tr>
          <td align="right" class="tablerow2"><b>确认新密码：</b></td>
          <td colspan="3" class="tablerow2"><input name="newpass1" type="password" id="newpass1" value="" size="30" /></td>
        </tr>
       
        <tr align="center">
          <td class="tablerow2">&nbsp;</td>
          <td colspan="3" align="left" class="tablerow2"><input onclick="checkpass();" type="button"  value="确认修改" class="button" />&nbsp;&nbsp;&nbsp;&nbsp;          </td>
          </tr>
		</form>
      </table>
     
<%end if%>



      
      <%if act="ok" then%>
      <table align="center" border="0" cellpadding="3" cellspacing="1" class="table2">
    <tr> 
      <th colspan="2" align="left"> 成功提示信息!</th>
    </tr>
  <tr><td align="center" width="20%" class="tableline1"><img src="/images/suc.gif" width="95" height="97" border="0"></td><td width="80%" class="tableline1"> <b style="color:blue">您在成功提示页面的停留时间 <span id="jump">0</span> 秒</b><br><li><%=eStr%>。</li></td></tr>
  <tr><td colspan="2" align="center" height="25" class="tableline2">
  <%if act="ok" and u_id="" then%>
  <a href="admin_pass.asp?act=edit">返回上一页...</a>
  <%end if%>
 
   
  
  
  
  </td></tr>
</table><p>&nbsp;</p>

      <%end if%>
      <%if act="error" then%>
<table align="center" border="0" cellpadding="3" cellspacing="1" class="table2">
    <tr> 
      <th colspan="2" align="left"> 错误提示信息!</th>
    </tr>
  <tr><td align="center" width="20%" class="tableline1"><img src="/images/err.gif" width="95" height="97" border="0"></td><td width="80%" class="tableline1"> <b style="color:blue">产生错误的可能原因：</b><br><%=eStr%></td></tr>
  <tr><td colspan="2" align="center" height="25" class="tableline2"><a href="javascript:history.go(-1)">返回上一页...</a></td></tr>
</table><p>&nbsp;</p>
<%end if%>
      <div id="BokeccBtn"> </div>
</div>

<form name="NewAsp_UploadForm" action="../remoteupload.asp?action=upload&ChannelID=1" method="post" target="NewAsp_UploadTarget">
<input type="hidden" name="NewAsp_UploadText" value=""/>
</form>
<div id="divProcessing" style="width:200px;height:30px;position:absolute;display:none">
<table border="0" cellpadding="0" cellspacing="1" bgcolor="#000000" width="100%" height="100%"><tr><td bgcolor="#0650D2"><marquee align="middle" behavior="alternate" scrollamount="5" style="font-size:9pt"><font color="#FFFFFF">...正在保存数据...请等待...</font></marquee></td></tr></table>
</div>

<script type="text/javascript">
function checkpass(){
	if($("#oldpass").val()==""){alert("原始密码必填");$("#oldpass").focus();return;}
	if($("#newpass").val()==""){alert("新密码必填");$("#newpass").focus();return;}
	if($("#newpass1").val()!=$("#newpass").val()){alert("两次输入的新密码不一致");$("#newpass1").focus();return;}
	$("#passform").submit();
}
 
</script>
<!--#include file="end.asp"-->
</body></html>
