<% Option Explicit %>
<!--#include file="../../Inc/Const.asp" -->
<!--#include file="../../Inc/Cls_DB.asp" -->
<!--#include file="../../Inc/Function.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"),"P0107") then Call ReturnError1()
Dim RsClassObj,RsNewsObj,Sql,AlreadyDelClassIDStr,NewsType,PicStr,SunNumAsp
AlreadyDelClassIDStr = ""
Sql = "Select * from NewsClass where DelFlag=1"
Set RsClassObj = Conn.Execute(Sql)
%>
<!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="../../CSS/css.css" rel="stylesheet">
<script src="../JS/PublicJS.js" language="JavaScript"></script>
<body topmargin="0" leftmargin="0" ondragstart="return false;" onselectstart="return false;" oncontextmenu="ClickClassOrNews(document.all('MainTable'));showMenu(MouseRightMenu);return false;">
<table width="100%" height="100%" onclick="ClickClassOrNews(this);" border="0" cellspacing="0" cellpadding="0" id="MainTable">
  <tr>
  <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="46%" class="ButtonList"><div align="center">名称</div></td>
    <td width="15%" class="ButtonList"><div align="center">类型</div></td>
    <td width="22%" class="ButtonList"><div align="center">删除时间</div></td>
    <td width="17%" class="ButtonList"><div align="center">大小</div></td>
  </tr>
  <%
	do while Not RsClassObj.Eof
		if AlreadyDelClassIDStr = "" then
			AlreadyDelClassIDStr = "'" & RsClassObj("ClassID") & "'"
		else
			AlreadyDelClassIDStr = AlreadyDelClassIDStr & "," & "'" & RsClassObj("ClassID") & "'"
		end if
%>

        <tr> 
          <td>
            <table border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td>&nbsp;<img src="../Images/Folder.gif" width="18" height="18"></td>
                <td><span class="TempletItem" ClassID="<% = RsClassObj("ClassID") %>" align="center"><% = RsClassObj("ClassCName") %></span></td>
              </tr>
            </table>
            
          </td>
        

    <td><div align="center" class="TempletItem">
              栏目</div></td>
    <td><div align="center" class="TempletItem"><% = RsClassObj("DelTime") %></div></td>
          <td><div align="center">--</div></td>
	</tr>
  <%
		RsClassObj.MoveNext
	loop
	if AlreadyDelClassIDStr <> "" then
		Sql = "Select * from News where DelTF=1 order by DelTime desc" 
	else
		Sql = "Select * from News where DelTF=1 order by DelTime desc"
	end if
	Set RsNewsObj = Server.CreateObject("Adodb.RecordSet")
	RsNewsObj.Open Sql,Conn,3,3
	SunNumAsp = RsNewsObj.RecordCount
	If Not RsNewsObj.eof then
	Dim page_size,page_no,page_total,record_all,PageNums
	If isnumeric(Request.Form("PageNums")) then
		if Request.Form("PageNums")<>0 then
			PageNums = Cint(Request.Form("PageNums"))
		else
			PageNums=20
		end if
	Else
		PageNums=20
	End if
	page_size=PageNums
	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
	RsNewsObj.PageSize=page_size
	page_total=RsNewsObj.PageCount
	if (cint(page_no)>page_total) then page_no=page_total
	If page_no=0 then page_no=1
	RsNewsObj.AbsolutePage=page_no
 	Dim i
	for i=1 to RsNewsObj.PageSize
		if RsNewsObj.eof then exit for		
		if RsNewsObj("HeadNewsTF")<>"1" and RsNewsObj("PicNewsTF")<>"1" then
		   NewsType = "文字新闻"
		   PicStr = "../Images/WordNews.gif"
		elseif RsNewsObj("HeadNewsTF")="1" then
		   NewsType = "标题新闻"
		   PicStr = "../Images/TitleNews.gif"
		else
		   NewsType = "图片新闻"
		   PicStr = "../Images/PicNews.gif"
		end if
%>
        <tr> 
          <td>
            <table border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td>&nbsp;<img src="<% = PicStr %>"></td>
                <td><span class="TempletItem" NewsID="<% = RsNewsObj("NewsID") %>" align="center"><% = GotTopic(RsNewsObj("Title"),40) %></span></td>
              </tr>
            </table>
		 </td>
          <td> <div align="center" class="TempletItem"> 
              <% = NewsType %>
            </div></td>
          <td> <div align="center" class="TempletItem"> 
              <% = RsNewsObj("DelTime") %>
            </div></td>
          <td><div align="center" class="TempletItem"> 
              <% = Len(RsNewsObj("Content")) %>
              字符 </div></td>
        </tr>
<%
		RsNewsObj.MoveNext
	Next
	End If
%>
</table>
</td>
</tr>
<tr> 
<td valign="middle" height="10">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="ButtonList">
	  <tr height="1">
		  <td width="62%" height="18"><table width="99%" border="0" cellspacing="0" cellpadding="0">
			  <tr><form name="PGNum" method="post" action="">
				<td width="38%" valign="middle">   
				  <div align="right">每页记录条数<input name="PageNums" type="text" id="PageNums" size="10" value="20">
				  </div></td>  
				<td width="11%" valign="bottom"><div align="center">
				  <input name="imageField" type="image" src="../Images/Submit.gif" border="0">
				</div></td>
				</form>
			  </tr>
		   </table> </td>
		
		<td 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&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)&"&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)&"&Keywords="&Request("Keywords")&"><img src=../images/nextPage.gif border=0 alt=下一页></img></a>&nbsp;"
						response.Write "&nbsp;<a href=?page_no="& Page_Total &"&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)&"&Keywords="&Request("Keywords")&"><img src=../images/nextPage.gif border=0 alt=下一页></img></a>&nbsp;"
						response.Write "&nbsp;<a href=?page_no="& Page_Total &"&Keywords="&Request("Keywords")&"><img src=../images/endpage.gif border=0 alt=尾页></img></a>&nbsp;"
					else
						response.Write "&nbsp;<a href=?page_no=1&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)&"&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
				%>
			<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>
		</div></td>
	  </tr>
	</table></td>
	</tr>
</table>

</body>
</html>
<!-- 鼠标右键菜单 -->
<div id=MouseRightMenu onclick="ClickMenu(this);" onmouseover="MouseOverRightMenu();" onmouseout="MouseOverRightMenu();" class="menu"> 
  <div class="MouseRightItem" id="UnDoDel" ExeFunction="Revert();">还原</div>
  <div class="MouseRightItem" id="Del" ExeFunction="DelClassOrNews();">删除</div>
  <div class="MouseRightItem" id="Attribute" ExeFunction="ShowAttribute();">属性</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>
<%
Set RsNewsObj = Nothing
Set RsClassObj = Nothing
Set Conn = Nothing
%>
<script language="JavaScript">
var ClassID='';
var NewsID='';
function ClickClassOrNews(Obj)
{
	for (var i=0;i<Obj.all.length;i++) if (Obj.all(i).className=='TempletSelectItem') Obj.all(i).className='TempletItem';
	if ((event.srcElement.ClassID!=null)||(event.srcElement.NewsID!=null))
	{
		event.srcElement.className='TempletSelectItem';
		if (event.srcElement.ClassID!=null)
		{
			ClassID=event.srcElement.ClassID;
			NewsID='';
			UnDoDel.className='MouseRightItem';
			Del.className='MouseRightItem';
			Attribute.className='MouseRightItem';
		}
		else
		{
			ClassID='';
			NewsID=event.srcElement.NewsID;
			UnDoDel.className='MouseRightItem';
			Del.className='MouseRightItem';
			Attribute.className='MouseRightItem';
		}
	}
	else
	{
		UnDoDel.className='MenuItemDisable';
		Del.className='MenuItemDisable';
		Attribute.className='MenuItemDisable';
	}
}
function Revert()
{
	if (ClassID!='') {OpenWindow('Frame.asp?FileName=Revert.asp&OperateType=Class&ID='+ClassID,260,104,window);return;}
	if (NewsID!='') {OpenWindow('Frame.asp?FileName=Revert.asp&OperateType=News&ID='+NewsID,260,104,window);return;}
}
function DelClassOrNews()
{
	if (ClassID!='') {OpenWindow('Frame.asp?FileName=Del.asp&OperateType=Class&ID='+ClassID,260,100,window);return;}
	if (NewsID!='') {OpenWindow('Frame.asp?FileName=Del.asp&OperateType=News&ID='+NewsID,260,100,window);return;}
}
function ShowAttribute()
{
	if (ClassID!='') {OpenWindow('ClassAttribute.asp?OperateType=Class&ID='+ClassID,250,270,window);return;}
	if (NewsID!='') {OpenWindow('NewsAttribute.asp?OperateType=News&ID='+NewsID,250,270,window);return;}
}
function ChangePage(PageNum)
{
	window.location.href='?page_no='+PageNum;
}
</script>