<!--#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"-->
<%
if not exsm.members then
	exsm.errmess="您还没有股票帐户，不能使用该功能，请先开户。"
	call exsm.endinfo("no")
else
	call main()
end if
sub main()
	dim closingprice,tradeprice,zangdierange
	exsm.title 1,"股市排行榜"
%>
	<table cellspacing="0" cellpadding="0" align="center" border="0" width="<%=exsm.assignwidth%>">
		<tr>
			<td width="50%" valign="top">
				<table class="tableborder1" cellspacing="1" cellpadding="3" align="center" border="0" style="width:100%">
					<tr>
						<th colspan="6" height="25">-=> 上 市 公 司 涨 幅 前 十 名 <=-</th>
					</tr>
					<tr align="center">
						<td class="tablebody2"><b>r</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>
<%
				i=1
				set rs=stock_conn.execute("select top 10 * from ex_stock where tradeprice>closingprice order by (tradeprice-closingprice)/closingprice desc")
				if not rs.eof then
					do while not rs.eof
					closingprice=round(rs("closingprice"),2)
					tradeprice=round(rs("tradeprice"),2)
					zangdierange=round((tradeprice-closingprice)/closingprice,4)
%>
					<tr align=center>
						<td class="tablebody1" align="center"><%=i%></td>
						<td class="tablebody1"><font color="olive"><%=rs("code")%></font></td>
						<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)"><%=rs("company")%></a></td>
						<td class="tablebody1"><%if rs("management")<>"" then%><a href="ex_sm_dispu.asp?uid=<%=rs("managementid")%>"><%=rs("management")%></a><%else%>-<%end if%></td>
						<td class="tablebody1"><%=formatnumber(tradeprice,2,-1)%></td>
						<td class="tablebody1"><%=formatpercent(zangdierange,2,-1)%></td>
					</tr>
<%
					i=i+1
					rs.movenext
					loop
				else
					response.write "<tr><td colspan=""6"" class=""tablebody1"">暂无排行</td></tr>"
				end if
%>
				</table>
			</td>
			<td>&nbsp;</td>
			<td width="50%" valign=top>
				<table class="tableborder1" cellspacing="1" cellpadding="3" align="center" border="0" style="width:100%">
					<tr>
						<th colspan="6" height="25">-=> 上 市 公 司 跌 幅 前 十 名 <=-</th>
					</tr>
					<tr align=center>
						<td class="tablebody2"><b>r</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>
<%
				i=1
				set rs=stock_conn.execute("select top 10 * from ex_stock where tradeprice<closingprice order by (tradeprice-closingprice)/closingprice")
				if not rs.eof then
					do while not rs.eof
					closingprice=round(rs("closingprice"),2)
					tradeprice=round(rs("tradeprice"),2)
					zangdierange=round((tradeprice-closingprice)/closingprice,4)
%>
					<tr align=center>
						<td class="tablebody1" align="center"><%=i%></td>
						<td class="tablebody1"><font color="olive"><%=rs("code")%></font></td>
						<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)"><%=rs("company")%></a></td>
						<td class="tablebody1"><%if rs("management")<>"" then%><a href="ex_sm_dispu.asp?uid=<%=rs("managementid")%>"><%=rs("management")%></a><%else%>-<%end if%></td>
						<td class="tablebody1"><%=formatnumber(tradeprice,2,-1)%></td>
						<td class="tablebody1"><%=formatpercent(zangdierange,2,-1)%></td>
					</tr>
<%
					i=i+1
					rs.movenext
					loop
				else
					response.write "<tr><td colspan=""6"" class=""tablebody1"">暂无排行</td></tr>"
				end if
%>
				</table>
			</td>
		</tr>
	</table>
	<br>
	<table class="tableborder1" cellspacing="1" cellpadding="3" align="center" border="0">
		<tr>
			<th colspan="11" height="25">-=> 股 市 十 大 富 翁 排 行 <=-</th>
		</tr>
		<tr align="center">
			<td class="tablebody2"><b>r</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>
<%
		i=1
		set rs=stock_conn.execute("select top 10 * from ex_user order by userassets desc")
		if not rs.eof then
			do while not rs.eof
%>
			<tr align="right">
				<td class="tablebody1" align="center"><%=i%></td>
				<td class="tablebody1" align="center">
					<%if rs("ranksecret")=1 or exsm.stockadmin or rs("id")=exsm.userid then%>
						<a href="ex_sm_dispu.asp?uid=<%=rs("id")%>"><%if rs("id")=exsm.userid then%><font color="blue">您自己</font><%else%><%=rs("username")%><%end if%></a>
					<%else%><a title="使用了用户名保护模式">***</a><%end if%>
				</td>
				<td class="tablebody1"><%=formatcurrency(rs("userwealth"),2,-1)%></td>
				<td class="tablebody1"><%=formatcurrency(rs("userassets"),2,-1)%></td>
				<td class="tablebody1"><%=rs("possesssort")%></td>
				<td class="tablebody1"><%=rs("todaybuy")%></td>
				<td class="tablebody1"><%=rs("todaysell")%></td>
				<td class="tablebody1"><%=rs("totalbuy")%></td>
				<td class="tablebody1"><%=rs("totalsell")%></td>
				<td class="tablebody1" align="center"><%=formatdatetime(rs("joindate"),2)%></td>
				<td class="tablebody1" align="center"><%if rs("lockuser")=1 then%><font color="red">锁定<%else%>正常<%end if%></td>
			</tr>
<%
			i=i+1
			rs.movenext
			loop
		else
			response.write "<tr><td colspan=""11"" class=""tablebody1"">没有找到任何股民</td></tr>"
		end if
		response.write "</table>"
	exsm.rootshow
end sub
%>