
<%response.buffer=true%>
<head>

<LINK 
href="css.css" type=text/css rel=stylesheet>

<!--#include file="../conn2.asp"-->
<!--#include file="set.asp"-->
<!--#include file="../md5.asp"-->
</head>

<body>
<% username=request.querystring("username")
action=request.querystring("action")
id=request.querystring("id")    
select case action
case ""%>
<div align="center">
  <center>
  
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="1" bordercolordark="#FFFFFF" bgcolor="F6F6F6">
  <form method="POST" action="edit_user.asp?id=<%=id%>&action=edit">
    <tr bgcolor="#FFFFFF"> 
      <td colspan="2" align="center" class="norightbuttonborder2"><font color="#FFFFFF">社区用户资料修改</font></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="44%" align="center"> <p align="right">用户名：</p></td>
      <td width="56%"><%=request.querystring("username")%>　</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="44%" align="center"> <p align="right">新密码：</p></td>
      <td width="56%"> <input name="password" type="text" class="textbox_shiixian_hui" size="30"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="44%" align="center"> <p align="right">确认密码：</p></td>
      <td width="56%"> <input name="repassword" type="text" class="textbox_shiixian_hui" size="30"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="44%"> <p align="right">&nbsp; </p></td>
      <td width="56%"> <input name="B1" type="submit" class="button" value="提 交"> 
        <input name="B2" type="reset" class="button" value="全部重写"></td>
    </tr>
  </form>
</table>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="norightbuttonborder3">
  <form method="POST" action="user.asp">
    <tr> 
      <td> <p align="center">用户搜索：&nbsp;&nbsp; 
          <input name="name" type="text" class="textbox_shiixian_hui" size="20">
          &nbsp; 
          <input name="B12" type="submit" class="button" value="搜 索">
        </p></td>
    </tr>
  </form>
</table>
<%case "edit"
	set rs=server.createobject("adodb.recordset")
    sql="select * from member  where id="&id
    rs.open sql,conn,3,3
    password=request.form("password")
    repassword=request.form("repassword") 
    if password<>repassword  then
response.write"<script language='javascript'>alert('两次输入的密码不一样！')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
response.end
else
rs("password")=md5(password)
rs.update
response.write"<script language='javascript'>alert('修改成功！')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
end if  
case "del"

set rs=server.createobject("adodb.recordset")
sql="select * from member where id=" & id
rs.open sql,conn,3,3
rs.delete 
conn.execute "delete from book where username in ('"&username&"')"
response.redirect "user.asp"
end select 

  
%>
</body>

