<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/cms/front/include/taglib.jsp"%>

<% String base=request.getContextPath(); %>
<% String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + base + "/";%>
<base href="<%=basePath%>"></base>
<link type="text/css" rel="stylesheet" href="assets/jedate/skin/jedate.css">
<link type="text/css" rel="stylesheet" href="assets/js/jquery/easyui/themes/default/easyui.css"/>
<script src="assets/js/jquery.min.js"></script> 
<script src="assets/js/jqueryui/jquery-ui.min.js"></script>
<script type="text/javascript" src="assets/jedate/jquery.jedate.js"></script>
<script src="assets/js/jquery/easyui/jquery.easyui.min.js"></script>
<link type="text/css" rel="stylesheet" href="assets/js/jquery/easyui/themes/bootstrap/easyui.css"/>
<script type="text/javascript">
  $(document).ready(function(){
    	var date = new Date();
    	$(".year").text(date.getFullYear());
    	$(".mon").text(date.getMonth()+1);
    	$(".day").text(date.getDate());
    	$(".week").text("星期" + "日一二三四五六".charAt(date.getDay()))
   		var arg = new Array();
   		arg='${page.list}';
   		if(arg=='[]'){  
   			$.messager.alert("提示","当前查询条件暂无数据","info")
   		}
   		
   		$('#columnclass .listfont a').each(function(m){
   			if($(this).text()=='${category.name}'){
   				$(this).css("color","#FF7E09");
   				$(this).css("font-weight","bold");
   			}
  		})
    });
function  searchlist(n,s){
	var title=$("#title").val();
	title=title.replace(/\s/g, "");
	var flag1=false,flag2=false;
	var timestart=$("#timestart").val();
	var timeend=$("#timeend").val();
	if(timestart!=null&&timestart!=""&&timeend!=null&&timeend!=""){
		if(timeend<timestart){
			flag2=true;
		}
	}
	for(var k=0;k<title.length;k++){  
	     if ((!/^[\u4e00-\u9fa5]+$/.test(title.charAt(k)))&&(!title.charAt(k).match(/\d+/g))&&(!/^[A-Za-z]+$/.test(title.charAt(k)))){   
	    	flag1=true;
	    	break;
		 }   
    }
	if(flag1||flag2){  
		  if(flag1){
			  $.messager.alert("提示","您输入的数据含有非法字符！","info");
			  $("#title").val("");
			  return false;     
		  }
		  if(flag2)
           {  $.messager.alert("提示","输入的开始时间不能大于结束时间！","info");
			  return false;     
		   }
		
	}     
	else{
		var timestart=$("#timestart").val();
		var timeend=$("#timeend").val();
		var url="${ctx}/list-${category.id}${urlSuffix}?searchtimestart="+timestart+"&searchtimeend="+timeend+"&searchtitle="+title+"&pageNo="+n+"&pageSize="+s;
		loadPage(url); 
	}
	
	
  }
</script>
<!-- 更多栏目的页面 JSP-->
<div class="morecontent_warp" style="width:80%;margin: 1% auto;height: 95%;" >
			<div  class="fontViewArticleBack2">
			     <a href="javascript:loadPage('front');"><img src="assets/images/icon_back.png" class="headback"/>资讯首页</a>
		    </div>
	       <!--search  -->
	       <div class="searchlan" style="height:5%;margin-bottom:2%;">
	           <!-- <form> -->
	           <table style="height:100%;position: relative;left:25%;width: 85%;">
	     			<td style="font-size:0.8vw;width:6%;">标题：</td>
	     			<td style="width: 25%;"> <input id="title" name="title"  type="text" style="background-color:#Edf0f7;width:200px;height:30px; border: 1px solid #c8d0e0;
    border-radius: 3px;" value="${title}"/></td>
  		            <td style="font-size:0.8vw;width:6%;margin-left: 3%;"> 时间：</td>
	     			<td style="width: 15%;"> <input id="timestart" name="timestart"  type="text" class="timetextymdhms" readonly="true" value="${timestart}"/></td>
	     			<td style="font-size:0.8vw;"> 至</td>
	     			<td style="width: 15%;"> <input id="timeend"  name="timeend"  type="text" class="timetextymdhms" readonly="true"  value="${timeend}"/></td>
	     			<td style="width:31%;height:100%;"> <button type="button" onclick="searchlist('','')" class="searchbutton" id="searchbutton" value="查询" ><a>查询</a></button></td>
<!-- 	     			<a>查询</a> -->
	     	   </table>
	     	<!--  </form> -->
	       </div>
	       <!--content  -->
	       <div class="contentcolumn" style="width:100%;height: 88%">
			      <div class="columnreadlist" style="width:22%;height: 100%;" >
			   	       <h4 style="padding-left: 9%;">栏目列表</h4>
			   	       <div class="columnlist" id="columnclass">
						   <cms:frontCategoryList categoryList="${categoryList}"/>
				       </div>
			           <h4 style="padding-left: 9%;">推荐阅读</h4>
				       <div class="columnlist">
					   <cms:frontArticleHitsTop category="${category}"/>
				       </div> 
			      </div>
			      <div class="getcontentlist" style="width:74%;">
						  <h4 >${category.name}</h4>
						   <div class="columnlist" style="height: 96%;padding-bottom:30px;">
							  <c:if test="${category.module eq 'article'}">
								<ul><c:forEach items="${page.list}" var="article" varStatus="status">
									<li><span class="pull-right"><fmt:formatDate value="${article.updateDate}" pattern="yyyy.MM.dd"/></span>
										<font class="icon">
							  	      		<img src="assets/images/to.png"/>
							  	      	</font>${status.count}.
							  	      	<c:if test="${article.link eq null||empty article.link }">
							  	      	<a href="javascript:loadPage('${article.url}');" style="color:${article.color}">${fns:abbr(article.title,96)}</a>
							  	      	</c:if>
										<c:if test="${article.link ne null&&not empty article.link }">
										<a href="${article.link}" target="_blank" style="color:${article.color}">${fns:abbr(article.title,96)}</a>
										</c:if>
									</li>
								</c:forEach></ul>
								<div class="pageList" style="height: 14%;padding-left:6%;margin-top:2%;">
								 <div class="pagination">${page}</div>
								 </div>
								<script type="text/javascript">
									function page(n,s){
										searchlist(n,s);
									}
								</script>
							  </c:if>
						  </div>
				  </div>
		   </div>
		
   </div>
   
</div>
<script  type="text/javascript">
$(".timetextymdhms").jeDate({
// 	dateCell:".textymdhms",  
	format:"YYYY/MM/DD",
	isTime:false, 
	festival: false, //显示节日
})
</script>