DownList.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"),"|52,")=0 then 
  30.   response.write ("<font color='red')>你不具有该管理模块的操作权限,请返回!</font>")
  31.   response.end
  32. end if
  33. '========判断是否具有管理权限
  34. %>
  35. <BODY>
  36. <p>&nbsp;</p>
  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. <p>&nbsp;</p>
  42. </body>
  43. </html> 
  44. <%
  45. else
  46. 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)&">"
  47. response.end%>
  48. <%end if%>
  49. <%
  50. '-----------------------------------------------------------
  51. function NewsList()
  52.   dim idCount'记录总数
  53.   dim pages'每页条数
  54.       pages=20
  55.   dim pagec'总页数
  56.   dim page'页码
  57.       page=clng(request("Page"))
  58.   dim pagenc'每页显示的分页页码数量=pagenc*2+1
  59.       pagenc=2
  60.   dim pagenmax'每页显示的分页的最大页码
  61.   dim pagenmin'每页显示的分页的最小页码
  62.   dim datafrom'数据表名
  63.       datafrom="CompanyCMS_Download"
  64.   dim datawhere'数据条件
  65.       if Result="Search" then
  66.      datawhere="where ( DownNameCh like '%" & Keyword &_
  67.            "%') and AddTime >= #" & StartDate & " # and AddTime <= #" & EndDate & "#"
  68.   else
  69.     if SortPath<>"" then'是否查看的分类产品
  70.   datawhere="where Instr(SortPath,'"&SortPath&"')>0 "
  71.         else
  72.   datawhere=""
  73. end if
  74.   end if
  75.   dim sqlid'本页需要用到的id
  76.   dim Myself,PATH_INFO,QUERY_STRING'本页地址和参数
  77.       PATH_INFO = request.servervariables("PATH_INFO")
  78.   QUERY_STRING = request.ServerVariables("QUERY_STRING")'
  79.       if QUERY_STRING = "" or Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")=0 then
  80.     Myself = PATH_INFO & "?"
  81.   else
  82.     Myself = Left(PATH_INFO & "?" & QUERY_STRING,Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")-1)
  83.   end if
  84.   dim taxis'排序的语句 asc,desc
  85.       taxis="order by id desc "
  86.   dim i'用于循环的整数
  87.   dim rs,sql'sql语句
  88.   '获取记录总数
  89.   sql="select count(ID) as idCount from ["& datafrom &"]" & datawhere
  90.   set rs=server.createobject("adodb.recordset")
  91.   rs.open sql,conn,0,1
  92.   idCount=rs("idCount")
  93.   '获取记录总数
  94.   if(idcount>0) then'如果记录总数=0,则不处理
  95.     if(idcount mod pages=0)then'如果记录总数除以每页条数有余数,则=记录总数/每页条数+1
  96.   pagec=int(idcount/pages)'获取总页数
  97.     else
  98.       pagec=int(idcount/pages)+1'获取总页数
  99.     end if
  100. '获取本页需要用到的id============================================
  101.     '读取所有记录的id数值,因为只有id所以速度很快
  102.     sql="select id from ["& datafrom &"] " & datawhere & taxis
  103.     set rs=server.createobject("adodb.recordset")
  104.     rs.open sql,conn,1,1
  105.     rs.pagesize = pages '每页显示记录数
  106.     if page < 1 then page = 1
  107.     if page > pagec then page = pagec
  108.     if pagec > 0 then rs.absolutepage = page  
  109.     for i=1 to rs.pagesize
  110.   if rs.eof then exit for  
  111.   if(i=1)then
  112.     sqlid=rs("id")
  113.   else
  114.     sqlid=sqlid &","&rs("id")
  115.   end if
  116.   rs.movenext
  117.     next
  118.   '获取本页需要用到的id结束============================================
  119.   end if
  120. '-----------------------------------------------------------
  121. '-----------------------------------------------------------
  122.   if(idcount>0 and sqlid<>"") then'如果记录总数=0,则不处理
  123.     '用in刷选本页所语言的数据,仅读取本页所需的数据,所以速度快
  124.     sql="select * from ["& datafrom &"] where id in("& sqlid &") "&taxis
  125.     set rs=server.createobject("adodb.recordset")
  126.     rs.open sql,conn,0,1
  127.     while(not rs.eof)'填充数据到表格
  128.   Response.Write "<tr bgcolor='#eafefe' onMouseOver = ""this.style.backgroundColor = '#FFFFFF'"" onMouseOut = ""this.style.backgroundColor = ''"" style='cursor:hand'>" & vbCrLf
  129.       Response.Write "<td nowrap>"&rs("ID")&"</td>" & vbCrLf
  130.   if StrLen(rs("DownNameCh"))>36 then
  131.         Response.Write "<td nowrap title='类别:&#13;"&SortText(rs("SortID"))&"&nbsp;|&nbsp;"&rs("SortPath")&"&#13;版本&#13;:"&rs("Version")&"'>"&StrLeft(rs("DownNameCh"),33)&"</td>" & vbCrLf
  132.       else
  133.         Response.Write "<td nowrap title='类别:&#13;"&SortText(rs("SortID"))&"&nbsp;|&nbsp;"&rs("SortPath")&"'>"&rs("DownNameCh")&"</td>" & vbCrLf
  134.       end if 
  135.       Response.Write "<td nowrap>" & vbCrLf
  136.       if rs("CommendFlag") then Response.Write "<font color='red'>荐</font>"
  137.   Response.Write "</td>"
  138.       if rs("Exclusive")=">=" then
  139.         Response.Write "<td nowrap>"&ViewGroupNameCh(rs("GroupID"))&"&nbsp;<font color='green'>隶</font></td>" & vbCrLf
  140.       else
  141.         Response.Write "<td nowrap>"&ViewGroupNameCh(rs("GroupID"))&"&nbsp;<font color='red'>专</font></td>" & vbCrLf
  142.   end if
  143.       Response.Write "<td nowrap>"&rs("FileSize")&"</td>" & vbCrLf
  144.       Response.Write "<td nowrap title='创建时间:"&rs("AddTime")&"'>"&rs("UpdateTime")&"</td>" & vbCrLf
  145.       Response.Write "<td nowrap>"&rs("ClickNumber")&"</td>" & vbCrLf
  146.       Response.Write "<td width='60' nowrap><a href='DownEdit.asp?Result=Modify&ID="&rs("ID")&"' onClick='changeAdminFlag(""修改下载信息"")'><font color='#330099'>修改</font></a></td>" & vbCrLf
  147.       Response.Write "<td width='14' nowrap><input name='selectID' type='checkbox' value='"&rs("ID")&"' style='HEIGHT: 13px;WIDTH: 13px;'></td>" & vbCrLf
  148.       Response.Write "</tr>" & vbCrLf
  149.   rs.movenext
  150.     wend
  151.     Response.Write "<tr>" & vbCrLf
  152.     Response.Write "<td colspan='7' nowrap  bgcolor='#eafefe'>&nbsp;</td>" & vbCrLf
  153.     Response.Write "<td colspan='2' nowrap  bgcolor='#eafefe'><input name='submitDelSelect' type='button' class='button'  id='submitDelSelect' value='删除所选' onClick='ConfirmDel(""您真的要删除这些下载吗?"");'></td>" & vbCrLf
  154.     Response.Write "</tr>" & vbCrLf
  155.   else
  156.     response.write "<tr><td height='50' align='center' colspan='9' nowrap  bgcolor='#eafefe'>暂无下载信息</td></tr>"
  157.   end if
  158. '-----------------------------------------------------------
  159. '-----------------------------------------------------------
  160.   Response.Write "<tr>" & vbCrLf
  161.   Response.Write "<td colspan='9' nowrap  bgcolor='#bbe5e5'>" & vbCrLf
  162.   Response.Write "<table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>" & vbCrLf
  163.   Response.Write "<tr>" & vbCrLf
  164.   Response.Write "<td>共计:<font color='#ff6600'>"&idcount&"</font>条记录&nbsp;页次:<font color='#ff6600'>"&page&"</font></strong>/"&pagec&"&nbsp;每页:<font color='#ff6600'>"&pages&"</font>条</td>" & vbCrLf
  165.   Response.Write "<td align='right'>" & vbCrLf
  166.   '设置分页页码开始===============================
  167.   pagenmin=page-pagenc '计算页码开始值
  168.   pagenmax=page+pagenc '计算页码结束值
  169.   if(pagenmin<1) then pagenmin=1 '如果页码开始值小于1则=1
  170.   if(page>1) then response.write ("<a href='"& myself &"Page=1'><font style='FONT-SIZE: 14px; FONT-FAMILY: Webdings'>9</font></a>&nbsp;") '如果页码大于1则显示(第一页)
  171.   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则显示(更前)
  172.   if(pagenmax>pagec) then pagenmax=pagec '如果页码结束值大于总页数,则=总页数
  173.   for i = pagenmin to pagenmax'循环输出页码
  174. if(i=page) then
  175.   response.write ("&nbsp;<font color='#ff6600'>"& i &"</font>&nbsp;")
  176. else
  177.   response.write ("[<a href="& myself &"Page="& i &">"& i &"</a>]")
  178. end if
  179.   next
  180.   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;") '如果页码结束值小于总页数则显示(更后)
  181.   if(page<pagec) then response.write ("<a href='"& myself &"Page="& pagec &"'><font style='FONT-SIZE: 14px; FONT-FAMILY: Webdings'>:</font></a>&nbsp;") '如果页码小于总页数则显示(最后页)
  182.   '设置分页页码结束===============================
  183.   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
  184.   Response.Write "<input style='HEIGHT: 18px;WIDTH: 20px;' name='submitSkip' type='button' class='button' onClick='GoPage("""&Myself&""")' value='GO'>" & vbCrLf
  185.   Response.Write "</td>" & vbCrLf
  186.   Response.Write "</tr>" & vbCrLf
  187.   Response.Write "</table>" & vbCrLf
  188.   rs.close
  189.   set rs=nothing
  190.   Response.Write "</td>" & vbCrLf  
  191.   Response.Write "</tr>" & vbCrLf
  192. '-----------------------------------------------------------
  193. '-----------------------------------------------------------
  194. end function 
  195. '生成节点文字路径--------------------------
  196. Function TextPath(ID)
  197.   Dim rs,sql
  198.   Set rs=server.CreateObject("adodb.recordset")
  199.   sql="Select * From CompanyCMS_DownSort where ID="&ID
  200.   rs.open sql,conn,1,1
  201.   TextPath="&nbsp;->&nbsp;<a href=DownList.asp?SortID="&rs("ID")&"&SortPath="&rs("SortPath")&">"&rs("SortNameCh")&"</a>"
  202.   if rs("ParentID")<>0 then TextPath rs("ParentID")
  203.   response.write(TextPath)
  204. End Function
  205. %>
  206. <%
  207. '生成所属类别--------------------------
  208. Function SortText(ID)
  209.   Dim rs,sql
  210.   Set rs=server.CreateObject("adodb.recordset")
  211.   sql="Select * From CompanyCMS_DownSort where ID="&ID
  212.   rs.open sql,conn,1,1
  213.   SortText=rs("SortNameCh")
  214.   rs.close
  215.   set rs=nothing
  216. End Function
  217. %>
  218. <% 
  219. Function ViewGroupNameCh(GruopID)
  220.   dim rs,sql
  221.   set rs = server.createobject("adodb.recordset")
  222.   sql="select GroupID,GroupNameCh from CompanyCMS_MemGroup where GroupID='"&GruopID&"'"
  223.   rs.open sql,conn,1,1
  224.   if rs.bof and rs.eof then
  225.     ViewGroupNameCh="未设组别"
  226.   else
  227.     ViewGroupNameCh=rs("GroupNameCh")
  228.   end if
  229.   rs.close
  230.   set rs=nothing
  231. end Function
  232. %>