⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bank.asp

📁 ASP整套的建站源代码
💻 ASP
字号:
<!-- #include file="setup.asp" -->
<%
if Request.Cookies("username")="" then
error("<li>您还还未<a href=login.asp>登陆</a>社区")
end if

if instr(Request.Cookies("username")," ")>0 then:error("<li>非法操作"):end if

sql="select * from user where username='"&Request.Cookies("username")&"'"
rs.Open sql,Conn,1,3

if Request.Cookies("userpass")<>rs("userpass") then
error2("密码错误!")
end if

select case Request("menu")
case "save"
succtitle="存款成功!"
save
case "draw"
succtitle="取款成功!"
draw
case "virement"
succtitle="转账成功!"
virement
end select
top
%>
<table width="750" align="center" border="0"><tr>
<td vAlign="top" width="30%"><img src="images/logo.gif" border="0"></td>
<td vAlign="center" align="top"> <img src="images/closedfold.gif" border="0"> <a href="index.asp"><%=clubname%></a><br> <img src="images/bar.gif" border="0"><img src="images/openfold.gif" border="0"> 社区银行</td></tr></table><html><head>
<title>社区银行</title>
<center>
<table cellSpacing="0" cellPadding="0" width="622" border="0" style="border-collapse: collapse" bordercolor="#111111"><tr>
<td align="center" width="590">
<table border="0" cellpadding="4" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="83%">
<tr>
<td width="50%" rowspan="4"><img src="images/plus/bank.gif" width="249" height="107"></td>
<td width="50%" colspan="2" bgcolor="#A4B6D7" align="center"><font color="#FFFFFF">
您在本银行</font></td>
</tr>
<tr>
<td width="24%">&nbsp;现金:</td>
<td width="26%"><b><font color="aa0000"><%=rs("money")%> </font>
NG</b></td>
</tr>
<tr>
<td width="24%">&nbsp;存款:</td>
<td width="26%"><b><font color="aa0000"><%=rs("savemoney")%></font>
NG</b></td>
</tr>
<tr>
<td width="24%">&nbsp;总共:</td>
<td width="26%"><b><font color="aa0000"><%=rs("savemoney")+rs("money")%></font>
NG</b></td>
</tr>
</table>
<p><br></p>
<table cellSpacing="0" cellPadding="0" bgColor="000000" border="0"><tr bgColor="ffffff">
<td bgColor="666666" height="20"><font color="ffffff">&nbsp; <b>我要存钱</b>&nbsp;
</font></td><td vAlign="bottom"><img src="bar1.gif" width="300" height="2"></td></tr></table>
<form action="bank.asp?menu=save" method="post">
<p>&nbsp; 您有现金 <b><font color="aa0000"><%=rs("money")%></font></b> <b>NG</b><br>&nbsp; 我要存
<input size="10" value="1000" name="qmoney" MAXSIZE="32"><b> NG</b> 
<input type="submit" value=" 存了 " name="B1">&nbsp;</p></form>
<table cellSpacing="0" cellPadding="0" bgColor="000000" border="0"><tr bgColor="ffffff">
<td bgColor="666666" height="20"><font color="ffffff">&nbsp; <b>我要取钱</b>&nbsp;</font></td>
<td vAlign="bottom"><img src="bar1.gif" width="300" height="2"></td>
</tr>
</table>
<form action="bank.asp?menu=draw" method="post" onSubmit="return formCheck()">
<p>&nbsp;您现有存款<b><font color="aa0000"> <%=rs("savemoney")%></font> NG</b><br>&nbsp; 我要取
<input size="10" value="1000" name="qmoney" MAXSIZE="32">
<b>NG</b> 
<input type="submit" value=" 取了 " name="B1">&nbsp;
</p>
</form>
<table cellSpacing="0" cellPadding="0" bgColor="000000" border="0">
<tr bgColor="ffffff">
<td bgColor="666666" height="20"><font color="ffffff">&nbsp; <b>我要转帐</b>&nbsp;
</font></td>
<td vAlign="bottom"><img src="bar1.gif" width="300" height="2"></td>
</tr>
</table>
<form action="bank.asp?menu=virement" method="post" onSubmit="return formCheck()">
<p>&nbsp; 最低转账金额为 <font color="#AA0000"><b>1000</b></font> <b>NG</b><br>&nbsp; 我要将
<input size="5" value="1000" name="qmoney" MAXSIZE="32"><b> NG</b> 转到
<input size="5" name="dxname" MAXSIZE="32"> 的账户<br> 
<input type="submit" value=" 确 定 " name="B1">&nbsp;
</p>
</form>
</td>
</tr>
</table>
</center>
<%
rs.close
htmlend

sub save
qmoney=int(request("qmoney"))
if qmoney > rs("money") then
message="<li>你的现金没有这么多吧!"
error(message)
end if
if qmoney<1 then
message="<li>存款不能为零!"
error(message)
end if
rs("savemoney")=rs("savemoney")+qmoney
rs("money")=rs("money")-qmoney
rs.update
rs.close
message="<li><a href=bank.asp>返回银行</a><li><a href=index.asp>返回论坛首页</a>"
succeed(message&"<meta http-equiv=refresh content=3;url='bank.asp'")
end sub


sub draw
qmoney=int(request("qmoney"))
if qmoney>rs("savemoney") then
message="<li>您的存款不够!"
error(message)
end if
if qmoney<1 then
message="<li>取款不能为零!"
error(message)
end if
rs("savemoney")=rs("savemoney")-qmoney
rs("money")=rs("money")+qmoney
rs.update
rs.close
message="<li><a href=bank.asp>返回银行</a><li><a href=index.asp>返回论坛首页</a>"
succeed(message&"<meta http-equiv=refresh content=3;url='bank.asp'")
end sub

sub virement

if Request.Cookies("username")=request("dxname") then
message="<li>您输入的是自己的账号?"
error(message)
end if


qmoney=int(request("qmoney"))
if qmoney>rs("savemoney") then
message=message&"<li>您的帐户余额不够!!"
end if
if qmoney<1000 then
message=message&"<li>转帐不能低于1000!"
end if

sql="select * from user where username='"&request("dxname")&"'"
rs1.Open sql,Conn,1,3
if rs1.eof then
message=message&"<li>查无此人的账号!"
end if


if message<>"" then
error(""&message&"")
end if



rs1("savemoney")=rs1("savemoney")+qmoney
rs1.update
rs1.close

rs("savemoney")=rs("savemoney")-qmoney
rs.update
rs.close


message="<li><a href=bank.asp>返回银行</a><li><a href=index.asp>返回论坛首页</a>"
succeed(message&"<meta http-equiv=refresh content=3;url='bank.asp'")
end sub


%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -