📄 card_list.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="func.asp"-->
<%
if session("loginpass")<>true then Response.Redirect "notlogin.htm"
if session("IsAdmin")<>true then Response.Redirect "notlogin1.htm"
dim sql,rs,temp,sql2,rs2
sql="select GameType,CardType from Type"
set rs=conn.execute(sql)
set rs2=server.CreateObject ("ADODB.Recordset")
dim qmethod,gtq,ctq,cq,dq
qmethod=cint(request("qmethod"))
ctq=request("ctq")
cq=request("cq")
if cq<>"" then cq=trim(cq)
if qmethod<>0 then
ctq=request("ctq")
cq=request("cq")
session("qmethod")=qmethod
session("ctq")=ctq
session("cq")=cq
select case qmethod
case 2:
if ctq<>"" then
sql2="select * from card where CardType='"&ctq&"' order by CardId desc"
elseif session("ctq")="" then
sql2="select * from card order by CardId desc"
else
sql2="select * from card where CardType='"&session("ctq")&"' order by CardId desc"
end if
case 3:sql2="select * from card where CardId like '%"&session("cq")&"%' order by CardId desc"
case else sql2="select * from card order by CardId desc"
end select
else
qmethod=session("qmethod")
select case cint(qmethod)
case 2:
if ctq<>"" then
sql2="select * from card where CardType='"&ctq&"' order by CardId desc"
elseif session("ctq")="" then
sql2="select * from card order by CardId desc"
else
sql2="select * from card where CardType='"&session("ctq")&"' order by CardId desc"
end if
case 3:
sql2="select * from card where CardId like '%"&session("cq")&"%' order by CardId desc"
case else sql2="select * from card order by CardId desc"
end select
end if
rs2.Open sql2,conn,1,1
%>
<html>
<head>
<link href="css.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body leftmargin="0" topmargin="0">
<form name="pform" action="card_list.asp" method="post">
<input type="hidden" name="qmethod" value="<%=cint(request("qmethod"))%>">
<input type="hidden" name="ctq" value="<%=request("ctq")%>">
<input type="hidden" name="cq" value="<%=request("cq")%>">
</form>
<form name="eform" action="edit_card.asp" method="post">
<input type="hidden" name="ope" value="">
<input type="hidden" name="id" value="">
<input type="hidden" name="r_page" value="<%=cint(request("page"))%>">
</form>
<table width="103%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="22" align="center" bgcolor="#F7F7F7"><strong>记录查询与管理</strong></td>
</tr>
<tr>
<td align="center"><table width="103%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td> 点卡类型查询:
<select name="ctypequery" onchange="javascript:ctq(options[selectedIndex].value,2)">
<option value="">-请选择- <%
rs.movefirst
while not(rs.eof)
if instr(1,temp,rs(1))=0 then
%>
<option value="<%=rs(1)%>"><%=rs(1)%> <%
end if
temp=temp&rs(1)
rs.movenext
wend
rs.close
set rs=nothing
%> </select>
</td>
<td> 卡号查询:
<input name="cardquery" type="text" size="12" maxlength="12">
<input type="submit" name="cq" value="查询" onclick="javascript:cq(cardquery.value,3)"> </td>
</tr>
</table></td>
</tr>
</table>
<hr width="96%">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#2284E6">
<tr>
<td> <table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr align="center" bgcolor="#DDEEFF">
<td width="15%" nowrap><b><font color="#1529B7">卡号</font></b></td>
<td width="15%" nowrap><b><font color="#1529B7">密码</font></b></td>
<td width="10%" nowrap><b><font color="#1529B7">类型</font></b></td>
<td width="15%" nowrap><b><font color="#1529B7">是否已售</font></b></td>
<td width="15%" nowrap><b><font color="#1529B7">是否已充</font></b></td>
<td width="22%" nowrap><b><font color="#1529B7">生成日期</font></b></td>
<td width="28%" nowrap><b><font color="#1529B7">操作</font></b></td>
</tr>
<%
rs2.PageSize=15
dim page,so,topage,c,bgc,totalrec,totalpage
page=request.querystring("page")
if page="" then page=1
if not(isnumeric(page)) then page=1
if page<1 then page=1
page=int(page)
totalrec=rs2.recordcount
totalpage=rs2.pagecount
if page>totalpage then page=totalpage
'rs2.absolutepage=page
topage=onepage(rs2,page)
for so=1 to topage(1)
c=so mod 2
if c=0 then bgc="#FFFFFF" else bgc="#F7F3F7"
if rs2.EOF then exit for
%>
<tr align="center" bgcolor="<%=bgc%>">
<td nowrap><%=rs2("CardId")%></td>
<td nowrap><%=UCase(Uencrypt(rs2("CardPwd")))%></td>
<td nowrap>[<span style="color:#ff0000"><%=rs2("CardType")%></span>]</td>
<td nowrap><%if rs2("Isell") then response.Write "<span style='color:#ff0000'>已售</span>" else response.write "<span style='color:#0000ff'>未售</span>"%></td>
<td nowrap><%if rs2("IsFill") then response.Write "<span style='color:#ff0000'>已充值</span>" else response.write "<span style='color:#0000ff'>未充值</span>"%></td>
<td nowrap><%=formatdatetime(rs2("MakeDate"),2)%></td>
<td nowrap>[<a href="###" onclick="javascript:submitdata(<%=rs2("ID")%>,1)">售出</a>] [<a href="###" onclick="javascript:submitdata(<%=rs2("ID")%>,2)">编辑</a>] [<a href="###" onclick="javascript:submitdata(<%=rs2("ID")%>,3)">删除</a>]</td>
</tr>
<%
rs2.MoveNext
next
%>
</table></td>
</tr>
</table>
<hr width="96%">
<TABLE width="100%" border=0 align="center" cellPadding=0 cellSpacing=0 class=indiv>
<TBODY>
<TR>
<TD class=toolbarleft1 align="right" width="100%">
<TABLE width="70%" border=0 cellPadding=cellspacing=0>
<TBODY>
<TR>
<td>总记录数:<span style="color:#ff0000;font-weight:700"><%=totalrec%></span></td>
<td>当前页:<span style="color:#ff0000;font-weight:700"><%=page%>
<%session("page")=page%></span></td>
<td>总页数:<span style="color:#ff0000;font-weight:700"><%=totalpage%></span></td>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="80%" border=0 class=btn align="center">
<TBODY>
<TR>
<TD noWrap align="center"><a href="card_list.asp?page=1">最前一页</a></TD>
</TR></TBODY></TABLE></TD>
<TD >
<TABLE cellSpacing=0 cellPadding=0 width="80%" border=0 class=btn align="center">
<TBODY>
<TR>
<TD noWrap align="center"><%if page-1>0 then%><a href="card_list.asp?page=<%=page-1%>">上一页</a><%else%><font color=666666>上一页</font><%end if%></TD>
</TR></TBODY></TABLE></TD>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="80%" border=0 class=btn align="center">
<TBODY>
<TR>
<TD noWrap align="center"><font color=666666><%if page+1<=totalpage then%><a href="card_list.asp?page=<%=page+1%>">下一页</a><%else%><font color=666666>下一页</font><%end if%></font>
</TD>
</TR></TBODY></TABLE></TD>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="80%" border=0 class=btn align="center">
<TBODY>
<TR>
<TD noWrap align="center"><a href="card_list.asp?page=<%=totalpage%>">最后一页</a></TD>
</TR></TBODY></TABLE></TD>
</TR></TBODY></TABLE>
</TD>
</TR></TBODY></TABLE>
<script language="javascript">
function ctq(para,m){
ff=document.forms[0];
ff.qmethod.value=m;
ff.ctq.value=para;
ff.submit()
}
function cq(para,m){
ff=document.forms[0];
ff.qmethod.value=m;
if (para!=""){
ff.cq.value=para;
ff.submit();
}else
{
alert("请填上你要查询的卡号!");
cardquery.focus();
}
}
function submitdata(id,o){
f=document.forms[1];
if (o==3) {
var bConfirm,sMessage
sMessage="是否删除ID为:"+id+"的卡?"
bConfirm=window.confirm(sMessage);
if (bConfirm)
{
f.ope.value=o;
f.id.value=id;
f.submit();
}
}else
{
f.ope.value=o;
f.id.value=id;
f.submit();
}
}
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -