<% Option Explicit %>
<!--#include file="Function.asp" -->
<!--#include file="../../Inc/Function.asp" -->
<!--#include file="../../Inc/Const.asp" -->
<!--#include file="../../Inc/Cls_DB.asp" -->
<%
Dim DBC,Conn
Set DBC = New DataBaseClass
Set Conn = DBC.OpenConnection()
Set DBC = Nothing
%>
<!--#include file="../../Inc/Session.asp" -->
<!--#include file="../../Inc/CheckPopedom.asp" -->
<%
if Not JudgePopedomTF(Session("Name"),"P0402") then Call ReturnError1()
Dim TempClassListStr
	TempClassListStr = ClassList
Function ClassList()
	Dim Rs
	Set Rs = Conn.Execute("select ClassID,ClassCName from newsclass where ParentID = '0' and DelFlag=0 order by AddTime desc")
	do while Not Rs.Eof
		ClassList = ClassList & "<option value="&Rs("ClassID")&"" & ">" & Rs("ClassCName") & chr(10) & chr(13)
		ClassList = ClassList & ChildClassList(Rs("ClassID"),"")
		Rs.MoveNext	
	loop
	Rs.Close
	Set Rs = Nothing
End Function
Function ChildClassList(ClassID,Temp)
	Dim TempRs,TempStr
	Set TempRs = Conn.Execute("Select ClassID,ClassCName,ChildNum from NewsClass where ParentID = '" & ClassID & "' and DelFlag=0 order by AddTime desc ")
	TempStr = Temp & " - "
	do while Not TempRs.Eof
		if TempRs("ChildNum") = 0 then
			ChildClassList = ChildClassList & "<option value="&TempRs("ClassID")&"" & ">" & TempStr & TempRs("ClassCName") & "</option>"& chr(10) & chr(13)
		else
			ChildClassList = ChildClassList & "<option value="&TempRs("ClassID")&"" & ">" & TempStr & TempRs("ClassCName") & "</option>"& chr(10) & chr(13)
		end if
		ChildClassList = ChildClassList & ChildClassList(TempRs("ClassID"),TempStr)
		TempRs.MoveNext
	loop
	TempRs.Close
	Set TempRs = Nothing
End Function
%>
<html>
<head>
<link href="../../CSS/css.css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>栏目首页生成</title>
</head>

<body topmargin="0" leftmargin="0" oncontextmenu="return false;">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30" colspan="3" class="ButtonList"><div align="center"><strong>栏目首页生成管理</strong></div></td>
  </tr>
</table>
<table width="100%"  border="0" cellspacing="8" cellpadding="0">
  <tr> 
    <td width="9%">&nbsp;</td>
    <td width="5%">&nbsp;</td>
    <td colspan="2">&nbsp;</td>
  </tr>
  <form action="RefreshClassSave.asp?Types=ClassOne" method="post" name="ReClassOneForm">
    <tr> 
      <td>&nbsp;</td>
      <td>分类</td>
      <td width="81%"><select name="ClassID" style="width:20%">
          <% =TempClassListStr %>
        </select> <input name="imageField" type="image" src="../Images/Publish.gif" width="75" height="21" border="0"> 
      </td>
      <td width="5%">&nbsp;</td>
    </tr>
  </form>
  <form action="RefreshClassSave.asp?Types=ClassAll" method="post" name="ReClassAllForm">
    <tr> 
      <td>&nbsp;</td>
      <td>全部</td>
      <td colspan="2"><input name="imageField2" type="image" src="../Images/Publish.gif" width="75" height="21" border="0"></td>
    </tr>
  </form>
  <tr> 
    <td>&nbsp;</td>
    <td colspan="3"><font color=red>注意:如果需要生成的栏目较多，建议采用分类生成,并且在生成过程中，请勿刷新此页面</font></td>
  </tr>
</table>
</body>
</html>
