📄 class.asp
字号:
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/vip.asp"-->
<%
if not adminlevel=1 then
call msgbox("管理员级别够!",1)
end if
sql="select categoryid,categoryname,categoryindex,categorysort from category where not categoryindex like '%.%' order by categoryid ASC"
rs.open sql,conn,1,1
if not rs.eof then
category=rs.getrows
end if
rs.close
categoryid =request("category")
if not isnumeric(categoryid) then
call msgbox("指定分类不正确!",1)
end if
categoryindex =request("categoryindex")
if categoryindex><"" then
categoryindex =split(categoryindex,".")
end if
sort =strFilter(request("sort"),20)
dim categoryarray(0)
if isarray(categoryindex) then
for i=0 to ubound(categoryindex,1)
if categorysort="" then
categorysort=categoryindex(0)&"."
else
categorysort=categorysort&categoryindex(i)&"."
end if
sql="select categoryid,categoryname,categoryindex,categorysort from category where categoryindex like '"&categorysort&"%' order by categoryid ASC"
rs.open sql,conn,1,1
if not rs.eof then
categoryarraytree=rs.getrows
else
exit for
end if
rs.close
if isarray(categoryarraytree) then
for j=0 to ubound(categoryarraytree,2)
catesort=split(categoryarraytree(2,j),".")
if ubound(catesort,1)>i+1 then
categoryarraytree(0,j)=""
end if
next
if i=0 then
catearray=categoryarray
catearray(0)=categoryarraytree
else
redim preserve catearray(i)
catearray(i)=categoryarraytree
end if
end if
next
end if
Set rs=nothing
Set conn=nothing
%>
<!--#include file="../inc/head.asp"-->
<table border="0" align="center" width="400" cellpadding="2" cellspacing="1">
<tr bgcolor="EFEFEF"><th>分类ID</th><th>分类名</th><th>分类索引</th><th colspan="2">进行操作</th></tr>
<%
formtable=false
if isarray(category) then
for i=0 to ubound(category,2)
%>
<tr bgcolor="FFFFFF">
<th><%=category(0,i)%></th>
<td><a href="../category/class.asp?category=<%=category(2,i)%>&categoryindex=<%=category(2,i)%>&sort=<%=sort%>">[<%=category(1,i)%>]</a></td>
<td><%=category(2,i)%></td>
<th width="40"></th>
<th width="40"></th>
</tr>
<% if categoryid=category(2,i) then
if isarray(catearray) then
for j=0 to ubound(catearray,1)
categorytree=catearray(j)
for k=0 to ubound(categorytree,2)
if categorytree(0,k)><"" and (instr(request("categoryindex"),categorytree(2,k))=1 or instr(categorytree(2,k),request("categoryindex"))>0) then%>
<tr bgcolor="#FFFFFF">
<th><A href="../<%=categorytree(3,k)%>/find.asp?categoryid=<%=categorytree(0,k)%>" style="color:003063" title="查询该栏目下内容"><b><%=categorytree(0,k)%></b></a></th>
<td><%for l=0 to j%><%if l=j then%>┗<%else%> <%end if%><%next%><a href="../category/class.asp?category=<%=categoryid%>&categoryindex=<%=categorytree(2,k)%>&sort=<%=sort%>">[<%=categorytree(1,k)%>]</a></td>
<td><%=categorytree(2,k)%></td>
<%if (categorytree(3,k)=sort or sort="") and not isNull(categorytree(3,k)) then%>
<th width="40" bgcolor="F5F5F5"><A href="../<%=categorytree(3,k)%>/add.asp?categoryid=<%=categorytree(0,k)%>">录入</a></th>
<th width="40" bgcolor="F5F5F5"><A href="../<%=categorytree(3,k)%>/default.asp?categoryid=<%=categorytree(0,k)%>">管理</a></th>
</tr>
<%else%>
<th width="40"></th>
<th width="40"></th>
</tr>
<%end if
end if
next
Set categorytree=nothing
next
Set catearray=nothing
end if
end if
next
Set category=nothing
end if
Set category=nothing%>
</table>
<!--#include file="../inc/foot.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -