📄 bank.asp
字号:
<!--#include file="Inc.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
Const int_rate=0.0001 '银行利率
Dim Coin
If Not BBS94KK.Founduser Then BBS94KK.GoToErr(10)
Coin=BBS94KK.Fun.GetStr("Coin")
If Coin<>"" Then If Not BBS94KK.Fun.isInteger(Coin) then Call Alert("请输入正确的金额!")
Select Case Request.querystring("Action")
Case "Save"
Save
Case "Draw"
Draw
Case "Virement"
Virement
Case"Convert"
Convert
Case Else
Main
End Select
BBS94KK.Footer()
Set BBS94KK=Nothing
Function GetInterest()
Dim Interest,Rs
IF Session(BBS94KK.CacheName & "Bank")="" Then
Set Rs=BBS94KK.Execute("select Coin,BankSave,Banktime from [KK_user] where Name='"&BBS94KK.MyName&"' and password='"&BBS94KK.MyPwd&"'")
If Rs.Eof Then BBS94KK.GoToErr(35)
If Day(Rs(2))<>Day(BBS94KK.NowBbsTime) then
Interest=ccur(ccur(rs(1))*int(Datediff("d",cdate(rs("banktime")),cdate(BBS94KK.NowBbsTime)))*int_rate)
BBS94KK.Execute("Update [KK_user] Set BankSave=BankSave+"&Interest&",BankTime='"&BBS94KK.NowBbsTime&"' where Name='"&BBS94KK.MyName&"' ")
'更新缓存
Session(BBS94KK.CacheName & "MyInfo") = Empty
BBS94KK.UserLoginTrue
Else
Interest=0
End If
Rs.Close
Session(BBS94KK.CacheName & "Bank")=Interest
GetInterest=Interest
Else
GetInterest=Session(BBS94KK.CacheName & "Bank")
End IF
End Function
Sub Main
Call BBS94KK.Head("论坛银行")
Dim Interest,Content
Interest=GetInterest()
Content="<table border=0 cellpadding=4 cellspacing=0 style='border-collapse: collapse' width='100%'><tr><td width='46%' align='center'><img src=images/bank.gif width=249 height=107></td><td>"&_
"<table align='center' width='97%' border='0' cellpadding='0' cellspacing='5' bgcolor='#FFFFFF' style='border-right: #BCBCBC 2px solid; border-bottom: #BCBCBC 2px solid;border-top: #e8e8e8 1px solid; border-left: #e8e8e8 1px solid;'>"&_
"<tr><th height='25' bgcolor='#E8E8E8' colspan=2>财务状况 [存款利率:<font color=red>"&int_rate*1000&"</font>‰]</th></tr>"&_
"<tr><td width='15%'> 银行户主:</td><td width='39%'><b>"&BBS94KK.MyName&"</b></td></tr>"&_
"<tr><td> 存款(含利息):</td><td><b><font color='red'>"&BBS94KK.MyBankSave&"</font></b> 元</td></tr>"&_
"<tr><td> 今日结算利息:</td><td><b><font color='red'>"&Interest&"</font></b> 元</td></tr>"&_
"<tr><td> 持有现金:</td><td><b><font color='Red'>"&BBS94KK.MyCoin&"</font></b> 元</td></tr>"&_
"<tr><td> 个人资金总共:</td><td><b><font color='red'>"&Ccur(BBS94KK.MyBankSave)+Ccur(BBS94KK.MyCoin)&"</font></b> 元</td></tr>"&_
"</table></td></tr></table>"&BankPlacard&_
"<table width='100%' border='0' cellPadding='0' cellSpacing='0'><tr><td>"&_
"<form action='?Action=Save' method='post'><table align='center' width='97%' border='0' cellpadding='0' cellspacing='5' bgcolor='#FFFFFF' style='border-right: #BCBCBC 2px solid; border-bottom: #BCBCBC 2px solid;border-top: #e8e8e8 1px solid; border-left: #e8e8e8 1px solid;'>"&_
"<tr><th height='25' bgcolor='#E8E8E8'>存款柜台</th></tr>"&_
"<tr><td> 现金:<b><font color=red>"&BBS94KK.MyCoin&"</font></b> 元</td></tr>"&_
"<tr><td align='center'>存储:<input size='10' value='1000' name='Coin'>元 <input type='submit' value=' 存钱 '></td></tr></table></form>"&_
"</td><td>"&_
"<form action='?Action=Draw' method='post'><table align='center' width='97%' border='0' cellpadding='0' cellspacing='5' bgcolor='#FFFFFF' style='border-right: #BCBCBC 2px solid; border-bottom: #BCBCBC 2px solid;border-top: #e8e8e8 1px solid; border-left: #e8e8e8 1px solid;'>"&_
"<tr><th height='25' bgcolor='#E8E8E8'>支取柜台</th></tr>"&_
"<tr><td> 存款:<b><font color=Red>"&BBS94KK.MyBankSave&"</font></b> 元</td></tr>"&_
"<tr><td align='center'>支取 <input size='10' value='1000' name='Coin'> 元 <input type='submit' value=' 支取 '></td></tr></table></form>"&_
"</td><td>"&_
"<form action='?Action=Virement' method='post'><table align='center' width='97%' border='0' cellpadding='0' cellspacing='5' bgcolor='#FFFFFF' style='border-right: #BCBCBC 2px solid; border-bottom: #BCBCBC 2px solid;border-top: #e8e8e8 1px solid; border-left: #e8e8e8 1px solid;'>"&_
"<tr><th height='25' bgcolor='#E8E8E8'>转帐柜台</th></tr>"&_
"<tr><td> 把存款转帐给好友</td></tr>"&_
"<tr><td align='center'><input size='5' value='1000' name='Coin'>元 给<input size='5' name='ToUserName'> <input type='submit' value=' 转帐 '></td></tr></table></form>"&_
"</td></tr></table>"
Call BBS94KK.ShowTable("论坛银行",Content)
End Sub
Sub Save
If Coin="" Then Call Alert("失败!您还没有填写要存款的金额!")
If Int(Coin) > Int(BBS94KK.MyCoin) Then Call Alert("失败!拜托你先看看你口袋里有多少钱行不行?别老把一毛钱当一百!")
BBS94KK.Execute("update [KK_user] Set BankSave=BankSave+"&Coin&",Coin=Coin-"&Coin&" where Name='"&BBS94KK.MyName&"'")
Session(BBS94KK.CacheName & "MyInfo") = Empty
Call Alert("恭喜!银行存款成功")
End sub
Sub Draw
If Coin="" Then Call Alert("失败!您还没有填写要取款的金额!")
If int(Coin) > Int(BBS94KK.MyBankSave) Then Call Alert("耶!这位漂亮的先生或英俊的小姐,您真是英勇无比,请问银行很好抢吗?小心飞毛腿呀你!(请注意你的存款还有多少)")
BBS94KK.Execute("update [KK_user] Set BankSave=BankSave-"&Coin&",Coin=Coin+"&Coin&" where Name='"&BBS94KK.MyName&"'")
Session(BBS94KK.CacheName & "MyInfo") = Empty
Call Alert("恭喜!银行取款成功!")
End Sub
Sub Virement
Dim ToUserName,Sms,TmpUbbString
ToUserName=LCase(BBS94KK.Fun.GetStr("ToUserName"))
IF Not BBS94KK.Fun.CheckIn(ToUserName) Or ToUserName="" Then Call Alert("失败!查无此人,如果您实在想送出钱来的话,送给站长就好了!")
If Int(Coin) > Int(BBS94KK.MyBankSave) then call Alert("失败!你是不是好心过头啦?还是人家催债催得太紧,让你自己还有多少钱都不知道?!")
If ToUserName=LCase(BBS94KK.MyName) Then Call Alert("失败!给自己转帐很好玩吗?")
IF BBS94KK.Execute("Select Name From[KK_user] where Name='"&ToUserName&"'").Eof Then
Call Alert("失败!查无此人,如果您实在想送出钱来的话,送给站长就好了!")
End if
BBS94KK.Execute("Update [KK_user] Set BankSave=BankSave-"&Coin&" where LCase(Name)='"&LCase(BBS94KK.MyName)&"'")
Sms="天下掉下大馅饼啦,"&BBS94KK.MyName&"通过友情转帐赠送您"&Coin&"元现金!您可以到社区银行柜台查收!"&vbcrlf&"[right][color=#FF0000]「社区银行」自动送信系统[/color][/right]"
TmpUbbString=BBS94KK.Fun.UbbString(Sms)
BBS94KK.Execute("Update [KK_user] Set BankSave=BankSave+"&Coin&",NewSmsNum=NewSmsNum+1,SmsSize=SmsSize+"&Len(Sms)&" where Name='"&ToUserName&"'")
BBS94KK.execute("insert Into [KK_Sms](Name,Content,MyName,ubbString)VALUES('自动送信系统','"&Sms&"','"&ToUserName&"','"&TmpUbbString&"')")
Session(BBS94KK.CacheName & "MyInfo") = Empty
Call Alert("恭喜!转帐成功,系统已自动发信通知了您的朋友!")
End sub
Sub Alert(message)
message = replace(message,"'","\'")
Response.Write ("<script LANGUAGE='javascript'>alert('" & message & "');window.location.href='Bank.Asp';</script>")
Response.End
End Sub
Function BankPlacard()
Dim Temp,Rs,Arr_Rs,i
Cache.Name="BankPlacard"'缓存名称
If Cache.valid then'如果缓存有效
BankPlacard=Cache.Value
Else
Set Rs=BBS94KK.Execute("Select Content,AddTime From [KK_Sms] where MyName='银行公告' order by Id desc")
If Rs.Eof Or Rs.Bof Then
Exit Function
Else
Arr_Rs=Rs.GetRows(-1)
Rs.Close
For i=0 To Ubound(Arr_Rs,2)
Temp=Temp&" ·"&BBS94KK.Fun.HtmlCode(Arr_Rs(0,i))&" <font style='font-size:10px'>["&Arr_Rs(1,i)&"]</font> "
Next
Temp="<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td>银行公告:</td><td width='80%' align='center'><marquee width='80%' onMouseOver='this.stop()' onMouseOut='this.start()' scrollamount='3' direction='left'>"&Temp&"</marquee></td></tr></table>"
Cache.add Temp,dateadd("n",5000,now)
BankPlacard=Temp
End if
End if
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -