📄 film_manage.asp
字号:
<!--#include file="chklogin.asp"-->
<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" class="font1"><strong class="font1"><a href="film_manage.asp" class="lfont1">[所有影片]</a> 影片列表 <a href="vbscript:tb()" class="lfont1">[高级搜索]</a></strong></td>
</tr>
</table>
<table width="550" height="100" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7" id="tb_body" style="display:none">
<!--<table width="550" height="100" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7" id="tb_body">-->
<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="form2" method="post" action="film_manage.asp?sql=1">
●列出类别为:
<select name="var" class="select1" id="var">
<%
set rs=server.createobject("adodb.recordset")
rs.open "select * from film_class",conn,1,1
do while not rs.eof
%>
<option value="<%=rs("caption")%>">
<%if rs("isvip")=true then%>
[VIP]
<%end if%>
<%=rs("caption")%></option>
<%
rs.movenext
loop
rs.close
%>
</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="film_manage.asp?sql=2">
●列出用户报告无法播放的影片
<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="film_manage.asp?sql=3">
●列出影片名称及影片别名中包含:
<input name="var" type="text" class="input1" id="var" size="10">
的影片
<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="form5" method="post" action="film_manage.asp?sql=4">
●列出点播次数小于
<input name="var" type="text" class="input1" id="var" size="3">
次的影片
<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="film_manage.asp?sql=5">
●列出影片文件名中包含:
<input name="var" type="text" class="input1" id="var" size="10">
的影片
<input name="Submit" type="submit" class="button1" value="确定">
</form></td>
</tr>
</table></td>
</tr>
</table>
<table width="550" height="30" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center">当前查询条件:<%if request("sql")="" then%><span class="font3">全部影片</span><%end if%><%if request("sql")=1 then%>类别为 <span class="font3"><%=request("var")%></span> 的影片<%end if%><%if request("sql")=2 then%><span class="font3">用户报告错误的影片</span><%end if%><%if request("sql")=3 then%>影片名称或别名中包含 <span class="font3"><%=request("var")%></span> 的影片<%end if%><%if request("sql")=4 then%>点播次数小于 <span class="font3"><%=request("var")%></span> 的影片<%end if%><%if request("sql")=5 then%>影片文件名为 <span class="font3"><%=request("var")%></span> 的影片ID<%end if%></td>
</tr>
</table>
<%
if request("sql")="" then '所有影片
set rs=server.createobject("adodb.recordset")
rs.open "select * from films order by id desc",conn,1,1
end if
if request("sql")=1 then '按分类查询
set rs=server.createobject("adodb.recordset")
rs.open "select * from films where film_class='"&request("var")&"' order by id desc",conn,1,1
end if
if request("sql")=2 then '所有错误影片
set rs=server.createobject("adodb.recordset")
rs.open "select * from films where err=1 order by id desc",conn,1,1
end if
if request("sql")=3 then '按影片名称或别名查询
set rs=server.createobject("adodb.recordset")
rs.open "select * from films where film_name like '%"&request("var")&"%' or other_name like '%"&request("var")&"%' order by id desc",conn,1,1
end if
if request("sql")=4 then '按点播次数
set rs=server.createobject("adodb.recordset")
rs.open "select * from films where see_count<"&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 film_files where filename='"&request("var")&"' order by id desc",conn,1,1
end if
if rs.eof and rs.bof then
%>
<table width="550" height="100" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
<tr>
<td 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">影片<%if request("sql")=5 then%>ID<%else%>名称<%end if%></td>
<td align="center" bgcolor="#F7F7F7">所属类别</td>
<td align="center" bgcolor="#F7F7F7">点播次数</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 request("sql")=5 then%><a href="film_edit.asp?id=<%=rs("filmid")%>"><%=rs("filmid")%></a><%else%><span title="<%=rs("film_name")%>"><%if rs("err")=true then%><font class="font3"><%end if%><%=left(rs("film_name"),20)%><%if rs("err")=true then%></font><%end if%><%end if%></span></td><td height="25" align="center" bgcolor="#FFFFFF"><%=rs("film_class")%></td>
<td height="25" align="center" bgcolor="#FFFFFF"><%=rs("see_count")%></td>
<td height="25" align="center" bgcolor="#FFFFFF"><%=rs("join_time")%></td>
<td height="25" align="center" bgcolor="#FFFFFF"><a href="film_edit.asp?id=<%if request("sql")=5 then%><%=rs("filmid")%><%else%><%=rs("id")%><%end if%>" title="<%=rs("film_name")%>">编辑</a>/<a href="film_del.asp?id=<%if request("sql")=5 then%><%=rs("filmid")%><%else%><%=rs("id")%><%end if%>" title="<%=rs("film_name")%>" onclick="javascript:{if(confirm('确定要删除影片《<%=rs("film_name")%>》吗?')){return true;}return false;}">删除</a></td>
</tr>
<%
if i>=maxpage then exit do
rs.movenext
loop
%>
</table>
<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="film_manage.asp<%if request("sql")<>"" then%>?&sql=<%=request("sql")%>&var=<%=request("var")%><%end if%>"><%end if%>首页<%if currentpage>1 then%></a><%end if%>
<%if currentpage>1 then%><a href="<%=filename%>?page=<%=currentPage-1%><%if request("sql")<>"" then%>&sql=<%=request("sql")%>&var=<%=request("var")%><%end if%>"><%end if%>上一页<%if currentpage>1 then%></a><%end if%>
<%if cint(currentpage)<totalpage then%><a href="<%=filename%>?page=<%=currentPage+1%><%if request("sql")<>"" then%>&sql=<%=request("sql")%>&var=<%=request("var")%><%end if%>"><%end if%>下一页<%if cint(currentpage)<totalpage then%></a><%end if%>
<%if cint(currentpage)<totalpage then%><a href="<%=filename%>?page=<%=totalpage%><%if request("sql")<>"" then%>&sql=<%=request("sql")%>&var=<%=request("var")%><%end if%>"><%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 request("sql")<>"" then%>&sql=<%=request("sql")%>&var=<%=request("var")%><%end if%>" <%if cint(request.Querystring("page"))=j then%>selected<%end if%>> 第<%=j%>页 </option>
<%next%>
</select></td>
</form>
<!-- ############################ 判断分页类型结束 ######################## -->
</table>
<%end if%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -