<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="UserSession.asp" -->
<!--#include file="UserConn.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;}
.STYLE1 {
	color: #333333;
	font-weight: bold;
}
.input{width:130px; font-size:12px}
.STYLE2 {color: #FF0000}
#leftlist{ border-bottom:1px #F1F1F1 solid; padding-left:15px;}
-->
</style>
<script src="UserDate.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"))
userpic=Replace(Replace(Request.Form("userpic"),"../Images/faces/",""),".gif","")'用户头像
Set urs=Conn.Execute("Select ulc,uqq,upic from qvodcms_user where uid="&Uid&"")
If Not(urs.eof and urs.bof) Then
ulc=Trim(urs("ulc"))
uqq=urs("uqq")
upic=urs("upic")
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 qvodcms_user where uid="&Uid&""
  rs.open sql,conn,1,3
    if oldpass<>"" or newpass <>"" then
	   if len(newpass)<6 then
       Call QvodCms_Err("新密码不能小于6位！！！")
	   Response.End()
       End if
	   if newpass<>"" Then
	     if rs("upass")<>md5(oldpass,32) then
	      Call  QvodCms_Err("原始密码错误！！！")
		  Response.End()
	     Else
	      mypass=md5(newpass,32)
		  rs("upass")=mypass
	     End If
	   Else
	   Call QvodCms_Err("请输入新密码！！！")
	   Response.End()
	   End If 
	'Else
	  'Call QvodCms_Err("请输入原始密码和新密码！！！")   	
	End if
	If myulc<>"" then
	     
		 'Response.Write newpass
		 'Response.End()
		 if userpic<>"nobody" Then
		 rs("upic")=userpic
		 End If
	     rs("ulc")=left(myulc,50)
		 rs("uqq")=left(myqq,15) 
		 rs.update
		 rs.Close
		 Set rs=Nothing
		 Call QvodCms_Err_Url("修改成功","UserEdit.Asp")
		 Response.End() 
	Else	 
	Call QvodCms_Err("请输入昵称！！！")
	Response.End()
	End If 	     

response.End()
End if
Call CloseConn()
%>
<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">今天是：<script language="javascript">CAL();</script> 我的帐号:<%=UserName%></td>
  </tr>
  <tr>
    <td height="32" colspan="2" align="center"><span class="STYLE1">修改我的资料</span></td>
  </tr><form action="?action=editsave&upic=<%=upic%>" method="post" name="jajafrom">
  <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,"")'/>
      * 只能是数字！ 选择头像：<select name="userpic" onchange="document.images['idface'].src=options[selectedIndex].value;">
<option value="../Images/faces/nobody.gif" style="color:#FF0000">---热门导演头像---</option>
<option value="../Images/faces/1.gif">史蒂芬·斯皮尔伯格</option>
<option value="../Images/faces/2.gif">乔治·卢卡斯</option>
<option value="../Images/faces/3.gif">雷德利·斯科特</option>
<option value="../Images/faces/4.gif">彼得·杰克逊</option>
<option value="../Images/faces/5.gif">克林特·伊斯特伍德</option>
<option value="../Images/faces/6.gif">马丁·西科塞斯</option>
<option value="../Images/faces/7.gif">奥利弗·斯通</option>
<option value="../Images/faces/8.gif">詹姆斯·卡梅隆</option>
<option value="../Images/faces/9.gif">吕克·贝松</option>
<option value="../Images/faces/10.gif">弗朗西斯·福特·科波拉</option>
<option value="../Images/faces/nobody.gif" style="color:#FF0000">---热门动漫头像---</option>
<option value="../Images/faces/11.gif">火影忍者 </option>
<option value="../Images/faces/12.gif">灰太狼</option>
<option value="../Images/faces/13.gif">红太狼</option>
<option value="../Images/faces/14.gif">喜羊羊</option>
<option value="../Images/faces/15.gif">卡哇伊女生</option>
<option value="../Images/faces/16.gif">可爱娃娃</option>
<option value="../Images/faces/17.gif">奥特曼</option>
<option value="../Images/faces/18.gif">功夫熊猫</option>
<option value="../Images/faces/19.gif">米奇老鼠</option>
<option value="../Images/faces/20.gif">怪物史莱克</option>
<option value="../Images/faces/nobody.gif" style="color:#FF0000">---热门明星头像---</option>
<option value="../Images/faces/21.gif">周星驰</option>
<option value="../Images/faces/22.gif">小沈阳</option>
<option value="../Images/faces/23.gif">韩彩英</option>
<option value="../Images/faces/24.gif">宫心计</option>
<option value="../Images/faces/25.gif">蔡少芬</option>
<option value="../Images/faces/26.gif">苏乞儿</option>
<option value="../Images/faces/27.gif">孔  子</option>
<option value="../Images/faces/28.gif">范  伟</option>
<option value="../Images/faces/29.gif">甄子丹</option>
<option value="../Images/faces/30.gif">古天乐</option>
<option value="../Images/faces/31.gif">林  峰</option>
<option value="../Images/faces/32.gif">孙燕姿</option>
<option value="../Images/faces/33.gif">林志铃</option>
<option value="../Images/faces/34.gif">刘德华</option>
<option value="../Images/faces/35.gif">成  龙</option>
<option value="../Images/faces/36.gif">林正英</option>
<option value="../Images/faces/37.gif">李连杰</option>
<option value="../Images/faces/38.gif">赵本山</option>
<option value="../Images/faces/39.gif">张学友</option>
<option value="../Images/faces/40.gif">苍井空</option>
<option value="../Images/faces/41.gif">范冰冰</option>
<option value="../Images/faces/42.gif">洪金宝</option>
<option value="../Images/faces/43.gif">梁朝伟</option>
<option value="../Images/faces/44.gif">吴彦祖</option>
<option value="../Images/faces/45.gif">张曼玉</option>
<option value="../Images/faces/46.gif">黄日华</option>
<option value="../Images/faces/47.gif">张卫健</option>
<option value="../Images/faces/48.gif">张家辉</option>
<option value="../Images/faces/49.gif">吴耀汉</option>
<option value="../Images/faces/50.gif">王  晶</option>
<%
if Instr(upic,"http://")>0 then
upic=upic
else
upic="../images/faces/"&upic&".gif"
End IF
%>
</select> <div style="position:absolute; margin-left:10px;"><img src="<%=upic%>" id=idface></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>
