<!--#include file="../Include/Head.asp"-->
<%session("ListPage")=session("nowpage")%>

<script type="text/javascript">
	function DoSearch() {
		if (document.getElementById("Keyword").value != "") {
			//location.href = "search.asp?" + encodeURI(document.getElementById("search_keyword").value);
			location.href = "Index.asp?Keyword=" + document.getElementById("Keyword").value ;
		}
		else { alert("请输入关键词进行查找！") }
	}
</script>



	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="../Main/Right.asp">首页</a></li>
    <li><a href="Index.asp">文章列表</a></li>
    </ul>
    </div>
    
    <div class="rightinfo">
    
    <div class="tools">
    <%
	Keyword=Request_QueryString("Keyword")		'搜索关键词
	Pid=Cnum(Request.QueryString("Pid"))		'所属栏目ID
	AType=Cnum(Request.QueryString("AType"))	'文章类型(已发表、回收站、未归类等)
	Order=Request.QueryString("Order")			'排序方式
	
	
	ClassID=getClassBytype("Article","",0)		'全部Article分类ID
	ClassIDS=getTbValue("ChildStr",2,"ID",Pid,0)
	%>    
    
    <ul class="seachform">
        <li><label>综合查找</label></li>
        <li>
        <select onChange="window.location.href=this.options[this.selectedIndex].value" class="jinselect">
            <option value="?" <%If AType=0 then%>selected="selected"<%End If%>>已发表文章</option>
            <option value="?AType=1" <%If AType=1 then%>selected="selected"<%End If%>>回收站文章</option>
            <option value="?AType=2" <%If AType=2 then%>selected="selected"<%End If%>>未归类文章</option>
        </select>
        </li>
        <li><%call getClassList("Article",Pid)%></li>
        <li><input name="Keyword" id="Keyword" type="text" value="<%=Keyword%>" class="newinput200" /></li>
        <li><input name="" type="button" class="newbtn" onClick="DoSearch();" value="查找" style="width:75px; height:31px;"/></li>
    </ul>
    
    </div>
    
    <%
	Select case AType
		Case 0 : wherestr="And Pid in ("&ClassID&") And Verify"
		Case 1 : wherestr="And Pid in ("&ClassID&") And not Verify"
		Case 2 : wherestr="And Pid not in ("&ClassID&")"
		Case else : wherestr=""
	End Select
	If Keyword<>"" Then Wherestr1="And (Title like '%"&Keyword&"%' or Content like '%"&Keyword&"%') " else Wherestr1=""
	If Pid<>0 then Wherestr2="And Pid in ("&ClassIDS&")" else Wherestr2=""
	Select case Order
		Case 0 : orderstr="Order by Recommend,SysID desc"
		Case 1 : orderstr="Order by SysID asc"
		Case 2 : orderstr="Order by Hits desc,SysID desc"
		Case else : orderstr=""
	End Select
	%>
    
    
    <table class="tablelist" style="margin-top:8px;">
    	<thead>
    	<tr>
        <th width="30"><input name="chk_all" type="checkbox" class="chk_all" /></th>
        <th width="60"><a href="?AType=<%=AType%>&Pid=<%=Pid%>&Order=1">序号</a></th>
        <th>分类 : 标题</th>
        <th width="50"><a href="?AType=<%=AType%>&Pid=<%=Pid%>&Order=2">阅读数</a></th>
        <th width="130">发布时间</th>
        <th width="130">操作</th>
        </tr>
        </thead>
        <tbody>
        <%
        Page=Max(Cnum(sqlshow(Request("page"))),1)
        Set Rs=server.createobject("adodb.recordSet")
        Sql="select * from Jin_Article where title<>'' "&Wherestr&" "&Wherestr1&" "&Wherestr2&" "&Orderstr&" "
        Rs.Open Sql,Conn,1,3
        ListPageSize=12
        '显示页数
        AllCount=Rs.RecordCount
        Pages=Fix(AllCount/ListPageSize)
        If Pages*ListPageSize<AllCount Then Pages=Pages+1	
        PastCount=(Page-1)*ListPageSize
        If AllCount>PastCount Then Rs.Move PastCount
        ShowCount=Min(AllCount-PastCount,ListPageSize)
        For i=1 To ShowCount
        %>    
        <tr>
        <td><input name="chk_ids" type="checkbox" class="chk_ids" value="<%= Rs("sysID") %>" /></td>
        <td><%=Rs("sysID")%></td>
        <td>
        <%If getTbValue("ClassName",2,"ID",Rs("Pid"),0)="Null" then%>
        未归类 :
        <%else%>
        <a href="?AType=<%=AType%>&Pid=<%=Rs("Pid")%>&Keyword=<%=Keyword%>"><font color="#0066FF"><%=getTbValue("ClassName",2,"ID",Rs("Pid"),0)%></font></a> : 
        <%End IF%>
		<a href="<%=getNewsUrl(Rs("sysID"))%>" target="_blank"><%=Rs("Title")%></a>
        </td>
        <td><%=Rs("Hits")%></td>
        <td><%=Rs("Addtime")%></td>
        <td>
        <%If Rs("Verify") then%>
        <A href="javascript:;" class="tablelink Verifyno" id2="<%=Rs("sysID")%>">回收站</A>
        <%Else%>
        <A href="javascript:;" class="tablelink Verify" id2="<%=Rs("sysID")%>">还原</A>
        <%End If%>
        <%If Rs("Recommend") then%>
        <font color="red">已顶</font>
		<%else%>
        <A href="javascript:;" class="tablelink Recommend" id2="<%=Rs("sysID")%>">置顶</A>
		<%end if%>
        <a href="Add.asp?action=edit&id=<%=Rs("sysID")%>" class="tablelink">编辑</a>
        <a href="javascript:;" class="tablelink articleDel" id2="<%=Rs("sysID")%>"> 删除</a></td>
        </tr> 
		<%
        Rs.MoveNext
        Next
        Rs.Close
        Set Rs=nothing
        %>    
        
        </tbody>
    </table>
    
    
    <div class="pagin">
    	<div class="message"><a href="javascript:;" id="articleplsc"><font color="#B50000">批量删除</font></a> &nbsp; 共<i class="blue"> <%=AllCount%> </i>篇文章 &nbsp; &nbsp; 每页 <i class="blue">12</i> 篇文章</div>
        <ul class="paginList">
        <%Response.write ShowPages(Pages,Page,"Index.asp?AType="&AType&"&Keyword="&Keyword&"&Pid="&Pid&"&Order="&Order&"")%>
        </ul>
    </div>
    
    </div>


<%Call BackFoot()%>

<script>
$(document).ready(function(e){
autoSave("Web_BackPageNumA");
autoClick("Recommend");
autoClick("Verify");
autoClick("Verifyno");
autoDel("articleDel");
autoChkAll("articleplsc");
});
</script>