<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="UserSession.asp" -->
<!--#include file="../tgzcm.Scnn.asp" -->
<!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>
<style type="text/css">
<!--
body,td,th {
	font-size: 12px;
}
#lltt{
	padding-left:10px;
	font-size: 14px;
}
.STYLE1 {
	color: #333333;
	font-weight: bold;
	font-size: 14px;
}
.input{ height:15px; width:130px;}
.STYLE2 {
	color: #FF0000;
	font-size: 14px;
}
#leftlist{ border-bottom:1px #F1F1F1 solid; padding-left:15px;}
-->
</style>
<script src="../js/tgzcm.Date.Js"></script> 
</head>
<%
action=Request.QueryString("action")
oldpass=Request.Form("oldpass")
newpass=Request.Form("newpass")
myqq=Request.Form("myqq")
myulc=Server.HTMLEncode(Request.Form("ulc"))
Set urs=Conn.Execute("Select ulc,uqq from tgzcm_user where uid="&Uid&"")
If Not(urs.eof and urs.bof) Then
ulc=Trim(urs("ulc"))
uqq=urs("uqq")
Else
response.write "<script language=javascript>alert('请先登录！');window.location.href='UserLogin.Asp'</script>"
Response.End()
End IF
urs.Close
Set urs=Nothing
If action="editsave" then
  Set rs = Server.CreateObject("adodb.recordset")
  Sql="Select * from tgzcm_user where uid="&Uid&""
  rs.open sql,conn,1,3
    if oldpass<>"" or newpass <>"" then
	   if newpass<>"" Then
	     if rs("upass")<>md5(oldpass,32) then
	      Call tgzcm_err_c("原始密码错误！！！")
		  Response.End()
	     Else
	      mypass=md5(newpass,32)
	     End If
	   Else
	   Call tgzcm_err_c("请输入新密码！！！")
	   Response.End()
	   End If 	
	End if
	If myulc<>"" then
	     rs("upass")=mypass
		 'Response.Write newpass
		 'Response.End()
	     rs("ulc")=myulc
		 rs("uqq")=myqq 
		 rs.update
		 rs.Close
		 Set rs=Nothing
		 Call tgzcm_err_b("修改成功","UserEdit.Asp")
		 Response.End() 
	Else	 
	Call tgzcm_err_c("请输入昵称！！！")
	Response.End()
	End If 	     

response.End()
End if
%>
<body>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" style="border:1px #F1F1F1 solid">
  <tr>
    <td height="25" colspan="2" bgcolor="#F1F4F6" id="lltt" style="color:#FF0000; font-weight:bold">欢迎您:<%=UserName%></td>
  </tr>
  <tr>
    <td height="32" colspan="2" align="center"><span class="STYLE1">修改我的资料</span></td>
  </tr><form action="?action=editsave" method="post" name="tgzcmfrom">
  <tr>
    <td width="12%" height="28"  id="lltt">我的帐号：</td>
    <td width="88%"><font color="#FF0000"><%=UserName%></font></td>
  </tr>
  <tr>
    <td width="12%" height="28"  id="lltt">原始密码：</td>
    <td width="88%"><label>
      <input name="oldpass" type="password" id="oldpass" class="input" maxlength="30" />
      <span class="STYLE2">* 不修改请留空</span></label></td>
  </tr>
  <tr>
    <td width="12%" height="28"  id="lltt">新的密码：</td>
    <td width="88%"><input name="newpass" type="password" id="newpass" class="input"  maxlength="30"/>
      <span class="STYLE2">      * 不修改请留空</span></td>
  </tr>
  <tr>
    <td width="12%" height="28"  id="lltt">我的昵称：</td>
    <td width="88%"><input name="ulc" type="text" id="ulc" class="input"  maxlength="30" value="<%=ulc%>"/>
      <span class="STYLE2">      * 请不要使用个性符号</span></td>
  </tr>
  <tr>
    <td width="12%" height="28"  id="lltt">我的QQ号：</td>
    <td width="88%"><label>
      <input name="myqq" type="text" class="input" id="myqq" maxlength="12" value="<%=uqq%>" onkeyup='this.value=this.value.replace(/\D/gi,"")'/>
      <span class="STYLE2">* 只能是数字！</span></label></td>
  </tr>
  <tr>
    <td height="50" colspan="2"  id="lltt"><label>
      <input type="submit" name="button" id="button" value="确认修改" />
    </label></td>
  </tr></form>
</table>
</body>
</html>
