%
<%
If request.cookies("timesshop")("username")="" Then
Response.Write ""
end if%>
select case FormatSQL(SafeRequest("action",0))
case "vipscore"
vipscore
case "uptovip"
uptovip
case "chgscore"
chgscore
end select
sub vipscore
%>
<%=webname%>--VIP会员资格和推荐会员奖励
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select webimg11,webimg13,webimg14 from config",conn,1,1
%>
<%rs.close
set rs=nothing
conn.close
set conn = nothing
end sub
sub uptovip
dim strvipscore,strscore
set rs=server.CreateObject("adodb.recordset")
rs.open "select webimg14 from config",conn,1,1
if not isnumeric(rs("webimg14")) then
response.Write ""
rs.close
set rs=nothing
conn.close
set conn = nothing
response.End
end if
strvipscore = CLng(rs("webimg14"))
rs.close
rs.open "select score,vip from [user] where username='"&request.cookies("timesshop")("username")&"' ",conn,1,3
if rs("vip")=true then
response.Write ""
rs.close
set rs=nothing
conn.close
set conn = nothing
response.End
else
strscore = CLng(rs("score"))
if strscore>=strvipscore then
rs("vip")=true
rs("score")=strscore-strvipscore
rs.update
rs.close
set rs=nothing
conn.close
set conn = nothing
response.Write ""
response.end
else
rs.close
set rs=nothing
conn.close
set conn = nothing
response.Write ""
response.end
end if
end if
end sub
sub chgscore
dim strdeposit,strscore,strchg
if not isnumeric(request.form("strchg")) then
response.Write ""
conn.close
set conn = nothing
response.end
end if
strchg=ABS(CLng(request.form("strchg")))
set rs=server.CreateObject("adodb.recordset")
rs.open "select score,deposit from [user] where username='"&request.cookies("timesshop")("username")&"' ",conn,1,3
strscore=CLng(rs("score"))
strdeposit=rs("deposit")
if strchg>strscore then
rs.close
set rs=nothing
conn.close
set conn = nothing
response.Write ""
response.End
else
rs("deposit")=strdeposit+strchg
rs("score")=strscore-strchg
rs.update
rs.close
set rs=nothing
conn.close
set conn = nothing
response.Write ""
response.End
end if
end sub
%>