<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link type="text/css" rel="stylesheet" href="../Css/style.css" />
<script language="javascript" type="text/javascript" src="../jQuery/lib/jquery.js"></script>
<script language="javascript" type="text/javascript" src="../js/WebSite.js"></script>
</head>
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Function.asp"-->
<body>
<%
Call ChkLogin(session("WebAdminsUserName"))
Call ConnectionDataBase(2)

Action = Request("Action")
CID = Request("NewsCategory")
Key =  Request("Key")
%>
<form action="?" name="frmSearch" method="post">
<input type="hidden" name="Action" value="Search" />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
    <select name="NewsCategory" id="NewsCategory">
    <option value="0" selected="selected">请选择类别</option>
    <%
	Sql="SELECT * FROM T_JcClass WHERE recycle=0"
	SetRs Rs,Sql,conn,1,1
	IF Not Rs.EOF Then
	Do While Not Rs.EOF
	iCount = iCount + 1
	FileName = Rs("FileName")
	ClassID = Rs("ID")
    %>
    <option value="<%=ClassID%>" <%IF Cstr(ClassID)=Cstr(CID) Then Response.Write("selected")%>><%=FileName%></option>
	<%
	  Call SubCategory(Rs("ID"),"&nbsp;&nbsp;&nbsp;&nbsp;")
	  Rs.movenext
	Loop
	End IF
	DisRs Rs
    %>
    </select>
    <input type="text" name="Key" id="Key" class="txt" value="<%=Key%>" />
    <input type="submit" name="search" value="搜索" class="btn">
    </td>  
  </tr>
</table>
</form>
<form action="Delete.asp" method="post" name="frm" onsubmit="return Confirm('确定要删除所选记录吗?')">
<input type="hidden" name="Action" value="LogicDelNews">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <th width="5%">序号</th>
    <th width="47%">标 题</th>
    <th width="15%">类 别</th>
    <th width="15%">发布日期</th>
    <th width="15%">操作</th>
  </tr>
  <%
	Sql = "SELECT * FROM T_JcClassNew AS N LEFT JOIN T_JcClass AS C ON N.ClassID=C.ID WHERE N.Recycle=0"
	IF Action="Search" Then Sql = Sql & " And NewsTitle like '%" & Key & "%'"
	IF Action="Search" Then
		IF Isnumeric(CID) And CID>0 Then Sql = Sql & " And C.ID=" & CID & ""
	End IF
	Sql = Sql & " ORDER BY N.SortID DESC,N.AddTime DESC"
	SetRs Rs,Sql,conn,1,1
	IF Rs.eof And Rs.bof Then
		Response.write "<tr><td colspan='5'>&nbsp;没有相关记录!</td></tr>"
	Else
		n=0
		Rs.pagesize=15
		IF Not isempty(request("page")) And isnumeric(request("page")) Then 				  
			p=cint(request("page"))   
			IF p>Rs.pagecount Then p=Rs.pagecount
		Else   
			p=1
		End IF             
		Rs.AbsolutePage=p
		do while not Rs.eof	
  %>
  <tr>
    <td align="center"><%=n+1%></td>
    <td><%=Rs("NewsTitle")%></td>
    <td align="center"><%IF len(Trim(Rs("Filename"))) Then: Response.write Rs("Filename"): Else:Response.write "根目录": End IF%></td>
    <td align="center"><%=Formatdatetime(Rs("N.AddTime"),2)%></td>
    <td align="center">
    <input type="button" value="修改" class="btn1" onclick="window.location.href='NewsEdit.asp?Act=Edit&id=<%=Rs("N.ID")%>'" />
    <input name="ChkBox" type="checkbox" value="<%=Rs("N.ID")%>" />
    </td>
  </tr>
  <%  
		n=n+1     
		Rs.movenext
		IF n>=Rs.pagesize Then Exit Do
		Loop
    End IF
  %>
  <tr>
    <th colspan="4" align="right" class="FontWeight">
	<%Call showpage(Rs.pagesize,Rs.recordcount,p,Rs.pagecount,"&Action=" & Action & "&NewsCategory=" & CID & "&Key=" & Server.URLEncode(Key))%>
	</th>    
	<th>
    <input type="submit" name="submit" value="删除" class="btn">
    <input name="" type="checkbox" value="" style="margin-left:10px" onclick="CheckAll(this.checked);"/>全选/反选
    <%
	DisRs Rs
	Call CloseDataBase
	%>
    </th>
  </tr>
</table>
</form>
</body>
</html>
