<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->
<!--#include file="../inc/setup.asp"-->
<!--#include file="../inc/sql.asp"-->
<%
	end if
	useflag=3
%>
<!--#include file="flag.asp"-->
<!--#include file="../inc/md5.asp"-->
<%
	Response.Expires = 0
	Response.Expiresabsolute = Now() - 1
	Response.AddHeader "pragma","no-cache"
	Response.AddHeader "cache-control","private"
	Response.CacheControl = "no-cache"

	Method=Trim(Request.QueryString("Method"))
	
	if Method="save" then
	
		password=Trim(Request.Form("password"))
		email=Trim(Request.Form("email"))
		iname=Trim(Request.Form("iname"))
		phone=Trim(Request.Form("phone"))
		lock1=Trim(Request.Form("lock"))
		changepay=Trim(Request.Form("changepay"))
		set rs=server.createobject("adodb.recordset")
		sql="select * from person where id="&Trim(Request.Form("AdminID"))
		rs.open sql,conn,2,3
		if password<>"" then rs("pwd")=mistake(password)
		rs("email")=email
		rs("iname")=iname
		rs("phone")=phone
		rs("lock")=lock1
		rs("changepay")=changepay
		rs.update
		rs.close
		set rs=nothing
		response.write"<SCRIPT language=JavaScript>alert('资料更新成功，系统将关闭页面!');"
		response.write"javascript:window.close();</SCRIPT>"
		response.end 
		
	end if

	set rs=server.createobject("adodb.recordset")
	sql="select * from person where id="&Trim(Request.QueryString("id"))
	rs.open sql,conn,1,1
	if rs.eof then
		response.Write "<div align=center><font size=12 color=red><b>没有该用户，请查询后再重试</b></font></div>"
		response.End
	else
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Include/ModeWindow.css" rel="stylesheet">
<title>用户资料修改</title>
<script language="JavaScript" src="Include/Common.js"></script>
<script language="JavaScript" src="Include/CheckPassWord.js"></script>
<style>
.cssPWD{
background-color:#EBEBEB;
border-right:solid 1px #BEBEBE;
border-bottom:solid 1px #BEBEBE;
}
.cssWeak{
background-color:#FF4545;
border-right:solid 1px #BB2B2B;
border-bottom:solid 1px #BB2B2B;
}
.cssMedium{
background-color:#FFD35E;
border-right:solid 1px #E9AE10;
border-bottom:solid 1px #E9AE10;
}
.cssStrong{
background-color:#3ABB1C;
border-right:solid 1px #267A12;
border-bottom:solid 1px #267A12;
}
.cssPWT{width:132px;}
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form action="?Method=save" name="AdminForm" method="post">
<input name="AdminID" type="hidden" value="<%= Trim(Request.QueryString("id")) %>">
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><FIELDSET align=center><LEGEND align=left>修改资料</LEGEND>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="179" height="25" align="center"><div align="center">用户名</div></td>
<td width="542" height="25"><input name="uname" Readonly value="<%= rs("uname") %>" type="text" id="uname" size="30" class="textbox">
个人用户登陆的用户名称</td>
</tr>
<tr>
<td width="179" height="25" align="center"><div align="center">密　码</div></td>
<td width="542" height="25"><input name="password" value="" type="password" id="password" size="30" class="textbox">
  不修改请留空白</td>
</tr>
<tr>
<td height="25" align="center">电子邮件</td>
<td height="25"><input name="email" type="text" class="textbox" value="<%= rs("email") %>" id="email" size="30"></td>
</tr>
<tr>
<td height="25" align="center">姓　　名</td>
<td height="25"><input name="iname" type="text" class="textbox" value="<%= rs("iname") %>" id="iname" size="30"></td>
</tr>
<tr>
<td height="25" align="center">电　　话</td>
<td height="25"><input name="phone" type="text" class="textbox" value="<%= rs("phone") %>" id="phone" size="30"></td>
</tr>
<tr>
<td height="25" align="center">金　　钱</td>
<td height="25">M币：<%=rs("dian")%>   积分：<%=rs("fen")%>	  帐户余额：<%=rs("mmoney")%> 元</td>
</tr>
<tr>
<td height="25" align="center">状　　态</td>
<td height="25">
  <input name="lock" type="radio" value="1" <% if rs("lock")=1 then %>checked <% end if %>>
锁定
  <input type="radio" name="lock" value="0" <% if rs("lock")=0 then %>checked<% end if %>>
正常
<font color="#FF0000">锁定的用户不能登录后台管理</font></td>
</tr>
<tr>
<td height="25" align="center">用户收费方式</td>
<td height="25">
  <input name="changepay" type="radio" value="0" <% if rs("changepay")=0 then %>checked <% end if %>>
M币与积分
  <input type="radio" name="changepay" value="1" <% if rs("changepay")=1 then %>checked<% end if %>>
级别与时间
<font color="#FF0000">用户在前台操作的收费方式</font></td>
</tr>
<tr>
<td height="25" align="center">上次登陆IP</td>
<td height="25"><%=rs("ip")%></td>
</tr>
<tr>
<td height="25" align="center">上次登陆时间</td>
<td height="25"><%=rs("ltime")%></td>
</tr>

</table>
</FIELDSET>
</td>
</tr>
</table>
<table width="100%" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="40" align="center"><input type="Submit" class='textbox' name="Submit" value=" 确 定 ">
<input type="button" class='textbox' name="Submit2" onClick="window.close()" value=" 取 消 "></td>
</tr>
</table>
</form>
</body>
</html>
<%
	End If
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
%>