<% data_path="../../../" 'ACC连接数据库路径,对SQL无效 %> <% if request.Cookies("masterflag")="" or request.Cookies("masterflag")="" then response.write "" response.end end if '权限限制^^^^^^^^^^^^^^^^^^^^ dim ishavegant ishavegant=false in_str=split(request.Cookies("masterflag"),",") for each ins in in_str if trim(ins)="04" then ishavegant=true end if next if ishavegant=false then response.redirect "../../err.asp" response.end end if if request.querystring("id")="" then Sql="Select * from benming_ch_NewsCat where root=0 order by orderid" else Sql="Select * from benming_ch_NewsCat where root="&request.querystring("id")&" order by orderid" end if set Rs=server.CreateObject("ADODB.Recordset") Rs.open Sql,conn,1,1 msg_per_page=20 %>
新闻分类

注意
①类别直接与发布的信息相关联,删除类别可能会影响到以前发布的新闻信息。

  管理新闻 | 添加新闻 | 管理类别 | 添加类别 | [刷新页面]
<% j=1 do while not rs.eof and rowcount > 0 %> <% rowcount=rowcount-1 rs.movenext j=j+1 loop %>
新闻分类列表
      分类名称 所属分类 排序 操作
      "><%=Rs("CatName")%>[<%=GetCount(Rs("id"))%>] [ID=<%=Rs("id")%>]   <%if rs("root")=0 then response.write("作为顶级分类") else response.write GetCatName(request.querystring("id")) end if %>  <%=Rs("ORderID")%> ">修改 | ">删除
<%=listPages("Class.asp?id="&request.querystring("id"))%>
 
<% Rs.close Set Rs=nothing '分类名称 Function GetCatName(id) Sql="Select CatName from benming_ch_NewsCat where id="&id Set Rs1=Server.Createobject("ADODB.RecordSet") Rs1.open Sql,Conn,1,1 if Rs1.bof=false and Rs1.eof=false then GetCatName=Rs1("CatName") end if Rs1.close Set Rs1=nothing end function Function GetCount(id) Sql="Select Count(*) from benming_ch_NewsCat where root="&id Set Rs1=Server.Createobject("ADODB.RecordSet") Rs1.open Sql,Conn,1,1 if Rs1.bof=False and Rs1.eof=False then GetCount=Rs1(0) else GetCount=0 end if End Function Conn.close Set Conn=nothing %>