<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/admin/include/taglib.jsp"%>
<link href="assets/admin/bootstrap/2.3.1/css_cerulean/bootstrap.min.css" type="text/css" rel="stylesheet" />
<link href="assets/admin/bootstrap/2.3.1/awesome/font-awesome.min.css" type="text/css" rel="stylesheet" />
<link type="text/css" rel="stylesheet" href="assets/js/jquery/easyui/themes/bootstrap/easyui.css"/>
<script src="assets/admin/bootstrap/2.3.1/js/bootstrap.min.js" type="text/javascript"></script>
<script src="assets/admin/bootstrap/2.3.1/js/bootstrap.min.js" type="text/javascript"></script>
<script src="assets/js/chajian.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	var arg = new Array();
	arg='${page.list}';
	if(arg=='[]'){  
		$.messager.alert("提示","当前查询条件暂无数据","info")
	}
});
function page(n,s){
	searchlist(n,s);
}
function searchlist(n,s){
	var lineName=$("#lineName").val().trim();
	var site=$("#site").val().trim();
// 	lineName=lineName.replace(/\s/g, "");
// 	site=site.replace(/\s/g, "");
	
	var flag1=false,flag2=false;
	for(var k=0;k<lineName.length;k++){  
	     if ((!/^\s+$/g.test(lineName.charAt(k)))&&(!/^[\u4e00-\u9fa5]+$/.test(lineName.charAt(k)))&&(!lineName.charAt(k).match(/\d+/g))&&(!/^[A-Za-z]+$/.test(lineName.charAt(k)))){   
	    	 flag1=true;
	    	break;
		 }   
    }
	for(var k=0;k<site.length;k++){  
	     if ((!/^\s+$/g.test(site.charAt(k)))&&(!/^[\u4e00-\u9fa5]+$/.test(site.charAt(k)))&&(!site.charAt(k).match(/\d+/g))&&(!/^[A-Za-z]+$/.test(site.charAt(k)))){   
	    	 flag2=true;
	    	break;
		 }   
   }
	if(flag1||flag2){  
		  $.messager.alert("提示","您输入的数据含有非法字符！","info");
		  if(flag1){
			  $("#lineName").val("");
		  }
		  if(flag2){
			  $("#site").val("");
		  }
		 return false;     
	}     
	else{
	   	 $("#pageNo").val(n);
	   		$("#pageSize").val(s);
	   		var url="table/initLineData?LINE_NAME="+encodeURI(lineName)+"&SITE="+encodeURI(site)+"&pageNo="+n+"&pageSize="+s;
	   	 	loadPage(url); 
     } 
  
}


</script>
<div class="about_top">
	当前位置: 公交车
</div>

<!-- about_form -->
<div class="about_form">
	<form:form method="post" action="table/initLineData" id="busLineSearchForm" class="breadcrumb form-search" modelAttribute="bl">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<label>公交线路：</label><form:input id="lineName" path="LINE_NAME" value="${lineName}" htmlEscape="false" maxlength="50" class="input_text"/>&nbsp;
		<label style="margin-left: 3%;">途径站点：</label><form:input id="site" path="SITE" value="${site}" htmlEscape="false" maxlength="50" class="input_text"/>&nbsp;
		<p class="last">
			<button type="button" onclick="searchlist('','')" class="searchbutton" ><a >查询</a></button>
		</p>
	</form:form>
</div>

<!-- grid-->
<table id="contentTable" class="table table-striped table-bordered table-condensed" style="width:98%">
	<thead><tr><th style="width: 64px">线路名称</th><th style="width: 100px">起讫点</th><th>途径站点</th><th style="width: 74px">首班车发车时间（上午）</th><th style="width: 74px">末班车发车时间（下午）</th></tr></thead>
	<tbody>
	<c:forEach items="${page.list}" var="busLine">
		<tr>
			<td>${busLine.LINE_NAME}</td>
			<td>${busLine.START_END}</td>
			<td style="text-align: left;">${busLine.SITE}</td>
			<td>${busLine.FIRST_TIME}</td>
			<td>${busLine.LAST_TIME}</td>
		</tr>
	</c:forEach>
	</tbody>
</table>
<%-- <div class="pagination2">${page}</div> --%>
<div class="pagination">${page}</div>


<div class="bottom" >
	<p>以上数据仅供参考，以实际公布信息为准！</p>
</div>
</div>