List.asp
上传用户:xxtaishan
上传日期:2022-01-02
资源大小:4063k
文件大小:6k
源码类别:

IP电话/视频会议

开发平台:

ASP/ASPX

  1. <!--#include file="../../inc/conn.asp"-->
  2. <!--#include file="../../inc/func.asp"-->
  3. <html>
  4. <head>
  5. <title>信息列表</title>
  6. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  7. <LINK REL="stylesheet" HREF="../images/style.css" TYPE="text/css"> <style type="text/css">
  8. <!--
  9. .style1 {
  10. color: #FFFFFF;
  11. font-weight: bold;
  12. }
  13. -->
  14. </style>
  15. </head>
  16. <body bgcolor="#FFFFFF" text="#000000">
  17. <%
  18. Dim query
  19. Dim classid
  20. Dim nclassid
  21. classid=request("classid")
  22. nclassid=request("nclassid")
  23. Dim sql
  24. sql=" where 1=1 "
  25. Dim key
  26. key = request("key")
  27. if key<>"" then
  28. sql=sql&" and title like '%"&key&"%' "
  29. query=query&"key="&key&"&"
  30. end if
  31. sql=" select * from Info "&sql&" order by id desc "
  32. Dim rs
  33. Set rs=Server.CreateObject("ADODB.RecordSet")
  34. rs.open sql,conn,1,1
  35. Dim page,i
  36. if request("page")="" then
  37. page=1
  38. else
  39. page=clng(request("page"))
  40. end if
  41. i=0
  42. rs.pagesize=15
  43. if page<1 then page=1
  44. if page>rs.pagecount then page=rs.pagecount 
  45. if rs.pagecount>0 then rs.absolutepage=page
  46. %> 
  47. <form name="form1" method="post"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
  48.   <tr>
  49.       <td>信息列表: 
  50.         <%if classid<>"" then response.write classname(classid)%>
  51.         <%if nclassid<>"" then response.write " - "&nclassname(nclassid)%>
  52.       </td>
  53.   </tr>
  54. </table>
  55.   <table width="100%" border="1" cellspacing="0" cellpadding="2" align="center" bordercolordark="#ffffff" bordercolorlight="#000000">
  56.     <tr bgcolor="#23458B"> 
  57.       <td width="24" height="25">&nbsp; </td>
  58.       <td width="340" height="25"> 
  59.         <div align="center"><span class="style1">标题</span></div>      </td>
  60.       <td width="151" height="25"> 
  61.         <div align="center"><span class="style1">添加日期</span></div>      </td>
  62.       <td width="139" height="25"> 
  63.         <div align="center"><span class="style1">管理操作</span></div>      </td>
  64.     </tr>
  65.     <%
  66. if rs.eof then
  67. response.write "<tr><td colspan='6'><font color='red'>系统中还没有录入相关任何信息!</font></td></tr>"
  68. else
  69. Do while not rs.eof and i<rs.pagesize
  70. if i mod 2<>0 then
  71. bgc="#d8e4f1"
  72. else
  73. bgc="#ffffff"
  74. end if
  75. %>
  76.     <tr bgcolor=<%=bgc%> onMouseOut=this.style.backgroundColor='<%=bgc%>' onMouseOver=this.style.backgroundColor='#F1FBEC'> 
  77.       <td width="24" height="25"> 
  78.         <div align="center"> 
  79.           <input type="checkbox" id="checkbox" value="<%=rs("id")%>" name="checkbox" onClick="chkclick();">
  80.         </div>      </td>
  81.       <td width="340" height="25"><a href="List_Edit.asp?checkbox=<%=rs("id")%>"><%=replace(rs("title"),key,"<font color=red>"&key&"</font>")%></a> 
  82.         <%IF RS("pic")<>"" THEN%>
  83.         <img src="../images/img.gif" align="absmiddle"> 
  84.         <%END IF%>      </td>
  85.       <td width="151" height="25"> 
  86.         <div align="center"><%=rs("postdate")%></div>      </td>
  87.       <td width="139" height="25"> 
  88.         <div align="center"><a href="List_Edit.asp?checkbox=<%=rs("id")%>">修改</a> 
  89.           | <a href="#" onClick="DelGood('<%=rs("id")%>');">删除</a></div>      </td>
  90.     </tr>
  91.     <%
  92. rs.MoveNext
  93. i=i+1
  94. Loop
  95. end if
  96. %>
  97.   </table>
  98.     <table width="100%" height="30" border="0" align="center" cellpadding="0" cellspacing="0"> 
  99. <tr> <td width="23%"> <input type=checkbox name='chkall' onClick='chooseall(document.form1.checkbox,this);'> 
  100. 全选 <input type=checkbox name='chkl' onClick='choosefalse(document.form1.checkbox,this);'> 
  101. 反选 </td><td width="77%"> <div align="right"> 共 <%=rs.recordcount%> 条 页 次 <%=page%>/<%=rs.pagecount%> <a href="?<%=query%>page=1">首页</a>
  102.     <%if rs.pagecount>1 then 
  103.      if page=1 then%>
  104. | 上页 | <a href="?<%=query%>page=<%=(page+1)%>"> 下页</a>
  105. <%else
  106.       if page=rs.pagecount then%>
  107. <a href="?<%=query%>page=<%=(page-1)%>">上页</a> | 下页
  108. <%else%>
  109. | <a href="?<%=query%>page=<%=(page-1)%>">上页</a> | <a href="?<%=query%>page=<%=(page+1)%>"> 下页</a>
  110. <%end if%>
  111. <%end if%>
  112. <%end if%>
  113. | <a href="?<%=query%>page=<%=rs.pagecount%>"> 尾页</a> 第
  114. <select name="sel_page" onChange="javascript:location=this.options[this.selectedIndex].value;">
  115.   <%
  116.        for i = 1 to rs.PageCount
  117.        if i = page then%>
  118.   <option value="?<%=query%>page=<%=i%>" selected><%=i%></option>
  119.   <%else%>
  120.   <option value="?<%=query%>page=<%=i%>"><%=i%></option>
  121.   <%
  122.           end if
  123.         next
  124.         %>
  125. </select>
  126. 页</div></td></tr> </table></form>
  127. <%
  128. set rs=conn.execute("select * from nclass")
  129. %>
  130. <script language = "JavaScript">
  131. var onecount;
  132. onecount=0;
  133. subcat = new Array();
  134. <%
  135. dim count
  136. count=0
  137. do while not rs.eof 
  138. if count=0 then
  139. %>
  140. subcat[0] = new Array("--请选择类别--","<%= trim(rs("classid"))%>","");
  141. <%
  142. count = count + 1
  143. end if
  144. %>
  145. subcat[<%=count%>] = new Array("<%= trim(rs("nclassname"))%>","<%= trim(rs("classid"))%>","<%= trim(rs("id"))%>");
  146. <%
  147. count = count + 1
  148. rs.movenext
  149. loop
  150. rs.close
  151. %>
  152. onecount=<%=count%>;
  153. function changelocation(locationid)
  154.     {
  155.     document.form2.nclassid.length = 0; 
  156.     var locationid=locationid;
  157.     var i;
  158.     for (i=0;i < onecount; i++)
  159.         {
  160.             if (subcat[i][1] == locationid)
  161.             { 
  162.                 document.form2.nclassid.options[document.form2.nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
  163.             }        
  164.         }
  165.         
  166.     } 
  167. </script>
  168. <table width="100%" border="0" cellspacing="0" cellpadding="1"> 
  169. <tr> <td WIDTH="35%"> <input type="button" value="刷新" onClick="history.go(0);" name="button2">
  170.       <INPUT TYPE="button" NAME="Submit" VALUE="全部" onClick="location.href='?';">
  171.       <input name="add" type="button" id="add" onClick="record_add();" value="添加">
  172.   <input type="button" value="修改" onClick="record_edit();" name="edit" disabled>
  173.       <input type="button" value="删除" onClick="record_del();" name="del" disabled></td>
  174.   <form name="form2" method="post" action="?"><td WIDTH="65%">
  175.       <input type="text" name="key">
  176.         <input type="submit" name="Submit2" value="查询">
  177. <script>
  178. function frmchk2()
  179. {
  180. if(form2.classid.value=='')
  181. {
  182. alert('系统提示:请先选择大类!');
  183. return false;
  184. }
  185. }
  186. function DelGood(x)
  187. {
  188. if(confirm('确认删除选择的记录?'))
  189. {
  190. window.location.href = "List_Del.asp?operation=del&checkbox=" + x;
  191. }
  192. }
  193. </script>
  194. &nbsp;
  195. </td>
  196.   </form>
  197. </tr> 
  198. </table>
  199. <script src="List_Use.js"></script> 
  200. </body>
  201. </html>
  202. <%
  203. call COCLS
  204. %>