tab.asp
上传用户:btntkt
上传日期:2021-04-16
资源大小:5296k
文件大小:7k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

DOS

  1. <!--#include file="conn.asp"-->
  2. <%if session("admin")="" then
  3. response.Write "<script language='javascript'>alert('网络超时或您还没有登陆!');window.location.href='login.asp';</script>"
  4. response.End
  5. else
  6. end if 
  7. %>
  8. <html>
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  11. <link href="images/style.css" rel="stylesheet" type="text/css">
  12. <body>
  13. <%dim selectm,selectkey,selectbookid
  14. selectkey=trim(request(trim("selectkey")))
  15. selectm=trim(request("selectm"))
  16. if selectkey="" then
  17. selectkey=request.QueryString("selectkey")
  18. end if
  19. if selectm="" then
  20. selectm=request.QueryString("selectm")
  21. end if
  22. selectbookid=request("selectbookid")
  23. if selectbookid<>"" then
  24. conn.execute "delete FROM kind where anclassid in ("&selectbookid&")"
  25. response.Redirect "tab.asp"
  26. response.End
  27. end if
  28. %>
  29. <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  30. </tr>
  31. <tr> 
  32. <form name="form1" method="post" action="">
  33. <td height="100"> 
  34.                                 <%
  35. Const MaxPerPage=20
  36.     dim totalPut   
  37.     dim CurrentPage
  38.     dim TotalPages
  39.     dim j
  40.     dim sql
  41.      if Not isempty(request("page")) then
  42.        currentPage=Cint(request("page"))
  43.     else
  44.        currentPage=1
  45.     end if 
  46. set rs=server.CreateObject("adodb.recordset")
  47. rs.open "select * FROM kind order by anclassidorder",conn,1,1
  48.     if err.number<>0 then
  49. response.write "数据库中无数据"
  50. end if
  51.    if rs.eof And rs.bof then
  52.         Response.Write "<p align='center' class='contents'> 数据库中无数据!</p>"
  53.     else
  54.    totalPut=rs.recordcount
  55.        if currentpage<1 then
  56.            currentpage=1
  57.        end if
  58.        if (currentpage-1)*MaxPerPage>totalput then
  59.     if (totalPut mod MaxPerPage)=0 then
  60.       currentpage= totalPut  MaxPerPage
  61.     else
  62.        currentpage= totalPut  MaxPerPage + 1
  63.     end if
  64.        end if
  65.         if currentPage=1 then
  66.              showContent
  67.              showpage totalput,MaxPerPage,"tab.asp"
  68.         else
  69.            if (currentPage-1)*MaxPerPage<totalPut then
  70.              rs.move  (currentPage-1)*MaxPerPage
  71.              dim bookmark
  72.              bookmark=rs.bookmark
  73.              showContent
  74.               showpage totalput,MaxPerPage,"tab.asp"
  75.          else
  76.          currentPage=1
  77.             showContent
  78.             showpage totalput,MaxPerPage,"tab.asp"
  79.        end if
  80.     end if
  81.         end if
  82.     sub showContent
  83.         dim i
  84.     i=0%>
  85.                 
  86.         <table class="tableBorder" width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
  87.           <tr> 
  88.             <td colspan="4" align="center" background="../images/admin_bg_1.gif"><b><font color="#ffffff">添加/修改帮助信息</font></b></td>
  89.           </tr>
  90.           <tr > 
  91.             <td width="10%" align="center" bgcolor="fbc2c2">序号</td>
  92.             <td width="55%" align="center" bgcolor="fbc2c2">栏目名称</td>
  93.             <td width="20%" align="center" bgcolor="fbc2c2">最后修改时间</td>
  94.             <td width="15%" align="center" bgcolor="fbc2c2">选 择</td>
  95.           </tr>
  96.           <%
  97.   do while not rs.eof%>
  98.           <tr > 
  99.             <td class="forumRowHighlight"> <div align="center"><%=rs("anclassidorder")%></div></td>
  100.             <td class="forumRowHighlight"> <a href=edit.asp?id=<%=rs("anclassid")%>> 
  101.               <% if len(replace(trim(rs("anclass")),"<br>",""))>16 then
  102. response.write left(replace(trim(rs("anclass")),"<br>",""),14)&"..."
  103. else
  104. response.write replace(trim(rs("anclass")),"<br>","")
  105. end if%>
  106.               </a></td>
  107.             <td class="forumRowHighlight"><%=rs("updatetime")%></td>
  108.             <td class="forumRowHighlight"> <input name="selectbookid" type="checkbox" id="selectbookid" value="<%=rs("anclassid")%>"> 
  109.             </td>
  110.           </tr>
  111.           <%i=i+1
  112. if i>=MaxPerPage then Exit Do
  113. rs.movenext
  114.   loop
  115.   rs.close
  116.   set rs=nothing%>
  117.           <tr > 
  118.             <td class="forumRowHighlight" height="30" align="right">&nbsp; </td>
  119.             <td class="forumRowHighlight" height="30"><a href="edithelp.asp?action=regtiaoyue">注册协议</a></td>
  120.             <td class="forumRowHighlight" height="30">系统自带</td>
  121.             <td height="30" class="forumRowHighlight"> 全选 
  122.               <input type="checkbox" name="checkbox" value="Check All" onClick="mm()"> 
  123.               <input type="submit" name="Submit" value="删 除" onClick="return test();"> 
  124.             </td>
  125.           </tr>
  126.         </table>
  127.                                <%  
  128. End Sub   
  129. Function showpage(totalnumber,maxperpage,filename)  
  130.    Dim n
  131. If totalnumber Mod maxperpage=0 Then  
  132. n= totalnumber  maxperpage  
  133. Else
  134. n= totalnumber  maxperpage+1  
  135. End If
  136. Response.Write "<form method=Post action="&filename&"?selectm="&selectm&"&selectkey="&selectkey&" >"  
  137. Response.Write "<p align='center' class='contents'> "  
  138. If CurrentPage<2 Then  
  139. Response.Write "<font class='contents'>首页 上一页</font> "  
  140. Else  
  141. Response.Write "<a href="&filename&"?page=1&selectm="&selectm&"&selectkey="&selectkey&" class='contents'>首页</a> "  
  142. Response.Write "<a href="&filename&"?page="&CurrentPage-1&"&selectm="&selectm&"&selectkey="&selectkey&" class='contents'>上一页</a> "  
  143. End If
  144. If n-currentpage<1 Then  
  145. Response.Write "<font class='contents'>下一页 尾页</font>"  
  146. Else  
  147. Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&"&selectm="&selectm&"&selectkey="&selectkey&" class='contents'>"  
  148. Response.Write "下一页</a> <a href="&filename&"?page="&n&"&selectm="&selectm&"&selectkey="&selectkey&" class='contents'>尾页</a>"  
  149. End If  
  150. Response.Write "<font class='contents'> 页次:</font><font class='contents'>"&CurrentPage&"</font><font class='contents'>/"&n&"页</font> "  
  151. Response.Write "<font class='contents'> 共有"&totalnumber&"个栏目 " 
  152. Response.Write "<font class='contents'>转到:</font><input type='text' name='page' size=2 maxlength=10 class=smallInput value="&currentpage&">"  
  153. Response.Write "&nbsp;<input type='submit'  class='contents' value='GO' name='cndok' ></form>"  
  154. End Function  
  155. %>
  156.                                 <table width="12" height="7" border="0" cellpadding="0" cellspacing="0">
  157.                                   <tr> 
  158.                                     <td height=7></td>
  159.                                   </tr>
  160.                                 </table>
  161.       </td>
  162.                             </form>
  163.                           </tr>
  164.                         </table>
  165. <!--#include file="foot.asp"-->
  166. </body>
  167. </html>
  168. <script>
  169. function test()
  170. {
  171.   if(!confirm('确认删除吗?')) return false;
  172. }
  173. </script>
  174. <script language=javascript>
  175. function mm()
  176. {
  177.    var a = document.getElementsByTagName("input");
  178.    if(a[0].checked==true){
  179.    for (var i=0; i<a.length; i++)
  180.       if (a[i].type == "checkbox") a[i].checked = false;
  181.    }
  182.    else
  183.    {
  184.    for (var i=0; i<a.length; i++)
  185.       if (a[i].type == "checkbox") a[i].checked = true;
  186.    }
  187. }
  188. </script>