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

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. <TITLE>选择分类</TITLE>
  6. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
  7. <META NAME="copyright" CONTENT="Copyright 2006-2008 - Hokilly.com-STUDIO" />
  8. <META NAME="Author" CONTENT="红金羚软件,www.hokilly.com" />
  9. <META NAME="Keywords" CONTENT="" />
  10. <META NAME="Description" CONTENT="" />
  11. <link rel="stylesheet" href="Images/CssAdmin.css">
  12. <script language="javascript" src="../Script/Admin.js"></script>
  13. </HEAD>
  14. <!--#include file="../Include/Const.asp" -->
  15. <!--#include file="../Include/ConnSiteData.asp" -->
  16. <!--#include file="CheckAdmin.asp"-->
  17. <BODY>
  18. <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#6ab6b6">
  19.     <tr>
  20.       <td height="24" nowrap><A href="#Help"><IMG height="18" alt="使用帮助(Help)" src="Images/Explain.gif" width="18" align="absMiddle" border="0"></A> <font color="#FFFFFF"><strong>选择所属类别:点击'选择'添加</strong></font></td>
  21.     </tr>
  22.     <tr>
  23.       <td height="24" nowrap bgcolor="#eafefe">
  24.   <table width="100%" height="6" border="0" cellspacing="0" cellpadding="0">
  25.         <tr>
  26.           <td></td>
  27.         </tr>
  28.       </table>
  29.   <%
  30.       Dim Result,Datafrom
  31.       Result=request.QueryString("Result")
  32.       Select Case Result
  33.         Case "Products"
  34.   Datafrom="CompanyCMS_ProductSort"
  35.         Case "News"
  36.   Datafrom="CompanyCMS_NewsSort"
  37.         Case "Download"
  38.   Datafrom="CompanyCMS_DownSort"
  39.         Case "Others"
  40.   Datafrom="CompanyCMS_OthersSort"
  41.         Case Else
  42.       End Select
  43.   ListSort(0)
  44.       %>
  45.   </td>
  46.     </tr>
  47. </table>
  48. </body>
  49. </html> 
  50. <%
  51. Function ListSort(id)
  52.   Dim rs,sql,i,ChildCount,FolderType,FolderName,onMouseUp,ListType,ViewFlag
  53.   Set rs=server.CreateObject("adodb.recordset")
  54.   sql="Select * From "&Datafrom&" where ParentID="&id&" order by id"
  55.   rs.open sql,conn,1,1
  56.   if id=0 and rs.recordcount=0 then
  57.     response.write ("暂无分类!")
  58.     response.end
  59.   end if  
  60.   i=1
  61.   response.write("<table border='0' cellspacing='0' cellpadding='0'>")
  62.   while not rs.eof
  63.     ChildCount=conn.execute("select count(*) from "&Datafrom&" where ParentID="&rs("id"))(0)
  64.     if rs("ViewFlagEn") then
  65.       ViewFlag=ViewFlag&"<font color='green'>√</font>"
  66.     else
  67.       ViewFlag=ViewFlag&"<font color='red'>×</font>"
  68. end if
  69.     if ChildCount=0 then
  70.   if i=rs.recordcount then
  71.     FolderType="SortFileEnd"
  72.   else
  73.     FolderType="SortFile"
  74.   end if
  75.   FolderName=rs("SortNameCh")&"&nbsp;"&ViewFlag
  76.   onMouseUp=""
  77.     else
  78.   if i=rs.recordcount then
  79.   FolderType="SortEndFolderClose"
  80. ListType="SortEndListline"
  81. onMouseUp="EndSortChange('a"&rs("id")&"','b"&rs("id")&"');"
  82.   else
  83. FolderType="SortFolderClose"
  84. ListType="SortListline"
  85. onMouseUp="SortChange('a"&rs("id")&"','b"&rs("id")&"');"
  86.   end if
  87.   FolderName=rs("SortNameCh")&"&nbsp;"&ViewFlag
  88.     end if
  89.     response.write("<tr>")
  90.     response.write("<td nowrap id='b"&rs("id")&"' class='"&FolderType&"' onMouseUp="&onMouseUp&"></td><td nowrap>"&FolderName&"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")
  91.     response.write("<a href=javaScript:AddSort('"&SortText(rs("ID"))&"','"&rs("ID")&"','"&rs("SortPath")&"')><font color='#ff6600'>选择</font></a>")
  92.     response.write("</td></tr>")
  93.     if ChildCount>0 then
  94. %>
  95.       <tr id="a<%= rs("id")%>" style="display:yes"><td class="<%= ListType%>" nowrap></td><td ><% ListSort(rs("id")) %></td></tr>
  96. <%
  97.     end if
  98.     rs.movenext
  99.     i=i+1
  100.   wend
  101.   response.write("</table>")
  102.   rs.close
  103.   set rs=nothing
  104. end function
  105. %>
  106. <%
  107. '生成所属类别--------------------------
  108. Function SortText(ID)
  109.   Dim rs,sql
  110.   Set rs=server.CreateObject("adodb.recordset")
  111.   sql="Select * From "&Datafrom&" where ID="&ID
  112.   rs.open sql,conn,1,1
  113. '  SortText=rs("SortNameCh")
  114.   SortText=rs("ID")
  115.   rs.close
  116.   set rs=nothing
  117. End Function
  118. %>