<!--#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"-->
<!--#include file="money.asp"-->

<%
stats="查询个人资料"
dim username
dim abgcolor
username=trim(checkStr(request("name")))
founderr=false
dim usersign
usersign=true
if ViewUser_g=0 and membername="" then
	Errmsg=Errmsg+"<br>"+"<li>客人不允许查看会员资料。"
	founderr=true
end if
if ViewUser_u=0 then
	Errmsg=Errmsg+"<br>"+"<li>论坛设定不允许查看会员资料。"
	founderr=true
end if
if username="" then
   	ErrMsg=Errmsg+"<br>"+"<li>错误的参数。"
	founderr=true
end if
call nav()
call headline(1)
if founderr then
	call error()
else
	call main()
	if founderr then call error()
end if
sub main()
	dim stat,OnlineTime
	dim Srs
	dim Stockmoney,bankmoney,usergrade,boardmaster
	set rs=server.createobject("adodb.recordset")
	sql="select * from [User] where username='"&UserName&"'"
	rs.open sql,conn,1,1
	if err.number<>0 then 
		ErrMsg=Errmsg+"<br>"+"<li>数据库操作失败："&err.description
		founderr=true
		exit sub
	end if
	if rs.eof and rs.bof then
	ErrMsg=Errmsg+"<br>"+"<li>您查询的名字不存在"
	founderr=true
	exit sub
	else
%>
<table width="<%=TableWidth%>" border="0" cellspacing="0" cellpadding="3" align="center">
  <tr> 
    <td><img src="<%=htmlencode(rs("face"))%>" width="20" height="21" align="absmiddle"> 
<b><%=htmlencode(username)%></b> 
</td>
    <td align="right">
<%
	set Srs=conn.execute("select stats,startime,hiddenuser from online where username='"&username&"'")
	if Srs.eof and Srs.bof then
	stat=""
	OnlineTime="[离线]"
	else
	  if srs(2)<>1 then
	stat="当前位置：["&Srs(0)&"]"
	OnlineTime="[在线：" & datediff("n",Srs(1),Now()) & "Mins]"
	   else
	stat=""
	OnlineTime="[离线]"
	   end if
	end if
	Srs.close
	set Srs=nothing
%>
 <%=stat%>
 <img src="<%=picurl%>zhuangtai.gif" width="16" height="16" align="absmiddle"> 
      状态： 
<%
	if rs("lockuser")=1 then
		response.write "锁定  "
	elseif rs("lockuser")=2 then
		response.write "屏蔽  "
	else
		response.write "正常  "
	end if
%>
<%=OnlineTime%>  <%if master then%>   『 <a href="admin_lockuser.asp?action=lock_1&name=<%=htmlencode(username)%>" title="锁定该用户不允许登陆和发言">锁定</a> | <a href="admin_lockuser.asp?action=lock_2&name=<%=htmlencode(username)%>" title="屏蔽该用户在论坛的发言">屏蔽</a> | <a href="admin_lockuser.asp?action=lock_3&name=<%=htmlencode(username)%>" title="解除该用户在论坛的锁定">解锁</a> | <a href="admin_lockuser.asp?action=power&name=<%=htmlencode(username)%>" title="对用户进行分值奖励">奖励</a> 』<%end if%></td>
  </tr>
</table>
<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="9" align="center" bgcolor="<%=TablebodyColor%>" width="40%" valign=middle>
<%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 height=100 width=90></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 not isnull(rs("birthday")) and rs("birthday")<>"" then%><%=astro(rs("birthday"))%> <%else%><font color=gray>未填</font><%end if%></td>
  </tr>
  <tr bgcolor="<%=aTablebodyColor%>"> 
    <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">Ｑ Ｑ：</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>
  <tr  bgcolor="<%=aTablebodyColor%>"> 
    <td width="20%" align="right" valign="top"></td>
    <td>&nbsp;</td>
    <td align="center" width="40%">
      <p align="center"><b><a href="usersms.asp?action=new&touser=<%=htmlencode(username)%>"><font color="<%=TableFontColor%>">给他留言</font></a> | <a href=friendlist.asp?action=addF&myFriend=<%=HTMLEncode(username)%> target=_blank><font color="<%=TableFontColor%>">加为好友</font></a> </b></td>
  </tr>
</table>
<br>
<table width="<%=TableWidth%>" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="<%=TableBackColor%>">
  <tr 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 bgcolor="<%=TableTitleColor%>"> 
    <td colspan="4"><b><img src="<%=picurl%>arrow1.gif" width="13" height="13"> 
      资产情况</b></td>
  </tr>
<%
if rs("userclass")=20 then
usergrade="总版主<br>"
end if
if rs("userclass")>=19 then
set Srs=conn.execute("select boardmaster,boardid,boardtype from board order by boardid")
do while not srs.eof
	boardmaster=split(srs(0),"|")
	for i=0 to ubound(boardmaster)
	if boardmaster(i)=username then usergrade=usergrade & "<a href=list.asp?boardid="&srs(1)&">"&srs(2)&"</a>  版主<br>"
	next
srs.movenext
loop
srs.close
set srs=nothing
end if
if rs("userclass")<19 then
usergrade="<font color=gray>无职务</font>"
end if
%>
  <tr bgcolor="<%=TablebodyColor%>"> 
    <td width="15%" align="right">现金货币：</td>
    <td width="35%"><b><%= rs("userWealth") %></b></td>
    <td colspan="2" valign="top" rowspan="4">论坛职务：
      <hr size="1" width="100" align="left"><%=usergrade%>
      </td>
  </tr>
 
  <tr bgcolor="<%=TablebodyColor%>"> 
    <td width="15%" align="right">股票市值：</td>
	<%dim dbgp,conngp,connstrgp,sqlgp,sqlgp2,siddgp,rs_ugp,rs_bjgp	
	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>
<%
'set Srs=conn.execute("select usersaving from userbank where userid="&rs("userid"))
'if srs.eof and srs.bof then
'bankmoney=0
'else
'bankmoney=Srs(0)
'end if
'srs.close
'set srs=nothing
bankmoney=0
%>
  <tr bgcolor="<%=TablebodyColor%>"> 
  <%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="15%" align="right">银行存款：</td>
    <td width="35%"><b><%=deposit%></b></td>
  </tr>
  <tr bgcolor="<%=TablebodyColor%>"> 
    <td width="15%" align="right">总 资 产：</td>
    <td width="35%"><b><%=rs("userWealth")+stockmoney+deposit%>--><%=xiaoxie(rs("userWealth")+stockmoney+deposit)%></b></td>
  </tr>
</table>
<br>
<table width="<%=TableWidth%>" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="<%=TableBackColor%>">
  <tr bgcolor="<%=TableTitleColor%>"> 
    <td><b><img src="<%=picurl%>arrow1.gif" width="13" height="13"> 
      最近活动－－<a href="queryResult.asp?stype=1&nSearch=3&keyword=<%=HTMLEncode(UserName)%>&SearchDate=ALL&boardid=0">搜索该用户所有帖子</a></b></td>
  </tr>
<%
set srs=conn.execute("select top 5 rootid,boardid,dateandtime,topic,expression from bbs1 where username='"&username&"' and not locktopic=2 order by announceid desc")
do while not srs.eof
%>
  <tr bgcolor="<%=TablebodyColor%>"> 
    <td align="left">&nbsp;<img src="face/<%=srs(4)%>" width=14 height=14>&nbsp;<a href="dispbbs.asp?boardid=<%=srs(1)%>&rootid=<%=srs(0)%>&id=<%=srs(0)%>"><%=htmlencode(srs(3))%>&nbsp;--&nbsp;<%=srs(2)%></td>
  </tr>
<%
srs.movenext
loop
srs.close
set srs=nothing
%>
</table>
<%end if%>
</body>
</html>
<%
rs.close
set rs=nothing
end sub
call endline()
%>
<!--#include file=footer.asp-->