<!--#include file="../Include/Conn.asp" -->
<!--#include file="../sql/Neeao_SqlIn.Asp" -->
<!--#include file="../Include/Char.asp" -->

<%
if trim(Request.Cookies("UserID")) = "" or trim(Session("UserID"))=""  THEN
     Response.Redirect("Login.asp")
	 Response.End()
   end if
   
  ID =  Request.Cookies("UserID")
  oldpwd = CheckStr(Request("oldpwd"))
  Newpwd1 = CheckStr(Request("Newpwd1"))
  Newpwd2 = CheckStr(Request("Newpwd2"))

  if CheckStr(Request("update")) = "OK" then
    if Oldpwd = ""  OR Newpwd1 = "" OR Newpwd2 = "" then
       msbox = "密码框不能为空"
	elseif Newpwd1 <> Newpwd2 then
	   msbox = "新密码不一致"
	else
      SET rs=server.createobject("adodb.recordset")
      SQL="SELECT * FROM  CityCard_League WHERE CompanyID ="&ID  
      rs.Open SQL,conn,1,1 
	  if rs.eof then 
	     msbox = "对不起，不存在"	  
	  elseif rs("password") <> Oldpwd then
	     msbox = "旧密码不正确"
	  else
		set rs = server.CreateObject("adodb.recordset")
    m_SQL = "Select * From CityCard_League Where CompanyID="&ID&""
	rs.open m_SQL,conn,1,3
	if rs.Eof then
	   rs.Close
	   call msgbox("对不起，登陆超时，请重新登陆后再修改密码",1)
	else
	  rs("password")=Newpwd1
	  rs.update
	end if
	    msbox = "修改成功,2秒钟后自动返回管理首页"
		Response.Write "<meta HTTP-EQUIV=REFRESH CONTENT='2; URL=index.asp'>"
	  end if
	end if
  end if	
	


%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>襄樊生活网-商家管理系统</title>
<link href="../css/Style.css" rel="stylesheet" type="text/css"><link href="../css/Menu.css" rel="stylesheet" type="text/css"><link href="../css/aCardList.css" rel="stylesheet" type="text/css"><SCRIPT src="../js/029bxw.js" type=text/javascript></SCRIPT>
<script language="JavaScript" type="text/JavaScript">
<!--



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
</head>

<body onLoad="MM_preloadImages('images/xf_link1b.gif','images/xf_link2b.gif','images/xf_link3b.gif','images/xf_link4b.gif','images/xf_link5b.gif','images/ly_b_2b.gif','images/ly_b_4b.gif','images/ly_b_1b.gif','images/ly_b_3b.gif','images/ly_b_5b.gif')">
<!--#include file="../Include/cardMenu.htm" -->
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td width="170" height="500" valign="top" bgcolor="f5f5f5">
      <!--#include file="Left.asp" -->    </td>
    <td width="10" valign="top"></td>
    <td width="600" valign="top">
      <!--#include file="Ad.asp" -->
      <table width="600" border="1" cellpadding="0" cellspacing="5" bordercolor="e2e2e2" bgcolor="f5f5f5">
        <tr> 
          <td height="25" background="images/about_bj.gif" class="p4">&nbsp;<b>·密码修改</b>          </td>
        </tr>
      </table>
      <table width="600" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height="5"></td>
        </tr>
        <tr> 
          <td height="1" background="images/line.gif" ></td>
        </tr>
      </table>
      <br>
      <br>
      <br>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><div align="center"><font color=ff0000><%=msbox%></font></div></td>
        </tr>
      </table>
      <br>
      <br>
      <table width="82%" height="48" border="0" align="center" cellpadding="4" cellspacing="0">
        <tr bgcolor="f5f5f5"> 
          <th colspan="2"><div align="center">密码修改</div></th>
        </tr>
        <form name="form1" method="post" action="?update=OK">
          <tr> 
            <td width="13%" height="24" bgcolor="#FFFFFF">旧密码：</td>
            <td width="87%" bgcolor="#FFFFFF"><input name="Oldpwd" type="password" id="Oldpwd">
              <font color="#FF0000">*</font></td>
          </tr>
          <tr> 
            <td height="24" bgcolor="#FFFFFF">新密码：</td>
            <td bgcolor="#FFFFFF"><input name="NewPwd1" type="password" id="NewPwd1" maxlength="12">
              <font color="#FF0000">*</font></td>
          </tr>
          <tr> 
            <td height="24" bgcolor="#FFFFFF">确　认：</td>
            <td bgcolor="#FFFFFF"><input name="NewPwd2" type="password" id="NewPwd2" maxlength="12">
              <font color="#FF0000">*</font></td>
          </tr>
          <tr>
            <td height="24" bgcolor="#FFFFFF">&nbsp;</td>
            <td bgcolor="#FFFFFF"><input type="submit" name="Submit" value="修　改">
              <input type="reset" name="Submit2" value="重　来"></td>
          </tr>
        </form>
      </table>    </td>
    <td valign="top">
	<!--#include file="Inc_Ser.asp"-->
</td>
  </tr>
</table>
<!--#include file="../Include/CopyRight.htm" -->
</body>
</html>
