<!--#include file="setup.asp"-->
<!--#include file="plus/Ex_Stock/Exsm_Plus_Conn.asp"-->
<!--#include file="plus/Ex_Stock/Exsm_Plus_Const.asp"-->
<%
	Dim page,Uid,UserName,UserCash,Userfund
	Dim StockType,TodayBuy,TodaySale,TotalBuy,TotalSale
	page=request("page")
	Uid=request("uid")
	If page="" Or Not isnumeric(page) Then page=1
	If Uid="" Or not isnumeric(Uid) Then
		Exsm.Errmess="<li>错误的参数，请指定正确的用户ID。"
		Call Exsm.Endinfo(1)
	Else
		set rs=stock_conn.execute("select * from Ex_User where ID="&Uid&"")
		If rs.eof and rs.bof then
			Exsm.Errmess="<li>指定的用户不存在，请确认传递的参数是否正确。"
			Call Exsm.Endinfo(1)
		Else
			UserName="***"
			If Rs("RankSecret")=1 Or Exsm.StockAdmin Or Rs("ID")=Uid Then UserName=Exsm.htmlencode(rs("UserName"))
			UserCash=rs("UserWealth")
			Userfund=rs("UserAssets")
			StockType=rs("PossessSort")
			TodayBuy=rs("TodayBuy")
			TodaySale=rs("TodaySell")
			TotalBuy=rs("TotalBuy")
			TotalSale=rs("TotalSell")
			Exsm.Title 1,""&UserName&"-用户资料"
			call main()
		End if
	End if
	Sub main()
		Dim ExsmUserSql
		Response.Write "<script language=""JavaScript"" src =""plus/Ex_Stock/Exsm_Plus_Dispu.js""></script>"
		Response.Write "<Script Language=JavaScript>"
		Response.Write "var assignwidth='"&Exsm.AssignWidth&"';"
		Response.Write "var username='"&UserName&"';"
		Response.Write "var userid="&Uid&";"
		sql="select d.Code,d.Company,d.Sid,d.PossessStockSum,d.BuyPrice,d.AveragePrice,g.TradePrice,g.ManageMent,g.ManageMentID from EX_Customer d inner join EX_Stock g on d.Code=g.Code Where d.UserId="&Uid&" order by d.PossessStockSum desc"
		Set Rs=server.createobject("adodb.recordset")
		rs.open sql,stock_conn,1,1
		If not Rs.eof Then
			Response.Write "var stockuserdivon=true;"
			Rs.PageSize=CInt(Exsm.Setting_Info(15))
			If page+0>Rs.PageCount Then page=Rs.PageCount
			Response.Write "var page="&page&";"
			Rs.AbsolutePage=page
			ExsmUserSql=Rs.GetRows(Rs.PageSize)
			For i=0 To Ubound(ExsmUserSql,2)
				Response.Write "userstocklist["&i&"]='"&ExsmUserSql(0,i)&","&Exsm.htmlencode(ExsmUserSql(1,i))&","&ExsmUserSql(2,i)&","&ExsmUserSql(3,i)&","&ExsmUserSql(4,i)&","&ExsmUserSql(5,i)&","&ExsmUserSql(6,i)&","&ExsmUserSql(7,i)&","&ExsmUserSql(8,i)&"';"
			Next
			Response.Write "var recordcount="&Rs.RecordCount&";"
			Response.Write "var pagesize="&Rs.PageSize&";"
			Response.Write "var pagecount="&Rs.PageCount&";"
		Else
			Response.Write "var stockuserdivon=false;"
		End if
		Response.Write "var userfund='"&Userfund&"';"
		Response.Write "var usercash='"&UserCash&"';"
		Response.Write "var stocktype='"&StockType&"';"
		Response.Write "var todaybuy='"&TodayBuy&"';"
		Response.Write "var todaysale='"&TodaySale&"';"
		Response.Write "var totalbuy='"&TotalBuy&"';"
		Response.Write "var totalsale='"&TotalSale&"';"
		Response.Write "stockuserdiv();"
		Response.Write "</Script>"
		Exsm.RootShow
	End Sub
%>