<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="JumboUCMS.WebFile.Search._index" %>
<!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" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>站内搜索 -<%= site.Name%></title>
<link href="/statics/css/global.css" rel="stylesheet" type="text/css" />
<link href="/statics/css/default_blue.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/_libs/jquery.tools.pack.js"></script>
<script type="text/javascript" src="/_data/jcmsU1.js"></script>
<link type="text/css" rel="stylesheet" href="/_data/jcmsU1.css" />
<script type="text/javascript" src="/_libs/jquery.sgallery.js"></script>
<script type="text/javascript" src="/statics/js/search_common.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	if('<%= Keywords%>'!='')ajaxSearchList(<%= PageSize%>,1);
});
function ajaxSearchList(pagesize,page)
{
	$.ajax({
		type:		"get",
		dataType:	"json",
		data:		"time="+(new Date().getTime()),
		url:		"ajax.aspx?oper=ajaxGetContentList&type=<%= ChannelType%>&mode=<%= Mode%>&ch=<%= ChannelId%>&k="+encodeURIComponent('<%= Keywords%>')+"&pagesize="+pagesize+"&page="+page,
		error:		function(XmlHttpRequest,textStatus, errorThrown){if(XmlHttpRequest.responseText!=""){alert(XmlHttpRequest.responseText);}},
		success:	function(d){
			if(d.recordcount != -1)
			{
				$("#ajaxTotalCount").text(d.recordcount);
				$("#ajaxEventTime").text(d.eventtime);
				$("#ajaxSearchList").setTemplateElement("tplList", null, {filter_data: false});
				$("#ajaxSearchList").processTemplate(d);
				$("#ajaxPageBar").html(d.pagerbar);
			}
		}
	});
}
</script>
</head>
<body>
<!--#include virtual="/_data/html/header.htm" -->
<!--main-->

<div class="main cat-search">
  <div class="col-auto">
    <div class="crumbs"><a href="/">首页</a><span>&nbsp;&gt;&nbsp;</span>搜索</div>
    <form name="myform" method="get" action="default.aspx" >
      <ul class="search-form">
        <li>
          <label>类别</label>
          <select name='type'>
            <option value="all">不限</option>
            <option value="article">文章</option>
            <option value="photo">图片</option>
            <option value="video">视频</option>
            <option value="document">文档</option>
          </select>
        </li>
        <li>
          <label>频道</label>
          <select name="ch">
            <option value="0">不限频道</option>
            <%=ChannelList %>
          </select>
        </li>
        <li>
          <label>关键词</label>
          <input type='text' name='k' id='keywords' value='<%= Keywords%>' class='input-text search-text'/>
        </li>
        <li><div class="btn"><input type="submit" value="搜索" /></div></li>
      </ul>
    </form>
    <div class="search-point">共找到到符合条件的结果 <strong id="ajaxTotalCount" class="red">0</strong> 条</div>
<textarea id="tplList" style="display:none">
{#foreach $T.table as record}
      <li style="margin:0">
      {#if $T.record.img != ""}
        <a href="{$T.record.url}" target="_blank"><img height="60" width="60" src="{$T.record.img}"></a>
      {#/if}
        <h5><a href="{$T.record.url}" target="_blank" class="blue fn">{$T.record.title}</a> - <span class="green f12 fn">{$T.record.adddate}</span></h5>
        <p>{$T.record.summary}</p>
      </li>
{#/for}
</textarea>
    <ul id="ajaxSearchList" class="search-list"></ul>
    <div id="ajaxPageBar" class="pages"></div>
  </div>
</div>
<!--#include virtual="/_data/html/footer.htm" -->
</body>
</html>
