<!--#include file="conn.asp"-->

<%	membername=request.cookies("aspsky")("username")

if membername="" then
response.redirect "../login.asp"
response.end
end if
 set rs=server.createobject("adodb.recordset")
   sql= "select 锁定 from 客户 where 帐号='"&membername&"'"         
   rs.open sql,conn,0,1
  if not rs.eof then
if rs("锁定")=1 then
response.write "<title>账号被冻结</title>"
call endinfo("你的股票账户被冻结，请与管理员联系！")
%>
<OBJECT  id=closes  type="application/x-oleobject"  classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" width="14" height="14">   
<param  name="Command"  value="Close">   
</object> <a href="#" onclick="closes.Click()"><div align=center>关闭本页</div> </a>

<%
response.end
end if
rs.close
end if

session("uname")=membername
 if hour(time)<8  then 
response.redirect "gpto.asp"
else 
sql= "select * from 股票"      
set rss=conn.execute(sql)
if rss("状态")="封" then 
sql= "select * from 股票"        
set rs=conn.execute(sql)   
DO while not RS.EOF   
sql="update 股票 set 开盘价格='"&rs("当前价格")&"',状态='开',日期='"&date()&"'where sid="&RS("SID")
conn.execute sql
rs.movenext
LOOP
rs.close
end if
 end if
 %>
<meta http-equiv="refresh" content="120">
<!--#include file="chufa.asp"--> 
 <html>
<head>
<title>股票交易所-<%=uname%></title>
<style type="text/css"><!--td {  font-family: 宋体; font-size: 9pt}body {  font-family: 宋体; font-size: 9pt}select {  font-family: 宋体; font-size: 9pt}A {text-decoration: none; font-family: "宋体"; font-size: 9pt}A:hover {text-decoration: underline; color: #CC0000; font-family: "宋体"; font-size: 9pt} .big {  font-family: 宋体; font-size: 10.8pt}
--></style>
</head>
<body bgcolor="#FFFEF4"  >
<table border="0" width="99%" bgcolor="#666666" cellspacing="1" cellpadding="3" bordercolorlight="#000000" bordercolordark="#FFFFFF" class="fnt9" align="center">
  <tr bgcolor="#666666"> 
    <td height="20" align="right" width="6%"> 
      <table class=dropshadow cellspacing=0 cellpadding=1 border=0>
         
        <tr> 
          <td><font color=#ffffff>代号</font></td>
        </tr>
         
      </table>
    </td>
    <td height="20" align="center" width="14%"> 
      <table class=dropshadow cellspacing=0 cellpadding=1 border=0>
         
        <tr> 
          <td><font color=#ffffff>股票名称</font></td>
        </tr>
         
      </table>
    </td>
    <td height="20" align="center" width="16%"> 
      <table class=dropshadow cellspacing=0 cellpadding=1 border=0>
         
        <tr> 
          <td><font color=#ffffff>股票数量</font></td>
        </tr>
         
      </table>
    </td>
    <td height="20" align="center" width="17%"> 
      <table class=dropshadow cellspacing=0 cellpadding=1 border=0>
         
        <tr> 
          <td><font color=#ffffff>昨日</font><font color="#FFFFFF">收盘</font><font color=#ffffff>价</font></td>
        </tr>
         
      </table>
    </td>
    <td height="20" align="center" width="17%"> 
      <table class=dropshadow cellspacing=0 cellpadding=1 border=0>
         
        <tr> 
          <td><font color=#ffffff>目前成交价</font></td>
        </tr>
         
      </table>
    </td>
    <td height="20" align="center" width="12%" bgcolor="#666666"> 
      <table class=dropshadow cellspacing=0 cellpadding=1 border=0>
         
        <tr> 
          <td><font color=#ffffff>今日成交量</font></td>
        </tr>
         
      </table>
    </td>
    <td height="20" width="8%" bgcolor="#666666" class="big"> 
      <table class=dropshadow cellspacing=0 cellpadding=1 border=0>
         
        <tr> 
          <td><font color=#ffffff>涨跌幅</font></td>
        </tr>
         
      </table>
    </td>
  </tr>
  <%           
sql= "select * from 股票"         
set rs=conn.execute(sql)         
DO UNTIL RS.EOF  %>
 
  <%if ccur(formatcurrency(rs("当前价格"),3))<=1 then           
    color="#ffffff"           
    elseif ccur(formatcurrency(rs("开盘价格"),3))<ccur(formatcurrency(rs("当前价格"),3)) then           
    color="#FF0000"           
    elseif ccur(formatcurrency(rs("开盘价格"),3))>ccur(formatcurrency(rs("当前价格"),3)) then          
    color="#00FF00"           
    elseif ccur(formatcurrency(rs("开盘价格"),3))=ccur(formatcurrency(rs("当前价格"),3)) then             
    color="#FFCC00"          
    end if          

zd=ccur((formatcurrency(rs("当前价格"),3)-formatcurrency(rs("开盘价格"),3))/formatcurrency(rs("开盘价格"),3))
zd1=ccur(formatcurrency(rs("当前价格"),3))

if zd1<=1 then
   sstop=4
   mmm="停牌"
elseif zd>=0.1 then          
   sstop=1
   mmm="涨停"          
elseif zd<= -0.1 then 
   sstop=2 
   mmm="跌停" 
elseif zd=0 then
sstop=3
mmm="0.00%"
else       
   sstop=0
   mmm=zd
end if   %>
  <tr bgcolor="#006633" valign="bottom"> 
    <td height="20" width="6%" bgcolor="#000000" class="fnt9" align="right"> 
      <div align="right"><span class="p"><a href="exchange.asp?sid=<%=rs("sid")%>"><font color=#FFCC00><%=rs("sid")%></font></a></span> </div>
    </td>
    <td height="20" width="14%" bgcolor="#000000" class="fnt9"><span class="p"><a href="exchange.asp?sid=<%=rs("sid")%>"><font color="<%=color%>"><%=rs("企业")%></font></a></span></td>
    <td height="20" bgcolor="#000000" class="fnt9"><font color=#FFCC00><span class="p"><%=formatnumber(rs("流通股票"),0)%>　</span></font></td>
    <td height="20" bgcolor="#000000" class="fnt9"><font color=#FFCC00><span class="p"><%=formatcurrency(rs("开盘价格"),3)%>　</span></font></td>
    <td height="20" bgcolor="#000000" class="fnt9"><font color="<%=color%>"><span class="p"><%=formatcurrency(rs("当前价格"),3)%></span></font><font color="<%=color%>"><span class="p">　</span></font></td>
    <td height="20" bgcolor="#000000" class="fnt9"><font color=#FFCC00> <span class="fnt9"> 
      <% if rs("交易量")=0 then %>
      <%="没有交易"%> 
      <% else %>
      <%=formatnumber(rs("交易量"),0)%> 
      <%  zcjl=zcjl+rs("交易量")*(rs("当前价格")+rs("开盘价格"))/2 %>
      <% end if %>
      　</span></font></td>
    <td height="20" bgcolor="#000000" class="fnt9"><font color="<%=color%>"> 
      <% 
	if sstop <>0 then
	response.write "<B>"&mmm&"</b>"
	else

    response.write ""&mmm*100&"%"
zhzs= zhzs+mmm*100
	end if 
	%>
      </font></td>
  </tr>
  <%        
  
  rs.MoveNext         
  Loop 
  rs.close
 set rs=Nothing
%>
</table>
<br>
<%
sql="select * from 客户 where 帐号='"&session("uname")&"'"
set rs=conn.execute(sql)
if not(rs.eof or rs.bof) then
%>
<TABLE cellSpacing=1 cellPadding=3 width="98%" align=center 
      bgColor=#000000 border=0>
   
  <TR bgcolor="#666666"> 
    <TD colSpan=8 height=24> 
      <TABLE class=dropshadow cellSpacing=0 cellPadding=1 width="97%" 
            align=center border=0>
         
        <TR > 
          <TD><FONT color=#ffffff>个股管理</FONT></TD>
        </TR>
         
      </TABLE>
    </TD>
  </TR>
  <TR align=center bgColor=#99CCFF valign="middle"> 
    <TD>代号</TD>
    <TD>股票名称</TD>
    <TD>拥有数量<font color="#FFFFFF"></font></TD>
    <TD>平均买入价格</TD>
    <TD>上次买入价格</TD>
  </TR>
  <%rs.close
  set rs=nothing%>
  <% 
sql="select * from 大户 where 帐号='"&session("uname")&"' and 持股数<>0" 
set rs_u=conn.execute(sql)

if rs_u.eof then %>
  <tr> 
    <td colspan="5" bgcolor="#FFFFFF"> 　你现在没有股票
  </tr>
  <% end if %>
 
  <% DO UNTIL RS_U.EOF  
  sidd=rs_u("sid")
   sql2= "select 当前价格 from 股票 where sid="&sidd      
set rs_bj=conn.execute(sql2) 
%>
  <TR align=center bgColor=#8d9aca> 
    <TD>

	<a href="exchange.asp?sid=<%=rs_u("sid")%>"><font color="#FFFF00"><%=rs_U("sid")%></font></a></TD>
    <TD>	<a href="exchange.asp?sid=<%=rs_u("sid")%>"><font color="#FFFF00"><%=rs_U("企业")%></font></a><%
bj=formatnumber(rs_bj("当前价格"),3)-formatnumber(rs_u("买入价格"),3)	
if bj>0 then
response.write "<b><font color=#FF0000>　↗</font> </b>"&formatnumber(bj,3)&" 元"
elseif bj<0 then
response.write "<b><font color=#00CC00>　↘</font> </b>"&formatnumber(abs(bj),3)&" 元"
elseif bj=0 then
response.write "<font color=#FFFFFF><b>　→</b></font>"
end if
%></TD>
    <TD><font color="#FFFF00"><%=rs_u("持股数")%></font></TD>
    <TD> <font color="#FFFF00"> 
      <% if rs_u("平均价格")=0 then %>
      <%=formatnumber(rs_u("买入价格"),3)%> 
      <%else%>
      <%=formatnumber(rs_u("平均价格"),3)%> </font></TD>
    <TD><font color="#FFFF00"><%=formatnumber(rs_u("买入价格"),3)%></font></TD>
    <%end if%>
  </tr>
  <%          
  rs_u.MoveNext          
  rs_bj.close
  set rs_bj=nothing
  Loop          

 end if %>
   
</TABLE>
 
<br>
<table cellspacing=0 cellpadding=0 width="98%" align=center border=0>
   
  <tr> 
    <td valign=top> 
      <table cellspacing=0 cellpadding=0 width=100% border=0>
         
        <tr valign=top> 
          <td width=250> 
            <table cellspacing=1 cellpadding=0 width=100% bgcolor=#000000 
            border=0>
                 <tr> 
                <td bgcolor=#ffffff valign="top"> 
                  <table cellspacing=0 cellpadding=0 border=0 width="100%">
                     
                    <tr bgcolor="#666666"> 
                      <td height=24> 
                        <table class=dropshadow cellspacing=0 cellpadding=1 
                        width="98%" align=center border=0>
                            <tr> 
                            <td><font 
                        color=#ffffff>股市信息</font></td>
                          </tr>
                         </table>
                      </td>
                    </tr>
                    <tr> 
                      <td> 
                        <table cellspacing=0 cellpadding=3 width="100%" 
border=0>       <tr> 
                            <td height=25> 成交总量：
							<% if  zcjl=0 then %>
                              <%="0"%> 
                              <% else %>
                              <%=formatnumber(zcjl,0)%> 
                              <%end if %>
                               </td>
                          </tr>
                          <tr> 
                            <td height=12> <br>
                              综合指数：<br>
                              <b><%=zhzs%></b>　 </td>
                          </tr>
                                             </table>
                      </td>
                    </tr>
                                  </table>
                </td>
              </tr>
              
            </table>
            <br>
						<%
sql="select * from 客户 where 帐号='"&session("uname")&"'"
set rs=conn.execute(sql)
if not(rs.eof or rs.bof) then
%>            
            <table cellspacing=1 cellpadding=0 width=100% bgcolor=#000000 
            border=0>
               
              <tr> 
                <td bgcolor=#ffffff> 
                  <table cellspacing=0 cellpadding=0 border=0 width="100%">
                     
                    <tr bgcolor="#666666"> 
                      <td colspan="2"  height=20> 
                        <table class=dropshadow cellspacing=0 cellpadding=1 
                        width="90%" align=center border=0>
                           
                          <tr> 
                            <td><font 
                        color=#ffffff>帐户管理</font></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                    <tr> 
                      <td > 
                        <table height=100 cellspacing=0 cellpadding=3 width=100% 
                        border=0>
						<tr> 
                            <td valign="middle"> 
                              <table cellspacing=0 cellpadding=0 width="100%" 
                              border=0>
                                  <tr> 
                                  <td>帐户资金： 
                                    <%if int(rs("资金"))<=0 then %>
                                    ０元 
                                    <%else %>
                                    <%=formatnumber(rs("资金"),0)%>元 
                                    <%end if %>
                                  </td>
                                </tr>
                              </table>
							  </td>
                          </tr>
                          <tr> 
                            <td valign="bottom"> 
                              <table cellspacing=0 cellpadding=0 width="100%" 
                              border=0>
                                <tr> 
                                  <td align="left" ><a href="manage.asp?menu=cun"><font color="#0000CC">账户存钱</font></a>　 
                                  </td>
                                </tr>
                                <tr> 
                                  <td align="left" ><a href="manage.asp?menu=qu"><font color="#0000CC">帐户提钱</font></a>　 
                                  </td>
                                </tr>
                              </table>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
			<% else %>
            <form name="form1" method="post" action='jingji2.asp'>
			<input type=hidden name=name size=10 value="<%=session("uname")%>" maxlength="0">
              你在股票市场里还没有帐户，要买卖股票请先开户
<input type="submit" name="submit" value="开户" class="fnt9">
            </form>
            <% end if %>
                </td>
          <td width=10>&nbsp;</td>
          <td width=250> 
            <table cellspacing=1 cellpadding=0 width=100% bgcolor=#000000 
            border=0>
               
              <tr> 
                <td bgcolor=#ffffff> 
                  <table cellspacing=0 cellpadding=0 border=0 width="100%">
                     
                    <tr bgcolor="#666666"> 
                      <td  height=24> 
                        <table class=dropshadow cellspacing=0 cellpadding=1 
                        width="90%" align=center border=0>
                           
                          <tr> 
                            <td><font 
                        color=#ffffff>股市大户</font></td>
                          </tr>
                           
                        </table>
                      </td>
                    </tr>
                    <tr> 
                      <td> 
                        <table height=22 cellspacing=0 cellpadding=3 width=245 
                        border=0>
                           
                          <%
						  set rs=server.createobject("adodb.recordset")
sql="select top 10 * from 总资金 order by (总资金) desc"
rs.open sql,conn
 if RS.Eof then %>
                            <td > 还未有人买入股票 </td>
                            <% end if 
	do while Not RS.Eof
%>
                          <tr> 
                            <td width="123"> <%=rs("帐号")%></td>
                            <td align=right width="110">
							<% if rs("总资金")<=0  then %>
							0 元
							<% else %>
							<%=formatnumber(rs("总资金"),0)%> 元
<% end if %></td>
                          </tr>
                          <% RS.MoveNext
						  	Loop
rs.close %>
 <tr> 
                          </tr>
                           
                        </table>
                        <table height=22 cellspacing=0 cellpadding=3 width=245 
                        border=0>
                            
                        </table>
                      </td>
                    </tr>
                     
                  </table>
                </td>
              </tr>
              
            </table>
          </td>
          <td width=10>&nbsp;</td>
          <td width=260 align="right"> 
            <table cellspacing=1 cellpadding=0 width=100% bgcolor=#000000 
            border=0>
               
              <tr> 
                <td bgcolor=#ffffff width=100%				> 
                  <table cellspacing=0 cellpadding=0 border=0 width="100%">
                     
                    <tr bgcolor="#666666"> 
                      <td height=24> 
                        <table class=dropshadow cellspacing=0 cellpadding=1 
                        width="90%" align=center border=0>
                           
                          <tr> 
                            <td><font color="#ffffff">股市新闻</font></td>
                          </tr>
                           
                        </table>
                      </td>
                    </tr>
                    <tr> 
                      <td> 
                        <table height=22 cellspacing=0 cellpadding=3 width=100% 
                        border=0>
                           
                          <tr> 
                            <td> <MARQUEE onmouseover=this.stop() onmouseout=this.start() 
                        scrollAmount=1 scrollDelay=90 direction=up width="100%" 
                        height=200 align="middle" border="0"> 
                              <%
						  set rs=server.createobject("adodb.recordset")
sql="select 原因,原因时间 from 事件 order by 原因时间 desc"
rs.open sql,conn
	do while Not RS.Eof
%>
                              　　<%=rs("原因")%><br><font color="#999999"><div align="right"><%=rs("原因时间")%></div><br></font>
<%			  RS.MoveNext
	Loop
rs.close%>
                              </marquee></td>
                          </tr>
                           
                        </table>
                        <table height=22 cellspacing=0 cellpadding=3 width=245 
                        border=0>
                            
                        </table>
                      </td>
                    </tr>
                     
                  </table>
                </td>
              </tr>
               
            </table>
          </td>
        </tr>
        
      </table>
    </td>
  </tr>
  
</table>
<% if session("uname")="rexsp"  then %>
<br>
<table border="0" width="98%" height="19"
cellspacing="1" cellpadding="3" align="center" bgcolor="#666666">
  <tr> 
    <td width="744" height="9" bordercolorlight="#000000" bordercolordark="#FFFFFF" align="left" valign="middle"> 
     
        <table class=dropshadow cellspacing=0 cellpadding=1 
                        width="98%" align=center border=0>
           
          <tr> 
            <td><font color="#FFFFFF">管理员选项</font> </td>
          </tr>
           
        </table>
    
    </td>
  </tr>
  <tr>
    <td width="744" height="10" bordercolorlight="#000000" bordercolordark="#FFFFFF" align="center" bgcolor="#FFFFFF"> 
      ｜　<a href="jiu.asp?who=<%=session("uname")%>">提升所有股票的现价</a><font color="#990000"></font>　｜　<a href="jiang.asp?who=<%=session("uname")%>">降低所有股票的现价</a><font color="#990000"></font> 
      　｜ 　<a href="gpma.asp"><font color="#0000CC">股票管理</font></a>   ｜ 　<a href="userma.asp"><font color="#0000CC">客户管理</font></a>

      <% end if
sub endinfo(message) 
'-------------------------------信息提示-------------------------------
%>
<table width="<%=TableWidth%>" border=0 cellspacing=1 cellpadding=3 align=center bgcolor="<%=Tablebackcolor%>"><tr bgcolor="<%=Tabletitlecolor%>" ><td align=center height=26 bgcolor="<%=Tabletitlecolor%>"><b>信息提示</b></td></tr><tr><td align=center height=70 bgcolor="<%=aTabletitlecolor%>"><%=message%><br></td></tr></table>
<%end sub
%>
    </td>
  </tr>
</table>
</body>
</html>