SelectSort.asp
上传用户:dbstep
上传日期:2022-08-06
资源大小:2803k
文件大小:3k
- <HTML xmlns="http://www.w3.org/1999/xhtml">
- <HEAD>
- <TITLE>选择分类</TITLE>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
- <link rel="stylesheet" href="Images/CssAdmin.css">
- <script language="javascript" src="../skweb/JS/Admin.js"></script>
- </HEAD>
- <!--#include file="../skweb/Const.asp" -->
- <!--#include file="../skweb/ConnSiteData.asp" -->
- <!--#include file="CheckAdmin.asp"-->
- <BODY>
- <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">
- <tr>
- <td height="29" nowrap background="Images/menutitle.gif"><A href="#Help"></A> <strong>选择所属类别:点击'选择'添加</strong></td>
- </tr>
- <tr>
- <td height="24" nowrap bgcolor="#EBF2F9">
- <table width="100%" height="6" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td></td>
- </tr>
- </table>
- <%
- Dim Result,Datafrom
- Result=trim(request.QueryString("Result"))
- Select Case Result
- Case "Products"
- Datafrom="sk_ProductSort"
- Case "Productsl"
- Datafrom="sk_ProductSortl"
- Case "Productsv"
- Datafrom="sk_ProductSortv"
- Case "News"
- Datafrom="sk_NewsSort"
- Case "Download"
- Datafrom="sk_DownSort"
- Case "Need"
- Datafrom="sk_NeedSort"
- Case "Others"
- Datafrom="sk_OthersSort"
- Case Else
-
- End Select
- ListSort(0)
- %>
- </td>
- </tr>
- </table>
- </BODY>
- </HTML>
- <%
- Function ListSort(id)
- Dim rs,sql,i,ChildCount,FolderType,FolderName,onMouseUp,ListType
- Set rs=server.CreateObject("adodb.recordset")
- sql="Select * From "&Datafrom&" where ParentID="&id&" order by id"
- rs.open sql,conn,1,1
- if id=0 and rs.recordcount=0 then
- response.write ("暂无分类!")
- response.end
- end if
- i=1
- response.write("<table border='0' cellspacing='0' cellpadding='0'>")
- while not rs.eof
- ChildCount=conn.execute("select count(*) from "&Datafrom&" where ParentID="&rs("id"))(0)
- if ChildCount=0 then
- if i=rs.recordcount then
- FolderType="SortFileEnd"
- else
- FolderType="SortFile"
- end if
- FolderName=rs("SortName")
- onMouseUp=""
- else
- if i=rs.recordcount then
- FolderType="SortEndFolderClose"
- ListType="SortEndListline"
- onMouseUp="EndSortChange('a"&rs("id")&"','b"&rs("id")&"');"
- else
- FolderType="SortFolderClose"
- ListType="SortListline"
- onMouseUp="SortChange('a"&rs("id")&"','b"&rs("id")&"');"
- end if
- FolderName=rs("SortName")
- end if
- response.write("<tr>")
- response.write("<td nowrap id='b"&rs("id")&"' class='"&FolderType&"' onMouseUp="&onMouseUp&"></td><td nowrap>"&FolderName&" ")
- response.write("<a href=javaScript:AddSort('"&SortText(rs("ID"))&"','"&rs("ID")&"','"&trim(rs("SortPath"))&"')><font color='#ff6600'>选择</font></a>")
- response.write("</td></tr>")
- if ChildCount>0 then
- %>
- <tr id="a<%= rs("id")%>" style="display:yes"><td class="<%= ListType%>" nowrap></td><td ><% ListSort(rs("id")) %></td></tr>
- <%
- end if
- rs.movenext
- i=i+1
- wend
- response.write("</table>")
- rs.close
- set rs=nothing
- end function
- %>
- <%
- '生成所属类别--------------------------
- Function SortText(ID)
- Dim rs,sql
- Set rs=server.CreateObject("adodb.recordset")
- sql="Select * From "&Datafrom&" where ID="&ID
- rs.open sql,conn,1,1
- SortText=rs("SortName")
- rs.close
- set rs=nothing
- End Function
- %>