📄 hbsendok.asp
字号:
<%@ LANGUAGE=VBScript.Encode codepage ="936" %>
<%Response.Buffer = True
Response.Expires = 0
Response.CacheControl = "Private"
Sub Msg (v)
Response.Write "<html><head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><meta http-equiv='pragma' content='no-cache'><style type=text/css>body{color:black;font-family:宋体;font-size:9pt;background-color:buttonface;border-bottom:medium none;border-left:medium none;border-right:medium none;border-top:medium none;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px}</style></head><body leftMargin=0 topMargin=0 marginheight=0 marginwidth=0>"
Response.Write "<script Language=JavaScript>alert('" & v & "');history.go(-1);</script></body></html>"
Response.End
End Sub
userip=Request.ServerVariables("REMOTE_ADDR")
nickname=Session("hxf_u_nickname")
cess=Application("wsaxhxf_c_cess")
If nickname = "" Then Msg "不在聊天室中,不能货币流通。"
If Session("hxf_u_inthechat")<>"1" Then Msg "不在聊天室中,不能货币流通。"
id = Trim(Request.Form("acname"))
If id = "" Then Msg "指定的用户名不存在!"
If nickname = id Then Msg "不能在自己的帐号中流通。"
If Server.HTMLEncode(id)<>id Or InStr(id, "|")<>0 Or InStr(id, "'")<>0 Or InStr(id, Chr(34))<>0 Then Msg "指定的用户名不存在!"
sendhb=Trim(Request.Form("sendhb"))
If sendhb = "" Then Msg "请输入要流通的金额。"
If Not IsNumeric(sendhb) Then Msg "流通金额必须为大于 100 的整数。"
f5 = Int(sendhb)
If sendhb < 100 Then Msg "流通金额必须为大于 100 的整数。"
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
connstr=Application("wsaxhg_connstr")
conn.open connstr
sql = "SELECT username, hb FROM reginfo WHERE kill = '0' AND grade > 0 AND username = '" & id & "'"
rs.Open sql, conn, 1, 1
If rs.Eof And rs.Bof Then
rs.Close
conn.Close
Set rs = Nothing
Set conn = Nothing
Msg "指定的用户名不存在!"
End If
id = rs("username")
idhb = Int(rs("hb"))
rs.Close
sql = "SELECT username, hb FROM reginfo WHERE kill = '0' AND grade > 0 AND username = '" & nickname & "'"
rs.Open sql, conn, 1, 1
If rs.Eof And rs.Bof Then
rs.Close
conn.Close
Set rs = Nothing
Set conn = Nothing
Msg "你的帐号不存在或被禁用,请重新登录!"
End If
yhb=int(rs("hb"))
rs.Close
If idhb>yhb Then
conn.Close
Set rs = Nothing
Set conn = Nothing
Msg "对方的货币比你多,不能流通给对方。"
End If
If yhb < 100 Then
conn.Close
Set rs = Nothing
Set conn = Nothing
Msg "你的货币只有 " & yhb & "¥,不能流通。"
End If
If yhb - idhb < 100 Then
conn.Close
Set rs = Nothing
Set conn = Nothing
Msg "你的货币只比对方多 " & (yhb - idhb) & "¥,不能流通。"
End If
x = round((myhb - toidhb)/((200 - cess)/100))
If x > yhb Then x = yhb
If f5v > x Then
conn.Close
Set rs = Nothing
Set conn = Nothing
Msg "你最多只能流通 " & x & "¥ 给对方。"
End If
y = Round(sendhb * (100 - cess) / 100)
z = Round(sendhb * (cess / 100))
sql = "SELECT hb FROM reginfo WHERE kill = '0' AND grade > 0 AND username = '" & nickname & "'"
rs.Open sql, conn, 1, 3
hb = yhb - sendhb
rs("hb") = hb
rs.Update
Session("hxf_u_hb")=hb
rs.Close
sql = "SELECT hb FROM reginfo WHERE kill = '0' AND grade > 0 AND username = '" & id & "'"
rs.Open sql, conn, 1, 3
rs("hb") = idhb + y
rs.Update
rs.Close
sql = "SELECT value FROM system WHERE name='chatmoney'"
rs.open sql, conn, 1, 3
chatmoney = Int(rs("value")) + z
rs("value") = chatmoney
rs.Update
rs.Close
Application.Lock
Application("wsaxhxf_c_chatmoney") = chatmoney
Application.UnLock
Set rs = Nothing
n=Year(date())
y=Month(date())
r=Day(date())
s=Hour(time())
f=Minute(time())
m=Second(time())
if len(y)=1 then y="0" & y
if len(r)=1 then r="0" & r
if len(s)=1 then s="0" & s
if len(f)=1 then f="0" & f
if len(m)=1 then m="0" & m
t=s & ":" & f & ":" & m
sj=n & "-" & y & "-" & r & " " & t
sql = "INSERT INTO logs (type, logtime, name, ip, opertion) VALUES ('1', '" & sj & "', '" & nickname & "', '" & userip & "', '赠送 <font color=red>" & sendhb & "¥</font> 货币给 <font color=blue>" & id & "</font> 上缴税款 <font color=red> " & z & "¥</font> 对方实得 <font color=red>" & (sendhb-z) & "¥</font>。')"
conn.Execute sql
conn.close
set conn=nothing
Response.Write "<html><head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><meta http-equiv='pragma' content='no-cache'><style type=text/css>body{color:black;font-family:宋体;font-size:9pt;background-color:buttonface;border-bottom:medium none;border-left:medium none;border-right:medium none;border-top:medium none;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px}</style></head><body leftMargin=0 topMargin=0 marginheight=0 marginwidth=0>"
Response.Write "<script Language=JavaScript>alert('■ 操作完成 ■\n\n你已经流通:" & sendhb & "¥。剩余金额:" & hb & "¥。\n\n对方已得到:" & (sendhb-z) & "¥。总金额为:" & (idhb + sendhb-z) & "¥。\n\n交纳货币流通税" & z &"¥');window.close();</script></body></html>"
Response.End
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -