<html>
<head>
<META content=ywnt,云网互动影视管理系统 name=keywords>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>云网互动影视6.0--栏目管理</title>
<LINK href="css/css.css" type=text/css rel=stylesheet>
</head>
<BODY leftMargin=0 topMargin=0 scroll=yes MARGINHEIGHT="0" MARGINWIDTH="0">
<script language="JavaScript" src="YWNT_TMS_Inc/YWNT_TMS_Common.js"></script>
<!--#include file="../Conn.asp" -->
<!--#include file="YWNT_TMS_inc/YWNT_TMS_Function.asp" -->
<!--#include file="YWNT_TMS_inc/YWNT_TMS_Page.asp" -->
<!--#include file="../function/MD5.asp" -->
<%
'===================================================================================================================
'软件名称：云网影视管理系统
'Copyright (C) 2002-2007 ywnt.net  All rights reserved.
'产品咨询QQ：489234,2813712
'程序版权：云网互动科技有限公司
'程序开发：云网互动科技有限公司
'官方网站：http://www.ywnt.net 
'郑重声明:
'    1、免费版本请在程序首页保留版权信息，并做上本站LOGO友情连接,商业版本无此要求;
'    2、任何个人或组织不得在授权允许的情况下删除、修改、拷贝本软件及其他副本上一切关于版权的信息；
'    3、云网互动科技有限公司保留此软件的法律追究权利
'===================================================================================================================
Call CheckLogin("Type")
sub EditSave()
		if Request.Form("ClassID")=Request.Form("ID") then
		call Admin_ShowErr("<li>对不起不能为自己的子栏目</li>","Admin_Type.asp?ID="&Request.Form("ID")&"",0)
		end if
		if chkinputchar(Request.Form("ClassNameE"))=False then
		call Admin_ShowErr("<li>栏目英文名只能是英文与数字</li>","javascript:history.go(-1);",0)
		exit sub
		end if
		if Request.Form("classid2")=0 and ClassIDJC(NoSqlHack(Request.Form("ClassID")))<>0 then
		Conn.execute("Update YWNT_TMS_MovieClass set ClassID=0 where ClassID="&NoSqlHack(Request.Form("ID"))&"")
		end if
		Set Rs=Server.CreateObject(YWNT_TMS_RS)
		sql="select * from YWNT_TMS_MovieClass where ID="&NoSqlHack(Request.Form("ID"))
		Rs.open sql,Conn,1,3
		RS("ClassName")=NoSqlHack(Request.Form("ClassName"))
		RS("ClassNameE")=NoSqlHack(Request.Form("ClassNameE"))
		RS("ClassTemplate")=NoSqlHack(Request.Form("ClassTemplate"))
		RS("MovieTemplate")=NoSqlHack(Request.Form("MovieTemplate"))
		RS("ClassID")=NoSqlHack(Request.Form("ClassID"))
		Rs.Update
		Rs.Close
		Set Rs = Nothing
		Call AddLog("修改影片栏目"&Request.Form("ClassName"),3)
		call Admin_ShowErr("<li>影片栏目修改成功</li>","Admin_Type.asp",1)
end sub
sub AddSave()
		if chkinputchar(Request.Form("ClassNameE"))=False then
		call Admin_ShowErr("<li>栏目英文名只能是英文与数字</li>","javascript:history.go(-1);",0)
		exit sub
		end if
		if CheckClass("ClassNameE",request.Form("ClassNameE"),"'")>0 then 
		call Admin_ShowErr("<li>栏目英文名重复，请重新输入！</li>","javascript:history.go(-1);",0)
		end if
		Set Rs=Server.CreateObject(YWNT_TMS_RS)
		sql="select * from YWNT_TMS_MovieClass"
		Rs.open sql,Conn,1,3
		Rs.addnew
		RS("ClassName")=NoSqlHack(Request.Form("ClassName"))
		RS("ClassNameE")=NoSqlHack(Request.Form("ClassNameE"))
		RS("ClassTemplate")=NoSqlHack(Request.Form("ClassTemplate"))
		RS("MovieTemplate")=NoSqlHack(Request.Form("MovieTemplate"))
		RS("ClassID")=NoSqlHack(Request.Form("ClassID"))
		Rs.Update
		Rs.Close
		Set Rs = Nothing
		Call AddLog("添加影片栏目"&Request.Form("ClassName"),3)
		call Admin_ShowErr("<li>影片栏目添加成功</li>","Admin_Type.asp",1)
end sub
sub Del()
	conn.execute "delete from YWNT_TMS_MovieClass WHERE ID = "&NoSqlHack(Request("ID"))&""
	Call AddLog("删除影片栏目",3)
	call Admin_ShowErr("<li>影片栏目删除成功！</li>","Admin_Type.asp",1)
end sub
sub ClassWithSave()
		Set Rs=Server.CreateObject(YWNT_TMS_RS)
		sql="select * from YWNT_TMS_MovieClass where ID="&NoSqlHack(Request.Form("ID"))
		Rs.open sql,Conn,1,3
		RS("ClassWith")=NoSqlHack(Request.Form("ClassWith"))
		Rs.Update
		Rs.Close
		Set Rs = Nothing
		Call AddLog("修改影片栏目排序",3)
		call Admin_ShowErr("<li>影片栏目排序修改成功</li>","Admin_Type.asp?Action=ClassWith",1)
end sub%>
<table class=table cellspacing=1 cellpadding=3 width="98%" align=center border=0>
  <tbody>
    <tr>
      <td class=xingmu>栏目管理</td>
    </tr>
    <tr>
      <td class="hback"><a href="Admin_Type.asp">栏目管理首页</a> | <a href="Admin_Type.asp?Action=Add">添加栏目</a> | <a href="Admin_Type.asp?Action=ClassWith">修改栏目排序</a></td>
    </tr>
  </tbody>
</table>
<% Action=Trim(request("Action"))
Select Case Action
Case "Add"
	call Add()
Case "AddSave"
	call AddSave()
Case "Edit"
		Set Rs=Server.CreateObject(YWNT_TMS_RS)
		sql="select * from YWNT_TMS_MovieClass where ID="&NoSqlHack(Request.QueryString("ID"))
		Rs.open sql,Conn,1,1
		YWNT_TMS_ID=RS("ID")
		YWNT_TMS_ClassName=RS("ClassName")
		YWNT_TMS_ClassNameE=RS("ClassNameE")
		YWNT_TMS_ClassTemplate=RS("ClassTemplate")
		YWNT_TMS_MovieTemplate=RS("MovieTemplate")
		YWNT_TMS_ClassID=RS("ClassID")
		RS.close   
      	set RS=nothing
	call Edit()
Case "EditSave"
	call EditSave()
Case "Del"
	call Del()
Case "ClassWith"
	call ClassWith()
Case "ClassWithSave"
	call ClassWithSave()
Case else
	call List()
End Select
sub List()
Dim int_RPP
	int_RPP=GetConfig("PageNumber") '设置每页显示数目%>
<table class=table cellspacing=1 cellpadding=3 width="98%" align=center border=0>
  <tbody>
    <tr>
      <td width="5%" align="center" class=xingmu>ID</td>
      <td width="57%" align="center" class=xingmu>栏目名称</td>
      <td width="10%" align="center" class=xingmu>栏目排序</td>
      <td width="20%" align="center" class=xingmu>操作</td>
    </tr>
	<%  Set Rs = server.CreateObject(YWNT_TMS_RS)
		sql="Select ID,ClassName,ClassID,ClassWith from YWNT_TMS_MovieClass where ClassID=0 Order by ClassWith asc,id asc"
		Rs.open sql,Conn,1,1
	if Rs.eof then
	   Response.Write"<TR  class=""hback""><TD colspan=""4"" class=""hback"" height=""40"">没有记录。</TD></TR>"
	else
		Rs.PageSize=int_RPP
		cPageNo=NoSqlHack(Request.QueryString("Page"))
		If cPageNo="" Then cPageNo = 1
		If not isnumeric(cPageNo) Then cPageNo = 1
		cPageNo = Clng(cPageNo)
		If cPageNo>Rs.PageCount Then cPageNo=Rs.PageCount 
		If cPageNo<=0 Then cPageNo=1
		Rs.AbsolutePage=cPageNo 
	for i=1 to int_RPP
	 if Rs.eof Then exit For %> 
    <tr>
      <td height=32 align="center" class="hback"><%= RS("ID") %></td>
      <td height=32 class="hback"><%= RS("ClassName") %></td>
      <td height=32 align="center" class="hback"><%= RS("ClassWith") %></td>
      <td align="center" class="hback"><a href="Admin_Type.asp?ID=<%=RS("ID")%>&Action=Add">添加子栏目</a>｜<A href="Admin_Type.asp?ID=<%= RS("ID") %>&Action=Edit">修改</A>｜<A href="Admin_Type.asp?ID=<%= RS("ID") %>&Action=Del">删除</A></td>
    </tr>
	<%Response.Write GetChildNewsList(RS("ID"),"")
	Rs.MoveNext
	next
	end if%>
	<tr align="right">
	<td height=32 colspan="4" class="hback"><% response.Write fPageCount(Rs,cPageNo) %></td>
	</tr>
  </tbody>
</table>
<%RS.Close
Set RS = Nothing
end sub
sub Add()%>
<table class=table cellspacing=1 cellpadding=3 width="98%" align=center border=0>
  <tbody>
    <tr>
      <td colspan="2" class=xingmu>添加栏目</td>
    </tr>
	   <form name="form" action="Admin_Type.asp?Action=AddSave" method="post" onSubmit="if (!Classcheck()) return false;">
    <tr>
      <td width="21%" height=32 align="right" class="hback">所属栏目：</td>
      <td class="hback">
	  	<%call AddClassID(Request("ID"),"ClassID")%>
      </td>
    </tr>
    <tr>
      <td height=32 align="right" class="hback">栏目名称：</td>
      <td class="hback"><input name="ClassName" type="text" id="ClassName" size="40"></td>
    </tr>
    <tr>
      <td height=32 align="right" class="hback">栏目英文名：</td>
      <td class="hback"><input name="ClassNameE" type="text" id="ClassNameE" size="40"></td>
    </tr>
    <tr>
      <td height=32 align="right" class="hback">栏目模板：</td>
      <td class="hback"><%call ClassTemplate("ClassTemplate","",1) %></td>
    </tr>
	<tr>
      <td height=32 align="right" class="hback">下属影片内容模版：</td>
      <td class="hback"><%call ClassTemplate("MovieTemplate","",2) %></td>
    </tr>
    <tr>
      <td height=32 colspan="2" align="center" class="hback"><input type="submit" name="Submit" value="添 加"></td>
    </tr>
	  </form>
</tbody>
</table>
<%end sub
sub Edit()%>
<table class=table cellspacing=1 cellpadding=3 width="98%" align=center border=0>
  <tbody>
    <tr>
      <td colspan="2" class=xingmu>修改栏目</td>
    </tr>
	   <form name="form" action="Admin_Type.asp?Action=EditSave" method="post" onSubmit="if (!Classcheck()) return false;">
    <tr>
      <td width="21%" height=32 align="right" class="hback">所属栏目：</td>
      <td class="hback"><select name="ClassID" id="ClassID">
	  	<option value="0">做为一级栏目</option>
	  	<%Response.Write EditClassID(0,"",YWNT_TMS_ClassID)%>
      </select></td>
    </tr>
    <tr>
      <td height=32 align="right" class="hback">栏目名称：</td>
      <td class="hback"><input name="ClassName" type="text" id="ClassName" value="<%=YWNT_TMS_ClassName%>" size="40"></td>
    </tr>
    <tr>
      <td height=32 align="right" class="hback">栏目英文名：</td>
      <td class="hback"><input name="ClassNameE" type="text" id="ClassNameE" value="<%=YWNT_TMS_ClassNameE%>" size="40"></td>
    </tr>
    <tr>
      <td height=32 align="right" class="hback">栏目模板：</td>
      <td class="hback"><%call ClassTemplate("ClassTemplate",YWNT_TMS_ClassTemplate,1) %></td>
    </tr>
	<tr>
      <td height=32 align="right" class="hback">下属影片内容模版：</td>
      <td class="hback"><%call ClassTemplate("MovieTemplate",YWNT_TMS_MovieTemplate,2) %></td>
    </tr>
    <tr>
      <td height=32 colspan="2" align="center" class="hback"><input name="classid2" type="hidden" value="<%=YWNT_TMS_ClassID%>"><input name="ID" type="hidden" value="<%=YWNT_TMS_ID%>"><input type="submit" name="Submit" value="修 改"></td>
    </tr>
	  </form>
</tbody>
</table>
<%end sub
sub ClassWith()%>
<table class=table cellspacing=1 cellpadding=3 width="98%" align=center border=0>
  <tbody>
    <tr>
      <td width="5%" align="center" class=xingmu>ID</td>
      <td width="57%" align="center" class=xingmu>栏目名称</td>
      <td width="10%" align="center" class=xingmu>栏目排序</td>
      <td width="20%" align="center" class=xingmu>操作</td>
    </tr>
	<%  Set Rs = server.CreateObject(YWNT_TMS_RS)
		sql="Select ID,ClassName,ClassID,ClassWith from YWNT_TMS_MovieClass where ClassID=0 Order by ClassWith asc,id asc"
		Rs.open sql,Conn,1,1
	if Rs.eof then
	   	Response.Write"<TR  class=""hback""><TD colspan=""4"" class=""hback"" height=""40"">没有记录。</TD></TR>"
	else
		do while Not RS.Eof%>
	<form name="form" action="Admin_Type.asp?Action=ClassWithSave" method="post"> 
    <tr>
      <td height=32 align="center" class="hback"><%= RS("ID") %></td>
      <td height=32 class="hback"><%= RS("ClassName") %></td>
      <td height=32 align="center" class="hback"><input name="ClassWith" type="text" value="<%= RS("ClassWith") %>" size="5"></td>
      <td align="center" class="hback"><input name="ID" type="hidden" value="<%= RS("ID") %>"><input type="submit" name="Submit" value="修改排序"></td>
    </tr>
	</form>
	<%Response.Write ClassWithList(RS("ID"),"")
	Rs.MoveNext
	loop
	end if
	Rs.close
	Set Rs=Nothing%>
  </tbody>
</table>
<%end sub
call connclose()%>
</BODY></HTML>
