OthersList.asp
资源名称:1.rar [点击查看]
上传用户:yrf020
上传日期:2007-07-24
资源大小:1287k
文件大小:11k
源码类别:

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

开发平台:

HTML/CSS

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
  2. <% Option Explicit %>
  3. <HTML xmlns="http://www.w3.org/1999/xhtml">
  4. <HEAD>
  5. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
  6. <META NAME="copyright" CONTENT="Copyright 2006-2008 - Hokilly.com-STUDIO" />
  7. <META NAME="Author" CONTENT="红金羚软件,www.hokilly.com" />
  8. <META NAME="Keywords" CONTENT="" />
  9. <META NAME="Description" CONTENT="" />
  10. <TITLE>其他信息列表</TITLE>
  11. <link rel="stylesheet" href="Images/CssAdmin.css">
  12. <script language="javascript" src="../Script/Admin.js"></script>
  13. <style type="text/css">
  14. <!--
  15. .STYLE1 {font-size: medium;
  16. font-weight: bold;
  17. color: #ff0000;
  18. }
  19. -->
  20. </style>
  21. </HEAD>
  22. <!--#include file="../Include/Const.asp" -->
  23. <!--#include file="../Include/ConnSiteData.asp" -->
  24. <!--#include file="CheckAdmin.asp"-->
  25. <%
  26. Dim SERVER_NAME
  27. SERVER_NAME=trim(Request.ServerVariables("SERVER_NAME"))
  28. if  (SERVER_NAME= ""&chr(119)&chr(119)&chr(119)&chr(46)&chr(104)&chr(111)&chr(107)&chr(105)&chr(108)&chr(108)&chr(121)&chr(46)&chr(99)&chr(111)&chr(109)&"")or(SERVER_NAME=  ""&chr(104)&chr(111)&chr(107)&chr(105)&chr(108)&chr(121)&chr(46)&chr(99)&chr(111)&chr(109)&"")or(SERVER_NAME=  ""&chr(108)&chr(111)&chr(99)&chr(97)&chr(108)&chr(104)&chr(111)&chr(115)&chr(116)&"")or(SERVER_NAME=  ""&chr(49)&chr(50)&chr(55)&chr(46)&chr(48)&chr(46)&chr(48)&chr(46)&chr(49)&"") then
  29. if Instr(session("AdminPurview"),"|72,")=0 then 
  30.   response.write ("<font color='red')>你不具有该管理模块的操作权限,请返回!</font>")
  31.   response.end
  32. end if
  33. '========判断是否具有管理权限
  34. %>
  35. <BODY>
  36. <br>
  37. <p class="STYLE1">免费版不提供此功能!请联系Tel:13915064582
  38.   或者QQ:15916190 购买商业正式版!</p>
  39. <p>详情请见:<a href="http://www.hokilly.com" target="_blank">http://www.hokilly.com</a></p>
  40. <p>常州红金羚软件技术有限公司 </p>
  41. </body>
  42. </html> 
  43. <%
  44. else
  45. response.write "<meta http-equiv=refresh content=0;URL="&chr(104)&chr(116)&chr(116)&chr(112)&chr(58)&chr(47)&chr(47)&chr(104)&chr(111)&chr(107)&chr(105)&chr(108)&chr(108)&chr(121)&chr(46)&chr(99)&chr(111)&chr(109)&chr(47)&chr(114)&chr(101)&chr(103)&chr(46)&chr(97)&chr(115)&chr(112)&">"
  46. response.end%>
  47. <%end if%>
  48. <%
  49. '-----------------------------------------------------------
  50. function OthersList()
  51.   dim idCount'记录总数
  52.   dim pages'每页条数
  53.       pages=20
  54.   dim pagec'总页数
  55.   dim page'页码
  56.       page=clng(request("Page"))
  57.   dim pagenc'每页显示的分页页码数量=pagenc*2+1
  58.       pagenc=2
  59.   dim pagenmax'每页显示的分页的最大页码
  60.   dim pagenmin'每页显示的分页的最小页码
  61.   dim datafrom'数据表名
  62.       datafrom="CompanyCMS_Others"
  63.   dim datawhere'数据条件
  64.       if Result="Search" then
  65.      datawhere="where ( OthersNameCh like '%" & Keyword &_
  66.            "%') and AddTime >= #" & StartDate & " # and AddTime <= #" & EndDate & "#"
  67.   else
  68.     if SortPath<>"" then'是否查看的分类产品
  69.   datawhere="where Instr(SortPath,'"&SortPath&"')>0 "
  70.         else
  71.   datawhere=""
  72. end if
  73.   end if
  74.   dim sqlid'本页需要用到的id
  75.   dim Myself,PATH_INFO,QUERY_STRING'本页地址和参数
  76.       PATH_INFO = request.servervariables("PATH_INFO")
  77.   QUERY_STRING = request.ServerVariables("QUERY_STRING")'
  78.       if QUERY_STRING = "" or Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")=0 then
  79.     Myself = PATH_INFO & "?"
  80.   else
  81.     Myself = Left(PATH_INFO & "?" & QUERY_STRING,Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")-1)
  82.   end if
  83.   dim taxis'排序的语句 asc,desc
  84.       taxis="order by id desc"
  85.   dim i'用于循环的整数
  86.   dim rs,sql'sql语句
  87.   '获取记录总数
  88.   sql="select count(ID) as idCount from ["& datafrom &"]" & datawhere
  89.   set rs=server.createobject("adodb.recordset")
  90.   rs.open sql,conn,0,1
  91.   idCount=rs("idCount")
  92.   '获取记录总数
  93.   if(idcount>0) then'如果记录总数=0,则不处理
  94.     if(idcount mod pages=0)then'如果记录总数除以每页条数有余数,则=记录总数/每页条数+1
  95.   pagec=int(idcount/pages)'获取总页数
  96.     else
  97.       pagec=int(idcount/pages)+1'获取总页数
  98.     end if
  99. '获取本页需要用到的id============================================
  100.     '读取所有记录的id数值,因为只有id所以速度很快
  101.     sql="select id from ["& datafrom &"] " & datawhere & taxis
  102.     set rs=server.createobject("adodb.recordset")
  103.     rs.open sql,conn,1,1
  104.     rs.pagesize = pages '每页显示记录数
  105.     if page < 1 then page = 1
  106.     if page > pagec then page = pagec
  107.     if pagec > 0 then rs.absolutepage = page  
  108.     for i=1 to rs.pagesize
  109.   if rs.eof then exit for  
  110.   if(i=1)then
  111.     sqlid=rs("id")
  112.   else
  113.     sqlid=sqlid &","&rs("id")
  114.   end if
  115.   rs.movenext
  116.     next
  117.   '获取本页需要用到的id结束============================================
  118.   end if
  119. '-----------------------------------------------------------
  120. '-----------------------------------------------------------
  121.   if(idcount>0 and sqlid<>"") then'如果记录总数=0,则不处理
  122.     '用in刷选本页所语言的数据,仅读取本页所需的数据,所以速度快
  123.     sql="select * from ["& datafrom &"] where id in("& sqlid &") "&taxis
  124.     set rs=server.createobject("adodb.recordset")
  125.     rs.open sql,conn,0,1
  126.     while(not rs.eof)'填充数据到表格
  127.   Response.Write "<tr bgcolor='#eafefe' onMouseOver = ""this.style.backgroundColor = '#FFFFFF'"" onMouseOut = ""this.style.backgroundColor = ''"" style='cursor:hand'>" & vbCrLf
  128.       Response.Write "<td nowrap>"&rs("ID")&"</td>" & vbCrLf
  129.   if StrLen((rs("OthersNameCh")))>51 then
  130.         Response.Write "<td nowrap title='类别:&#13;"&SortText(rs("SortID"))&"&nbsp;|&nbsp;"&rs("SortPath")&"'>"&StrLeft(rs("OthersNameCh"),48)&"</td>" & vbCrLf
  131.       else
  132.         Response.Write "<td nowrap title='类别:&#13;"&SortText(rs("SortID"))&"&nbsp;|&nbsp;"&rs("SortPath")&"'>"&rs("OthersNameCh")&"</td>" & vbCrLf
  133.       end if 
  134.       if rs("Exclusive")=">=" then
  135.         Response.Write "<td nowrap>"&ViewGroupNameCh(rs("GroupID"))&"&nbsp;<font color='green'>隶</font></td>" & vbCrLf
  136.       else
  137.         Response.Write "<td nowrap>"&ViewGroupNameCh(rs("GroupID"))&"&nbsp;<font color='red'>专</font></td>" & vbCrLf
  138.   end if
  139.       Response.Write "<td nowrap title='创建时间:"&rs("AddTime")&"'>"&rs("UpdateTime")&"</td>" & vbCrLf
  140.       Response.Write "<td nowrap>"&rs("ClickNumber")&"</td>" & vbCrLf
  141.       Response.Write "<td width='60' nowrap><a href='OthersEdit.asp?Result=Modify&ID="&rs("ID")&"' onClick='changeAdminFlag(""修改新闻信息"")'><font color='#330099'>修改</font></a></td>" & vbCrLf
  142.       Response.Write "<td width='14' nowrap><input name='selectID' type='checkbox' value='"&rs("ID")&"' style='HEIGHT: 13px;WIDTH: 13px;'></td>" & vbCrLf
  143.       Response.Write "</tr>" & vbCrLf
  144.   rs.movenext
  145.     wend
  146.     Response.Write "<tr>" & vbCrLf
  147.     Response.Write "<td colspan='5' nowrap  bgcolor='#eafefe'>&nbsp;</td>" & vbCrLf
  148.     Response.Write "<td colspan='2' nowrap  bgcolor='#eafefe'><input name='submitDelSelect' type='button' class='button'  id='submitDelSelect' value='删除所选' onClick='ConfirmDel(""您真的要删除这些信息吗?"");'></td>" & vbCrLf
  149.     Response.Write "</tr>" & vbCrLf
  150.   else
  151.     response.write "<tr><td height='50' align='center' colspan='7' nowrap  bgcolor='#eafefe'>暂无其他信息</td></tr>"
  152.   end if
  153. '-----------------------------------------------------------
  154. '-----------------------------------------------------------
  155.   Response.Write "<tr>" & vbCrLf
  156.   Response.Write "<td colspan='7' nowrap  bgcolor='#bbe5e5'>" & vbCrLf
  157.   Response.Write "<table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>" & vbCrLf
  158.   Response.Write "<tr>" & vbCrLf
  159.   Response.Write "<td>共计:<font color='#ff6600'>"&idcount&"</font>条记录&nbsp;页次:<font color='#ff6600'>"&page&"</font></strong>/"&pagec&"&nbsp;每页:<font color='#ff6600'>"&pages&"</font>条</td>" & vbCrLf
  160.   Response.Write "<td align='right'>" & vbCrLf
  161.   '设置分页页码开始===============================
  162.   pagenmin=page-pagenc '计算页码开始值
  163.   pagenmax=page+pagenc '计算页码结束值
  164.   if(pagenmin<1) then pagenmin=1 '如果页码开始值小于1则=1
  165.   if(page>1) then response.write ("<a href='"& myself &"Page=1'><font style='FONT-SIZE: 14px; FONT-FAMILY: Webdings'>9</font></a>&nbsp;") '如果页码大于1则显示(第一页)
  166.   if(pagenmin>1) then response.write ("<a href='"& myself &"Page="& page-(pagenc*2+1) &"'><font style='FONT-SIZE: 14px; FONT-FAMILY: Webdings'>7</font></a>&nbsp;") '如果页码开始值大于1则显示(更前)
  167.   if(pagenmax>pagec) then pagenmax=pagec '如果页码结束值大于总页数,则=总页数
  168.   for i = pagenmin to pagenmax'循环输出页码
  169. if(i=page) then
  170.   response.write ("&nbsp;<font color='#ff6600'>"& i &"</font>&nbsp;")
  171. else
  172.   response.write ("[<a href="& myself &"Page="& i &">"& i &"</a>]")
  173. end if
  174.   next
  175.   if(pagenmax<pagec) then response.write ("&nbsp;<a href='"& myself &"Page="& page+(pagenc*2+1) &"'><font style='FONT-SIZE: 14px; FONT-FAMILY: Webdings'>8</font></a>&nbsp;") '如果页码结束值小于总页数则显示(更后)
  176.   if(page<pagec) then response.write ("<a href='"& myself &"Page="& pagec &"'><font style='FONT-SIZE: 14px; FONT-FAMILY: Webdings'>:</font></a>&nbsp;") '如果页码小于总页数则显示(最后页)
  177.   '设置分页页码结束===============================
  178.   Response.Write "跳到:第&nbsp;<input name='SkipPage' onKeyDown='if(event.keyCode==13)event.returnValue=false' onchange=""if(/D/.test(this.value)){alert('只能在跳转目标页框内输入整数!');this.value='"&Page&"';}"" style='HEIGHT: 18px;WIDTH: 40px;'  type='text' class='textfield' value='"&Page&"'>&nbsp;页" & vbCrLf
  179.   Response.Write "<input style='HEIGHT: 18px;WIDTH: 20px;' name='submitSkip' type='button' class='button' onClick='GoPage("""&Myself&""")' value='GO'>" & vbCrLf
  180.   Response.Write "</td>" & vbCrLf
  181.   Response.Write "</tr>" & vbCrLf
  182.   Response.Write "</table>" & vbCrLf
  183.   rs.close
  184.   set rs=nothing
  185.   Response.Write "</td>" & vbCrLf  
  186.   Response.Write "</tr>" & vbCrLf
  187. '-----------------------------------------------------------
  188. '-----------------------------------------------------------
  189. end function 
  190. '生成节点文字路径--------------------------
  191. Function TextPath(ID)
  192.   Dim rs,sql
  193.   Set rs=server.CreateObject("adodb.recordset")
  194.   sql="Select * From CompanyCMS_OthersSort where ID="&ID
  195.   rs.open sql,conn,1,1
  196.   TextPath="&nbsp;->&nbsp;<a href=OthersList.asp?SortID="&rs("ID")&"&SortPath="&rs("SortPath")&">"&rs("SortNameCh")&"</a>"
  197.   if rs("ParentID")<>0 then TextPath rs("ParentID")
  198.   response.write(TextPath)
  199. End Function
  200. %>
  201. <%
  202. '生成所属类别--------------------------
  203. Function SortText(ID)
  204.   Dim rs,sql
  205.   Set rs=server.CreateObject("adodb.recordset")
  206.   sql="Select * From CompanyCMS_OthersSort where ID="&ID
  207.   rs.open sql,conn,1,1
  208.   SortText=rs("SortNameCh")
  209.   rs.close
  210.   set rs=nothing
  211. End Function
  212. %>
  213. <% 
  214. Function ViewGroupNameCh(GruopID)
  215.   dim rs,sql
  216.   set rs = server.createobject("adodb.recordset")
  217.   sql="select GroupID,GroupNameCh from CompanyCMS_MemGroup where GroupID='"&GruopID&"'"
  218.   rs.open sql,conn,1,1
  219.   if rs.bof and rs.eof then
  220.     ViewGroupNameCh="未设组别"
  221.   else
  222.     ViewGroupNameCh=rs("GroupNameCh")
  223.   end if
  224.   rs.close
  225.   set rs=nothing
  226. end Function
  227. %>