<%@ 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" />
<script src="assets/admin/bootstrap/2.3.1/js/bootstrap.min.js" type="text/javascript"></script>
<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/js/jquery/easyui/easyui-lang-zh_CN.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	var arg = new Array();
	arg='${allList}';
	if(arg=='[]'){  
		$.messager.alert("提示","当前接口暂无数据","info")
	}
});
	//点击查询按钮时
	function searchlist(){
		var carNum=$.trim($("#carNum").val().trim());
		var routeNum=$.trim($("#routeNum").val().trim());
		
		var flag1=false,flag2=false;
		for(var k=0;k<laterNo.length;k++){  
		     if ((!/^\s+$/g.test(carNum.charAt(k)))&&(!/^[\u4e00-\u9fa5]+$/.test(carNum.charAt(k)))&&(!carNum.charAt(k).match(/\d+/g))&&(!/^[A-Za-z]+$/.test(carNum.charAt(k)))){   
		    	 flag1=true;
		    	break;
			 }   
	    }
		for(var k=0;k<routeNum.length;k++){  
		     if ((!/^[\u4e00-\u9fa5]+$/.test(routeNum.charAt(k)))&&(routeNum.charAt(k) != "|")){   
		    	 flag2=true;
		    	break;
			 }   
	   }
		if(flag1||flag2){  
			  $.messager.alert("提示","您输入的数据含有非法字符！","info");
			  if(flag1){
				  $("#carNum").val("");
			  }
			  if(flag2){
				  $("#routeNum").val("");
			  }
			 return false;     
		}     
		else{
			var url="table/getSswzList?carNum="+encodeURI(carNum)+"&routeNum="+encodeURI(routeNum);
			loadPage(url);  
		}
	}
</script>
<div class="about_top">
	当前位置: 晚点列车
</div>
<!-- about_form -->
<div class="about_form">
		<form:form method="post" action="table/fechZWD" id="trainSearchForm" class="breadcrumb form-search" modelAttribute="busInfo">
			<label>车牌号：</label><form:input id="carNum" path="carNum" value="${carNum}" htmlEscape="false" maxlength="50" class="input_text" />&nbsp;
			<label style="margin-left: 3%;">线路名称：</label><form:input id="routeNum" path="routeNum" value="${routeNum}" htmlEscape="false" maxlength="50" class="input_text1"/>&nbsp;
			<p class="last">
			<button type="button" onclick="searchlist()" class="searchbutton" ><a style="color:#fff;position: absolute;right: 34px;top: 7px">查询</a></button>
			</p>
		</form:form>
	</div>
	
<!-- 从数据库获取的数据列表 -->
<div class="cont" style="overflow: auto;">
		<!-- grid-->
		<table id="contentTable" class="table table-striped table-bordered table-condensed" style="width:98%">
			<thead><tr><th>车辆ID</th><th>车牌号码</th><th>设备号</th><th>发动机状态</th><th>线路名称</th><th>更新时间</th><th>方向</th><th>进站状态</th><th>当前速度</th><th>当前站点ID</th><th>当前站点名称</th><th>下一站点ID</th><th>下一站点名称</th><th>GPS经度</th><th>GPS纬度</th></tr></thead>
			<tbody>
			<c:forEach items="${allList}" var="busInfo">
				<tr>
					<td>${busInfo.carId}</td>
					<td>${busInfo.carNum}</td>
					<td>${busInfo.devID}</td>
					<td>${busInfo.acc_status}</td>
					<td>${busInfo.routeName}</td>
					<td>${busInfo.gpsTime}</td>
					<td>${busInfo.dir}</td>
					<td>${busInfo.status}</td>
					<td>${busInfo.curSpeed}</td>
					<td>${busInfo.curStationId}</td>
					<td>${busInfo.curStation}</td>
					<td>${busInfo.nextStationId}</td>
					<td>${busInfo.nextStation}</td>
					<td>${busInfo.longitude}</td>
					<td>${busInfo.latitude}</td>
				</tr>
			</c:forEach>
			</tbody>
		</table>
</div>	
