SelectSort.asp
上传用户:dbstep
上传日期:2022-08-06
资源大小:2803k
文件大小:3k
源码类别:

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

开发平台:

ASP/ASPX

  1. <HTML xmlns="http://www.w3.org/1999/xhtml">
  2. <HEAD>
  3. <TITLE>选择分类</TITLE>
  4. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
  5. <link rel="stylesheet" href="Images/CssAdmin.css">
  6. <script language="javascript" src="../skweb/JS/Admin.js"></script>
  7. </HEAD>
  8. <!--#include file="../skweb/Const.asp" -->
  9. <!--#include file="../skweb/ConnSiteData.asp" -->
  10. <!--#include file="CheckAdmin.asp"-->
  11. <BODY>
  12. <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">
  13.     <tr>
  14.       <td height="29" nowrap background="Images/menutitle.gif"><A href="#Help"></A> <strong>选择所属类别:点击'选择'添加</strong></td>
  15.     </tr>
  16.     <tr>
  17.       <td height="24" nowrap bgcolor="#EBF2F9">
  18.   <table width="100%" height="6" border="0" cellspacing="0" cellpadding="0">
  19.         <tr>
  20.           <td></td>
  21.         </tr>
  22.       </table>
  23.   <%
  24.       Dim Result,Datafrom
  25.       Result=trim(request.QueryString("Result"))
  26.       Select Case Result
  27.         Case "Products"
  28.   Datafrom="sk_ProductSort"
  29.         Case "Productsl"
  30.   Datafrom="sk_ProductSortl"
  31.         Case "Productsv"
  32.   Datafrom="sk_ProductSortv" 
  33.         Case "News"
  34.   Datafrom="sk_NewsSort"
  35.         Case "Download"
  36.   Datafrom="sk_DownSort"
  37.         Case "Need"
  38.   Datafrom="sk_NeedSort"
  39.         Case "Others"
  40.   Datafrom="sk_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
  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 ChildCount=0 then
  65.   if i=rs.recordcount then
  66.     FolderType="SortFileEnd"
  67.   else
  68.     FolderType="SortFile"
  69.   end if
  70.   FolderName=rs("SortName")
  71.   onMouseUp=""
  72.     else
  73.   if i=rs.recordcount then
  74.   FolderType="SortEndFolderClose"
  75. ListType="SortEndListline"
  76. onMouseUp="EndSortChange('a"&rs("id")&"','b"&rs("id")&"');"
  77.   else
  78. FolderType="SortFolderClose"
  79. ListType="SortListline"
  80. onMouseUp="SortChange('a"&rs("id")&"','b"&rs("id")&"');"
  81.   end if
  82.   FolderName=rs("SortName")
  83.     end if
  84.     response.write("<tr>")
  85.     response.write("<td nowrap id='b"&rs("id")&"' class='"&FolderType&"' onMouseUp="&onMouseUp&"></td><td nowrap>"&FolderName&"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")
  86.     response.write("<a href=javaScript:AddSort('"&SortText(rs("ID"))&"','"&rs("ID")&"','"&trim(rs("SortPath"))&"')><font color='#ff6600'>选择</font></a>")
  87.     response.write("</td></tr>")
  88.     if ChildCount>0 then
  89. %>
  90.       <tr id="a<%= rs("id")%>" style="display:yes"><td class="<%= ListType%>" nowrap></td><td ><% ListSort(rs("id")) %></td></tr>
  91. <%
  92.     end if
  93.     rs.movenext
  94.     i=i+1
  95.   wend
  96.   response.write("</table>")
  97.   rs.close
  98.   set rs=nothing
  99. end function
  100. %>
  101. <%
  102. '生成所属类别--------------------------
  103. Function SortText(ID)
  104.   Dim rs,sql
  105.   Set rs=server.CreateObject("adodb.recordset")
  106.   sql="Select * From "&Datafrom&" where ID="&ID
  107.   rs.open sql,conn,1,1
  108.   SortText=rs("SortName")
  109.   rs.close
  110.   set rs=nothing
  111. End Function
  112. %>