📄 cz.asp
字号:
'个人包月
pop_ps1m=rs("pop_ps1m")
vip_ps1m=rs("vip_ps1m")
pop_ps3m=rs("pop_ps3m")
vip_ps3m=rs("vip_ps3m")
pop_ps6m=rs("pop_ps6m")
vip_ps6m=rs("vip_ps6m")
'网吧包月
pop_pb1m=rs("pop_pb1m")
vip_pb1m=rs("vip_pb1m")
pop_pb3m=rs("pop_pb3m")
vip_pb3m=rs("vip_pb3m")
pop_pb6m=rs("pop_pb6m")
vip_pb6m=rs("vip_pb6m")
rs.close
if cint(request.form("cz_type"))=1 and cbool(request.form("cz_vip"))=false then
Select Case cint(request.form("cz_value"))
Case 100
cz_money=pop_100p
Case 300
cz_money=pop_300p
Case 600
cz_money=pop_600p
end select
end if
if cint(request.form("cz_type"))=1 and cbool(request.form("cz_vip"))=true then
Select Case cint(request.form("cz_value"))
Case 100
cz_money=vip_100p
Case 300
cz_money=vip_300p
Case 600
cz_money=vip_600p
end select
end if
if cint(request.form("cz_type"))=2 and cbool(request.form("cz_vip"))=false then
Select Case cint(request.form("cz_value2"))
Case 1
cz_money=pop_ps1m
Case 3
cz_money=pop_ps3m
Case 6
cz_money=pop_ps6m
end select
end if
if cint(request.form("cz_type"))=2 and cbool(request.form("cz_vip"))=true then
Select Case cint(request.form("cz_value2"))
Case 1
cz_money=vip_ps1m
Case 3
cz_money=vip_ps3m
Case 6
cz_money=vip_ps6m
end select
end if
if cint(request.form("cz_type"))=3 and cbool(request.form("cz_vip"))=false then
Select Case request.form("cz_value2")
Case 1
cz_money=ccur(pop_pb1m)*cint(request.form("pc_count"))
Case 3
cz_money=ccur(pop_pb3m)*cint(request.form("pc_count"))
Case 6
cz_money=ccur(pop_pb6m)*cint(request.form("pc_count"))
end select
end if
if cint(request.form("cz_type"))=3 and cbool(request.form("cz_vip"))=true then
Select Case request.form("cz_value2")
Case 1
cz_money=Ccur(vip_pb1m)*cint(request.form("pc_count"))
Case 3
cz_money=Ccur(vip_pb3m)*cint(request.form("pc_count"))
Case 6
cz_money=Ccur(vip_pb6m)*cint(request.form("pc_count"))
end select
end if
else
if cint(request.form("cz_type"))=3 and cbool(request.form("cz_vip"))=false then
Select Case request.form("cz_value2")
Case 1
cz_money=ccur(pop_pb1m)
Case 3
cz_money=ccur(pop_pb3m)
Case 6
cz_money=ccur(pop_pb6m)
end select
end if
if cint(request.form("cz_type"))=3 and cbool(request.form("cz_vip"))=true then
Select Case request.form("cz_value2")
Case 1
cz_money=Ccur(vip_pb1m)
Case 3
cz_money=Ccur(vip_pb3m)
Case 6
cz_money=Ccur(vip_pb6m)
end select
end if
my_money=(ccur(request.form("agent_money"))+ccur(request.form("agent_money2")))-ccur(cz_money)
a=Ccur(request.form("agent_money"))
b=Ccur(request.form("agent_money2"))
c=ccur(cz_money)
if ccur(my_money)<0 then
cz_result=false
else
set rs=server.createobject("adodb.recordset")
rs.open "select * from member where userid='"&request.form("member_id")&"'",conn,1,3
if cint(request.form("cz_type"))=1 then
rs("point")=rs("point")+cint(request.form("cz_value"))
end if
if cint(request.form("cz_type"))<>1 then
if Datediff("s",rs("end_time"),now())<0 then
rs("end_time")=DateAdd("m",cint(request.form("cz_value2")),rs("end_time"))
else
rs("end_time")=DateAdd("m",cint(request.form("cz_value2")),now())
end if
end if
rs.update
rs.close
set rs=server.createobject("adodb.recordset")
rs.open "select * from agents where agent_id='"&request.cookies("username")&"'",conn,1,3
if a-c<=0 then
b=b+(a-c)
a=0
else
a=a-c
end if
rs("agent_money")=a
if b<=0 then
rs("agent_money2")=0
else
rs("agent_money2")=b
end if
rs.update
rs.close
set rs=server.createobject("adodb.recordset")
rs.open "select * from cz_log where (id is null)",conn,1,3
rs.addnew
rs("agent_id")=request.cookies("username")
rs("member_id")=request.form("member_id")
rs("cz_type")=request.form("cz_type")
if cint(request.form("cz_type"))=1 then
rs("cz_value")=request.form("cz_value")
else
rs("cz_value")=request.form("cz_value2")
end if
rs("cz_vip")=CBool(request.form("cz_vip"))
rs("cz_money")=ccur(cz_money)
rs.update
rs.close
set rs=server.createobject("adodb.recordset")
rs.open "select @@identity AS 'cz_log'",conn,1,1
link_id=rs(0)
rs.close
set rs=server.createobject("adodb.recordset")
rs.open "select * from money_stat where (id is null)",conn,1,3
rs.addnew
rs("money_type")=2
rs("link_id")=link_id
rs("money_count")=cz_money
rs.update
rs.close
Session.Contents.Remove("cz")
cz_result=true
end if
%>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
<table width="500" height="50" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center">[<a href="agent_index.asp">管理中心首页</a>] [<a href="edit.asp">修改资料</a>] [<span class="font3">账号充值</span>] [<a href="cz_log.asp">充值记录</a>] [<a href="login.asp?action=logout">注销登陆</a>]</td>
</tr>
</table>
<table width="500" height="25" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#3975CE">
<tr>
<td align="center" class="font1"><strong class="font1">用户账号充值</strong></td>
</tr>
</table>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
<tr>
<td align="center" valign="top" bgcolor="#F7F7F7"><table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table width="400" height="25" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><%if cz_result=true then%>
<strong>充值成功</strong>
<%else%><span class="font3"><strong>您的代理预付金和可透支金额的总数已不足以进行本次充值</strong></span>
<%end if%></td>
</tr>
</table>
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20">充值类型:<%if request.form("cz_type")=1 then%>个人计点<%end if%><%if request.form("cz_type")=2 then%>个人包月<%end if%><%if request.form("cz_type")=3 then%>网吧包月<%end if%></td>
</tr>
<tr>
<td height="20">充值数量:<%if request.form("cz_type")=1 then%><%=request.form("cz_value")%> 点<%end if%><%if request.form("cz_type")<>1 then%><%=request.form("cz_value2")%> 个月<%end if%></td>
</tr>
<tr>
<td height="20">VIP用户充值:<%if cbool(request.form("cz_vip"))=true then%>是<%else%>否<%end if%></td>
</tr>
<tr>
<td height="20">充值所需金额:<%=cz_money%> 元</td>
</tr>
<tr>
<td height="20">剩余代理预付金额:<%=a%> 元</td>
</tr>
<tr>
<td height="20">剩余可透支金额:<%=b%> 元</td>
</tr>
<%if cz_result=true then%>
<tr>
<td height="25" align="center">[被充值用户账号信息]</td>
</tr>
<tr>
<td height="20">被充值的账号:<%=request.form("member_id")%></td>
</tr>
<%
set rs=server.createobject("adodb.recordset")
rs.open "select * from member where userid='"&request.form("member_id")&"'",conn,1,3
point=rs("point")
end_time=rs("end_time")
u_type=rs("u_type")
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<tr>
<td height="20">用户类型:<%if u_type=1 then%>个人计点用户<%end if%><%if u_type=2 then%>个人包月用户<%end if%><%if u_type=3 then%>网吧包月用户<%end if%></td>
</tr>
<%if cint(request.form("cz_type"))=1 then%>
<tr>
<td height="20">可用点数:<%=point%> 点</td>
</tr>
<%end if%>
<%if cint(request.form("cz_type"))<>1 then%>
<tr>
<td height="20">到期时间:<%=end_time%></td>
</tr>
<%end if%>
<tr>
<td> </td>
</tr>
</table>
</td>
</tr>
<%end if%>
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
</table>
<%end sub%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -