⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 default.asp

📁 视频源代码 视频源代码
💻 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 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

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="500" cellpadding="2" cellspacing="1">
  <tr bgcolor="EFEFEF"><th>分类ID</th><th>分类名</th><th width=30%>分类索引</th><th colspan="4">进行操作</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="default.asp?category=<%=category(2,i)%>&categoryindex=<%=category(2,i)%>">[<%=category(1,i)%>]</a></td>
    <td><%=category(2,i)%></td>
    <th width="40"><A href="javascript:openwin('chg.asp?categoryid=<%=category(0,i)%>','edit',350,200);">修改</a></th>
    <th width="40"><A href="javascript:del(<%=category(0,i)%>,'<%=category(1,i)%>');">删除</a></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><%=categorytree(0,k)%></th>
    <td><%for l=0 to j%><%if l=j then%>┗<%else%> <%end if%><%next%><a href="default.asp?category=<%=categoryid%>&categoryindex=<%=categorytree(2,k)%>">[<%=categorytree(1,k)%>]</a></td>
    <td><%=categorytree(2,k)%></td>
    <th width="40"><A href="javascript:openwin('chg.asp?categoryid=<%=categorytree(0,k)%>','edit',350,400);">修改</a></th>
    <th width="40"><A href="javascript:del(<%=categorytree(0,k)%>,'<%=categorytree(1,k)%>');">删除</a></th>
  </tr>
<form name="form" method="post" action="add.asp?old=<%=request("category")%>">
  <tr bgcolor="F5F5F5"><th><input type="hidden" name="categoryindex" value="<%=categorytree(2,k)%>"></th><th><input class="text" type="text" name="categoryname"></th><td><%=categorytree(2,k)&".x"%></td><th colspan="4"><input class="button" type="submit" name="Submit" value="提 交" title="新开下级分类"></th></tr>
</form>
<%          end if
          next
          Set categorytree=nothing
        next
        Set catearray=nothing
      end if
    end if
if not isarray(categoryindex) then%>
<form name="form" method="post" action="add.asp">
  <tr bgcolor="F5F5F5"><th><input type="hidden" name="categoryindex" value="<%=category(2,i)%>"></th><th><input class="text" type="text" name="categoryname"></th><td><%=category(2,i)&".x"%></td><th colspan="4"><input class="button" type="submit" name="Submit" value="提 交" title="新开下级分类"></th></tr>
</form>
<%end if
    categorynum=category(2,i)+1
  next
  Set category=nothing
end if
%>
<form name="form" method="post" action="add.asp">
  <tr bgcolor="F5F5F5"><th></th><th><input class="text" type="text" name="categoryname"></th><td><%=categorynum%></td><th colspan="4"><input class="button" type="submit" name="Submit" value="提 交" title="新开顶级分类"></th></tr>
</form>
</table>
<script>
function del(id,name){
  if (confirm("关于删除 " + name + " :\n\n  您真的要删除这个类别和这个类别下的所有内容吗?\n\n  删除前您必须确定该类别不存在子类别!\n\n  如果存在子类别,请先删除该类别下的所有子类别!\n\n       Copyright by 2001~2002 ZWCITY.COM")){
      document.location.href="del.asp?categoryid=" + id;
  }
}
</script>

<!--#include file="../inc/foot.asp"-->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -