<!--#include file="../../fy.Function.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 ModeID
ModeID=2
	Dim Article_rs,Article_rs_1,ChangesLink,ModeName
If Not fycms.fycms_QXYZ(0,"lyxt_fy","") Then   Call fycms.Alert("对不起，你没有操作权限！","") 
%>
<div class="content"> 
	<div class="breadnav">当前位置：<a href="#">后台首页</a> >> 留言本管理</div>
    <div class="opers">
    	<span class="btn">查看选项：</span> 
		<a href="class.index.asp" class="btn btn_primary">留言栏目</a> 
		<a href="fy.ClassAdd.asp?Action=add" class="btn">添加栏目</a> 
		<a href="index.asp" class="btn ">留言系统</a>
		<a href="sys.asp" class="btn ">留言设置</a>
		<a href="Listm.asp" class="btn">留言自定义字段</a>
    </div>
  	<form name="ClassForm" method="post" action="?Action">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <thead>
      <tr>
      <th>cid</th>
	  <th>栏目中文</th>
	  <th>权重</th>
	  <th>操作</th>
	  </tr>
    </thead>
		<%
	Set Article_rs = Server.CreateObject("adodb.recordset")
	Article_rs.Open "Select Orderid,id,cid,title from bookclass_fy where rootid=0  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("cid")%></td>
	  <td height="22" >
				<% 
		
			echo  "<img src=""../../Images/-.gif""></img> "&fycms.HTMLCode(Article_rs("title"))
		
		Set Article_rs_1 = server.CreateObject("adodb.recordset")
		%>
			</td>
			<td  align="center"><% = Article_rs("OrderID")%></td>
		 
			<td  >
				<div align="center"><a  target="_blank" href="../../../plus/book/index.asp?cid=<% = Article_rs("cid")%>">预览</a>┆<a href="fy.ClassAdd.asp?cid=<% = Article_rs("cid")%>&Action=edit">修改</a>┆<a href="fy.Action.asp?ModeID=<% =ModeID%>&cid=<% = Article_rs("cid")%>&Action=del"  onClick="{if(confirm('确定删除您所选择的栏目吗?\n\n此栏目下的所有信息也将被删除,此操作不可恢复!!!')){return true;}return false;}">删除</a>
					<input name="cid" type="checkbox" id="cid" value="<% = Article_rs("cid")%>">
			  </div>			</td>
		</tr>

		<%
		echo(GetClassValue(Article_rs("cid"),""))&""
		Article_rs.MoveNext
	loop
	Public Function GetClassValue(TypeID,CompatStr)  
		Dim ChildArticleRs,ChildTypeListStr,TempStr,TmpStr,CMS_isUrl
		Dim tg,ismenu,ClassRs
		Set ClassRs = Conn.Execute("Select id,orderid,title,cid from bookclass_fy where rootid=" & TypeID & "   Order by Orderid asc,ID asc" )
		TempStr =CompatStr & "<img src=""../../Images/L.gif""></img>"
		do while Not ClassRs.Eof
			  TmpStr = ""
			  
	  		GetClassValue = GetClassValue & "<tr >"&Chr(13) & Chr(10)
			GetClassValue = GetClassValue & "<td align=""center"">"& ClassRs("cid")&"</td>" & Chr(13) & Chr(10)
 				CMS_isUrl = "&nbsp;"
			GetClassValue = GetClassValue & "<td class=""td_bg"">&nbsp;"& TempStr &"<Img src=""../../Images/-.gif""></img>" & ClassRs("title") & "&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""><a  target=""_blank""   href=""../../../plus/book/index.asp?cid="&ClassRs("cid")&""">预览</a>┆<a href=""fy.ClassAdd.asp?cid="&ClassRs("cid")&"&Action=edit"">修改</a>┆<a href=""fy.Action.asp?ModeID="&ModeID&"&cid="&ClassRs("cid")&"&Action=del""   onClick=""{if(confirm('确定删除您所选择的栏目吗？\n\n此栏目下的所有信息也将被删除,此操作不可恢复!!!')){return true;}return false;}"">删除</a>"&vbNewLine&"<input name=""cid"" type=""checkbox"" id=""cid"" value="""& ClassRs("cid")&"""></div></td>" & Chr(13) & Chr(10)
			GetClassValue = GetClassValue & "</tr>" & Chr(13) & Chr(10)
			GetClassValue = GetClassValue &GetClassValue(ClassRs("cid"),TempStr)


			ClassRs.MoveNext
		loop
		ClassRs.Close
		Set ClassRs = Nothing
	End Function
%>	<tr>
			<td  colspan="7" >
				
					<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>

    </table>
  </form>
<%end if%>
<script 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>
</div>
</body>
</html>
