<% Option Explicit %>
<!--#include file="../../Inc/Const.asp" -->
<!--#include file="../../Inc/Cls_DB.asp" -->
<!--#include file="../../Inc/Function.asp" -->
<%
'==============================================================================
'软件名称：风讯网站信息管理系统
'当前版本：Foosun Content Manager System 2.0 
'最新更新：2004.12
'==============================================================================
'商业注册联系：028-85098980-601,602 技术支持：028-85098980-606、607,客户支持：608
'产品咨询QQ：159410,655071,66252421
'技术支持:所有程序使用问题，请提问到bbs.foosun.net我们将及时回答您
'程序开发：风讯开发组 & 风讯插件开发组
'论坛支持：风讯在线论坛(http://bbs.foosun.net)
'官方网站：www.Foosun.net  演示站点：test.cooin.com    
'网站建设专区：www.cooin.com
'==============================================================================
'免费版本请在新闻首页保留版权信息，并做上本站LOGO友情连接
'==============================================================================
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"),"P0104") then Call ReturnError1()
		Dim SpecialID,TempSpecialObj,FileListObj,FileClassObj
       if Request("SpecialID")<>"" then
		   SpecialID = Cstr(Request("SpecialID"))
	   else
		 Response.Write("<script>alert(""参数传递错误!!"");</script>")
		 response.end
	   end if
	   Set TempSpecialObj = Conn.Execute("Select CName,SpecialID from Special where SpecialID = '"&SpecialID&"'")
	   Set FileListObj = Server.CreateObject("ADODB.Recordset")
	   FileListObj.open "Select * from News where SpecialID like '%"&SpecialID&"%' order by ID desc",Conn,1,1
	   If TempSpecialObj.eof then
		 Response.Write("<script>alert(""参数传递错误"");</script>")
		 response.end
	   End if
		%>
		<html>
		<head>
		<link href="../../CSS/css.css" rel="stylesheet" type="text/css">
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
		<title>频道/专题新闻列表</title>
		</head>
		<script src="../JS/PublicJS.js" language="JavaScript"></script>
		<body topmargin="0" leftmargin="0" oncontextmenu="SelectJS(true);showMenu(MouseRightMenu);return false;"  ondragstart="return false;" onselectstart="return false;">
		
<table id="MainTable" width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td valign="top"> <table width="100%" onclick="SelectJS(false);" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="49%" class="ButtonList"><div align="center">新闻名称</div></td>
          <td width="28%" class="ButtonList"><div align="center">所属栏目</div></td>
          <td width="23%" class="ButtonList"><div align="center">更新时间</div></td>
        </tr>
        <%if FileListObj.eof then 
		page_size = 20
		%>
        <tr> 
          <td colspan="3" ><div align="center"><font color="#FF0000">暂时没有记录</font></div></td>
        </tr>
        <% else 
			Dim page_size,page_no,page_total,record_all,PageNums
			page_size=Request.QueryString("page_size")
			if page_size<=0 or page_size="" then page_size=20
			If isnumeric(Request.Form("PageNums")) then
				if Request.Form("PageNums")<>0 then
					page_size = Cint(Request.Form("PageNums"))
				end if
			End if
			page_no=request.querystring("page_no")
			if page_no<=1 or page_no="" then page_no=1
			If Request.QueryString("page_no")="" then
				page_no=1
			end if
			FileListObj.PageSize=page_size
			page_total=FileListObj.PageCount
			if (cint(page_no)>page_total) then page_no=page_total
			FileListObj.AbsolutePage=page_no
			record_all=FileListObj.RecordCount
			Dim i
			for i=1 to FileListObj.PageSize
			if FileListObj.eof then exit for
			Dim TempFlagStr
			If FileListObj("HeadNewsTF")="1" then
				TempFlagStr = "<img src=""../Images/TitleNews.gif"" border=""0"">"
			Elseif FileListObj("PicNewsTF")="0" and FileListObj("HeadNewsTF")="0" then
				TempFlagStr = "<img src=""../Images/WordNews.gif"" border=""0"">"
			else
				TempFlagStr = "<img src=""../Images/PicNews.gif"" border=""0"">"
			End if
			Set FileClassObj = Conn.Execute("Select ClassCName from NewsClass where ClassID='"&FileListObj("ClassID")&"'")
		%>
        <tr height="25"> 
		<td><table border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td><% = TempFlagStr %></td>
                <td><span SpecialID="<%=TempSpecialObj("SpecialID")%>" class="TempletItem" NewsID="<%=FileListObj("NewsID")%>" align="center"><% = GotTopic(FileListObj("Title"),40) %></span></td>
              </tr>
            </table></td> 
          <td><div align="center" class="TempletItem"><%=FileClassObj("ClassCName")%></div></td>
          <td><div align="center" class="TempletItem"><%=FileListObj("AddDate")%></div></td>
        </tr>
        <%
		  		FileClassObj.Close
				FileListObj.MoveNext
			next
			FileListObj.close
			set FileListObj=nothing
			TempSpecialObj.close
			Set TempSpecialObj = Nothing
			end if
		%>
      </table></td>
  </tr>
	  <%if page_total>1 then%>
  <tr> 
    	<td valign="middle" height="10">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr height="1">
                  <tr height="1">
                  <td width="42%" height="18"><table width="99%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                      </tr>
                   </table> </td>
                
                <td width="51%" height="25" valign="middle"> <div align="right">
					<% =  "NO.<b>"& page_no &"</b>,&nbsp;&nbsp;" %>
                    <% = "Totel:<b>"& page_total &"</b>,&nbsp;RecordCounts:<b>" & record_all &"</b>&nbsp;&nbsp;&nbsp;"%>
                    <%
						if Page_Total=1 then
								response.Write "&nbsp;<img src=../images/First1.gif border=0 alt=首页></img>&nbsp;"
								response.Write "&nbsp;<img src=../images/prePage.gif border=0 alt=上一页></img>&nbsp;"
								response.Write "&nbsp;<img src=../images/nextPage.gif border=0 alt=下一页></img>&nbsp;"
								response.Write "&nbsp;<img src=../images/endPage.gif border=0 alt=尾页></img>&nbsp;"
						else
							if cint(Page_No)<>1 and cint(Page_No)<>Page_Total then
								response.Write "&nbsp;<a href=?page_no=1&page_size="& page_size &"&SpecialID="&SpecialID&"&Keywords="&Request("Keywords")&"><img src=../images/First1.gif border=0 alt=首页></img></a>&nbsp;"
								response.Write "&nbsp;<a href=?page_no="&cstr(cint(Page_No)-1)&"&SpecialID="&SpecialID&"&page_size="&page_size&"&Keywords="&Request("Keywords")&"><img src=../images/prePage.gif border=0 alt=上一页></img></a>&nbsp;"
								response.Write "&nbsp;<a href=?page_no="&cstr(cint(Page_No)+1)&"&SpecialID="&SpecialID&"&page_size="&page_size&"&Keywords="&Request("Keywords")&"><img src=../images/nextPage.gif border=0 alt=下一页></img></a>&nbsp;"
								response.Write "&nbsp;<a href=?page_no="& Page_Total &"&page_size="& page_size &"&SpecialID="&SpecialID&"&Keywords="&Request("Keywords")&"><img src=../images/endPage.gif border=0 alt=尾页></img></a>&nbsp;"
							elseif cint(Page_No)=1 then
								response.Write "&nbsp;<img src=../images/First1.gif border=0 alt=首页></img></a>&nbsp;"
								response.Write "&nbsp;<img src=../images/prePage.gif border=0 alt=上一页></img>&nbsp;"
								response.Write "&nbsp;<a href=?page_no="&cstr(cint(Page_No)+1)&"&page_size="& page_size &"&SpecialID="&SpecialID&"&Keywords="&Request("Keywords")&"><img src=../images/nextPage.gif border=0 alt=下一页></img></a>&nbsp;"
								response.Write "&nbsp;<a href=?page_no="& Page_Total &"&page_size="& page_size &"&SpecialID="&SpecialID&"&Keywords="&Request("Keywords")&"><img src=../images/endpage.gif border=0 alt=尾页></img></a>&nbsp;"
							else
								response.Write "&nbsp;<a href=?page_no=1&page_size="& page_size &"&SpecialID="&SpecialID&"&Keywords="&Request("Keywords")&"><img src=../images/First1.gif border=0 alt=首页></img>&nbsp;"
								response.Write "&nbsp;<a href=?page_no="&cstr(cint(Page_No)-1)&"&page_size="& page_size &"&SpecialID="&SpecialID&"&Keywords="&Request("Keywords")&"><img src=../images/prePage.gif border=0 alt=上一页></img></a>&nbsp;"
								response.Write "&nbsp;<img src=../images/nextPage.gif border=0 alt=下一页></img></a>&nbsp;"
								response.Write "&nbsp;<img src=../images/endpage.gif border=0 alt=尾页></img>&nbsp;"
							end if
						end if
						%>
                </div></td>
                <td width="7%" valign="middle"><select onChange="ChangePage(this.value);" style="width:50;" name="select">
                  <% for i=1 to Page_Total %>
                  <option <% if cint(Page_No) = i then Response.Write("selected")%> value="<% = i %>">
                  <% = i %>
                  </option>
                  <% next %>
                </select></td>
              </tr>
      
            </table></td>
			</tr>
<% end if %>
</table>
		<!-- 鼠标右键菜单 -->
		<div id=MouseRightMenu onclick="ClickMenu(this);" onmouseover="MouseOverRightMenu();" onmouseout="MouseOverRightMenu();" class="menu"> 
		  <div class="MouseRightItem" id="Del" ExeFunction="OpenWindow('Frame.asp?FileName=SpecialDell.asp&Types=DellFile&SpecialID='+SpecialIDStr+'&Titles=删除专题新闻&NewsID='+NewsID,220,95,window);">删除</div>
		  <hr id="HR1">
		  <div class="MouseRightItem" id="Cut" ExeFunction="CutOperation();">剪切</div>
		  <div class="MouseRightItem" id="Copy" ExeFunction="CopyOperation();">复制</div>
		  <div class="MouseRightItem" id="Paste" ExeFunction="PasteOperation();">粘帖</div>
		  <hr id="HR5">
		  <div class="MouseRightItem" id="Refresh" ExeFunction="window.location.reload();">刷新</div>
		   <hr id="HR6">
		  <div class="MouseRightItem" id="Pros" ExeFunction="javascript:window.prompt('本页面路径属性' , '<%=Request.ServerVariables("SCRIPT_NAME")%>');">路径属性</div>
		</div>
		</body>
		<%
		Set Conn = Nothing
		%>
<script>
var SpecialIDStr='<%=SpecialID%>';
var NewsID='';
parent.MoveOrCopyObjectClass=SpecialIDStr;
Del.className='MenuItemDisable';
Cut.className='MenuItemDisable';
Copy.className='MenuItemDisable';
if (parent.MoveOrCopySourceNews!='')
{
	Paste.className='MouseRightItem';
}
else  Paste.className='MenuItemDisable';
var ListObjArray=new Array();
IntialListObjArray();
function IntialListObjArray()
{
	var CurrObj=null,j=1;
	for (var i=0;i<document.all.length;i++)
	{
		CurrObj=document.all(i);
		if (CurrObj.NewsID!=null)
		{
			ListObjArray[ListObjArray.length]=new ListObj(CurrObj,0,j,false);
			j++;
		}
	}
}
function ListObj(Obj,Type,Index,Selected)
{
	this.Obj=Obj;
	this.Index=Index;
	this.Type=Type;
	this.Selected=Selected;
}
function SelectJS(MouseRight)
{
	var el=event.srcElement;
	var i=0;
	if (!MouseRight)
	{
		if ((event.ctrlKey==true)||(event.shiftKey==true))
		{
			if (event.ctrlKey==true)
			{
				for (i=0;i<ListObjArray.length;i++)
				{
					if (el==ListObjArray[i].Obj)
					{
						if (ListObjArray[i].Selected==false)
						{
							ListObjArray[i].Obj.className='TempletSelectItem';
							ListObjArray[i].Selected=true;
						}
						else
						{
							ListObjArray[i].Obj.className='TempletItem';
							ListObjArray[i].Selected=false;
						}
					}
				}
			}
			if (event.shiftKey==true)
			{
				var MaxIndex=0,ObjInArray=false,EndIndex=0,ElIndex=-1;
				for (i=0;i<ListObjArray.length;i++)
				{
					if (ListObjArray[i].Selected==true)
					{
						if (ListObjArray[i].Index>=MaxIndex) MaxIndex=ListObjArray[i].Index;
					}
					if (el==ListObjArray[i].Obj)
					{
						ObjInArray=true;
						ElIndex=i;
						EndIndex=ListObjArray[i].Index;
					}
				}
				if (MaxIndex!=0)
				{
					for (i=MaxIndex-1;i<EndIndex;i++)
					{
						ListObjArray[i].Obj.className='TempletSelectItem';
						ListObjArray[i].Selected=true;
					}
				}
				else
				{
					if (ElIndex!=-1)
					{
						ListObjArray[ElIndex].Obj.className='TempletSelectItem';
						ListObjArray[ElIndex].Selected=true;
					}
				}
			}
		}
		else
		{
			for (i=0;i<ListObjArray.length;i++)
			{
				if (el==ListObjArray[i].Obj)
				{
					ListObjArray[i].Obj.className='TempletSelectItem';
					ListObjArray[i].Selected=true;
				}
				else
				{
					ListObjArray[i].Obj.className='TempletItem';
					ListObjArray[i].Selected=false;
				}
			}
		}
	}
	else
	{
		var elInSelectArray=false;
		for (i=0;i<ListObjArray.length;i++)
		{
			if (el==ListObjArray[i].Obj)
			{
				if (ListObjArray[i].Selected==true)
				{
					elInSelectArray=true;
				}
			}
		}
		if (!elInSelectArray)
		{
			for (i=0;i<ListObjArray.length;i++)
			{
				if (el==ListObjArray[i].Obj)
				{
					ListObjArray[i].Obj.className='TempletSelectItem';
					ListObjArray[i].Selected=true;
				}
				else
				{
					ListObjArray[i].Obj.className='TempletItem';
					ListObjArray[i].Selected=false;
				}
			}
		}
		GetID();
		var NewsFlag;
		NewsFlag=(NewsID!='')?1:0;   //选择了新闻----1  没有选择新闻----0
		if (NewsFlag==1) NewsFlag=(NewsID.indexOf(',')==-1)?2:NewsFlag;  //只选择了一个新闻----2
		switch (NewsFlag)
		{
			case 0:
				Del.className='MenuItemDisable';
				Cut.className='MenuItemDisable';
				Copy.className='MenuItemDisable';
				if (parent.MoveOrCopySourceNews!='')
				{
					Paste.className='MouseRightItem';
				}
				else  Paste.className='MenuItemDisable';
				break;
			case 1:
				Del.className='MouseRightItem';
				Cut.className='MouseRightItem';
				Copy.className='MouseRightItem';
				Paste.className='MenuItemDisable';
				break;
			case 2:
				Del.className='MouseRightItem';
				Cut.className='MouseRightItem';
				Copy.className='MouseRightItem';
				Paste.className='MenuItemDisable';
				break;
			default:
			
		}
	}
}
function GetID()
{
	NewsID='';
	for (i=0;i<ListObjArray.length;i++)
	{
		if (ListObjArray[i].Selected==true)
		{
			if (NewsID=='') NewsID=ListObjArray[i].Obj.NewsID;
			else NewsID=NewsID+','+ListObjArray[i].Obj.NewsID;
		}
	}
}
function CutOperation()
{
	parent.MoveTF=true;
	if (NewsID!='')
	{
		parent.MoveOrCopySourceClass=SpecialIDStr;
		parent.MoveOrCopySourceNews=NewsID;
	}
}

function CopyOperation()
{
	parent.MoveTF=false;
	if (NewsID!='')
	{
		parent.MoveOrCopySourceClass=SpecialIDStr;
		parent.MoveOrCopySourceNews=NewsID;
	}
}

function PasteOperation()
{
	var MoveOrCopyClassPara='MoveTF:'+parent.MoveTF+';SourceClass:'+parent.MoveOrCopySourceClass+';SourceNews:'+parent.MoveOrCopySourceNews+';ObjectClass:'+parent.MoveOrCopyObjectClass+';';
	OpenWindow('Frame.asp?FileName=SpecialNewsMoveOrCopy.asp&Titles=移动或复制专题新闻&MoveOrCopyClassPara='+MoveOrCopyClassPara,260,110,window);
}
function ChangePage(PageNum)
{
	var page_size;
	page_size=<% = page_size %>;
	window.location.href='?page_no='+PageNum+'&page_size='+page_size+'&SpecialID='+SpecialIDStr;
}
</script>
