📄 exchange.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="const.asp"-->
<html><head>
<META http-equiv=Content-Type content=text/html; charset=gb2312>
<title><%=Gupiao_Setting(5)%>-股票交易</title>
<!--#include file="css.asp"-->
</head>
<body oncontextmenu=self.event.returnValue=false; bgcolor="#FFFEF4">
<%
'=========================================================
' File: Exchange.asp
' Version:1.0
' Date: 2003-1-20
' Script Written by Nev
'=========================================================
if not HaveAccount then
errmess="<li>您还没有股票帐户,不能炒股,请先开户"
call endinfo(1)
else
dim sid,mess,BuyTime,SaleTime
if Request.Form("sid")<>"" then
sid=trim(Request.Form("sid"))
else
sid=trim(Request.QueryString("sid"))
end if
if sid="" or (not isnumeric(sid)) then
errmess="<li>非法炒股,请从有效连接进入!"
call endinfo(1)
else
sql="select 交易量,当前价格,企业,状态,开盘价格 from [股票] where sid="&sid
set rs=gpconn.execute(sql)
if rs.eof and rs.bof then
rs.close
errmess="<li>没有这个股票"
call endinfo(1)
elseif rs(3)="封" then
rs.close
errmess="<li>该股票已经封盘,不能进行交易"
call endinfo(2)
else
dim NowPrice,NowNum,GupiaoName,OpenPrice,RaisingLimit,FallLimit
NowNum=rs(0) '交易量
NowPrice=rs(1) '当前价格
OpenPrice=rs(4) '开盘价格
GupiaoName=rs(2) '股票名称
rs.close
RaisingLimit=False '股票是否处于涨停状态
FallLimit=False '股票是否处于跌停状态
if NowPrice>=9999 OR (NowPrice-OpenPrice)/OpenPrice>=Trade_Setting(9)+0 then
RaisingLimit=True '涨停板 能买入不能卖出
elseif NowPrice<=Trade_Setting(11)+0 OR (OpenPrice-NowPrice)/OpenPrice>=Trade_Setting(10)+0 then
FallLimit=True '跌停板 能卖出不能买入
end if
select case request("action")
case "buy"
call Buy()
case "sale"
call Sale()
case else
call main()
end select
end if
end if
end if
response.Write "</body></html>"
set rs=nothing
CloseDatabase '关闭数据库
'======================================
sub main()
dim sushare,BuyMax
sql="select 持股数 from [大户] where uid="&MyUserID&" and sid="&sid
set rs=gpconn.execute(sql)
if rs.eof then
sushare=0
else
sushare=rs(0)
end if
'计算最多可以购买该股票多少股
if NowNum<(int(MyCash*(1-Trade_Setting(5)/100)/nowprice)) and MyCash>=NowNum*nowprice*(1+Trade_Setting(5)/100) then
BuyMax=NowNum
else
BuyMax=int(MyCash*(1-Trade_Setting(5)/100)/nowprice)
end if
%>
<table width="420" height=300 border=0 cellspacing=1 cellpadding=3 align=center bgcolor="#0066CC">
<TR>
<TD BACKGROUND="images/topbg.gif" height=9></TD>
</TR>
<tr>
<td valign=center align=middle height=23 class=big background="images/header.gif"><font face="Courier New, Courier, mono" color="#FF0000"><%=sid%></font> 号股票
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -