<!--#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
	ClassID=getClassBytype("Photos","",0)		'全部Article分类ID
	ClassIDS=getTbValue("ChildStr",2,"ID",Pid,0)
	%> 
        <ul class="toolbar1">
        <li><span><img src="../images/t01.png" /></span><a href="Add.asp">添加</a></li>
        </ul>
        
        <ul class="seachform">
            <li><label>综合查询</label></li>
        	<li><%call getClassList("Photos",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>
    
    
    <ul class="imglist">
    <%
	'可通过产品名称、作者、编号、内容、备注等信息来查找产品
    If Keyword<>"" Then Wherestr="And Title like '%"&Keyword&"%' or Content like '%"&Keyword&"%' " else Wherestr=""
	If Pid<>0 then Wherestr1="And Pid in ("&ClassIDS&")" else Wherestr1="And Pid in ("&ClassID&")"
	
    Page=Max(Cnum(sqlshow(Request("page"))),1)
    Set Rs=server.createobject("adodb.recordSet")
    Sql="select * from Jin_Photos where title<>'' "&Wherestr&" "&Wherestr1&" order by SortID,sysID desc"
    Rs.Open Sql,Conn,1,3
    ListPageSize=Web_PageSizeB
    '显示页数
    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
    %>   
    <li>
	<input name="chk_ids" type="checkbox" class="chk_ids" id="prochk" value="<%=Rs("sysID")%>" /> 
    <span><img src="<%=Web_Root%><%=rs("Pic")%>" /></span>
    <h2><a href="<%=getProUrl(Rs("sysID"))%>" title="<%=rs("Title")%>" target="_blank"><%=CutStr(rs("Title"),12)%></a></h2>
    <p>
    <input class="SortID" name="SortID" value="<%=rs("SortID")%>" id2="<%=rs("SysID")%>" style="width:20px; text-align:center; color:#666; outline:none; border-bottom:1px solid #ddd;" />
    <%If Rs("recommend") Then%>
    <a href="javascript:;" class="recommendno" id2="<%=rs("SysID")%>" id="red">取消</a>&nbsp;
    <%Else%>
    <a href="javascript:;" class="recommend" id2="<%=rs("SysID")%>">推荐</a>&nbsp;
    <%End If%>
    <a href="Add.asp?Action=edit&id=<%=rs("SysID")%>">编辑</a>&nbsp;
    <a href="javascript:;" class="PhotoDel" id2="<%=rs("SysID")%>">删除</a></p>
    </li>
	<%
    Rs.MoveNext
    Next
    Rs.Close
    Set Rs=nothing
    %>
    </ul>
    
    <div class="pagin">
    	<div class="message"><input name="chk_all" type="checkbox" class="chk_all" /> <a href="javascript:;" id="photodelplsc"><font color="#B50000">批量删除</font></a> &nbsp; 共<i class="blue"> <%=AllCount%> </i>个产品</div>
        <ul class="paginList">
        <%Response.write ShowPages(Pages,Page,"Index.asp?Keyword="&Keyword&"&Pid="&Pid&"")%>
        </ul>
    </div>
    
    
    
    </div>
    
    


<script>
$(document).ready(function(e){
autoSave("SortID");
autoClick("recommend");
autoClick("recommendno");
autoDel("PhotoDel");
autoChkAll("photodelplsc");
});
</script>

<%Call BackFoot()%>