manage.asp
上传用户:qyswxdl
上传日期:2013-06-01
资源大小:1373k
文件大小:11k
源码类别:

家庭/个人应用

开发平台:

ASP/ASPX

  1. <!--#include file="articleconn.asp"-->
  2. <!--#include file="security.asp"-->
  3. <html><!--#include file="../checkpost.asp"-->
  4. <%if session("flag")>1 then
  5.     response.write "<script>alert('您的操作权限不够!');history.back();</script>"
  6.     response.end
  7. end if
  8. %>
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  11. <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
  12. <meta name="ProgId" content="FrontPage.Editor.Document">
  13. <link rel="stylesheet" type="text/css" href="inc/Admin_STYLE.CSS">
  14. <title>管理页</title>
  15. <style type="text/css">
  16. <!--
  17. .样式1 {
  18. color: #FFFFFF;
  19. font-weight: bold;
  20. }
  21. .样式2 {color: #FFFFFF}
  22. -->
  23. </style>
  24. </head>
  25. <body leftmargin="0" topmargin="0">
  26. <script language="javascript">
  27. function dfile(id)
  28. {
  29. if(confirm("确定要删除吗?")==true)
  30. {
  31. var filename="delfile.asp?id="+id;
  32. window.open(filename,"显示窗口","scrollbars=yes,width=300,height=100,status=yes,resizable=no");
  33. }
  34. }
  35. function CheckAll(v)
  36. {
  37. var i;
  38. for (i=0;i<document.forms.elements.length;i++)
  39. {
  40. var e = document.forms.elements[i];
  41.         e.checked = v;
  42. }
  43. }
  44. function OnDelete()
  45.  {
  46. var del, a, i;
  47. del = new String("");
  48. for(i = 0; i < document.forms.elements.length ; i ++)
  49. {
  50. var e = document.forms.elements[i];
  51. if(e.name == 'selAnnounce')
  52. {
  53.    if ( e.checked == true)
  54.    {
  55.     a = e.value;
  56. del = del + a + ";";
  57.    }
  58. };
  59. }
  60.  if(del == "")
  61. {
  62. alert("请选择要删除的电影")
  63. }
  64. else
  65. {
  66. if(confirm("确定要删除吗?")==true)
  67.  {
  68. document.forms.submit();
  69. }
  70. }
  71. }
  72. //-->
  73. </script>
  74. <%
  75.    MaxPerPage=50
  76.    dim totalPut   
  77.    dim CurrentPage
  78.    dim TotalPages
  79.    dim i,j
  80.    dim typename
  81.    
  82.    typename=""
  83.    if not isempty(request("page")) then
  84.       currentPage=cint(request("page"))
  85.    else
  86.       currentPage=1
  87.    end if
  88.    dim sql
  89.    dim rs
  90.    dim rstype
  91.    dim typesql
  92.    dim typeid,typename1
  93.    if not isEmpty(Replace(request("typeid"), "'", "''")) then
  94. typeid=Replace(request("typeid"), "'", "''")
  95.    else
  96. typeid=""
  97.    end if
  98.    if request("page")="" then
  99.    page=0
  100.    end if
  101. %>
  102. <!--#include file="top1.asp"-->
  103. <table border="0" width="100%" cellspacing="0" cellpadding="0">
  104.   <tr> 
  105.     <td width="100%" height="83"> 
  106.   <div align="center">
  107.       </div>
  108.   <form method="POST" action="manage.asp">
  109.   <p align="center"><b>按电影名查询:</b><input type="text" name="moviename" size="20">
  110.   <input type="submit" value="查询"><br>
  111. </form>
  112. <table cellpadding="2" cellspacing="1" border="0" width="100%" class="border" align=center>
  113.           <tr> 
  114.             <td><div align="left">
  115.               <div align="center">
  116.                 <div align="center">
  117.                   <div align="center">
  118.                     <div align="center">
  119.                       <p>|<a href="manage.asp?canlook=0">免费电影</a>|<a href="manage.asp?canlook=1">普通电影</a>|<a href="manage.asp?canlook=3">黄金电影</a>|</p>
  120.                       <p>|
  121.                         <%
  122.      set rst=server.createobject("adodb.recordset")   
  123. rst.open "select * from type",conn,1
  124.    if rst.EOF then
  125. response.write "没有栏目:"
  126. else
  127.           %>
  128.                         <a href="manage.asp">全部电影</a>|
  129.                         <%do while NOT rst.EOF%>
  130.                         <a href="manage.asp?typeid=<%=rst("type")%>"><%=rst("type")%></a>|
  131.                         <% 
  132. rst.MoveNext
  133. loop
  134. end if
  135. rst.close
  136. set rst=nothing
  137.           %>
  138.                         </p>
  139.                     </div>
  140.                     <br>
  141.                     <div align="center"> |
  142.                         <%
  143.      set rst1=server.createobject("adodb.recordset")   
  144. rst1.open "select * from movie",conn,1
  145.    if rst1.EOF then
  146. response.write "没有服务器"
  147. else
  148. do while NOT rst1.EOF
  149. i=i+1
  150. %>
  151.                         <a href="listserver.asp?serv=<%=rst1("id")%>">第<%=i%>号服务器</a>|
  152.                         <% 
  153. rst1.MoveNext
  154. loop
  155. end if
  156. rst1.close
  157. set rst1=nothing
  158.           %>
  159.                     </div>
  160.                   </div>
  161.                 </div>
  162.               </div>
  163.               </div></td>
  164.           </tr>
  165.     </table>    </td>
  166.   </tr>
  167. </table>
  168. <%
  169. if request("canlook")<>"" then
  170.  sql="select articleid,title,canlook,serverip,name from learning where canlook="&request("canlook")&" order by articleid desc"
  171. else
  172. if typeid="" then
  173. if request("moviename")="" then  
  174.  sql="select articleid,title,canlook,serverip,name from learning  order by articleid desc"
  175.  else
  176.  name=request("moviename")
  177.  sql="select articleid,title,canlook,serverip,name from learning  where title Like '%"&request("moviename")&"%' order by articleid desc"
  178.  end if
  179. else  
  180.  sql="select articleid,title,canlook,serverip,name from learning where typeid='"+typeid+"' order by articleid desc"
  181. end if
  182. end if
  183. Set rs= Server.CreateObject("ADODB.Recordset")
  184. 'response.write(sql)
  185. rs.open sql,conn,1,1
  186.   if rs.eof and rs.bof then
  187.        response.write "<p align='center'> 还 没 有 任 何 影 片</p>"
  188.    else
  189.   totalPut=rs.recordcount
  190.       totalPut=rs.recordcount
  191.       if currentpage<1 then
  192.           currentpage=1
  193.       end if
  194.       if (currentpage-1)*MaxPerPage>totalput then
  195.    if (totalPut mod MaxPerPage)=0 then
  196.      currentpage= totalPut  MaxPerPage
  197.    else
  198.       currentpage= totalPut  MaxPerPage + 1
  199.    end if
  200.       end if
  201.        if currentPage=1 then
  202.            showpage totalput,MaxPerPage,"manage.asp"
  203.             showContent
  204.             showpage totalput,MaxPerPage,"manage.asp"
  205.        else
  206.           if (currentPage-1)*MaxPerPage<totalPut then
  207.             rs.move  (currentPage-1)*MaxPerPage
  208.             dim bookmark
  209.             bookmark=rs.bookmark
  210.            showpage totalput,MaxPerPage,"manage.asp"
  211.             showContent
  212.              showpage totalput,MaxPerPage,"manage.asp"
  213.         else
  214.         currentPage=1
  215.            showpage totalput,MaxPerPage,"manage.asp"
  216.            showContent
  217.            showpage totalput,MaxPerPage,"manage.asp"
  218.       end if
  219.    end if
  220.    end if
  221.         
  222.   
  223.    sub showContent
  224.        dim i
  225.    i=0
  226.   %>
  227. <table width="100%" height="48" border="0" cellpadding="0" cellspacing="1" bordercolorlight="#000000" bordercolordark="#FFFFFF" class="border">
  228.  <form method="Post" action="gmovie.asp?page=<%=request("page")%>&typeid=<%=request("typeid")%>" name="forms">    <tr bgcolor="#429AEF">
  229.       <td width="83" align="center" height="21"><span class="样式1">
  230.       ID号</span></td>
  231.       <td width="300" align="center" height="21"><span class="样式1"> 电影名称</span></td>
  232.       <td width="185" align="center"><span class="样式1">电影级别</span></td>
  233.       <td width="185" align="center" height="21"><span class="样式1"> 隶属服务器</span></td>
  234.       <td width="147" align="center" height="21"><span class="样式1"> 修改<br>
  235.       </span></td>
  236.       <td width="145" align="center" height="21"><span class="样式1"> 删除电影<br>
  237.       </span></td>
  238.       <td width="124" align="center" height="21">
  239.       <span class="样式2">全
  240.       <input name="chkall" onClick="CheckAll(document.forms.chkall.checked)" type="checkbox" value="on">
  241.       选<br>
  242.       <input name="act" type="submit" onClick="{if(confirm('确定删除选定电影吗!?删除前请先删除电影图片')){this.document.forms.submit();return true;}return false;}" value="删除">
  243. </span></td>
  244.     </tr>
  245.   <%do while not rs.eof%>
  246.     <tr bgcolor="#E1F4EE" class="tdbg">
  247.       <td height="23" width="83">
  248.       <p align="center" class="tdbg"><%=rs("articleid")%> </td>
  249.       <td width="300" height="23" class="tdbg">·<a href="../movie.asp?id=<%=rs("articleid")%>" target="_blank"><%=rs("title")%></a></td>
  250.       <td width="185"><div align="center">
  251.         <% if rs("canlook")=1 then%>
  252.         <a href="manage.asp?canlook=1">普通电影</a>
  253.         <%elseif rs("canlook")=3 then%>
  254.         <a href="manage.asp?canlook=3">黄金电影</a>
  255.         <%elseif rs("canlook")=0 then%>
  256.         <a href="manage.asp?canlook=0">免费电影</a>
  257.         <%end if%>
  258.       </div></td>
  259.       <td width="185" height="23"><div align="center" class="tdbg">
  260.         <%   
  261.             set rs4=server.createobject("adodb.recordset")   
  262.             rs4.open "select * from movie",conn,1,1   
  263.             dim c   
  264.             c=1   
  265.             do while not rs4.eof   
  266.             if rs4("id")=rs("serverip")  then%>
  267.         <%=c%>号服务器
  268.         <% end if   
  269.       c=c+1   
  270.       rs4.movenext   
  271.       loop   
  272.       rs4.close   
  273.       set rs4=nothing   
  274.             %>
  275.       </div></td>
  276.       <td width="147" height="23">
  277.         <p align="center"><a href="edit.asp?id=<%=rs("articleid")%>"><font color="#000000">修改</font></a></td>
  278.       <td width="145" height="23">
  279.         <p align="center"><a onClick="{if(confirm('确定删除选定电影吗!?删除前请先删除电影图片')){this.document.forms.submit();return true;}return false;}" href="delete.asp?articleid=<%=rs("articleid")%>"><font color="#000000">删除</font></a></td>
  280.       <td width="124" height="23" align="center">
  281.         <input type="checkbox" name="selAnnounce" value="<%=rs("articleid")%>"></td>
  282.     </tr>
  283.  <% i=i+1
  284.       if i>=MaxPerPage then exit do
  285.       rs.movenext
  286.    loop
  287.   %>  </form>
  288. </table>
  289. <div align="center">
  290.   <%
  291. end sub 
  292. function showpage(totalnumber,maxperpage,filename)
  293. dim n
  294. if totalnumber mod maxperpage=0 then
  295. n= totalnumber  maxperpage
  296. else
  297. n= totalnumber  maxperpage+1
  298. end if
  299. %>
  300. <table border="0" align="center" cellspacing="0" height="25" width="100%">
  301. <form method=Post action="<%=filename%>?typeid=<%=typeid%>">
  302. <tr><td>
  303. <center>共有<font color="#ff0000"><b><%=totalnumber%></b></font>个会员&nbsp;&nbsp;&nbsp;当前:第<strong><font color="#ff0000"><%=CurrentPage%></font></strong>页/共<strong><font color="#ff0000"><%=n%></font></strong>页</center>                                                     
  304. <td><div align="right">
  305. <%if CurrentPage<2 then%>
  306. <font color='888888'>首页&nbsp;上一页</font>&nbsp;&nbsp;&nbsp;                                                      
  307. <%else%>
  308. <a class=left href="<%=filename%>?typeid=<%=typeid%>&page=1">首页</a>&nbsp;                                                      
  309. <a class=left href="<%=filename%>?typeid=<%=typeid%>&page=<%=CurrentPage-1%>">上一页</a>&nbsp;&nbsp;&nbsp;                                                      
  310. <%
  311. end if
  312. if n-currentpage<1 then
  313. %>
  314. <font color='888888'>下一页&nbsp;尾页</font>&nbsp;&nbsp;&nbsp;                                                      
  315. <%else%>
  316. <a class=left href="<%=filename%>?typeid=<%=typeid%>&page=<%=(CurrentPage+1)%>">下一页</a>&nbsp;                                                      
  317. <a class=left href="<%=filename%>?typeid=<%=typeid%>&page=<%=n%>">尾页</a>&nbsp;                                                      
  318. <%end if%>
  319.   </div>
  320. <td align="center"><select name="page" onchange="javascript:submit()">
  321. <%for i = 1 to n%>                                                                 
  322. <option value="<%=i%>" <%if cint(CurrentPage)=cint(i) then%> selected <%end if%>>第<%=i%>页</option>
  323. <%next%></select></td>
  324. </tr></form></table>      
  325. <% 
  326. end function
  327. %>
  328. <%
  329. sub gotopage
  330. end sub
  331. %>
  332. <p></p>
  333. </center>
  334. </body>
  335. </html>
  336. </body>
  337. </html>