<% Option Explicit %>
<!--#include file="../../Inc/Cls_DB.asp" -->
<!--#include file="../../Inc/Const.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"),"P0302") then Call ReturnError()
Dim ClassID,SpecialID,Sql,RsNewsObj
ClassID = Request("ClassID")
SpecialID = Request("SpecialID")
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<link href="Templet.css" rel="stylesheet">
<body onLoad="parent.CheckInsertTF(document.all.NewsList.options.length);">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td>新闻列表 
<select name="NewsList" id="select5" style="width:80%;">
  <option selected>选择新闻</option>
<%
	if ClassID <> "" then
		ClassID = "'" & ClassID & "'" & ChildClassIDList(ClassID)
		Sql = "Select NewsID,Title,PicPath,AddDate,Path,FileName,FileExtName from News where ClassID in (" & ClassID & ") and DelTF=0 order by ID Desc"
	elseif SpecialID <> "" then
		Sql = "Select NewsID,Title from News where SpecialID like '" & SpecialID & "'"
	else
		Sql = ""
	end if
	if Sql <> "" then
		Set RsNewsObj = Conn.Execute(Sql)
		do while Not RsNewsObj.Eof
%>
	  <option Pic="<% = RsNewsObj("PicPath") %>" Path="<% = RsNewsObj("Path") %>" FileName="<% = RsNewsObj("FileName") %>" FileExtName="<% = RsNewsObj("FileExtName") %>" Date="<% = RsNewsObj("AddDate") %>" value="<% = RsNewsObj("Title") %>"><% = RsNewsObj("Title") %></option>
<%
			RsNewsObj.MoveNext
		loop
		Set RsNewsObj = Nothing
	end if
%>
</select>
</td>
  </tr>
</table>
</body>
</html>
<%
Set Conn = Nothing
Function ChildClassIDList(ClassID)
	Dim TempRs,TempStr
	Set TempRs = Conn.Execute("Select ClassID from NewsClass where ParentID = '" & ClassID & "' and DelFlag=0")
	do while Not TempRs.Eof
		ChildClassIDList = ChildClassIDList & ",'" & TempRs("ClassID") & "'"
		ChildClassIDList = ChildClassIDList & ChildClassIDList(TempRs("ClassID"))
		TempRs.MoveNext
	loop
	TempRs.Close
	Set TempRs = Nothing
End Function
%>