⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 film_manage.asp

📁 电影ASP文件
💻 ASP
字号:
<!--#include file="../film_conn.asp"-->
<!--#include file="session.asp"-->
<!--#include file="../set_url.asp"-->
<%if session("flag")>2 then
response.write "<br><p align=center>您的操作权限不够!</p>"
response.end
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css/style.css">
<title>电影管理</title>
</head>
<body bgcolor="#F6F6F6" leftmargin="0" topmargin="0">
<%
   MaxPerPage=20
   dim totalPut   
   dim CurrentPage
   dim TotalPages
   dim i,j

   dim typename
   
   typename=""
   if not isempty(request("page")) then
      currentPage=cint(request("page"))
   else
      currentPage=1
   end if
   dim sql
   dim rs
   dim rstype

   dim typesql
   dim typeid,typename1
   if not isEmpty(request("typeid")) then
	typeid=request("typeid")
   else
	typeid=""
   end if
   if request("page")="" then
   page=0
   end if
%>
<center>
<table border="0" width="100%" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111">
<tr><td width="100%"><form method="POST" action="film_manage.asp" align=" center">
  <p align="center"><b>影片名称:</b><input type="text" name="word" size="20">
  <input type="submit" value="查询"></p>
</form>
<hr size="1" color="#006CD9">
<div align="center">
|<%
set rst=server.createobject("adodb.recordset")   
rst.open "select * from type",conn,1
if rst.EOF then
response.write "没有分类!"
else
%> <a href="film_manage.asp">全部影片</a>|<%do while NOT rst.EOF%><a href="film_manage.asp?typeid=<%=rst("type")%>"><%=rst("type")%></a>|
<% 
rst.MoveNext
loop
end if
rst.close
set rst=nothing
%>
</div>
<hr size="1" color="#006CD9"></td></tr></table>
<%
if typeid="" then  
 sql="select articleid,title,name from learning  where title Like '%"& request("word") &"%' order by articleid desc"
else  
 sql="select articleid,title,name from learning where typeid='"+typeid+"' order by articleid desc"
end if
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
  if rs.eof and rs.bof then
       response.write "<p align='center'> 还 没 有 任 何 电 影 !</p>"
   else
	  totalPut=rs.recordcount
      totalPut=rs.recordcount
      if currentpage<1 then
          currentpage=1
      end if
      if (currentpage-1)*MaxPerPage>totalput then
	   if (totalPut mod MaxPerPage)=0 then
	     currentpage= totalPut \ MaxPerPage
	   else
	      currentpage= totalPut \ MaxPerPage + 1
	   end if

      end if
       if currentPage=1 then
           showpage totalput,MaxPerPage,"film_manage.asp"
            showContent
            showpage totalput,MaxPerPage,"film_manage.asp"
       else
          if (currentPage-1)*MaxPerPage<totalPut then
            rs.move  (currentPage-1)*MaxPerPage
            dim bookmark
            bookmark=rs.bookmark
           showpage totalput,MaxPerPage,"film_manage.asp"
            showContent
             showpage totalput,MaxPerPage,"film_manage.asp"
        else
	        currentPage=1
           showpage totalput,MaxPerPage,"film_manage.asp"
           showContent
           showpage totalput,MaxPerPage,"film_manage.asp"
	      end if
	   end if
   end if
	        

  

   sub showContent
       dim i
	   i=0

  %>
<table border="0" cellspacing="1" width="100%" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellpadding="0" height="48">
  <tr bgcolor="#CCCCCC">
    <td width="54" align="center" bgcolor="#CCCCCC" height="21"><b>
    <font color="#000000">ID号</font></b></td>
    <td width="500" align="center" bgcolor="#CCCCCC" height="21"><b>
    <font color="#000000">影片名称</font></b></td>
    <td width="99" align="center" bgcolor="#CCCCCC" height="21"><b>
    <font color="#000000">修改</font></b></td>
    <td width="97" align="center" bgcolor="#CCCCCC" height="21"><b>
    <font color="#000000">删除</font></b></td>
  </tr>
  <%do while not rs.eof%>
  <tr>
    <td height="23" width="54" bgcolor="#FFFFFF">
    <p align="center"><%=rs("articleid")%> </td>
    <td width="500" height="23" bgcolor="#FFFFFF">·<a href="/view.asp?id=<%=rs("articleid")%>" target="_blank"><%=rs("title")%></a></td>
    <td width="99" height="23" bgcolor="#FFFFFF">
    <p align="center"><a href="film_edit.asp?id=<%=rs("articleid")%>">
    <font color="#000000">修改</font></a></td>
    <td width="97" height="23" bgcolor="#FFFFFF">
    <p align="center"><a href="film_delete.asp?articleid=<%=rs("articleid")%>">
    <font color="#000000">删除</font></a></td>
  </tr>
  <% i=i+1
	      if i>=MaxPerPage then exit do
	      rs.movenext
	   loop
		  %>
</table>
<div align="center">
  <center>
  <p> </p>
  </center>
</div>
<%
   end sub 

function showpage(totalnumber,maxperpage,filename)
  dim n
  if totalnumber mod maxperpage=0 then
     n= totalnumber \ maxperpage
  else
     n= totalnumber \ maxperpage+1
  end if
  response.write "<form method=Post action="&filename&"?typeid="&typeid&">"
    if CurrentPage<2 then
    response.write "<font color='#000080' style='font-size: 9pt'>首页 上一页</font>&nbsp;"
  else
    response.write "<a href="&filename&"?page=1&typeid="&typeid&"&word="&request("word")&">首页</a>&nbsp;"
    response.write "<a href="&filename&"?page="&CurrentPage-1&"&typeid="&typeid&"&word="&request("word")&">上一页</a>&nbsp;"
  end if
  if n-currentpage<1 then
    response.write "<font color='#000080' style='font-size: 9pt'>下一页 尾页</font>"
  else
    response.write "<a href="&filename&"?page="&(CurrentPage+1)&"&typeid="&typeid&"&word="&request("word")&">"
    response.write "下一页</a> <a href="&filename&"?page="&n&"&typeid="&typeid&"&word="&request("word")&">尾页</a>"
  end if
   response.write "<font color='#000080' style='font-size: 9pt'>&nbsp;页次:</font><strong><font color=red style='font-size: 9pt'>"&CurrentPage&"</font><font color='#000080' style='font-size: 9pt'>/"&n&"</strong>页</font> "
    response.write "<font color='#000080' style='font-size: 9pt'>&nbsp;共<b>"&totalnumber&"</b>部影片 <b>"&maxperpage&"</b>部影片/页</font> "
   response.write " <font color='#000080' style='font-size: 9pt'>转到:</font><input type='text' name='page' size=4 maxlength=10 class=smallInput value="&currentpage&"><input type='hidden' name='word' class=smallInput value="&request("word")&">"
   response.write " <input class=buttonface type='submit'  value='Goto'  name='cndok'></span></p></form>"
       
end function
    
    rs.close
    set rs=nothing  
   conn.close
   set conn=nothing
  %> </center>

</body>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -