Bank.Asp
上传用户:btntkt
上传日期:2021-04-16
资源大小:5296k
文件大小:9k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

DOS

  1. <!--#include file="Inc/SysConfig.Asp"-->
  2. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  3. <%
  4. Const int_rate=0.0005 '银行利率
  5. Dim Coin,mark
  6. If Not YxBBs.Founduser Then YxBBs.Error("您还没有注册或者登陆!")
  7. Coin=YxBBs.Fun.GetStr("Coin")
  8. mark=YxBBs.Fun.GetStr("mark")
  9. If Coin<>"" Then If Not YxBBs.Fun.isInteger(Coin) then Call Alert("请输入正确的金额!")
  10. Select Case Request.QueryString("Action")
  11. Case "Save"
  12. Save
  13. Case "Draw"
  14. Draw
  15. Case "Virement"
  16. Virement
  17. Case"Convert"
  18. Convert
  19. Case "Zhanhuan"
  20. Zhanhuan
  21. Case "Zhanhuan1"
  22. Zhanhuan1
  23. Case Else
  24. Main
  25. End Select
  26. YxBBs.Footer()
  27. Set YxBBs=Nothing
  28. Function GetInterest()
  29. Dim Interest,Rs
  30. IF Session(YxBBs.CacheName & "Bank")="" Then
  31. Set Rs=YxBBs.Execute("select Coin,BankSave,Banktime from [YX_user] where Name='"&YxBBs.MyName&"' and password='"&YxBBs.MyPwd&"'")
  32. If Rs.Eof Then YxBBs.Error("您操作的参数错误!")
  33. If Day(Rs(2))<>Day(YxBBs.NowBbsTime) then
  34. Interest=ccur(ccur(rs(1))*int(Datediff("d",cdate(rs("banktime")),cdate(YxBBs.NowBbsTime)))*int_rate)
  35. YxBBs.Execute("Update [YX_user] Set BankSave=BankSave+"&Interest&",BankTime='"&YxBBs.NowBbsTime&"' where Name='"&YxBBs.MyName&"' ")
  36. '更新缓存
  37. Session(YxBBs.CacheName & "MyInfo") = Empty
  38. YxBBs.UserLoginTrue
  39. Else
  40. Interest=0
  41. End If
  42. Rs.Close
  43. Session(YxBBs.CacheName & "Bank")=Interest
  44. GetInterest=Interest
  45. Else
  46. GetInterest=Session(YxBBs.CacheName & "Bank")
  47. End IF
  48. End Function
  49. Sub Main
  50. Call YxBBs.Head("论坛银行")
  51. Dim Interest,Content
  52. Interest=GetInterest()
  53. 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>"&_
  54. "<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;'>"&_
  55. "<tr><td height='25' bgcolor='#E8E8E8' colspan=2>财务状况&nbsp;[存款利率:<font color=red>"&int_rate*1000&"</font>‰|&nbsp;"&YxBBs.BBSSetting(23)&":金钱=1:<font color=red>100</font>]</td></tr>"&_
  56. "<tr><td width='15%'>&nbsp;银行户主:</td><td width='39%'><b>"&YxBBs.MyName&"</b></td></tr>"&_
  57. "<tr><td>&nbsp;存款(含利息):</td><td><b><font color='red'>"&YxBBs.MyBankSave&"</font></b> 元</td></tr>"&_
  58. "<tr><td>&nbsp;今日结算利息:</td><td><b><font color='red'>"&Interest&"</font></b> 元</td></tr>"&_
  59. "<tr><td>&nbsp;持有现金:</td><td><b><font color='Red'>"&YxBBs.MyCoin&"</font></b> 元</td></tr>"&_
  60. "<tr><td>&nbsp;个人资金总共:</td><td><b><font color='red'>"&Ccur(YxBBs.MyBankSave)+Ccur(YxBBs.MyCoin)&"</font></b> 元</td></tr>"&_
  61. "</table></td></tr></table>"&_
  62. "<table width='100%' border='0' cellPadding='0' cellSpacing='0'><tr><td>"&_
  63. "<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;'>"&_
  64. "<tr><td height='25' bgcolor='#E8E8E8'>存款柜台</td></tr>"&_
  65. "<tr><td>&nbsp;现金:<b><font color=red>"&YxBBs.MyCoin&"</font></b> 元</td></tr>"&_
  66. "<tr><td align='center'>存储:<input size='10' value='1000' name='Coin'>元&nbsp;&nbsp;<input type='submit'  value=' 存钱 '></td></tr></table></form>"&_
  67. "</td><td>"&_
  68. "<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;'>"&_
  69. "<tr><td height='25' bgcolor='#E8E8E8'>支取柜台</td></tr>"&_
  70. "<tr><td>&nbsp;存款:<b><font color=Red>"&YxBBs.MyBankSave&"</font></b> 元</td></tr>"&_
  71. "<tr><td align='center'>支取 <input size='10' value='1000' name='Coin'> 元&nbsp;&nbsp;<input type='submit'  value=' 支取 '></td></tr></table></form>"&_
  72. "</td><td>"&_
  73. "<form action='?Action=Zhanhuan' 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;'>"&_
  74. "<tr><td height='25' bgcolor='#E8E8E8'>金钱换"&YxBBs.BBSSetting(23)&"</td></tr>"&_
  75. "<tr><td>&nbsp;现金:<b><font color=red>"&YxBBs.MyCoin&"</font></b> 元</td></tr>"&_
  76. "<tr><td align='center'>转换 <input size='10' value='100' name='Coin'> 元&nbsp;&nbsp;<input type='submit'  value=' 转换 '></td></tr></table></form>"&_
  77.         "</td><td>"&_
  78. "<form action='?Action=Zhanhuan1' 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;'>"&_
  79. "<tr><td height='25' bgcolor='#E8E8E8'>"&YxBBs.BBSSetting(23)&"换金钱</td></tr>"&_
  80. "<tr><td>&nbsp;"&YxBBs.BBSSetting(23)&":<b><font color=red>"&YxBBs.Mymark&"</font></b> 个</td></tr>"&_
  81. "<tr><td align='center'>转换 <input size='10' value='10' name='mark'> 个&nbsp;&nbsp;<input type='submit'  value=' 转换 '></td></tr></table></form>"&_
  82. "</td><td>"&_
  83. "<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;'>"&_
  84. "<tr><td height='25' bgcolor='#E8E8E8'>转帐柜台</td></tr>"&_
  85. "<tr><td>&nbsp;把存款转帐给好友</td></tr>"&_
  86. "<tr><td align='center'><input size='5' value='1000' name='Coin'>元&nbsp;给<input size='5' name='ToUserName'>&nbsp<input type='submit' value=' 转帐 '></td></tr></table></form>"&_
  87. "</td></tr><tr><td colspan=4><br>&nbsp;&nbsp;1.目前银行的存款利率:.<font color=red>"&int_rate*1000&"</font>‰<br>&nbsp;&nbsp;2."&YxBBs.BBSSetting(23)&"与金钱交换的比率为<font color=red>1:100</font>,注意一次转换最少输入<font color=red>100</font><br><br></td></tr></table>"
  88. Call YxBBs.ShowTable("论坛银行",Content)
  89. End Sub
  90. Sub Save
  91. If Coin="" Then Call Alert("失败!请输入存款的金额!")
  92. If Int(Coin) > Int(YxBBs.MyCoin) Then Call Alert("失败!金额不足!")
  93. YxBBs.Execute("update [YX_user] Set BankSave=BankSave+"&Coin&",Coin=Coin-"&Coin&" where Name='"&YxBBs.MyName&"'")
  94. Session(YxBBs.CacheName & "MyInfo") = Empty
  95. Call Alert("恭喜!银行存款成功!")
  96. End sub
  97. Sub Zhanhuan
  98. If Coin="" or Int(Coin) <100  Then Call Alert("失败!未输入要转换的金额或金额小于100!")
  99. If Int(Coin) > Int(YxBBs.MyCoin) Then Call Alert("失败!金额不足!")
  100. YxBBs.Execute("update [YX_user] Set mark=mark+"&Coin&"/100,Coin=Coin-"&Coin&" where Name='"&YxBBs.MyName&"'")
  101. Session(YxBBs.CacheName & "MyInfo") = Empty
  102. Call Alert("恭喜!转换成功,本次操作增加"&Coin/100&""&YxBBs.BBSSetting(23)&",减少了"&Coin&"金钱")
  103. End sub
  104. Sub Zhanhuan1
  105. If mark="" or Int(mark) <1  Then Call Alert("失败!未输入要转换的金额或金额小于1!")
  106. If Int(mark) > Int(YxBBs.Mymark) Then Call Alert("失败!金额不足!")
  107. YxBBs.Execute("update [YX_user] Set mark=mark-"&mark&",Coin=Coin+"&mark*100&" where Name='"&YxBBs.MyName&"'")
  108. Session(YxBBs.CacheName & "MyInfo") = Empty
  109. Call Alert("恭喜!转换成功,本次操作增加"&mark*100&"金钱,减少了"&mark&""&YxBBs.BBSSetting(23)&"")
  110. End sub
  111. Sub Draw
  112. If Coin="" Then Call Alert("失败!请输入取款的金额!")
  113. If int(Coin) > Int(YxBBs.MyBankSave) Then Call Alert("失败!金额不足!")
  114. YxBBs.Execute("update [YX_user] Set BankSave=BankSave-"&Coin&",Coin=Coin+"&Coin&" where Name='"&YxBBs.MyName&"'")
  115. Session(YxBBs.CacheName & "MyInfo") = Empty
  116. Call Alert("恭喜!银行取款成功!")
  117. End Sub
  118. Sub Virement
  119. Dim ToUserName,Sms,TmpUbbString
  120. ToUserName=LCase(YxBBs.Fun.GetStr("ToUserName"))
  121. IF Not YxBBs.Fun.CheckIn(ToUserName) Or ToUserName="" Then Call Alert("失败!查无此人!")
  122. If Int(Coin) > Int(YxBBs.MyBankSave) then call Alert("失败!金额不足!")
  123. If ToUserName=LCase(YxBBs.MyName) Then Call Alert("失败!不能给自己转帐!")
  124. IF YxBBs.Execute("Select Name From[YX_user] where Name='"&ToUserName&"'").Eof Then
  125.     Call Alert("失败!查无此人!")
  126. End if
  127. YxBBs.Execute("Update [YX_user] Set BankSave=BankSave-"&Coin&" where LCase(Name)='"&LCase(YxBBs.MyName)&"'")
  128. Sms=""&YxBBs.MyName&"通过转帐中心转给您"&Coin&"元现金!您可以到社区银行柜台查收!"&vbcrlf&"[right][color=#FF0000]「社区银行」系统消息[/color][/right]"
  129. TmpUbbString=YxBBs.Fun.UbbString(Sms)
  130. YxBBs.Execute("Update [YX_user] Set BankSave=BankSave+"&Coin&",NewSmsNum=NewSmsNum+1,SmsSize=SmsSize+"&Len(Sms)&" where Name='"&ToUserName&"'")
  131. YxBBs.execute("insert Into [YX_Sms](Name,Title,Content,MyName,ubbString)VALUES('系统消息','来自银行的系统信息','"&Sms&"','"&ToUserName&"','"&TmpUbbString&"')")
  132. Session(YxBBs.CacheName & "MyInfo") = Empty
  133. Call Alert("恭喜!转帐成功,系统已自动发信通知了您的朋友!")
  134. End sub
  135. Sub Alert(message)
  136. message = replace(message,"'","'")
  137. Response.Write ("<script LANGUAGE='javascript'>alert('" & message & "');window.location.href='Bank.Asp';</script>")
  138. Response.End
  139. End Sub
  140. %>