<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'queryTicket.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script type="text/javascript" src="js/jquery-1.5.2.js"></script>
<script type="text/javascript" src="js/json2.js"></script>
<script type="text/javascript">
$(function(){
$("#query").click(function(){
var url="queryTicket.do";
var param="cardnum="+$("input").val();
$.post(url,param,function(al){
var array = null;
eval("array = " + al);
$.each(array,function(i,qt){
var trStr="<tr>";
trStr+="<td align=center > "+qt.id +"</td>";
trStr+="<td align=center > "+qt.tname +"</td>";
trStr+="<td align=center > "+qt.ttime +"</td>";
trStr+="<td align=center > "+qt.state +"</td>";
$("#tablename").append(trStr);
});
});
});
});
</script>
</head>
<body>
<form action="" method="post">
<div align="center">身份证:<input type="text" size=20 name="cardnum" ><input type="button" value="查询" name="query" id="query"></div>
</form>
<div align="center">
<table id="tablename">
<tr><td>订单号</td>
<td>车次</td>
<td>乘车时间</td>
<td>车票状态 </td></tr>
</table>
</div>
</body>
</html>