<!--#include file="../ACT.Function.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>栏目管理</title>
<link href="../Images/css1/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<%
	Dim Article_rs,Article_rs_1,ChangesLink,ModeID,ModeName
	 ModeID = ACTCMS.ChkNumeric(Request("ModeID"))
	 if ModeID=0 or ModeID="" Then ModeID=1
	  ModeName= ACTCMS.ACT_C(ModeID,1) 
	If Not ACTCMS.ACTCMS_QXYZ(ModeID,"","") Then   Call Actcms.Alert("对不起，您没有"&ACTCMS.ACT_C(ModeID,1)&"系该项操作权限！","")
%>
<table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
	<tr >
		<td class="bg_tr">您现在的位置：<%=ModeName%>管理中心 >> 栏目管理</td>
	</tr>
	<tr>
		<td height="18" ><a href="ACT.Class.asp?ModeID=<%=ModeID %>">管理首页</a>┆<a href="ACT.ClassAdd.asp?ModeID=<%=ModeID %>&Action=add">添加根栏目</a>┆<a href="ACT.ClassAct.asp?Action=one&ModeID=<%=ModeID %>">栏目排序</a></td>
	</tr>
</table>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
	<form name="ClassForm" method="post" action="?Action">
		<tr class="bg_tr">
			<td width="5%" height="25" class="bg_tr">
				<div align="center">ClassID</div>			</td>
			<td width="30%" class="bg_tr">
				<div align="center">栏目中文[栏目英文]</div>			</td>
			<td width="7%" class="bg_tr">
				<div align="center">权重</div>			</td>
		  <td width="22%" align="center" class="bg_tr">栏目属性</td>
			<td width="36%" class="bg_tr">
				<div align="center">操作</div>			</td>
		</tr>
		<%
	Set Article_rs = Server.CreateObject("adodb.recordset")
	Article_rs.Open "Select Orderid,id,ClassID,ClassName,enname,ClassEName,ChangesLinkUrl,dh,tg from Class_Act where Parentid  = '0'  And ModeID = "&ModeID&" Order by Orderid asc,ID asc",Conn,1,1
	if Article_rs.eof then
	   Response.Write"<TR  class=""td_bg""><TD colspan=""5""  class=""td_bg"" height=""40"">没有记录</TD></TR>"
	else
	
	do while not Article_rs.eof
			if Article_rs.eof Then exit do
	%>
		<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
			<td height="22" >
				<div align="center">
					<% = Article_rs("ClassID")%>
				</div>			</td>
			<td height="22" >
				<% 
		if Article_rs("ChangesLinkUrl") <> "" then
			Response.Write  "<img src=""../images/-.gif""></img><a href="&Article_rs("ChangesLinkUrl")&"><font color=green>"&Article_rs("ClassName")&"</font></a>"
		Else
			Response.Write  "<img src=""../images/-.gif""></img><a href=ACT.Manage.asp?Action=ListID&ModeID="&ModeID&"&ClassID="&Article_rs("ClassID")&">"&ACTCMS.HTMLCode(Article_rs("ClassName"))&"</a>&nbsp;[文章："&Conn.Execute("Select Count(id) From  "&ACTCMS.ACT_C(ModeID,2)&"  Where Classid='" & Article_rs("ClassID")&"'")(0)&"]"
		End if
		Set Article_rs_1 = server.CreateObject("adodb.recordset")
		%>
			</td>
			<td  align="center">
				<% = Article_rs("OrderID")%>			</td>
		  <td ><div align="center">
					<%dim tmpstr
			  if Trim(Article_rs("ChangesLinkUrl")) <> "" then
				 response.Write "<font color=red title='外部链接'>外部</font>&nbsp;┆&nbsp;" 
			  Else
				 response.Write "<font title='系统目录'>系统</font>&nbsp;┆&nbsp;" 
			  End if
			  if Article_rs("tg")=1 then
				 response.Write "<font color=red title='该栏目可以投稿'>稿</font>&nbsp;┆&nbsp;" 
			  Else
				 response.Write "<strike title='该栏目不可以投稿'>稿</strike>&nbsp;┆&nbsp;" 
			  End if
			  if Article_rs("dh")=1 then
				 response.Write "<font color=red title='在导航中显示'>显示</font>&nbsp;┆&nbsp;" 
			  Else
				 response.Write "<font title='在导航中隐藏'>隐藏</font>&nbsp;┆&nbsp;" 
			  End if
	  %>
				</div></td>
			<td  >
				<div align="center">
				 <a  target="_blank" href="../../article/TypeClass.asp?ClassID=<% = Article_rs("ClassID")%>" >预览</a>┆<a href="ACT.Add.asp?ModeID=<% = ModeID%>&ClassID=<% = Article_rs("ClassID")%>" >添加文章</a>┆<a href="ACT.ClassAdd.asp?ModeID=<% = ModeID%>&ClassID=<% = Article_rs("ClassID")%>&Action=add">添加子栏目</a>┆<a href="ACT.ClassAdd.asp?ClassID=<% = Article_rs("ClassID")%>&Action=edit">修改</a>┆<a href="ACT.Action.asp?ModeID=<% =ModeID%>&ClassID=<% = Article_rs("ClassID")%>&Action=del"  onClick="{if(confirm('确定删除您所选择的栏目吗?\n\n此栏目下的所有信息也将被删除,此操作不可恢复!!!')){return true;}return false;}">删除</a>
					<input name="ClassID" type="checkbox" id="ClassID" value="<% = Article_rs("ClassID")%>">
			  </div>			</td>
		</tr>
		<%
		Response.Write(GetClassValue(Article_rs("ClassID"),""))&""
		Article_rs.MoveNext
	loop
	Public Function GetClassValue(TypeID,CompatStr)  
		Dim ChildArticleRs,ChildTypeListStr,TempStr,TmpStr,CMS_isUrl
		Dim tg,dh,ClassRs
		Set ClassRs = Conn.Execute("Select id,dh,orderid,ClassName,tg,ClassEName,enname,ClassID,ChangesLinkUrl from Class_Act where ParentID='" & TypeID & "'  And ModeID = "&ModeID&" Order by Orderid asc,ID asc" )
		TempStr =CompatStr & "<img src=""../images/L.gif""></img>"
		do while Not ClassRs.Eof
			  TmpStr = ""
			  if Trim(ClassRs("ChangesLinkUrl")) <> "" then
				TmpStr = TmpStr & "<font color=red title='外部链接'>外部</font>&nbsp;┆&nbsp;" 
			  Else
				TmpStr = TmpStr & "<font title='系统目录'>系统</font>&nbsp;┆&nbsp;" 
			  End if
			  if ClassRs("tg")=1 then
				TmpStr = TmpStr & "<font color=red title='该栏目可以投稿'>稿</font>&nbsp;┆&nbsp;" 
			  Else
				TmpStr = TmpStr & "<strike title='该栏目不可以投稿'>稿</strike>&nbsp;┆&nbsp;" 
			  End if
			  if ClassRs("dh")=1 then
				TmpStr = TmpStr & "<font color=red title='在导航中显示'>显示</font>&nbsp;┆&nbsp;" 
			  Else
				TmpStr = TmpStr & "<font title='在导航中隐藏'>隐藏</font>&nbsp;┆&nbsp;" 
			  End if
	  		GetClassValue = GetClassValue & "<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>"&Chr(13) & Chr(10)
			GetClassValue = GetClassValue & "<td align=""center"">"& ClassRs("ClassID")&"</td>" & Chr(13) & Chr(10)
			if Trim(ClassRs("ChangesLinkUrl")) <>"" then '是否是外部栏目
				CMS_isUrl = ""
			Else
				CMS_isUrl = "&nbsp;[文章："&Conn.Execute("Select Count(id) From  "&ACTCMS.ACT_C(ModeID,2)&"  Where Classid='" & ClassRs("ClassID")&"'")(0)&"]"
			End if
			GetClassValue = GetClassValue & "<td class=""td_bg"">&nbsp;"& TempStr &"<Img src=""../images/-.gif""></img><a href=""ACT.Manage.asp?Action=ListID&ModeID="&ModeID&"&ClassID="&ClassRs("ClassID")&""">" & ClassRs("ClassName") & "</a>&nbsp;<font style=""font-size:11.5px;"">"& CMS_isUrl &"</font></td>" & Chr(13) & Chr(10) 
			GetClassValue = GetClassValue & "<td class=""td_bg"" align=""center"">"&ClassRs("OrderID")&"</td>" & Chr(13) & Chr(10)
			GetClassValue = GetClassValue & "<td class=""td_bg"" align=""center""><div align=""center"">"& TmpStr &"</div></td>" & Chr(13) & Chr(10)
			GetClassValue = GetClassValue & "<td class=""td_bg"" align=""center""><div align=""center""><a  target=""_blank"" href=""../../article/TypeClass.asp?ClassID="&ClassRs("ClassID")&""" >预览</a>┆<a href=""ACT.Add.asp?ModeID="&ModeID&"&ClassID="&ClassRs("ClassID")&""" >添加文章</a>┆<a href=""ACT.ClassAdd.asp?ModeID="&ModeID&"&ClassID="&ClassRs("ClassID")&"&Action=add"">添加子栏目</a>┆<a href=""ACT.ClassAdd.asp?ClassID="&ClassRs("ClassID")&"&Action=edit"">修改</a>┆<a href=""ACT.Action.asp?ModeID="&ModeID&"&ClassID="&ClassRs("ClassID")&"&Action=del""   onClick=""{if(confirm('确定删除您所选择的栏目吗？\n\n此栏目下的所有信息也将被删除,此操作不可恢复!!!')){return true;}return false;}"">删除</a>"&vbNewLine&"<input name=""ClassID"" type=""checkbox"" id=""ClassID"" value="""& ClassRs("ClassID")&"""></div></td>" & Chr(13) & Chr(10)
			GetClassValue = GetClassValue & "</tr>" & Chr(13) & Chr(10)
			GetClassValue = GetClassValue &GetClassValue(ClassRs("ClassID"),TempStr)


			ClassRs.MoveNext
		loop
		ClassRs.Close
		Set ClassRs = Nothing
	End Function
%>
		<tr>
			<td height="25" colspan="5" >
				<div align="right">
					<label for=chk><input id="chk" type="checkbox" name="chkall" value="checkbox" onClick="CheckAll(this.form)">选择全部</label>
					
					<input type="button" name="Submit" Class="ACT_BTN" value="批量删除"  onClick="delpost()">
		  </div>			</td>
		</tr>
		<tr>
			<td height="30" colspan="5" ><font color="red">说明:</font><br>
			  系统 -------系统目录<br>
			  外部-------转向连接 <br>
			  稿--------栏目可以投稿<br>
			  显示----导航中显示<br>
			  隐藏----导航中隐藏 </td>
		</tr>
		<%end if%>
	</form>
</table>
<p></p>
</body>
</html>
<%
 
Article_rs.close
set Article_rs =Nothing
set ACTCMS = Nothing
%>
<script language="JavaScript" type="text/JavaScript">
function overColor(Obj)
{
	var elements=Obj.childNodes;
	for(var i=0;i<elements.length;i++)
	{
		elements[i].className="tdbg1"
		Obj.bgColor="";
	}
	
}

function outColor(Obj)
{
	var elements=Obj.childNodes;
	for(var i=0;i<elements.length;i++)
	{
		elements[i].className="tdbg";
		Obj.bgColor="";
	}
}
 

function CheckAll(form)  
  {  
 for (var i=0;i<form.elements.length;i++)  
    {  
    var e = ClassForm.elements[i];  
   if (e.name != 'chkall')  
      e.checked = ClassForm.chkall.checked;  
   }  
  }
  
function delpost(){
    document.ClassForm.method="post";
    document.ClassForm.action="ACT.Action.asp?Action=del";
{
	if(confirm('确认要删除选中的栏目吗?本操作将选中的栏目移到回收站当中.必要时您可以从回收站恢复!')){
	this.document.ClassForm.submit();
	return true;}return false;
}
	}
</script>

