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

家庭/个人应用

开发平台:

ASP/ASPX

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