<!--#include file="../Include/Conn.jsp" -->
<!--#include file="../Include/const.jsp" -->
<!--#include file="../Include/md5.jsp" -->
<!-- #include file=../bbs/inc/qqlevel.jsp -->
<!--#include file="IsLogin.jsp" -->

<%
 dim rs,m_Sql
 dim m_ID 
    Dim mOldPassword,mOldPassword2,mNewPassword
 mUserID = Request.Cookies("aspxnet")("CurUserID")
  m_username= Request.Cookies("aspxnet")("CurUsername")

  if Request.ServerVariables("REQUEST_METHOD")="POST" and Request.QueryString("ctype")="psw" then
    mOldPassword = md5(Trim(Request.Form("txtOldPassword")))
    mNewPassword = Trim(Request.Form("txtNewPassword"))
    mNewPassword2 = Trim(Request.Form("txtNewPassword2"))
	mSql="Select F_Password From T_Member Where F_UserName='"&m_username&"' and F_PassWord='"&mOldPassword&"'"
    Set rs=conn.Execute(mSql)
	
    If rs.Eof Then
      response.write "<script>alert('对不起，旧密码输入错误！');history.back();</Script>"
	  response.end
	Else
	    '密码修改成功
			 conn.Execute("Update T_Member Set F_PassWord='"&md5(mNewPassword)&"' Where F_UserName='" & m_username &"'")
	  conn.Execute("Update LeadBBS_User Set Pass ='"&md5(mNewPassword)&"' where UserName='" & m_username &"'")
	  conn.Execute("Update huiyuan Set password='"&md5(mNewPassword)&"' Where huiyuan='" & m_username &"'")
		conn.Execute("Update [oBlog_user] Set [password]='"&md5(mNewPassword)&"' Where [username]='" & m_username & "'")
	  response.write "<script>alert('祝贺您,密码修改成功！');history.back();</Script>"
	End if
End if
  
 m_ID = Request.Cookies("aspxnet")("CurUserID")
 m_Sql = "SELECT * FROM T_Member WHERE F_ID=" & m_ID
 Set rs = conn.Execute(m_Sql)
 if rs.Eof then
   Response.write "对不起，无此会员！"
   Response.end
 end if
 Session("m_Integral") = rs("F_Integral")
 m_MyImage = rs("F_MyImage")
 session("m_MyImage") = m_MyImage
 
 '短信
					sql_m="select count(f_id) as n_count from t_message where F_username_a='"&m_username&"' and F_accept=0"
					Set rs_m = conn.Execute(sql_m)
					m_count=rs_m("n_count")
					sql_m="select count(f_id) as n_count from t_message where F_username_a='"&m_username&"' and F_accept=0 and  F_active=0 "
					Set rs_m = conn.Execute(sql_m)
					m_newcount=rs_m("n_count")
					rs_m.close

 

 'Read
 mSql = "SELECT * FROM T_Member WHERE F_ID="&mUserID
 Set rsmp = conn.Execute(mSql)
 if Not rsmp.Eof then 
   mEmail = rsmp("F_Email")
   mQuestion = rsmp("F_Question")
   mAnswer = rsmp("F_Answer")

 Else
   Response.Write "对不起，操作有误，请重新登陆！"
   Response.End()
 End if
 rsmp.Close

  if Request.ServerVariables("REQUEST_METHOD")="POST" and Request.QueryString("ctype")="pswinfo" then
  
     mQuestion = Request.Form("txtQuestion")
   mAnswer = Request.Form("txtAnswer")
      mEmail = Request.Form("txtEmail")
	  
   mSql = "UPDATE T_Member SET"
   mSql = mSql+" F_Answer='"&mAnswer&"',"
   mSql = mSql+" F_Question='"&mQuestion&"',"
   mSql = mSql+" F_Email='"&mEmail&"'"
	mSql = mSql +" WHERE F_ID=" & mUserID
     conn.execute(mSql)
	 
	   conn.Execute("Update LeadBBS_User Set Answer ='"&md5(mAnswer)&"',Question='"&mQuestion&"',mail='"&mEmail&"' where UserName='" & m_username &"'")
	  conn.Execute("Update huiyuan Set useranswer ='"&md5(mAnswer)&"',userquestion='"&mQuestion&"',mail='"&mEmail&"'  Where huiyuan='" & m_username &"'")
		conn.Execute("Update [oBlog_user] Set answer ='"&md5(mAnswer)&"',question='"&mQuestion&"',useremail='"&mEmail&"'  Where [username]='" & m_username & "'")
	response.write "<script>alert('祝贺您,密保修改成功！');history.back();</Script>"
End if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>密码设置</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META http-equiv=Page-Enter content=blendTrans(Duration=0.5)>
<META http-equiv=Page-Exit content=blendTrans(Duration=0.5)><LINK 
href="css/index.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.2800.1555" name=GENERATOR>

<script language="javascript">
function IsValidString(checkStr)
{
	var checkOK ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_ ";
	var allValid = true;
	if (checkStr.length<3)
	allValid=false
	for (i=0;i<checkStr.length;i++)
	{
	ch=checkStr.charAt(i);
	for(j=0;j<checkOK.length;j++)
	if(ch==checkOK.charAt(j))
	break;
	if(j==checkOK.length)
	{
	allValid = false;
	break;
	}
	}
	return allValid;
}

function CheckValidForm()
{
	if (!IsValidString(document.thisForm.txtOldPassword.value))
	{
		msg="对不起，密码必须为3个以上的数字或字母！";
		alert(msg);
	 	document.thisForm.txtOldPassword.focus();
	return false;
	}

	if (!IsValidString(document.thisForm.txtNewPassword.value))
	{
		msg="对不起，密码必须为3个以上的数字或字母！\n并且不能使用汉字当作密码！";
		alert(msg);
	 	document.thisForm.txtNewPassword.focus();
	return false;
	}

	if (document.thisForm.txtNewPassword.value!=document.thisForm.txtNewPassword2.value)
	{
		msg="对不起，密码与确认密码不一致！";
		alert(msg);
		document.thisForm.txtNewPassword.focus();
	return false;
	}
}
</script>

</HEAD>
<BODY><!--menu start-->
<DIV id=menu><SPAN>登陆帐号：<%m_TempUserName = Request.Cookies("aspxnet")("CurUserName")
				  if m_TempUserName = "" then Response.write "游客" else
				   Response.write ""&m_TempUserName&""
				  %> | <A 
href="Logout.jsp">退出</A></SPAN> <B>操作中心</B>
<DIV id=nav>
<DIV class=right><IMG src="img/nav_right.gif"></DIV>
<DIV class=left><IMG src="img/nav_left.gif"></DIV>
<UL>
  <LI><A href="Center_index.jsp">首 页</A> </LI>
  <LI><A href="friend_index.jsp">交友频道</A> </LI>
  <LI><A href="QQ_ployall.jsp">精彩活动</A> </LI>
  <LI><A href="../bbs/">论坛社区</A> </LI>
  <LI><A href="photo_default.jsp">网络相册</A> </LI>
  <LI><A href="QQ_index.jsp">小圈子</A> </LI>
  <LI><A href="../info/">分类广告</A> </LI>
  <LI><A href="../jubao/">折扣店</A> </LI>
  <LI><A href="../shop/">逛街购物</A> </LI></UL></DIV></DIV><!--menu end-->
<DIV id=main>
<DIV id=user>
<H3>欢迎您：<%m_TempUserName = Request.Cookies("aspxnet")("CurUserName")
				  if m_TempUserName = "" then Response.write "游客" else
				   Response.write ""&m_TempUserName&""
				  %></H3>
<DIV class=rim>
<DIV id=uinfo>
<DIV id=uimg align=center><%if session("m_MyImage")<>"" then %>
		  <img  src="<%=session("m_MyImage")%>" > 
		  <%else%><img  src="img/nophoto_man.gif"><%end if%></DIV>
<P>ID: <%m_TempUserName = Request.Cookies("aspxnet")("CurUserName")
				  if m_TempUserName = "" then Response.write "游客" else
				   Response.write ""&m_TempUserName&""
				  %></P>
<P><%
   sql_m = "SELECT OnlineTime FROM LeadBBS_User Where UserName='" & m_username & "'"
			Set Rstest = conn.Execute(sql_m)
%>
<script language=javascript>
			<!--
				document.write (""+qqlevel("<%=CLng(cCur(Rstest("OnlineTime"))/3600)%>")+"");
			//-->
			</script></P>
<HR>

<DIV id=usercon><A href="../bbs/" target=_blank><IMG height=20 
src="img/Center_left01.gif" width=27 border=0></A><A 
href="QQ_default.jsp" target=_blank><IMG height=21 
src="img/Center_left02.gif" width=21 border=0></A><A 
href="../blog/" target=_blank><IMG height=16 
src="img/Center_left03.gif" width=24 border=0></A><A 
href="#"><IMG 
src="img/ico4.gif"></A><A 
href="#" 
target=_blank><IMG src="img/ico5.gif" border=0></A> </DIV></DIV><%
   sql_m = "SELECT Points FROM LeadBBS_User Where UserName='" & m_username & "'"
			Set Rstest = conn.Execute(sql_m)
%>
<P class=uline><STRONG>用户金币：<%=rstest("Points")%></STRONG><BUTTON class=bot 
onclick="location.href='#a'">帐户冲值</BUTTON><BUTTON class=bot 
onclick="location.href='#a'"><B>VIP</B>冲值</BUTTON> </P><% Rstest.close
				  set Rstest=nothing%>
<UL>
  <LI>·<A href="Center_userinfo.jsp">个人资料</A> </LI>
  <LI>·<A href="Center_msg.jsp">我的短信</A> </LI>
  <LI>·<A href="Center_contact.jsp">联系资料</A> </LI>
  <LI>·<A href="Center_wealth.jsp">金币兑换</A> </LI>
  <LI>·<A href="Center_editpassword.jsp">密码设置</A> </LI>
  <LI>·<A href="Center_ploy.jsp">我的活动</A> </LI></UL>
<DIV class=clear></DIV></DIV>
<H3>从这里开始</H3>
<DIV class=rim>
<DIV id=buildgroup>
<H4><A href="qq_ceaterclub.jsp" 
target=_blank><SPAN>建立小圈子</SPAN></A></H4>
<P>您可以在这里建立自己的小圈子，和更多的朋友一起互动。世界很小，圈子很大。您可以通过您的圈子认识更多志趣相投的朋友！</P></DIV>
<DIV id=invitefriend>
<H4><SPAN>邀请您的好友</SPAN></H4>
<P>您可以在这里建立自己的小圈子，和更多的朋友一起互动。世界很小，圈子很大。您可以通过您的圈子认识更多志趣相投的朋友！</P></DIV></DIV></DIV><!--contain-->
<DIV id=contain>
<DIV id=info>
<DIV id=infotop><IMG src="img/windows.gif">密码设置</DIV>
<FORM name=form1 action=center_editpassword.jsp?ctype=psw method=post> <LABEL><B>旧口令:</B> <INPUT name="txtOldPassword" type="password" size="28" maxlength="16"> 
</LABEL><LABEL><B>新口令:</B> <input name="txtNewPassword" type="password" size="28" maxlength="16"> </LABEL><LABEL><B>口令确认:</B><input name="txtNewPassword2" type="password" size="28" maxlength="16"> </LABEL>
<P class=botalign><INPUT class=bot type=submit value=确定修改 name=提交></P></FORM>
<FORM name=form1 action=center_editpassword.jsp?ctype=pswinfo method=post>
<H4>设置您的个人密码保护资料:</H4><LABEL><B>密码提示问题:</B> <INPUT id=txtQuestion size=30 
value="<%=mQuestion%>" name=txtQuestion> 
</LABEL><LABEL><B>密码提示答案:</B> <INPUT id=txtAnswer 
size=30 value="<%=mAnswer%>" name=txtAnswer> 
&nbsp;</LABEL> <LABEL><B>安全E-mail:</B> 
<INPUT id=txtEmail size=30 value="<%=mEmail%>" name=txtEmail> 
</LABEL>
<P class=botalign><INPUT class=bot type=submit value=确定修改 name=提交> </P></FORM>
<DIV id=infobot></DIV></DIV></DIV></DIV>
<STYLE type=text/css>.STYLE1 {
	COLOR: #ff0000
}
</STYLE>

<DIV id=rchart>
<DIV id=chart>
<DIV id=charttop>
<H6>&nbsp; </H6>
<P>用户等级:<%if rs("F_Grade") = 1 then Response.write "<font color=red><b>聚宝卡VIP会员</b></font>" else Response.write "普通会员"%>
                      <%if rs("F_Grade") <> 1 then%>
                      → <a href="UserGrade.jsp"> <font color="#FF0000">升级为VIP会员</font> 
                      </a> 
                      <%end if%></P>
<P>用户注册时间:<%=rs("F_RegTime")%></P>
<P id=mailone><a href="Center_msg.jsp">(<%=m_count%>/<font color="#FF0000"><%=m_newcount%>)</font>短信!</a></P></DIV>
<DIV id=chartlist>
<FORM name=form1 action=addfriend.jsp?return=add method=post><INPUT class=friendso 
id=username onBlur="if(this.value=='')this.value='输入好友';" 
onfocus="if(this.value=='输入好友')this.value='';" size=22 value=输入好友 name=username> 
<INPUT type=image src="img/friendso.gif" name=imageField> </FORM>
<DL>
  <SCRIPT type=text/javascript>
		<!--
		function SenFe_Com(){
		var a = document.getElementById("midrim");
		if(a.style.display=='none')
		{
			a.style.display='';
			}else{
			a.style.display='none';
			}
		}
		-->
		</SCRIPT>

    <DT id=SenFe onclick=SenFe_Com();><A 
  href="#">我的好友(<%
		m_SQL = "SELECT Count(*) FROM my_friend where F_flag=1 and F_userid="&mUserID
		Set rsh = conn.Execute(m_SQL)
		Response.write rsh(0)
		rsh.Close
		%>)</A> <SPAN 
  id=midrim></DT>
 <%m_Sql = "Select f_id,f_username From my_friend where F_flag=1 and F_userid="&mUserID&" order by f_id desc"
                   Set rshy = conn.Execute(m_Sql)
				   do while not rshy.eof%><DD> <DIV><A 
            href="club_member.jsp?username=<%=rshy("f_username")%>" 
            target=_blank><U><%=rshy("F_username")%></U></A> <A href="Center_msgsend.jsp?re_username=<%=rshy("f_username")%>" 
  target=_blank><IMG src="img/ico1.gif"></A> <A title="移到黑名单" 
  href="addfriend.jsp?username=<%=rshy("f_username")%>&amp;flag=0" 
  target=_blank><IMG src="img/ico2.gif"></A> <A 
  href="club_member.jsp?username=<%=rshy("f_username")%>" target=_blank><IMG 
  src="img/ico3.gif"></A></DIV><%rshy.movenext
				  loop
				  rshy.close
				  set rshy=nothing
				  %></SPAN>
 <DT><A href="#">黑名单(<%
		m_SQL = "SELECT Count(*) FROM my_friend where F_flag=0 and F_userid="&mUserID
		Set rst = conn.Execute(m_SQL)
		Response.write rst(0)
		rst.Close
		%>)</A> </DT>
    <%m_Sql = "Select f_id,f_username From my_friend where F_flag=0 and F_userid="&mUserID&" order by f_id desc"
                   Set rs_3 = conn.Execute(m_Sql)
				     do while not rs_3.eof%><DD> <DIV><A 
            href="club_member.jsp?username=<%=rs_3("f_username")%>" 
            target=_blank><U><%=rs_3("F_username")%></U></A> <A href="msgsend.asp?re_username=<%=rs_3("f_username")%>" 
  target=_blank><IMG src="img/ico1.gif"></A> <A title="移到我的好友"
  href="addfriend.jsp?username=<%=rs_3("f_username")%>&amp;flag=1" 
  target=_blank><IMG src="img/ico2.gif"></A> <A 
  href="club_member.jsp?username=<%=rs_3("f_username")%>" target=_blank><IMG 
  src="img/ico3.gif"></A></DIV><%rs_3.movenext
				  loop
				  rs_3.close
				  set rs_3=nothing
				  %></DD></DL></DIV>

<DIV id=chartbot></DIV></DIV>
</DIV>
</BODY></HTML>
