📄 card_manage.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 tb()
if document.GetElementById("tb_body").style.display="none" then
document.GetElementById("tb_body").style.display="inline"
else
document.GetElementById("tb_body").style.display="none"
end if
end function
</script>
<script language="JavaScript">
function tourl(form1_url){
location=form1_url;
for(var i=0;i<document.form1.elements.length;i++){
document.form1.elements[i].options[0].selected=true
}
}
</script>
</head>
<body leftMargin="0" topMargin="0" bgcolor="#FFFFFF">
<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"><a href="<%=filename%>" class="lfont1">所有影卡</a> <strong class="font1">影卡列表</strong> <a href="vbscript:tb()" class="lfont1">高级搜索</a></td>
</tr>
</table>
<table width="550" height="100" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7" id="tb_body" style="display:none">
<tr>
<td align="center" valign="bottom" bgcolor="#F7F7F7"><table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table width="500" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><form name="form7" method="post" action="<%=filename%>?sql=1">
●查看卡号中包含:
<input name="var" type="text" class="input1" id="var" size="20">
的影卡
<input name="Submit" type="submit" class="button1" value="确定">
</form></td>
</tr>
</table>
<table width="500" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><form name="form2" method="post" action="<%=filename%>?sql=2">
●查看种类为:
<select name="var" class="select1" id="var">
<option selected>--- 请选择 ---</option>
<option value="1">个人计点用户影卡</option>
<option value="2">个人包月用户影卡</option>
<option value="3">网吧包月用户影卡</option>
</select>
的影卡
<input name="Submit" type="submit" class="button1" value="确定">
</form></td>
</tr>
</table>
<table width="500" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><form name="form3" method="post" action="<%=filename%>?sql=3">
●查看
<select name="var" class="select1" id="var">
<option selected>请选择</option>
<option value="1">未被使用的影卡</option>
<option value="2">已经使用的影卡</option>
</select>
的影卡
<input name="Submit" type="submit" class="button1" value="确定">
</form></td>
</tr>
</table>
<table width="500" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><form name="form4" method="post" action="<%=filename%>?sql=4">
●查看被用户账号:
<input name="var" type="text" class="input1" id="var" size="20">
充值的影卡
<input name="Submit" type="submit" class="button1" value="确定">
</form></td>
</tr>
</table>
<table width="500" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><form name="form6" method="post" action="<%=filename%>?sql=6">
●查看所有VIP影卡
<input name="Submit" type="submit" class="button1" value="确定">
</form></td>
</tr>
</table>
<table width="500" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top"><a href="card_del_used.asp">删除所有已被充值的影卡</a></td>
</tr>
</table></td>
</tr>
</table>
<table width="550" height="30" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center">当前查询条件:<span class="font3">
<%if request("sql")="" then%>
所有影卡列表
<%end if%>
</span>
<%if request("sql")="1" then%>
卡号中包含:<span class="font3"><%=request("var")%></span> 的影卡列表
<%end if%>
<%if request("sql")="2" then%>
<%if request("var")=1 then%>查看所有<span class="font3">个人计点用户影卡</span><%end if%>
<%if request("var")=2 then%>查看所有<span class="font3">个人包月用户影卡</span><%end if%>
<%if request("var")=3 then%>查看所有<span class="font3">网吧包月用户影卡</span><%end if%>
<%end if%>
<%if request("sql")="3" then%>
<%if request("var")=1 then%>查看<span class="font3">未被使用的影卡</span><%end if%>
<%if request("var")=2 then%>查看<span class="font3">已被使用的影卡</span><%end if%>
<%end if%>
<%if request("sql")="4" then%>
查看被用户账号:<span class="font3"><%=request("var")%></span> 充值的影卡
<%end if%>
<%if request("sql")="5" then%>
<span class="font3">所有VIP影卡</span>
<%end if%>
</td>
</tr>
</table>
<%
if request("sql")="" or isnull(request("sql")) then
set rs=server.createobject("adodb.recordset")
rs.open "select * from cards order by id desc",conn,1,1
end if
if request("sql")=1 then
set rs=server.createobject("adodb.recordset")
rs.open "select * from cards where card_num like '%"&request("var")&"%' order by id desc",conn,1,1
end if
if request("sql")=2 and request("var")=1 then
set rs=server.createobject("adodb.recordset")
rs.open "select * from cards where card_type=1 order by id desc",conn,1,1
end if
if request("sql")=2 and request("var")=2 then
set rs=server.createobject("adodb.recordset")
rs.open "select * from cards where card_type=2 order by id desc",conn,1,1
end if
if request("sql")=2 and request("var")=3 then
set rs=server.createobject("adodb.recordset")
rs.open "select * from cards where card_type=3 order by id desc",conn,1,1
end if
if request("sql")=3 and request("var")=1 then '未被使用的影卡
set rs=server.createobject("adodb.recordset")
rs.open "select * from cards where used_userid is null or used_userid='' order by id desc",conn,1,1
end if
if request("sql")=3 and request("var")=2 then '已被使用的影卡
set rs=server.createobject("adodb.recordset")
rs.open "select * from cards where used_userid is not null or used_userid<>'' order by id desc",conn,1,1
end if
if request("sql")=4 then
set rs=server.createobject("adodb.recordset")
rs.open "select * from cards where used_userid like '%"&request("var")&"%' order by id desc",conn,1,1
end if
if request("sql")=5 then
set rs=server.createobject("adodb.recordset")
rs.open "select * from cards where card_vip=1 order by id desc",conn,1,1
end if
if rs.eof and rs.bof then
%>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
<tr>
<td height="100" align="center" bgcolor="#F7F7F7">没有查询到任何符合条件的影卡</td>
</tr>
</table>
<%
else
maxpage=10 '每页最大显示数
dim totalhow '数据库中的总记录数
dim totalpage '总共页数
dim CurrentPage '当前处于的页数
currentPage=request.Querystring("page")
totalhow=rs.recordcount
if totalhow mod maxpage=0 then
totalpage= totalhow \ maxpage
else
totalpage = totalhow \ maxpage +1
end if
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPage>totalhow then
if (totalhow mod MaxPage)=0 then
currentpage= totalhow \ MaxPage
else
currentpage= totalhow \ MaxPage + 1
end if
end if
if (currentPage-1)*MaxPage<totalhow then
rs.move (currentPage-1)*MaxPage
else
currentPage=1
end if
%>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
<tr>
<td height="25" align="center" bgcolor="#F7F7F7">影卡卡号</td>
<td align="center" bgcolor="#F7F7F7">种类</td>
<td align="center" bgcolor="#F7F7F7">面值</td>
<td align="center" bgcolor="#F7F7F7">VIP影卡</td>
<td align="center" bgcolor="#F7F7F7">是否被使用</td>
<td align="center" bgcolor="#F7F7F7"> 操作 </td>
</tr>
<%
i=0
do while not rs.eof
i=i+1
%>
<tr>
<td height="25" align="center" bgcolor="#FFFFFF"><%if isnull(rs("used_userid"))=false or rs("used_userid")<>"" then%><span class="font3"><%end if%><%=rs("card_num")%><%if isnull(rs("used_userid"))=false or rs("used_userid")<>"" then%></span><%end if%></td>
<td height="25" align="center" bgcolor="#FFFFFF"><%if rs("card_type")=1 then%>个人计点<%end if%><%if rs("card_type")=2 then%>个人包月<%end if%><%if rs("card_type")=3 then%>网吧包月<%end if%></td>
<td height="25" align="center" bgcolor="#FFFFFF"><%if rs("card_type")=1 then%><%=rs("card_value")%>点<%end if%><%if rs("card_type")<>1 then%><%=rs("card_value")%>个月<%end if%></td>
<td height="25" align="center" bgcolor="#FFFFFF"><%if rs("card_vip")=true then%>是<%else%>否<%end if%></td>
<td height="25" align="center" bgcolor="#FFFFFF"><%if isnull(rs("used_userid")) or isempty(rs("used_userid")) then%>未使用<%else%>已使用<%end if%></td>
<td height="25" align="center" bgcolor="#FFFFFF"><a href="card_more.asp?id=<%=rs("id")%>">详细</a>/<a href="<%=filename%>?action=card_del&id=<%=rs("id")%>" onclick="javascript:{if(confirm('确定要删除影卡:<%=rs("card_num")%> 吗?')){return true;}return false;}">删除</a></td>
</tr>
<%
if i>=maxpage then exit do
rs.movenext
loop
%>
</table>
<table width="550" height="25" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" class="font3">影卡的卡号为红色表示已被充值使用</td>
</tr>
</table>
<%if request("sql")="" then%>
<table width="550" height="40" border="0" align="center" cellpadding="0" cellspacing="0">
<form name="form1" method="post">
<tr>
<td width="421" align="right"><!-- ########### 开始判断分页类型 ############### -->
<font face="Webdings">7</font>
<%if currentpage>1 then%>
<a href="<%=filename%>"><%end if%>首页<%if currentpage>1 then%></a>
<%end if%>
<%if currentpage>1 then%>
<a href="<%=filename%>?page=<%=currentPage-1%>"><%end if%>上一页<%if currentpage>1 then%></a>
<%end if%>
<%if cint(currentpage)<totalpage then%>
<a href="<%=filename%>?page=<%=currentPage+1%>"><%end if%>下一页<%if cint(currentpage)<totalpage then%></a>
<%end if%>
<%if cint(currentpage)<totalpage then%>
<a href="<%=filename%>?page=<%=totalpage%>"><%end if%>尾页<%if cint(currentpage)<totalpage then%></a>
<%end if%>
<font face="Webdings">8</font> 共有<span class="font3"><%=totalhow%></span>条记录 共<span class="font3"><%=currentPage%></span>/<span class="font3"><%=totalpage%></span>页</td>
<td width="129">
<select name="topage" size="1" class="select1" onChange="JavaScript:tourl(document.form1.topage.options[document.form1.topage.selectedIndex].value)">
<%
for j=1 to totalpage
%>
<option value="<%=filename%>?page=<%=j%>" <%if cint(request.Querystring("page"))=j then%>selected<%end if%>> 第<%=j%>页 </option>
<%next%>
</select></td>
</form>
<!-- ############################ 判断分页类型结束 ######################## -->
</table>
<%else%>
<table width="550" height="40" border="0" align="center" cellpadding="0" cellspacing="0">
<form name="form1" method="post">
<tr>
<td width="421" align="right"><!-- ########### 开始判断分页类型 ############### -->
<font face="Webdings">7</font>
<%if currentpage>1 then%>
<a href="<%=filename%>?sql=<%=request("sql")%>&var=<%=request("var")%>"><%end if%>首页<%if currentpage>1 then%></a>
<%end if%>
<%if currentpage>1 then%>
<a href="<%=filename%>?page=<%=currentPage-1%>&sql=<%=request("sql")%>&var=<%=request("var")%>"><%end if%>上一页<%if currentpage>1 then%></a>
<%end if%>
<%if cint(currentpage)<totalpage then%>
<a href="<%=filename%>?page=<%=currentPage+1%>&sql=<%=request("sql")%>&var=<%=request("var")%>"><%end if%>下一页<%if cint(currentpage)<totalpage then%></a>
<%end if%>
<%if cint(currentpage)<totalpage then%>
<a href="<%=filename%>?page=<%=totalpage%>&sql=<%=request("sql")%>&var=<%=request("var")%>"><%end if%>尾页<%if cint(currentpage)<totalpage then%></a>
<%end if%>
<font face="Webdings">8</font> 共有<span class="font3"><%=totalhow%></span>条记录 共<span class="font3"><%=currentPage%></span>/<span class="font3"><%=totalpage%></span>页</td>
<td width="129">
<select name="topage" size="1" class="select1" onChange="JavaScript:tourl(document.form1.topage.options[document.form1.topage.selectedIndex].value)">
<%
for j=1 to totalpage
%>
<option value="<%=filename%>?page=<%=j%>&sql=<%=request("sql")%>&var=<%=request("var")%>" <%if cint(request.Querystring("page"))=j then%>selected<%end if%>> 第<%=j%>页 </option>
<%next%>
</select></td>
</form>
<!-- ############################ 判断分页类型结束 ######################## -->
</table>
<%
end if
end if
if request.Querystring("action")="card_del" then
conn.execute"delete from cards where id="&request.Querystring("id")&""
response.write"<script language=javascript>alert('影卡删除成功');location.href = '"&filename&"';</Script>"
response.end
end if
%>
</body>
</html>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -