<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="inc/ex_stock/ex_sm_conn.asp"-->
<!--#include file="inc/ex_stock/ex_sm_const.asp"-->
<%
	dim page,upage
	dim indication,sqlgoal,highlow,datasort,descdatasort
	dim sortclosingprice,sorttradeprice,sortheavechangea,sortheavechangeb,sorttodaybuynumber,sorttodaysellnumber,sorttodaypermittradesum,sorttodaytradenum,sortlockstock
	dim reg_info,trade_info,ask
	exsm.title 0,""&exsm.setting_info(0)&""
	session("ex_sm")=0
	reg_info=split(exsm.stockdata(9,0),",")
	trade_info=split(exsm.stockdata(10,0),",")
	sub getstocknews()
		set rs=stock_conn.execute("select top 20 content,color,addtime from ex_news order by id desc")
		exsm.value=null
		if not rs.eof then exsm.value=rs.getrows(20)
		set rs=nothing
	end sub
	sub getsequence()
		set rs=stock_conn.execute("select top 7 id,username,userassets from ex_user where lockuser<1 and ranksecret=1 and userassets<round(9999999999999.99,2) order by userassets desc")
		exsm.value=null
		if not rs.eof then exsm.value=rs.getrows(7)
		set rs=nothing
	end sub
	page=request("page")
	if page="" or not isnumeric(page) then page=1
	upage=request("upage")
	if upage="" or not isnumeric(upage) then upage=1
	sqlgoal=request("stsearch")
	if not isnumeric(sqlgoal) then sqlgoal=0
	highlow=request("desc")
	if highlow="" or not isnumeric(highlow) then highlow=0
	if sqlgoal="" and split(exsm.setting_info(20),"|")(1)<>0 then
		sqlgoal=split(exsm.setting_info(20),"|")(0)
		if split(exsm.setting_info(20),"|")(1)=1 then highlow=1
	end if
	if highlow=0 then
		descdatasort=""
		indication="<a href=""?stsearch="&sqlgoal&"&desc=1&upage="&upage&"&page="&page&"""><font color=""#008800"">↓</font></a>"
	else
		descdatasort=" desc"
		indication="<a href=""?stsearch="&sqlgoal&"&desc=0&upage="&upage&"&page="&page&"""><font color=""#ff0000"">↑</font></a>"
	end if
	select case sqlgoal
		case 1
			datasort="closingprice"
			sortclosingprice=indication
			stockdiv
		case 2
			datasort="tradeprice"
			sorttradeprice=indication
			stockdiv
		case 3
			datasort="(tradeprice-closingprice)/closingprice"
			sortheavechangea=indication
			stockdiv
		case 4
			datasort="(tradeprice-closingprice)/closingprice"
			sortheavechangeb=indication
			stockdiv
		case 5
			datasort="todaybuynumber"
			sorttodaybuynumber=indication
			stockdiv
		case 6
			datasort="todaysellnumber"
			sorttodaysellnumber=indication
			stockdiv
		case 7
			datasort="todaypermittradesum"
			sorttodaypermittradesum=indication
			stockdiv
		case 8
			datasort="todayadtradesum"
			sorttodaytradenum=indication
			stockdiv
		case 9
			datasort="lockstock"
			sortlockstock=indication
			stockdiv
		case else
			datasort="sid"
			stockdiv
	end select
	sub possessstock()
		if exsm.members then
			dim rst,agvinprice,currentprice,mygupiaocost
			dim bj,totalgain,granrate,meigukuisun,zongkuisun,yingkuilv,pricechange
			dim currentpage,page_count,totalrec,pcount,color(0)
			mygupiaocost=0
			currentpage=request("upage")
			if currentpage="" or not isnumeric(currentpage) then currentpage=1
			response.write "<br><table class=""tableborder1"" cellspacing=""1"" cellpadding=""3"" align=""center"" border=""0"">"
			response.write "<tr><th colspan=""11"" height=""25"">-=> 欢 迎 您 ["&exsm.stockholder&"] 您 的 持 股 情 况 如 下 <=-</th></tr>"
			response.write "<tr align=""center""><td class=""tablebody2""><b>代码</b></td><td class=""tablebody2""><b>股票名称</b></td><td class=""tablebody2""><b>拥有数量</b></td><td class=""tablebody2""><b>持股成本</b></td><td class=""tablebody2""><b>当前价</b></td><td class=""tablebody2""><b>持股价</b></td><td class=""tablebody2""><b>持股现值</b></td><td class=""tablebody2""><b>每股盈亏</b></td><td class=""tablebody2""><b>总盈亏</b></td><td class=""tablebody2""><b>盈亏率</b></td><td class=""tablebody2""><b>状态</b></td></tr>"
			sql="select d.*,g.tradeprice,g.closingprice,g.management,g.managementid,g.lockstock from ex_customer d inner join ex_stock g on d.code=g.code where d.userid="&exsm.userid&" order by d.possessstocksum desc"
			set rs=stock_conn.execute(sql)
			set rs= server.createobject("adodb.recordset")
			rs.open sql,stock_conn,1,1
			if rs.eof and rs.bof then
				response.write "<tr><td colspan=""11"" class=""tablebody1"" align=""center"">您现在还没有股票请点击上方屏幕中股票名称购买</tr></table>"
			else
				rs.pagesize=cint(exsm.setting_info(15))
				rs.absolutepage=currentpage
				page_count=0
				totalrec=rs.recordcount
				do while (not rs.eof) and (not page_count = rs.pagesize)
					currentprice=round(rs("tradeprice"),2)
					agvinprice=round(rs("averageprice"),2)
					mygupiaocost=mygupiaocost+rs("possessstocksum")*agvinprice
					bj=currentprice-agvinprice
					bj=round(bj,2)
					if bj>0 then
						meigukuisun="<font color=""#ff0000"">↑"&formatnumber(bj,2,-1)&"</font>"
						color(0)="#ff0000"
					elseif bj<0 then
						meigukuisun="<font color=""#008800"">↓"&formatnumber(abs(bj),2,-1)&"</font>"
						color(0)="#008800"
					elseif bj=0 then
						meigukuisun="<font color=""#000000"">→0.00</font>"
						color(0)="#000000"
					end if
					totalgain=bj*rs("possessstocksum")
					granrate=totalgain*100/mygupiaocost
					if totalgain>0 then
						zongkuisun="<font color=""#ff0000"">↑"&formatnumber(totalgain,2,-1)&"</font>"
						yingkuilv="<font color=""#ff0000"">↑"&formatnumber(granrate,2,-1)&"%</font>"
					elseif totalgain<0 then
						zongkuisun="<font color=""#008800"">↓"&formatnumber(-totalgain,2,-1)&"</font>"
						yingkuilv="<font color=""#008800"">↓"&formatnumber(-granrate,2,-1)&"%</font>"
					else
						zongkuisun="<font color=""#000000"">→0.00</font>"
						yingkuilv="<font color=""#000000"">→0.00%</font>"
					end if
					response.write "<tr align=""right""><td class=""tablebody1"" align=""center""><font color=""olive"">"&rs("code")&"</font></td>"
					response.write "<td class=""tablebody1"" align=""center""><a href=""ex_sm_dispcompare.asp?sid="&rs("sid")&""" onmouseover=""cziemenu(event,'<div><a href=\'ex_sm_dispcompare.asp?sid="&rs("sid")&"\'>上市资讯</a></div><div><a href=\'ex_sm_exchange.asp?sid="&rs("sid")&"\'>进行交易</a></div>','',15)""><font color="""&color(0)&""">"&rs("company")&"</font></a></td>"
					response.write "<td class=""tablebody1"">"&replace(formatnumber(rs("possessstocksum"),0,-1),",","")&"</td>"
					response.write "<td class=""tablebody1"">"&formatnumber(agvinprice*rs("possessstocksum"),2,-1)&"</td>"
					response.write "<td class=""tablebody1"">"&formatnumber(currentprice,2,-1)&"</td>"
					response.write "<td class=""tablebody1"">"&formatnumber(agvinprice,2,-1)&"</td>"
					response.write "<td class=""tablebody1"">"&formatnumber(currentprice*rs("possessstocksum"),2,-1)&"</td>"
					response.write "<td class=""tablebody1"">"&meigukuisun&"</td>"
					response.write "<td class=""tablebody1"">"&zongkuisun&"</td>"
					response.write "<td class=""tablebody1"">"&yingkuilv&"</td>"
					response.write "<td class=""tablebody1"" align=""center"">"
					response.write "<a style=""cursor:hand"" onmouseover=""cziemenu(event,'<div>"
					response.write "<a>股票状态："
					if rs("lockstock")=0 then
						pricechange=round(round(rs("tradeprice")-rs("closingprice"),2)/round(rs("closingprice"),2),4)
						if round(rs("tradeprice"),2)<round(trade_info(5),2) then
							response.write "<font color=\'navy\'>停牌</font>"
						elseif pricechange>=round(trade_info(3)/100,2) then
							response.write "<font color=\'#ff0000\'>涨停</font>"
						elseif pricechange<=-round(trade_info(4)/100,2) then
							response.write "<font color=\'#008800\'>跌停</font>"
						else
							response.write "开盘"
						end if
					else
						response.write "<font color=\'#ff0000\'>封盘</font>"
					end if
					response.write "</a></div>"
					if not exsm.stockadmin and split(exsm.stockdata(12,0),",")(0)=1 and rs("managementid")=exsm.userid then
						response.write "<div><a href=\'ex_sm_exchange.asp?action=userfh&sid="&rs("sid")&"\'>分红操作</a></div>"
					end if
					response.write "<div><a>今涨跌幅："&formatpercent(pricechange,2,-1)&"</a></div>"
					response.write "<div><a>买入时间："&rs("buytime")&"</a></div>"
					if datediff("n",rs("buytime"),now())<round(trade_info(14)) then
						response.write "<div><a>离再买入时间还差：<font color=\'#ff0000\'>"&trade_info(14)-datediff("n",rs("buytime"),now())&"分钟</font></a></div>"
					end if
					if datediff("n",rs("buytime"),now())<round(trade_info(7)) then
						response.write "<div><a>离可卖出时间还差：<font color=\'#ff0000\'>"&trade_info(7)-datediff("n",rs("buytime"),now())&"分钟</font></a></div>"
					else
						if datediff("n",rs("selltime"),now())<round(trade_info(15)) then
							response.write "<div><a>离再卖出时间还差：<font color=\'#ff0000\'>"&trade_info(15)-datediff("n",rs("selltime"),now())&"分钟</font></a></div>"
						end if
					end if
					response.write "','',0)"">其它</a>"
					response.write "</td></tr>"
					page_count=page_count+1
				rs.movenext
				loop
				pcount=rs.pagecount
				call exsm.disppagenum(totalrec,page_count,currentpage,pcount,"?stsearch="&sqlgoal&"&desc="&highlow&"&page="&page&"&upage=","?stsearch="&sqlgoal&"&desc="&highlow&"&page="&page&"")
			end if
			rs.close
			set rs=nothing
		end if
	end sub
	sub regask()
		if exsm.stockholder="" then
			response.write "<tr><td class=""tablebody2"">　</td></tr>"
			response.write "<tr><td class=""tablebody2"">　</td></tr>"
			response.write "<tr><td class=""tablebody1"" valign=""middle""><b>提示：</b><br>&nbsp;&nbsp;&nbsp;&nbsp;您是“游客”只能参观不能进行开户及股票买卖操作，如果你要开户或买卖股票请您先[<a href=""login.asp"">登录</a>]或[<a href=""reg.asp"">注册</a>]后在来。</td></tr>"
		else
			if cint(reg_info(0))=0 then
				response.write "<tr><td class=""tablebody2""><br><br><br></td></tr>"
				response.write "<tr><td class=""tablebody1"" valign=""middle""><b>提示：</b><br>&nbsp;&nbsp;&nbsp;&nbsp;“"&exsm.setting_info(0)&"”暂时停止开户谢谢光临。</td></tr>"
			else
				call connectiondatabase()
				sqlbbs="select UserPost,userCP,userEP,userWealth from Dv_User Where UserID="&exsm.bbsuserid&""
				set rsbbs=conn.execute(sqlbbs)
				ask=1
				response.write "<tr><td class=""tablebody1"" colspan=""3"">您要买卖股票请先开户。</td></tr>"
				response.write "<tr><td class=""tablebody2"" colspan=""3"">开户要求：</td></tr>"
				response.write "<tr><td class=""tablebody1"" align=""center"">要求内容</td>"
				response.write "<td class=""tablebody1"" align=""center"">限制数量</td>"
				response.write "<td class=""tablebody1"" align=""center"">是否</td></tr>"
				response.write "<tr><td class=""tablebody2"" align=""left"">最少发帖数为：</td>"
				response.write "<td class=""tablebody1"" align=""right"">"&reg_info(1)&"&nbsp;篇</td>"
				response.write "<td class=""tablebody2"" align=""right"">"
				if cdbl(reg_info(1))>rsbbs(0) then
					response.write "<a title=""没有达到要求""><font color=red style=""line-height: normal""><b>×</b></font></a>"
				else
					ask=ask+1
					response.write "<a title=""达到要求""><font color=""blue"">√</font></a>"
				end if
				response.write "</td></tr>"
				response.write "<tr><td class=""tablebody2"" align=""left"">最少魅力值为：</td>"
				response.write "<td class=""tablebody1"" align=""right"">"&reg_info(2)&"&nbsp;点</td>"
				response.write "<td class=""tablebody2"" align=""right"">"
				if cdbl(reg_info(2))>rsbbs(1) then
					response.write "<a title=""没有达到要求""><font color=red style=""line-height: normal""><b>×</b></font></a>"
				else
					ask=ask+1
					response.write "<a title=""达到要求""><font color=""blue"">√</font></a>"
				end if
				response.write "</td></tr>"
				response.write "<tr><td class=""tablebody2"" align=""left"">最少经验值为：</td>"
				response.write "<td class=""tablebody1"" align=""right"">"&reg_info(3)&"&nbsp;点</td>"
				response.write "<td class=""tablebody2"" align=""right"">"
				if cdbl(reg_info(3))>rsbbs(2) then
					response.write "<a title=""没有达到要求""><font color=""red"" style=""line-height: normal""><b>×</b></font></a>"
				else
					ask=ask+1
					response.write "<a title=""达到要求""><font color=""blue"">√</font></a>"
				end if
				response.write "</td></tr>"
				response.write "<tr><td class=""tablebody2"" align=""left"">最少现金值为：</td>"
				response.write "<td class=""tablebody1"" align=""right"">"&reg_info(4)&"&nbsp;币</td>"
				response.write "<td class=""tablebody2"" align=""right"">"
				if cdbl(reg_info(4))>rsbbs(3) then
					response.write "<a title=""没有达到要求""><font color=""red"" style=""line-height: normal""><b>×</b></font></a>"
				else
					ask=ask+1
					response.write "<a title=""达到要求""><font color=""blue"">√</font></a>"
				end if
				response.write "</td></tr>"
			end if
		end if
	end sub
	sub exsm_index_analyse()
		dim quotations
		exsm.name="exsm_imitate_quotations"
		quotations=exsm.value
		response.write "<br>"
		response.write "<table class=""tableborder1"" cellspacing=""1"" cellpadding=""0"" align=""center"" border=""0"">"
		response.write "<tr>"
		response.write "<th height=""25"" id=""tabletitlelink"" style=""font-weight:normal""><a name=""online""></a><b>-=> 股 市 统 计</b>&nbsp;[<span id=""showstr""><a href=""ex_sm_userlist.asp?action=analysediv&online=1"" target=""hiddenonline"">显示详细列表</a></span>][<a href=""ex_sm_userlist.asp"">查看在线用户位置</a>]<b> <=-</b></th>"
		response.write "</tr>"
		response.write "<td class=""tablebody1""><table class=""tableborder1"" cellspacing=""0"" cellpadding=""3"" align=""center"" border=""0"" style=""width:99%"">"
		response.write "<tr><td height=""20"" class=""tablebody1"">目前股市共有 <b>"&cint(quotations(4))+cint(quotations(5))&"</b> 位在线股民，会员 <b>"&cint(quotations(4))&"</b> 位，客人 <b>"&cint(quotations(5))&"</b> 位。</td></tr>"
		response.write "</table>"
		response.write "<table class=""tableborder1"" cellspacing=""0"" cellpadding=""0"" align=""center"" border=""0"" style=""width:99%"">"
		response.write "<tr><td height=1></td></tr>"
		response.write "</table>"
		response.write "<table align=""center"" cellspacing=""1"" cellpadding=""0"" border=""0"" width=""99%"">"
		response.write "<tr><td height=""2""></td></tr>"
		response.write "<tr><td width=""100%""><span style=""display:none"" id=""analyse"">正在读取在线信息，请稍侯……</span></td></tr>"
		response.write "</table></td>"
		response.write "</table>"
		response.write "<br>"
		if exsm.setting_info(11)=1 then
			response.write "<iframe width=""0"" height=""0"" src=""ex_sm_userlist.asp?action=analysediv&online=1&aion=on"" name=""hiddenonline""></iframe>"
		else
			response.write "<iframe width=""0"" height=""0"" src=""ex_sm_userlist.asp?action=ai&aion=on"" name=""hiddenonline""></iframe>"
		end if
	end sub
	sub stockdiv()
		dim exrs,exsm_news,exsm_usersequence
		dim pagev,totalrec,currentpage,page_count,pcount,todaypermittradesum,lockstock,color(2)
		dim closingprice,tradeprice,pricechange
		exsm.nav
		currentpage=request("page")
		if currentpage="" or not isnumeric(currentpage) then currentpage=1
		pagev="&upage="&upage&"&page="&page&""
		response.write "<table class=""tableborder1"" cellspacing=""1"" cellpadding=""3"" align=""center"" border=""0"">"
		response.write "<tr align=""center"" height=""25"" id=""tabletitlelink""><th><a href=""#topex"">代码</a></th><th><a href=""?"&pagev&""">股票名称</a></th><th><a href=""?"&pagev&""">经营者</a></th><th><a href=""?stsearch=1"&pagev&""">昨收盘</a>"&sortclosingprice&"</th><th><a href=""?stsearch=2"&pagev&""">当前价</a>"&sorttradeprice&"</th><th><a href=""?stsearch=3"&pagev&""">涨跌</a>"&sortheavechangea&"</th><th><a href=""?stsearch=4"&pagev&""">涨幅</a>"&sortheavechangeb&"</th><th><a href=""?stsearch=5"&pagev&""">买入</a>"&sorttodaybuynumber&"</th><th><a href=""?stsearch=6"&pagev&""">卖出</a>"&sorttodaysellnumber&"</th><th><a href=""?stsearch=7"&pagev&""">今可交易</a>"&sorttodaypermittradesum&"</th><th><a href=""?stsearch=8"&pagev&""">今成交</a>"&sorttodaytradenum&"</th><th><a href=""?stsearch=9"&pagev&""">状态</a>"&sortlockstock&"</th></tr>"
		sql= "select * from ex_stock order by "&datasort&descdatasort&""
		set rs=server.createobject("adodb.recordset")
		rs.open sql,stock_conn,1
		if rs.eof and rs.bof then
			response.write "<tr><td colspan=""12"" class=""tablebody1"" align=""center""><a href=""ex_sm_admin_gupiao.asp?action=newstock""><font color=""red"">数据库中没有股票数据！请点击这里到后台添加股票数据。</font></a></tr></table>"
		else
			rs.pagesize=cint(exsm.setting_info(14))
			totalrec=rs.recordcount
			if cdbl(currentpage)>=totalrec\clng(rs.pagesize)+1 then
				currentpage=totalrec\clng(rs.pagesize)+1
			else
				currentpage=clng(currentpage)
			end if
			if clng(currentpage)<1 then currentpage=1
			rs.absolutepage=currentpage
			page_count=0
			do while not rs.eof and page_count < rs.pagesize
				closingprice=round(rs("closingprice"),2)
				tradeprice=round(rs("tradeprice"),2)
				if closingprice<1 then
					color(0)="navy"
					color(1)="navy"
				elseif closingprice=tradeprice then
					color(0)="#000000"
					color(1)="#000000"
				elseif closingprice<tradeprice then
					color(0)="#ff0000"
					color(1)="#008800"
				elseif closingprice>tradeprice then
					color(0)="#008800"
					color(1)="#ff0000"
				end if
				pricechange=round((tradeprice-closingprice)/closingprice,4)
				if rs("lockstock")=0 then
					if rs("todaypermittradesum")>0 then
						todaypermittradesum=replace(formatnumber(rs("todaypermittradesum"),0,-1),",","")&""
					else
						todaypermittradesum="-"
					end if
					if tradeprice<round(trade_info(5),2) then
						lockstock="<font color="""&color(0)&""">停牌</font>"
					elseif pricechange>=round(trade_info(3)/100,2) then
						lockstock="<font color="""&color(0)&""">涨停</font>"
					elseif pricechange<=-round(trade_info(4)/100,2) then
						lockstock="<font color="""&color(0)&""">跌停</font>"
					else
						lockstock="开盘"
					end if
				else
					todaypermittradesum="-"
					lockstock="<font color=""#ff0000"">封盘</font>"
				end if
				response.write "<tr align=""center""><td class=""tablebody1""><font color=""olive"">"&rs("code")&"</font></td>"
				response.write "<td class=""tablebody1""><a href=""ex_sm_dispcompare.asp?sid="&rs("sid")&""" onmouseover=""cziemenu(event,'<div><a href=\'ex_sm_dispcompare.asp?sid="&rs("sid")&"\'>上市资讯</a></div><div><a href=\'ex_sm_exchange.asp?sid="&rs("sid")&"\'>进行交易</a></div>','',15)""><font color="""&color(0)&""">"&rs("company")&"</font></a></td>"
				response.write "<td class=""tablebody1"">"
				if rs("management")<>"" then
					response.write "<a href=""ex_sm_dispu.asp?uid="&rs("managementid")&""">"&rs("management")&"</a>"
				else
					response.write "-"
				end if
				response.write "</td>"
				response.write "<td class=""tablebody1""><font color="""&color(1)&""">"&formatnumber(closingprice,2,-1)&"</font></td>"
				response.write "<td class=""tablebody1""><font color="""&color(0)&""">"&formatnumber(tradeprice,2,-1)&"</font></td>"
				response.write "<td class=""tablebody1""><font color="""&color(0)&""">"&formatnumber(tradeprice-closingprice,2,-1)&"</font></td>"
				response.write "<td class=""tablebody1""><font color="""&color(0)&""">"&formatpercent(pricechange,2,-1)&"</font></td>"
				response.write "<td class=""tablebody1"">"&rs("todaybuynumber")&"</td>"
				response.write "<td class=""tablebody1"">"&rs("todaysellnumber")&"</td>"
				response.write "<td class=""tablebody1""><font color="""&color(0)&""">"&todaypermittradesum&"</font></td>"
				response.write "<td class=""tablebody1"">"
				if rs("todayadtradesum")>0 then
					response.write ""&replace(formatnumber(rs("todayadtradesum"),0,-1),",","")&""
				else
					response.write "-"
				end if
				response.write "</td>"
				response.write "<td height=""20"" align=""center"" class=""tablebody1"">"&lockstock&"</td></tr>"
				page_count=page_count+1
			rs.movenext
			loop
			pcount=rs.pagecount
			response.write "</table>"
			rs.close
			set rs=nothing
			call exsm.disppagenum(totalrec,page_count,currentpage,pcount,"?stsearch="&sqlgoal&"&desc="&highlow&"&upage="&upage&"&page=","?stsearch="&sqlgoal&"&desc="&highlow&"&upage="&upage&"")
		end if
		if cint(exsm.setting_info(19))=1 then possessstock
		response.write "<br><table class=""tableborder1"" border=""0"" cellpadding=""0"" cellspacing=""1"" align=""center"">"
		response.write "<tr><td width=""100%"" height=""25"" colspan=""3"">"
		response.write "<table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"">"
		response.write "<tr><th height=""25"" width=""30%"">-=> 个 人 情 况 总 揽 <=-</th><th height=""25"" width=""40%"">-=> 股 市 实 时 信 息 <=-</th><th height=""25"" width=""30%"">-=> 股 市 资 产 排 行 榜 <=-</th></tr>"
		response.write "</table>"
		response.write "</td></tr>"
		response.write "<tr><td width=""30%"" class=""tablebody2"" valign=""top"">"
		response.write "<table border=""0"" cellpadding=""2"" cellspacing=""1"" width=""100%"">"
		if exsm.members then
			dim stockstatistic,ykstr
			set rs=stock_conn.execute("select userstatistic,todaybuy,todaysell from ex_user where id="&exsm.userid&"")
			stockstatistic=split(rs(0),"|||")
			if stockstatistic(1)-stockstatistic(2)>0 then
				ykstr="<font color=""#ff0000"">↑"&formatcurrency(stockstatistic(1)-stockstatistic(2),2,-1)&""
			elseif stockstatistic(1)-stockstatistic(2)<0 then
				ykstr="<font color=""#008800"">↓"&formatcurrency(stockstatistic(2)-stockstatistic(1),2,-1)&""
			else
				ykstr="<font color=""#000000"">→￥0.00"
			end if
			ykstr=""&ykstr&"</font>"
			response.write "<tr><td class=""tablebody2"">帐户资金：</td>"
			response.write "<td class=""tablebody1"" align=""right"">"&formatcurrency(exsm.usercash,2,-1)&"&nbsp;元</td></tr>"
			response.write "<tr><td class=""tablebody2"">持股总数：</td>"
			response.write "<td class=""tablebody1"" align=""right"">"&replace(formatnumber(stockstatistic(0),0,-1),",","")&"&nbsp;股</td></tr>"
			response.write "<tr><td class=""tablebody2"">持股市值：</td>"
			response.write "<td class=""tablebody1"" align=""right"">"&formatcurrency(stockstatistic(1),2,-1)&"&nbsp;元</td></tr>"
			response.write "<tr><td class=""tablebody2"">股票成本：</td>"
			response.write "<td class=""tablebody1"" align=""right"">"&formatcurrency(stockstatistic(2),2,-1)&"&nbsp;元</td></tr>"
			response.write "<tr><td class=""tablebody2"">盈亏情况：</td>"
			response.write "<td class=""tablebody1"" align=""right"">"&ykstr&"&nbsp;元</td></tr>"
			response.write "<tr><td class=""tablebody2"">资产合计：</td>"
			response.write "<td class=""tablebody1"" align=""right"">"&formatcurrency(stockstatistic(1)+exsm.usercash,2,-1)&"&nbsp;元</td></tr>"
			response.write "<tr><td class=""tablebody2"">今日买卖：</td>"
			response.write "<td class=""tablebody1"" align=""right"">"&cdbl(rs(1)+rs(2))&"&nbsp;笔</td></tr>"
		else
			regask
		end if
		response.write "</table></td>"
		response.write "<td width=""40%"" class=""tablebody2"" align=""center"" valign=""middle"">"
		response.write "<table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"">"
		response.write "<tr><td width=""100%"">"
		exsm.name="exsm_imitate_news"
		if exsm.inspectisdata() then getstocknews
		exsm_news=exsm.value
		response.write "<marquee onmouseover=""this.stop()"" onmouseout=""this.start()"" scrollamount=""1"" scrolldelay=""15"" direction=""up"" width=""100%"" height=130>"
		if isarray(exsm_news) then
			for i=0 to ubound(exsm_news,2)
				response.write "<div><font color="""&exsm_news(1,i)&""">★&nbsp;"&exsm.ubbcode(exsm_news(0,i))&"</div><div align=""right"">"&exsm_news(2,i)&"</div><br>"
			next
		end if
		response.write "</marquee>"
		response.write "</td></tr>"
		response.write "</table></td>"
		response.write "<td width=""30%"" class=""tablebody2"" valign=""top"">"
		response.write "<table border=""0"" cellpadding=""2"" cellspacing=""1"" width=""100%"">"
		exsm.name="exsm_imitate_usersequence"
		if exsm.inspectisdata() then getsequence
		exsm_usersequence=exsm.value
		if isarray(exsm_usersequence) then
			for i=0 to ubound(exsm_usersequence,2)
				response.write "<tr>"
				response.write "<td class=""tablebody1"" align=""center"" width=""20""><font color=""red"">"&i+1&"</font></td>"
				response.write "<td class=""tablebody2"" align=""center""><a href=""ex_sm_dispu.asp?uid="&exsm_usersequence(0,i)&""">"&exsm_usersequence(1,i)&"</a></td>"
				response.write "<td class=""tablebody1"" align=""right"">"
				if exsm_usersequence(2,i)<=0 then 
					response.write "0 元"
				else
					response.write formatcurrency(exsm_usersequence(2,i),2,-1)&" 元"
				end if
				response.write "</td></tr>"
			next
		else
			response.write "<tr><td class=""tablebody2"">还没有股民开户</td></tr>"
		end if
		response.write "</table></td>"
		response.write "<tr><td width=""100%"" height=""20"" colspan=""3"" class=""tablebody2"">"
		response.write "<table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"">"
		response.write "<form name=""form"" method=""post"" action=""ex_sm_mymanage.asp?action=newexuser"">"
		response.write "<tr><td width=""30%"" align=""center"">"
		if exsm.members then
			response.write "<a href=""ex_sm_mymanage.asp"" onmouseover=""cziemenu(event,'<div><a href=\'ex_sm_mymanage.asp\'>帐户管理</a></div><div><a href=\'ex_sm_mymanage.asp?action=userinfo\'>帐户设置</a></div><div><a href=\'ex_sm_mymanage.asp?action=reflashinfo\'>刷新总揽</a></div>','',0)"">帐户管理</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
			response.write "<a href=""ex_sm_help.asp"">股市帮助</a>"
		else
			if ask=5 and reg_info(0)=1 then
				response.write "<input type=""submit"" name=""submit"" class=""pageinput"" value=""开户"">"
			else
				response.write "<input type=""submit"" name=""submit"" class=""pageinput"" disabled=""true"" value=""开户"">"
			end if
		end if
		response.write "</td></form>"
		response.write "<td width=""40%"" align=""center""><a href=""ex_sm_news.asp"">更多信息</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=""ex_sm_eachstock.asp"">个股上市</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=""index.asp"">返回论坛</a></td>"
		response.write "<td width=""30%"" align=""center""><a href=""ex_sm_topuser.asp?action=reflash"">刷新排名</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=""ex_sm_topuser.asp"">详细排名</a></td>"
		response.write "</tr></table>"
		response.write "</td></tr>"
		response.write "</tr></table>"
		exsm_index_analyse
		exsm.rootshow
	end sub
%>