📄 shop.asp
字号:
<!-- #include file="setup.asp" -->
<%
top
if Request.Cookies("username")=empty then error("<li>您还未<a href=login.asp>登录</a>社区")
sql="select * from [user] where username='"&Request.Cookies("username")&"'"
rs.Open sql,Conn,1,3
money=rs("money")
experience=rs("experience")
rs.close
select case Request("menu")
case "colony"
if ""&Request("sessionid")&""<>""&session.sessionid&"" then error("<li>效验码错误<li>请重新返回刷新后再试")
content=HTMLEncode(Request("content"))
howmoney=conn.execute("Select count(sessionid)from online where username<>''")(0)*10
if content="" then error("<li>请填写群发内容!")
if money<howmoney then error("<li>您的金币不够!<li>本次共需 "&howmoney&" 金币")
conn.execute("update [user] set [money]=[money]-"&howmoney&" where username='"&Request.Cookies("username")&"'")
sql="select username from online where username<>''"
Set Rs=Conn.Execute(sql)
do while not rs.eof
conn.Execute("insert into message (author,incept,content) values ('"&Request.Cookies("username")&"','"&rs("username")&"','<font color=0000FF>【会员广播】:"&content&"</font>')")
conn.execute("update [user] set newmessage=newmessage+1 where username='"&rs("username")&"'")
rs.movenext
loop
Set Rs = Nothing
error2("发送成功!\n\n共花费 "&howmoney&" 金币")
case "thew"
if money<100 then error("<li>您的金币不够!")
userlife=Conn.Execute("Select userlife From [user] where username='"&Request.Cookies("username")&"'")(0)
if userlife=100 then error("<li>体力已满,无需增加!")
conn.execute("update [user] set userlife=100,[money]=[money]-100 where username='"&Request.Cookies("username")&"'")
error2("您的体力已经全满!")
case "flowers"
if money<50 then error("<li>您的金币不够!")
vs=HTMLEncode(Request("vs"))
if vs=Request.Cookies("username") then error("<li>不能自己送自己!")
if Application(CacheName&"flowers")=vs then error("<li>请勿对同一个用户进行操作!")
If conn.Execute("Select id From [user] where username='"&vs&"'" ).eof Then error("<li>系统不存在"&vs&"的资料")
conn.execute("update [user] set [money]=[money]-50 where username='"&Request.Cookies("username")&"'")
Randomize
d1=fix(rnd*50)+1
conn.execute("update [user] set experience=experience+"&d1&" where username='"&vs&"'")
sql="insert into message(author,incept,content) values ('"&Request.Cookies("username")&"','"&vs&"','<font color=0000FF>【系统消息】:"&Request.Cookies("username")&"送您1束鲜花,您增加了"&d1&"点经验值!</font>')"
conn.Execute(SQL)
conn.execute("update [user] set newmessage=newmessage+1 where username='"&vs&"'")
Application(CacheName&"flowers") = vs
error2(""&vs&"已经增加了"&d1&"点经验值!")
case "egg"
if money<50 then error("<li>您的金币不够!")
vs=HTMLEncode(Request("vs"))
if vs=Request.Cookies("username") then error("<li>不能自己送自己!")
if Application(CacheName&"egg")=vs then error("<li>请勿对同一个用户进行操作!")
If conn.Execute("Select id From [user] where username='"&vs&"'" ).eof Then error("<li>系统不存在"&vs&"的资料")
If conn.Execute("Select experience From [user] where username='"&vs&"'" )(0)<50 Then error("<li>对方经验值少于50,您不能再向他(她)丢鸡蛋了")
conn.execute("update [user] set [money]=[money]-50 where username='"&Request.Cookies("username")&"'")
Randomize
d1=fix(rnd*50)+1
conn.execute("update [user] set experience=experience-"&d1&" where username='"&vs&"'")
sql="insert into message(author,incept,content) values ('"&Request.Cookies("username")&"','"&vs&"','<font color=0000FF>【系统消息】:"&Request.Cookies("username")&"送您1粒鸡蛋,您减少了"&d1&"点经验值!</font>')"
conn.Execute(SQL)
conn.execute("update [user] set newmessage=newmessage+1 where username='"&vs&"'")
Application(CacheName&"egg") = vs
error2(""&vs&"已经减少了"&d1&"点经验值!")
end select
content=replace(server.htmlencode(Request("content")), "'", "'")
sql="select * from [user] where username='"&Request.Cookies("username")&"'"
rs.Open sql,Conn,1,3
select case Request("menu")
case "send"
touser=Request.form("touser")
if touser=Request.Cookies("username") then error2("不能自己送自己!")
If conn.Execute("Select id From [user] where username='"&touser&"'" ).eof Then
error2("系统不存在这个用户的资料")
end if
if rs("money")<500 then
error2("您的金币不够500!")
end if
rs("money")=rs("money")-500
rs.update
rs.close
case "w1"
if money<40 then error("<li>您的金币不够!")
if userlife<10 then error("<li>您的体力欠佳,别太劳累了,休息会吧!")
conn.execute("update [user] set userlife=userlife-10,[money]=[money]-40,experience=experience+60 where username='"&Request.Cookies("username")&"'")
error2("恭喜你,经过辛勤工作,你共增加:经验值60点,减少:金币40个、体力10点")
case "w2"
if money<20 then error("<li>您的金币不够!")
if userlife<25 then error("<li>您的体力欠佳,别太劳累了,休息会吧!")
conn.execute("update [user] set userlife=userlife-25,[money]=[money]-20,experience=experience+55 where username='"&Request.Cookies("username")&"'")
error2("恭喜你,经过辛勤工作,你共增加:经验值55点,减少:金币20个、体力25点")
case "w3"
if userlife<50 then error("<li>您的体力欠佳,别太劳累了,休息会吧!")
conn.execute("update [user] set userlife=userlife-50,experience=experience+5,[money]=[money]+55 where username='"&Request.Cookies("username")&"'")
error2("恭喜你,经过辛勤工作,你共增加:金币55个、经验值5点,减少:体力50点")
case "w4"
if userlife<40 then error("<li>您的体力欠佳,别太劳累了,休息会吧!")
conn.execute("update [user] set userlife=userlife-40,experience=experience+10,[money]=[money]+40 where username='"&Request.Cookies("username")&"'")
error2("恭喜你,经过辛勤工作,你共增加:金币40个、经验值10点,减少:体力40点")
case "w5"
if userlife<35 then error("<li>您的体力欠佳,别太劳累了,休息会吧!")
conn.execute("update [user] set userlife=userlife-35,experience=experience+5,[money]=[money]+40 where username='"&Request.Cookies("username")&"'")
error2("恭喜你,经过辛勤工作,你共增加:金币40个、经验值5点,减少:体力35点")
case "w6"
if userlife<30 then error("<li>您的体力欠佳,别太劳累了,休息会吧!")
conn.execute("update [user] set userlife=userlife-30,experience=experience+20,[money]=[money]+20 where username='"&Request.Cookies("username")&"'")
error2("恭喜你,经过辛勤工作,你共增加:金币20个、经验值20点,减少:体力30点")
'''''''''''''''''''改名开始''''''''''''''''
case "kill"
n2=HTMLEncode(Request("n2"))
n1=HTMLEncode(Request("n1"))
vs=HTMLEncode(Request("vs"))
'''''''''''''''''''需要的一些体力金钱''''''''''''''''
if membercode < 5 then error2("只有城主才能给人改名")
if n2=n1 then error("<li>名字相同!")
If conn.Execute("Select id From [user] where username='"&n1&"'" ).eof Then
error("<li>系统不存在"&n1&"的资料")
end if
If conn.Execute("Select id From [user] where username='"&n2&"'" ).eof Then
conn.execute("update [user] set username="&n2&" where username='"&n1&"'")
Application(CacheName&"kill") = n2
error2(""&n1&"已经改成"&n2&"!")
end if
'新增物品
case "diamond"
p1=HTMLEncode(Request("p1"))
if p1=Request.Cookies("username") then error("<li>不能自己送自己!")
if Application(CacheName&"diamond")=p1 then error("<li>请勿对同一个用户进行操作!")
If conn.Execute("Select id From [user] where username='"&p1&"'" ).eof Then
error("<li>系统不存在"&p1&"的资料")
end if
if rs("money")<728 then
error("<li>您的金币不够!")
end if
rs("money")=rs("money")-728
rs.update
rs.close
conn.execute("update [user] set savemoney=savemoney+"&688&" where username='"&p1&"'")
sql="insert into message(author,incept,content) values ('"&Request.Cookies("username")&"','"&p1&"','【系统消息】:"&Request.Cookies("username")&"送您1颗钻石戒指,您的存款中增加了688的金币!')"
conn.Execute(SQL)
conn.execute("update [user] set newmessage=newmessage+1 where username='"&p1&"'")
Application(CacheName&"diamond") = p1
error2(""&p1&"已增加了688的金币!")
'新增物品
case "tv"
p2=HTMLEncode(Request("p2"))
if p2=Request.Cookies("username") then error("<li>不能自己送自己!")
if Application(CacheName&"tv")=p2 then error("<li>请勿对同一个用户进行操作!")
If conn.Execute("Select id From [user] where username='"&p2&"'" ).eof Then
error("<li>系统不存在"&p2&"的资料")
end if
if rs("money")<588 then
error("<li>您的金币不够!")
end if
rs("money")=rs("money")-588
rs.update
rs.close
conn.execute("update [user] set savemoney=savemoney+"&588&" where username='"&p2&"'")
sql="insert into message(author,incept,content) values ('"&Request.Cookies("username")&"','"&p2&"','【系统消息】:"&Request.Cookies("username")&"送您1台全新彩电,您的存款中增加了588的金币!')"
conn.Execute(SQL)
conn.execute("update [user] set newmessage=newmessage+1 where username='"&p2&"'")
Application(CacheName&"tv") = p2
error2(""&p2&"已增加了588的金币!")
'新增物品
case "redbao"
p3=HTMLEncode(Request("p3"))
if p3=Request.Cookies("username") then error("<li>不能自己送自己!")
if Application(CacheName&"redbao")=p3 then error("<li>请勿对同一个用户进行操作!")
If conn.Execute("Select id From [user] where username='"&p3&"'" ).eof Then
error("<li>系统不存在"&p3&"的资料")
end if
if rs("money")<600 then
error("<li>您的金币不够!")
end if
rs("money")=rs("money")-600
rs.update
rs.close
conn.execute("update [user] set savemoney=savemoney+"&588&" where username='"&p3&"'")
sql="insert into message(author,incept,content) values ('"&Request.Cookies("username")&"','"&p3&"','【系统消息】:"&Request.Cookies("username")&"送您1个大大的红包,您的存款中增加了588的金币!')"
conn.Execute(SQL)
conn.execute("update [user] set newmessage=newmessage+1 where username='"&p3&"'")
Application(CacheName&"redbao") = p3
error2(""&p3&"已增加了588的金币!")
'新增物品
case "rose"
p4=HTMLEncode(Request("p4"))
if p4=Request.Cookies("username") then error("<li>不能自己送自己!")
if Application(CacheName&"rose")=p4 then error("<li>请勿对同一个用户进行操作!")
If conn.Execute("Select id From [user] where username='"&p4&"'" ).eof Then
error("<li>系统不存在"&p4&"的资料")
end if
if rs("money")<20 then
error("<li>您的金币不够!")
end if
rs("money")=rs("money")-20
rs.update
rs.close
conn.execute("update [user] set savemoney=savemoney+"&18&" where username='"&p4&"'")
sql="insert into message(author,incept,content) values ('"&Request.Cookies("username")&"','"&p4&"','【系统消息】:"&Request.Cookies("username")&"送您1朵浪漫的玫瑰,您的存款中增加了18的金币!')"
conn.Execute(SQL)
conn.execute("update [user] set newmessage=newmessage+1 where username='"&p4&"'")
Application(CacheName&"rose") = p4
error2(""&p4&"已增加了18的金币!")
'新增物品
case "choco"
p5=HTMLEncode(Request("p5"))
if p5=Request.Cookies("username") then error("<li>不能自己送自己!")
if Application(CacheName&"choco")=p5 then error("<li>请勿对同一个用户进行操作!")
If conn.Execute("Select id From [user] where username='"&p5&"'" ).eof Then
error("<li>系统不存在"&p5&"的资料")
end if
if rs("money")<30 then
error("<li>您的金币不够!")
end if
rs("money")=rs("money")-30
rs.update
rs.close
conn.execute("update [user] set savemoney=savemoney+"&28&" where username='"&p5&"'")
sql="insert into message(author,incept,content) values ('"&Request.Cookies("username")&"','"&p5&"','【系统消息】:"&Request.Cookies("username")&"送您1盒金沙巧克力,您的存款中增加了28的金币!')"
conn.Execute(SQL)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -