📄 card_add.asp
字号:
<!--#include file="chklogin.asp"-->
<%
call myobj.chkrq()
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>生成新影卡</title>
<link href="images/style2.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
}
a:link {
color: #0000FF;
text-decoration: none;
}
a:visited {
color: #0000FF;
text-decoration: none;
}
a:hover {
color: #FF0000;
text-decoration: underline;
}
a:active {
text-decoration: none;
}
-->
</style>
<script language="vbscript">
function show_card_value()
if form1.card_type.value="" or isnull(form1.card_type.value) or IsEmpty(form1.card_type.value) then
document.GetElementById("card_value").style.display="none"
document.GetElementById("card_value2").style.display="none"
document.GetElementById("tb_pc_count").style.display="none"
document.GetElementById("card_value3").style.display="inline"
end if
if form1.card_type.value<>"" and isnull(form1.card_type.value)=false and IsEmpty(form1.card_type.value)=false then
if form1.card_type.value=1 then
document.GetElementById("card_value").style.display="inline"
document.GetElementById("card_value2").style.display="none"
document.GetElementById("card_value3").style.display="none"
end if
if form1.card_type.value=2 or form1.card_type.value=3 then
document.GetElementById("card_value").style.display="none"
document.GetElementById("card_value2").style.display="inline"
document.GetElementById("card_value3").style.display="none"
end if
if form1.card_type.value=3 then
document.GetElementById("tb_pc_count").style.display="inline"
else
document.GetElementById("tb_pc_count").style.display="none"
end if
end if
end function
</script>
</head>
<body leftMargin="0" topMargin="0" bgcolor="#FFFFFF">
<%
action_e=request.QueryString("action")
Select Case action_e
Case ""
Call main()
Case "make_card"
Call make_card()
end select
%>
<%
sub main()
%>
<form name="form1" method="post" target="_blank" action="<%=filename%>?action=make_card">
<table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
<table width="400" 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="400" height="190" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
<tr>
<td align="center" bgcolor="#F7F7F7"><table width="350" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="150" height="25" align="right">影卡种类:</td>
<td><select name="card_type" class="select1" id="card_type" onChange="vbscript:show_card_value()">
<option selected>请选择</option>
<option value="1">个人计点</option>
<option value="2">个人包月</option>
<option value="3">网吧包月</option>
</select></td>
</tr>
<tr>
<td height="25" align="right">影卡面值:</td>
<td><select name="card_value" class="select1" id="card_value" style="display:none">
<option selected>请选择点数</option>
<option value="100">100点</option>
<option value="300">300点</option>
<option value="600">600点</option>
</select>
<select name="card_value2" class="select1" id="card_value2" style="display:none">
<option selected>请选择月数</option>
<option value="1">1个月</option>
<option value="3">3个月</option>
<option value="6">6个月</option>
</select>
<select name="card_value3" class="select1" id="card_value3">
<option selected>请选择种类</option>
</select></td>
</tr>
<tr id="tb_pc_count">
<td height="25" align="right">VIP影卡:</td>
<td><input type="radio" name="card_vip" value="true">
是
<input type="radio" name="card_vip" value="false">
否</td>
</tr>
<tr id="tb_pc_count">
<td height="25" align="right">生成数量:</td>
<td><input name="make_count" type="text" class="input1" id="make_count" size="6">
张</td>
</tr>
<tr align="center" id="tb_pc_count">
<td height="40" colspan="2"><input name="submit" type="submit" class="button1" id="submit" value="确 定"></td>
</tr>
</table></td>
</tr>
</table>
</form>
<%end sub%>
<%
sub make_card()
if request.form("card_vip")="" then
response.write"<script language=javascript>alert('请选择是否是VIP影卡');window.close();</Script>"
response.end
end if
if request.form("make_count")="" then
response.write"<script language=javascript>alert('请填写要生成的影卡数量');window.close();</Script>"
response.end
end if
if myobj.ChkNum(request.form("make_count"))=false then
response.write"<script language=javascript>alert('要生成的影卡数量只能填写数字');window.close();</Script>"
response.end
end if
if cint(request.form("make_count"))<1 then
response.write"<script language=javascript>alert('要生成的影卡数量不能少于1张');window.close();</Script>"
response.end
end if
set rs=server.createobject("adodb.recordset")
rs.open "select * from money_setup where money_type='card'",conn,1,1
'个人计点
pop_100p=rs("pop_100p")
vip_100p=rs("vip_100p")
pop_300p=rs("pop_300p")
vip_300p=rs("vip_300p")
pop_600p=rs("pop_600p")
vip_600p=rs("vip_600p")
'个人包月
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("card_type"))=1 and cbool(request.form("card_vip"))=false then
Select Case request.form("card_value")
Case 100
card_money=ccur(pop_100p)
Case 300
card_money=ccur(pop_300p)
Case 600
card_money=ccur(pop_600p)
end select
end if
if cint(request.form("card_type"))=1 and cbool(request.form("card_vip"))=true then
Select Case request.form("card_value")
Case 100
card_money=ccur(vip_100p)
Case 300
card_money=ccur(vip_300p)
Case 600
card_money=ccur(vip_600p)
end select
end if
if cint(request.form("card_type"))=2 and cbool(request.form("card_vip"))=false then
Select Case request.form("card_value2")
Case 1
card_money=ccur(pop_ps1m)
Case 3
card_money=ccur(pop_ps3m)
Case 6
card_money=ccur(pop_ps6m)
end select
end if
if cint(request.form("card_type"))=2 and cbool(request.form("card_vip"))=true then
Select Case request.form("card_value2")
Case 1
card_money=Ccur(vip_ps1m)
Case 3
card_money=Ccur(vip_ps3m)
Case 6
card_money=Ccur(vip_ps6m)
end select
end if
if cint(request.form("card_type"))=3 and cbool(request.form("card_vip"))=false then
Select Case request.form("card_value2")
Case 1
card_money=ccur(pop_pb1m)
Case 3
card_money=ccur(pop_pb3m)
Case 6
card_money=ccur(pop_pb6m)
end select
end if
if cint(request.form("card_type"))=3 and cbool(request.form("card_vip"))=true then
Select Case request.form("card_value2")
Case 1
card_money=Ccur(vip_pb1m)
Case 3
card_money=Ccur(vip_pb3m)
Case 6
card_money=Ccur(vip_pb6m)
end select
end if
%>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
<table width="550" 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="550" height="150" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
<tr>
<td align="center" bgcolor="#F7F7F7"><table width="350" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="150" height="25" align="right">影卡种类:</td>
<td> <%if cint(request.form("card_type"))=1 then%>个人计点<%end if%><%if cint(request.form("card_type"))=2 then%>个人包月<%end if%><%if cint(request.form("card_type"))=3 then%>网吧包月<%end if%></td>
</tr>
<tr>
<td height="25" align="right">影卡面值:</td>
<td> <%if cint(request.form("card_type"))=1 then%><%=request.form("card_value")%> 点<%end if%><%if cint(request.form("card_type"))<>1 then%><%=request.form("card_value2")%> 个月<%end if%></td>
</tr>
<tr id="tb_pc_count">
<td height="25" align="right">VIP影卡:</td>
<td> <%if cbool(request.form("card_vip"))=true then%>是<%else%>否<%end if%></td>
</tr>
<tr id="tb_pc_count">
<td height="25" align="right">生成数量:</td>
<td> <%=request.form("make_count")%> 张</td>
</tr>
<tr id="tb_pc_count">
<td height="25" align="right">影卡单价:</td>
<td> <%=card_money%> 元</td>
</tr>
</table></td>
</tr>
</table>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
<table width="550" 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="550" height="40" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><table width="500" height="10" border="0" cellpadding="0" cellspacing="0">
<tr>
<td></td>
</tr>
</table>
<%
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open "select max(id) from cards",conn,1,1
if isnull(rs(0))=true then
maxid=1
else
maxid=rs(0)
end if
rs.close
set rs=server.createobject("adodb.recordset")
rs.open "select * from cards where (id is null)",conn,1,3
x=cint(request.form("make_count"))
execute "dim card_num("&x&"),card_pwd("&x&"),y,z"
for y=1 to x
maxid=maxid+1
card_num(y)=maxid&myobj.makeCard(16-len(maxid))
card_pwd(y)=myobj.MakeRnd(16)
%>
<table width="550" height="25" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
<tr>
<td align="center" bgcolor="#FFFFFF"><table width="500" height="25" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="40" align="center"><%=y%></td>
<td width="230">卡号:<%=card_num(y)%></td>
<td width="230">密码:<%=card_pwd(y)%></td>
</tr>
</table></td>
</tr>
</table>
<%
rs.addnew
rs("card_num")=card_num(y)
rs("card_pwd")=card_pwd(y)
rs("card_type")=cint(request.form("card_type"))
if cint(request.form("card_type"))=1 then
rs("card_value")=cint(request.form("card_value"))
end if
if cint(request.form("card_type"))<>1 then
rs("card_value")=cint(request.form("card_value2"))
end if
if cint(request.form("card_type"))=3 then
rs("pc_count")=cint(request.form("pc_count"))
end if
rs("card_money")=card_money
rs("card_vip")=cbool(request.form("card_vip"))
rs.update
next
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<table width="500" height="10" border="0" cellpadding="0" cellspacing="0">
<tr>
<td></td>
</tr>
</table></td>
</tr>
</table>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
<%end sub%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -