<!--#include file=conn.asp-->
<!--#include file=cookies.asp-->
<!--#include file=../inc/jle_fuction.asp-->
<!--#include file=../config.asp-->
<!--#include file="../inc/function.asp"-->
<%
if request("jle")="qian" then
id=replace(trim(request("id")),"'","‘")
set rs = Server.CreateObject("ADODB.RecordSet")
sql="select id,username from [user] where id="&cstr(id) 
rs.open sql,conn,1,1
if rs.eof then
response.write "<li>还没有用户数据！"
response.end
end if
Response.cookies("jle")("username")=rs("username")
Response.cookies("jle")("domain")=Request.ServerVariables("SERVER_NAME")
Response.cookies("jle")("id")=rs("id")
rs.close
set rs=nothing
closedb
response.redirect "../user.asp"
end if
%>

<%
dim email,name,idcard,dianhua,qq,dizhi
if request("jle")="edit" then
id=trim(request("id"))
if not isnumeric(id) or id="" then
response.write "<li>参数错误！"
response.end
end if
name=HtmlEncode(trim(request("name")))
password=HtmlEncode(trim(request("password")))
email=HtmlEncode(trim(request("email")))
dianhua=HtmlEncode(trim(request("dianhua")))
qq=HtmlEncode(trim(request("qq")))
dizhi=HtmlEncode(trim(request("dizhi")))
set rs=server.createobject("adodb.recordset")
sql="select * from [user] where id="&id
rs.open sql,conn,1,3
rs("name")=name
if password<>"" then
rs("password")=password
end if
rs("email")=email
rs("jf")=HtmlEncode(trim(request("jf")))
rs("hb")=HtmlEncode(trim(request("hb")))
rs("dianhua")=dianhua
rs("qq")=qq
rs("dizhi")=dizhi
rs.update
rs.close
set rs=nothing
closedb
response.write "修改成功！！"
call cl()
call mail()
%>

<%
sub mail()
dim mailbody,Jmail
mailbody="您好,"&username&"!<br>管理员已为你成功修改了密码！现在资料为：登录帐号：[<b>"&username&"</b>] 您的新密码是：[<b>"&password&"</b>]<br> 如果您要发布您的相关信息可以到 <a href="&web&">"&web&"</a> 进行发布！我们的失误，给您带来的不便，请见谅！<br>谢谢您使用我们<a href="&web&">"&title&"</a>为您提供的真诚服务！<br>"&about&""   '邮件内容
Set Jmail=server.createobject("Jmail.Message")
Jmail.Charset ="gb2312"
JMail.ContentType = "text/html"
Jmail.Silent =true
Jmail.Priority = 3
Jmail.MailServerUserName = mailname
Jmail.MailServerPassword = mailpass
Jmail.From = mailform
Jmail.FromName =""&title&""
Jmail.Subject ="密码修改成功！-"&title&""
Jmail.AddRecipient ""&email&""
Jmail.Body = mailbody
Jmail.Send(mailsmtp)
Set Jmail=nothing
end sub
%>
<%sub cl()%>
<body onLoad="setTimeout(window.close, 2000)">
<%end sub%>

<%else%>
<%
dim rs,sql,id
id=trim(request("id"))
if not isnumeric(id) or id="" then
response.write "<li>参数错误！"
response.end
end if
set rs = Server.CreateObject("ADODB.RecordSet")
sql="select * from [user] where id="&cstr(id) 
rs.open sql,conn,1,1
%>
<SCRIPT language=javascript>
<!--
function CheckForm()
{
if(document.thisForm.username.value.length<1)
	{
	    alert("参数错误!");
	    return false;
	}
if(document.thisForm.email.value.length<1)
	{
	    alert("参数错误!");
	    return false;
	}
if(document.thisForm.name.value.length<1)
	{
	    alert("真实姓名没有填写!");
	    document.thisForm.name.focus();
	    return false;
	}

if(document.thisForm.dianhua.value.length<1)
	{
	    alert("联系电话没有填写!");
	    document.thisForm.dianhua.focus();
	    return false;
	}
if(document.thisForm.dizhi.value.length<1)
	{
	    alert("通信地址没有填写!");
	    document.thisForm.dizhi.focus();
	    return false;
	}
}

//-->
</SCRIPT>
<meta http-equiv="Content-Language" content="zh-cn">
<title>修改资料</title>
<link href="inc_style.css" rel="stylesheet" type="text/css">
<body topmargin="0" leftmargin="0">
<div align="center">
<form method="POST" name="thisForm" action="?jle=edit&id=<%=id%>">
<tr> 
<td width="456" bgcolor="#EEEEEE">
<table width="93%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#c5cfe0" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
        <tr align="center" bgcolor="#FFFFFF" height="20"> 
<td align="center" height="29" bgcolor="#C5D5E4" colspan="2">
<p align="center"><font color="#FFFFFF"><b>修改用户资料</b></font></td>
</tr>
<tr>
<td width="134" height="30" align="right"  class="tdbar">
登录帐号：</td>
<td width="314"  class="tdbar"> &nbsp;<b><%=rs("username")%></b>
　</td>
</tr>
<tr>
<td width="134" height="30"  class="tdbar">
<p align="right">真实姓名：</td>
<td width="314"  class="tdbar">
&nbsp;<input type="text" maxlength="12" name="name" size="24" value="<%=rs("name")%>"></td>
</tr>
<tr> 
<td height="30" align="right"  class="tdbar">
新密码：</td>
<td width="314"  class="tdbar">
&nbsp;<input type="text" name="password" size="18"> 不改留空</td>
</tr>
<tr> 
<td width="134" height="30"  class="tdbar">
<p align="right">邮件地址：</td>
<td width="314"  class="tdbar">
&nbsp;<input type="text" maxlength="50" name="email" size="24" value="<%=rs("email")%>"></td>
</tr>
<tr> 
<td width="134" height="30" align="right"  class="tdbar">
联系电话：</td>
<td width="314"  class="tdbar">
&nbsp;<input type="text" maxlength="30" name="dianhua" size="24" value="<%=rs("dianhua")%>" ></td>
</tr>
<tr> 
<td width="134" height="30" align="right"  class="tdbar">
QQ：</td>
<td width="314"  class="tdbar">
&nbsp;<input type="text" maxlength="10" name="qq" size="24" value="<%=rs("qq")%>" >
</td>
</tr>
<tr> 
<td width="134" height="30" align="right"  class="tdbar">
通信地址：</td>
<td width="314"  class="tdbar">
&nbsp;<input type="text" maxlength="50" name="dizhi" size="37" value="<%=rs("dizhi")%>" ></td>
</tr>
<tr> 
<td width="134" height="30" align="right"  class="tdbar">
积分：</td>
<td width="314"  class="tdbar">
&nbsp;<input type="text" name="jf" size="10" value="<%=rs("jf")%>" maxlength="10"></td>
</tr>
<tr> 
<td width="134" height="30" align="right"  class="tdbar">
客币：</td>
<td width="314"  class="tdbar">
&nbsp;<input type="text" name="hb" size="10" value="<%=rs("hb")%>" maxlength="10"></td>
</tr>
<tr> 
<td width="134" height="45"  class="tdbar">
　</td>
<td width="314"  class="tdbar">
<p align="left">
<input type="submit" onClick="javascript:return CheckForm();" value="修改" name="B3"></td>
</tr>
</table></form>
</div>
<%
rs.close
set rs=nothing
closedb
end if
%>