<!--#include file="../fy.Function.asp"-->
<!--#include file="../include/fy.F.asp"-->
<!doctype html>
<html>
<head>
<meta charset="gb2312">
<title>栏目管理</title>
<link rel="stylesheet" type="text/css" href="../css/base.css">
<link rel="stylesheet" type="text/css" href="../css/content.css">
</head>
<body>
<%
	Dim Article_rs,Article_rs_1,ChangesLink,ModeName,ModeID,sqlstrmode
	 ModeID = ChkNumeric(Request("ModeID"))
	  if ModeID=0  Then ModeID=1
	  sqlstrmode=" and ModeID="&ModeID
	If Not fycms.fycms_QXYZ(1,"","") Then   Call fycms.Alert("对不起，您没有"&fycms.ACT_C(1,1)&"系该项操作权限！","")
%><div class="content"> 
	<div class="breadnav">当前位置：<a href="#">后台首页</a> >> 栏目管理 选择模型:<select name='ModeID' style='width:110px' onChange="location=this.value;">
  <%=AF.ACT_URL_Mode(ModeID,"&ClassID="&request("ClassID"))%>
  </select></div>
    <div class="opers">
		<a href="fy.Class.asp" class="btn btn_primary">管理首页</a>
		<a href="fy.ClassAdd.asp?Action=add" class="btn">添加根栏目</a>
		<a href="fy.ClassAddall.asp?Action=add" class="btn">批量添加栏目</a>
		<a href="fy.Classfy.asp?Action=one" class="btn">栏目排序</a>
		<a href="fy.m.asp" class="btn">栏目自定义字段</a>
		<a href="fy.Setclass.asp" class="btn">栏目批量设置</a>
    </div>
  	<form name="ClassForm" method="post" action="?Action">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <thead>
      <tr>
      <th>ClassID</th>
	  <th>栏目中文</th>
	  <th>权重</th>
	  <th>模型</th>
	  <th>栏目属性</th>
	  <th>操作</th>
 	  </tr>
    </thead>
			<%
	Set Article_rs = Server.CreateObject("adodb.recordset")
	Article_rs.Open "Select Orderid,id,ClassID,ClassName,enname,ClassEName,ActLink,ismenu,tg,ModeID,makehtmlname from Class_fy where rootid=0 "&sqlstrmode&" Order by Orderid asc,ID asc",Conn,1,1
 	if Article_rs.eof then
	   echo"<TR  class=""td_bg""><TD colspan=""7""  class=""td_bg"" height=""40"">没有记录</TD></TR>"
	else
	
	do while not Article_rs.eof
			if Article_rs.eof Then exit do
	%>
		<tr>
			<td ><% = Article_rs("ClassID")%></td>
	  <td class="tl" >
				<% 
		if Article_rs("ActLink") = "2" then
			echo  "<img src=""../Images/-.gif"" /><a target=""_blank"" href="&Article_rs("makehtmlname")&"><font color=green>"&Article_rs("ClassName")&"</font></a>"
		ElseIf  Article_rs("ActLink") = "3" Then 
			echo  "<img src=""../Images/-.gif"" /><a target=""_blank"" href="&fycms.diyclassname(Article_rs("classid"))&"><b>"&fycms.HTMLCode(Article_rs("ClassName"))&"</b></a>&nbsp;"
		else
			echo  "<img src=""../Images/-.gif"" /><a href=fy.Manage.asp?Action=t&ModeID="&Article_rs("ModeID")&"&ClassID="&Article_rs("ClassID")&">"&fycms.HTMLCode(Article_rs("ClassName"))&"</a>&nbsp;[内容："&Conn.Execute("Select Count(id) From  "&fycms.ACT_C(Article_rs("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  align="center"><% = fycms.ACT_C(Article_rs("ModeID"),1)%>模型</td>

		  <td > 
					<%dim tmpstr
			  
			  if Article_rs("tg")=1 then
				 echo "<font color=red title='该栏目可以投稿'>稿</font>&nbsp;┆&nbsp;" 
			  Else
				 echo "<strike title='该栏目不可以投稿'>稿</strike>&nbsp;┆&nbsp;" 
			  End if
			  if Article_rs("ismenu")=1 then
				 echo "<font color=red title='在导航中显示'>显示</font>&nbsp;" 
			  Else
				 echo "<font title='在导航中隐藏'>隐藏</font>&nbsp;" 
			  End if
	  %> </td>
			<td  >
				 
				 <a  target="_blank" href="../../List.asp?cid=<% = Article_rs("ClassID")%>" >预览</a>┆<a  href="../include/fy.L.asp?RefreshFlag=IDS&CID=<% = Article_rs("ClassID")%>" >生成</a>┆<a title="添加内容" href="fy.Add.asp?ModeID=<% = Article_rs("ModeID")%>&ClassID=<% = Article_rs("ClassID")%>" >内容</a>┆<a title="添加子栏目" href="fy.ClassAdd.asp?ModeID=<% = Article_rs("ModeID")%>&ClassID=<% = Article_rs("ClassID")%>&Action=add">子栏目</a>┆<a href="<%=getclassdiylink(Article_rs("ClassID"))%>?ClassID=<% = Article_rs("ClassID")%>&Action=edit">修改</a>┆<a href="fy.Action.asp?ModeID=<% =Article_rs("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")%>">
			 			</td>
		</tr>
	
	  <%echo(GetClassValue(Article_rs("ClassID"),""))&""
		Article_rs.MoveNext
	loop%>

	<%end if%>


		<tr>
			<td colspan="7" class="tl" >
				 
					<label for=chk><input id="chk" type="checkbox" name="chkall" value="checkbox" onClick="CheckAll(this.form)">选择全部</label>
 					<input type="button" name="Submit" class="btn btn_primary" value="批量删除"  onClick="delpost()">
		 		</td>
		</tr>
		<tr>
			<td colspan="7"  class="tl"><font color="red">说明:</font><br>
			  系统 -------系统目录<br>
			  外部-------转向连接 <br>
			  稿--------栏目可以投稿<br>
			  显示----导航中显示<br>
			  隐藏----导航中隐藏 </td>
		</tr>
    </table>
   </form>
</div>
<%	Public Function GetClassValue(TypeID,CompatStr)  
		Dim ChildArticleRs,ChildTypeListStr,TempStr,TmpStr,CMS_isUrl
		Dim tg,ismenu,ClassRs
		Set ClassRs = Conn.Execute("Select id,ismenu,orderid,ClassName,tg,ClassEName,enname,ClassID,ActLink,ModeID,makehtmlname from Class_fy where rootid=" & TypeID & "   Order by Orderid asc,ID asc" )
		TempStr =CompatStr & "<img src=""../Images/L.gif"" />"
		do while Not ClassRs.Eof
			  TmpStr = ""
			  
			  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("ismenu")=1 then
				TmpStr = TmpStr & "<font color=red title='在导航中显示'>显示</font>&nbsp;" 
			  Else
				TmpStr = TmpStr & "<font title='在导航中隐藏'>隐藏</font>&nbsp;" 
			  End if
	  		GetClassValue = GetClassValue & "<tr >"&Chr(13) & Chr(10)
			
			GetClassValue = GetClassValue & "<td align=""center"">"& ClassRs("ClassID")&"</td>" & Chr(13) & Chr(10)
			if Trim(ClassRs("ActLink")) ="2" then '是否是外部栏目
				CMS_isUrl = ""
				GetClassValue = GetClassValue & "<td class=""tl"">&nbsp;"& TempStr &"<Img src=""../Images/-.gif"" /><a  target=""_blank"" href="""&ClassRs("makehtmlname")&"""><b>" & ClassRs("ClassName") & "</b></a>&nbsp;<font style=""font-size:11.5px;"">"& CMS_isUrl &"</font></td>" & Chr(13) & Chr(10) 
			elseif Trim(ClassRs("ActLink")) ="3" then '是否是外部栏目
				CMS_isUrl = ""
				GetClassValue = GetClassValue & "<td class=""tl"">&nbsp;"& TempStr &"<Img src=""../Images/-.gif"" /><a  target=""_blank"" href="""&fycms.diyclassname(ClassRs("classid"))&"""><b>" & ClassRs("ClassName") & "</b></a>&nbsp;<font style=""font-size:11.5px;"">"& CMS_isUrl &"</font></td>" & Chr(13) & Chr(10) 
			Else
				CMS_isUrl = "&nbsp;[内容："&Conn.Execute("Select Count(id) From  "&fycms.ACT_C(ClassRs("ModeID"),2)&"  Where Classid=" & ClassRs("ClassID")&"")(0)&"]"
			GetClassValue = GetClassValue & "<td class=""tl"">&nbsp;"& TempStr &"<Img src=""../Images/-.gif"" /><a href=""fy.Manage.asp?Action=t&ModeID="&ClassRs("ModeID")&"&ClassID="&ClassRs("ClassID")&""">" & ClassRs("ClassName") & "</a>&nbsp;<font style=""font-size:11.5px;"">"& CMS_isUrl &"</font></td>" & Chr(13) & Chr(10) 
			End If
			
			GetClassValue = GetClassValue & "<td class=""td_bg"" align=""center"">"&ClassRs("OrderID")&"</td>" & Chr(13) & Chr(10)
			GetClassValue = GetClassValue & "<td class=""td_bg"" align=""center"">"&fycms.ACT_C(ClassRs("ModeID"),1)&"模型</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=""../../List.asp?cid="&ClassRs("ClassID")&""" >预览</a>┆<a  href=""../include/fy.L.asp?RefreshFlag=IDS&CID="&ClassRs("ClassID")&""" >生成</a>┆<a title=""添加内容"" href=""fy.Add.asp?ModeID="&ClassRs("ModeID")&"&ClassID="&ClassRs("ClassID")&""" >内容</a>┆<a title=""添加子栏目"" href=""fy.ClassAdd.asp?ModeID="&ClassRs("ModeID")&"&ClassID="&ClassRs("ClassID")&"&Action=add"">子栏目</a>┆<a href="""&getclassdiylink(ClassRs("ClassID"))&"?ClassID="&ClassRs("ClassID")&"&Action=edit"">修改</a>┆<a href=""fy.Action.asp?ModeID="&ClassRs("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
%><script language="JavaScript" type="text/JavaScript">


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="fy.Action.asp?Action=del";
{
	if(confirm('确认要删除选中的栏目吗?本操作将选中的栏目移到回收站当中.必要时您可以从回收站恢复!')){
	this.document.ClassForm.submit();
	return true;}return false;
}
	}
</script>

</body>
</html>
