<!--#include file="conn.asp"-->
<!--#include file="inc/char.asp"-->
<!-- #include file="inc/const.asp" -->
<!-- #include file="chkuser.asp" -->
<!--#include file="inc/grade.asp"-->
<!--#include file="inc/theme.asp"-->
<!--#include file="inc/ubbcode.asp"-->
<!--#include file="inc/birthday.asp"-->
<%
stats="登陆错误"
dim abgcolor
founderr=false
dim usersign
usersign=true
if membername="" then
   	ErrMsg=Errmsg+"<br>"+"<li>你还没有登陆。"
	founderr=true
end if
if founderr then
	call nav()
	call headline(1)
	call error()
else
stats="用户控制面版"
	call nav()
	call headline(1)
	call main()
	if founderr then call error()
end if
sub main()
	dim stat,OnlineTime
	dim Srs
	dim Stockmoney,bankmoney,usergrade,username,boardmaster
	set rs=server.createobject("adodb.recordset")
	sql="select * from [User] where username='"&membername&"' and userpassword='"&memberword&"'"
	rs.open sql,conn,1,1
	if err.number<>0 then 
		ErrMsg=Errmsg+"<br>"+"<li>一般程序保护错误，您试图进行不合法的操作。<li>您的密码不正确，请<a href=logout.asp><font color="&TableContentColor&">退出论坛</font></a>或者<a href=login.asp><font color="&TableContentColor&">重新登陆</font></a>"
		founderr=true
		exit sub
	end if
	if rs.eof and rs.bof then
	ErrMsg=Errmsg+"<br>"+"<li>您的用户名并不存在，或者您的密码错误，或者您的帐号已被管理员锁定"
	founderr=true
	exit sub
	else

%>
<table border=0 cellpadding=6 cellspacing=1 width="<%=TableWidth%>" height=29 align=center bgcolor="<%=TableBackColor%>"><tr class=coolbg bgColor="<%=aTablebodyColor%>" align=center>
<td width=14% bgColor="<%=TablebodyColor%>"><B><a href=usermanager.asp ><FONT COLOR=#000000>控制面板首页</font></a></B></td>
<td width=14% ><a href=mymodify.asp?name=<%=membername%> ><B><FONT COLOR=#000000>基本资料修改</font></B></a></td>
<td width=14% ><a href=modifypsw.asp?name=<%=membername%>> <B><FONT COLOR=#000000> 用户密码修改</font></B></a></td>
<td width=14% > <a href=modifyadd.asp?name=<%=membername%>> <B><FONT COLOR=#000000>修改联系资料</font></B></a></td>
<td width=14% ><a href=favlist.asp><B><FONT COLOR=#000000>用户收藏管理</font></B></a></td>
<td width=14% ><a href=usersms1.asp><B><FONT COLOR=#000000>用户短信服务</font></B></a></td>
<td width=14% ><a href=friendlist1.asp><B><FONT COLOR=#000000>编辑好友列表</font></B></a></B>
</td></tr></table><br>
<%

%>
<table width="<%=TableWidth%>" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="<%=TableBackColor%>" style="table-layout:fixed;word-break:break-all">
  <col width=20%><col width=*><col width=40%> 
  <tr> 
    <td colspan="2" bgcolor="<%=TabletitleColor%>"><b><img src="<%=picurl%>arrow1.gif" width="13" height="13">
      <font color="<%=TableFontColor%>">基本资料</font></b></td>
    <td rowspan="8" align="center" bgcolor="<%=TablebodyColor%>" width="40%" valign=top>
<%if not isnull(rs("userphoto")) and rs("userphoto")<>"" then%>
<a href="<%=htmlencode(rs("userPhoto"))%>" target=_blank><img src="<%=htmlencode(rs("userPhoto"))%>" onload="javascript:if(this.width>screen.width-550)this.width=screen.width-600" border=0></a>
<%end if%>
    </td>
  </tr>   
  <tr bgcolor="<%=TablebodyColor%>"> 
    <td width="20%" align="right">性 别：</td>
    <td><font color="<%=TableContentColor%>">
<%if rs("sex")=0 then   
    response.write("女")   
else   
    response.write("男")   
end if   
%></font> </td>
  </tr>
  <tr bgcolor="<%=aTablebodyColor%>"> 
    <td width="20%" align="right">出 生：</td>
    <td><%if rs("birthday")<>"" then%><%=FormatDateTime(rs("birthday"),1)%><%else%><font color=gray>未填</font><%end if%> </td>
  </tr>
  <tr bgcolor="<%=TablebodyColor%>"> 
    <td width="20%" align="right">邮 箱：</td>
    <td>
<%if trim(rs("useremail"))<>"" then%>
<a href="mailto:<%=htmlencode(rs("useremail"))%>"><%=htmlencode(rs("useremail"))%></a> 
<%else%>
<font color=gray>未填</font>
<%end if%></td>
  </tr>
  <tr bgcolor="<%=aTablebodyColor%>"> 
    <td width="20%" align="right">oicq：</td>
    <td>
<%if rs("oicq")<>"" then%>
<%=htmlencode(rs("oicq"))%> 
<%else%><font color=gray>未填</font>
<%end if%></td>
  </tr>
  <tr bgcolor="<%=TablebodyColor%>"> 
    <td width="20%" align="right">ＩＣＱ：</td>
    <td><%if rs("icq")<>"" then%>
<%=htmlencode(rs("icq"))%> 
<%else%><font color=gray>未填</font>
<%end if%></td>
  </tr>
  <tr bgcolor="<%=aTablebodyColor%>"> 
    <td width="20%" align="right">ＭＳＮ：</td>
    <td><%if rs("msn")<>"" then%>
<%=htmlencode(rs("msn"))%> 
<%else%><font color=gray>未填</font>
<%end if%> </td>
  </tr>
  <tr bgcolor="<%=TablebodyColor%>"> 
    <td width="20%" align="right">主 页：</td>
    <td><%if trim(rs("homepage"))<>"" then%>
<a href="<%=htmlencode(rs("homepage"))%>"
    target="_blank"><%=htmlencode(rs("homepage"))%></a> 
<%else%><font color=gray>未填</font>
<%end if%></td>
  </tr>
</table>
<br>
<table width="<%=TableWidth%>" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="<%=TableBackColor%>">
  <tr class=coolbg bgcolor="<%=TableTitleColor%>"> 
    <td colspan="6"><b><img src="<%=picurl%>arrow1.gif" width="13" height="13"> 短消息（以下为最新三封）</b></td>
  </tr>
<%dim usmrs,sqlusm
	set usmrs=server.createobject("adodb.recordset")
	sqlusm="select top 3 * from message where incept='"&membername&"' and issend=1 and delR=0 order by flag,sendtime desc"
	usmrs.open sqlusm,conn,1,1
	if usmrs.eof and usmrs.bof then
%>
 <tr>
                <td bgcolor=<%=Tablebodycolor%> align=center valign=middle colspan=6><font color="<%=TableContentColor%>">您的收件箱中没有任何内容。</font></td>
                </tr>
<%else%>
<%do while not usmrs.eof%>
 <tr bgcolor="<%=Tablebodycolor%>">
    <td width="15%" align="right"><%if usmrs("flag")=0 then%>末读的信件<img src="pic/m_news.gif"><%else%>已读的信件<img src="<%=picurl%>m_olds.gif"><%end if%></td>
    <td  width="35%">主题：<a href="usersms1.asp?action=read&id=<%=usmrs("id")%>&sender=<%=usmrs("sender")%>"><b><%=htmlencode(usmrs("title"))%></a><font color=<%=AlertFontColor%><b>（<%=len(usmrs("content"))%>KB）</b></font></td>
    <td width="15%" align=center><%if usmrs("flag")=0 then%><b><%end if%><%=formatdatetime(usmrs("sendtime"),1)%></font></td>
    <td  width="34%">发信人：<a href="dispuser.asp?name=<%=htmlencode(usmrs("sender"))%>" target=_blank><%=htmlencode(usmrs("sender"))%></a></td>
  </tr>
<%
	usmrs.movenext
	loop
	end if
	usmrs.close
	set usmrs=nothing
%>
</table>
<br>
<table width="<%=TableWidth%>" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="<%=TableBackColor%>">
  <tr class=coolbg bgcolor="<%=TableTitleColor%>"> 
    <td colspan="6"><b><img src="<%=picurl%>arrow1.gif" width="13" height="13"> 论坛属性</b></td>
  </tr>
  <tr bgcolor="<%=TablebodyColor%>"> 
    <td width="15%" bgcolor="<%=TablebodyColor%>" align="right">经验值：</td>
    <td  width="35%"><b><%= rs("userEP") %> </b></td>
    <td width="15%" align="right">精华帖子：</td>
    <td width="35%"> <b><%=rs("userisbest")%></b>篇</td>
  </tr>
  <tr bgcolor="<%=TablebodyColor%>"> 
    <td width="15%" align="right">魅力值：</td>
    <td  width="35%"><b><%= rs("userCP") %> </b></td>
    <td width="15%" align="right">帖子总数：</td>
    <td width="35%"><b><%=rs("article")%></b> 篇</td>
  </tr>
  <tr bgcolor="<%=TablebodyColor%>"> 
    <td width="15%" align="right">论坛等级：</td>
    <td  width="35%"><b><%=grade(rs("userclass"))%> </b></td>
    <td width="15%" align="right">被删主题：</td>
    <td width="35%"><b><font color=<%=AlertFontColor%>><%=rs("userDel")%></font></b> 
      篇</td>
  </tr>
  <tr bgcolor="<%=TablebodyColor%>"> 
    <td width="15%" align="right">威望值：</td>
    <td  width="35%"><b><font color=<%=AlertFontColor%>><%=rs("userPower")%></font> </b></td>
    <td width="15%" align="right">被删除率：</td>
    <td width="35%"><b></b> <font color=<%=AlertFontColor%>><b><%if rs("userDel")>0 or rs("article")>0 then%><%=FormatPercent(-rs("userDel")/rs("article"))%><%else%>%<%end if%></b></font> 
    </td>
  </tr>
  <tr bgcolor="<%=TablebodyColor%>"> 
    <td width="15%" align="right">门  派：</td>
    <td  width="35%"><b><%if rs("usergroup")<>"" then%><%=rs("usergroup")%><%else%><font color=gray>无</font><%end if%> </b></td>
    <td width="15%" align="right">登陆次数：</td>
    <td width="35%"><b><%=rs("logins")%></b> 
    </td>
  </tr>
  <tr bgcolor="<%=TablebodyColor%>"> 
    <td width="15%" align="right">注册日期：</td>
    <td  width="35%"><b><%=rs("addDAte")%></b></td>
    <td width="15%" align="right">上次登录：</td>
    <td width="35%"><b><%=rs("lastlogin")%></b></td>
  </tr>
</table>
<br>
<table width="<%=TableWidth%>" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="<%=TableBackColor%>">

  <tr class=coolbg bgcolor="<%=TableTitleColor%>"> 
    <td colspan="4"><b><img src="<%=picurl%>arrow1.gif" width="13" height="13"> 
      资产情况</b>
      </td>
  </tr>
  <tr bgcolor="<%=TablebodyColor%>"> 
    <td width="15%" align="right">现金货币：</td>
    <td width="35%"><b><%= rs("userWealth") %></b></td>
    <%Stockmoney=0%>
    <td width="15%" align="right">股票市值：</td>
	<%dim dbgp,conngp,connstrgp,sqlgp,sqlgp2,siddgp,rs_ugp,rs_bjgp	
	username=membername
	dbgp="gupiao/gupiao.mdb"
	Set conngp = Server.CreateObject("ADODB.Connection")
	connstrgp="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(dbgp)
 	conngp.Open connstrgp

	sqlgp="select sid,持股数 from 大户 where 帐号='"&username&"' and 持股数<>0" 
   set rs_ugp=conngp.execute(sqlgp)
   if not rs_ugp.eof then
      DO UNTIL rs_ugp.EOF
     siddgp=rs_ugp("sid")
     sqlgp2= "select 当前价格 from 股票 where sid="&siddgp      
     set rs_bjgp=conngp.execute(sqlgp2) 
	 Stockmoney=+Stockmoney+formatnumber(rs_bjgp("当前价格"),3)*rs_ugp("持股数")
	 rs_ugp.MoveNext          
     Loop
	     rs_bjgp.close
     set rs_bjgp=nothing
   else
     Stockmoney=0
   	end if
         rs_ugp.close
     set rs_ugp=nothing

	
	%>
    <td  width="35%"><b><%=Stockmoney%></b></td>
  </tr>
  <tr bgcolor="<%=TablebodyColor%>"> 
    <td width="15%" align="right">银行存款：</td>
	  <%dim conn1
	dim connstr1
	dim db1
	'更改数据库名字
	db1="bank/data/bank.MDB"
	Set conn1 = Server.CreateObject("ADODB.Connection")
	connstr1="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db1&"")
	conn1.Open connstr1
   dim sqlbank,rsbank,deposit
  sqlbank="SELECT * FROM bank WHERE UserName='"&username&"'"
	Set Rsbank=conn1.Execute(sqlbank)
	if rsbank.bof then
    rsbank.close
	deposit=0
	else 
	 deposit=rsbank("savemoney")
rsbank.close
set rsbank=nothing
end if
  %>

    <td width="35%"><b><%=deposit%></b></td>
    <td width="15%" align="right">总 资 产：</td>
    <td width="35%"><b><%=rs("userWealth")+stockmoney+deposit%></b></td>
  </tr>
</table>
<br>
<%end if%>
</body>
</html>
<%
rs.close
set rs=nothing
end sub
call endline()
%>
<!--#include file=footer.asp-->




