|
|
@ -5,8 +5,15 @@
|
|
|
|
<%@page contentType="text/html; charset=UTF-8" import="java.text.SimpleDateFormat"%>
|
|
|
|
<%@page contentType="text/html; charset=UTF-8" import="java.text.SimpleDateFormat"%>
|
|
|
|
|
|
|
|
|
|
|
|
<%
|
|
|
|
<%
|
|
|
|
//添加URL session ,作为用户登录后跳转回来的依据,登录servlet中已经写了判断程序,如果有url_cookie,就跳转到url_cookie,如果没有,就跳转到用户中心
|
|
|
|
// 检查用户是否已登录
|
|
|
|
session.setAttribute("url", request.getRequestURI());
|
|
|
|
if (session.getAttribute("user_id") == null) {
|
|
|
|
|
|
|
|
// 如果未登录,重定向到登录页面
|
|
|
|
|
|
|
|
response.sendRedirect("../index/login_reg.jsp");
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 添加URL session ,作为用户登录后跳转回来的依据,登录servlet中已经写了判断程序,如果有url_cookie,就跳转到url_cookie,如果没有,就跳转到用户中心
|
|
|
|
|
|
|
|
session.setAttribute("url", request.getRequestURI());
|
|
|
|
%>
|
|
|
|
%>
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<html>
|
|
|
@ -116,9 +123,6 @@ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
<div class="container"
|
|
|
|
<div class="container"
|
|
|
|
style="position: relative; margin-left: 650px; width: auto;">
|
|
|
|
style="position: relative; margin-left: 650px; width: auto;">
|
|
|
|
<form class="form-inline" action="/air_ticket_book/search" method="post">
|
|
|
|
<form class="form-inline" action="/air_ticket_book/search" method="post">
|
|
|
|
<!-- <div class="form-group mar-left-10" >
|
|
|
|
|
|
|
|
<label for="" >购买机票时间:<%=todaydate %></label>
|
|
|
|
|
|
|
|
</div> -->
|
|
|
|
|
|
|
|
<div class="form-group mar-left-10" >
|
|
|
|
<div class="form-group mar-left-10" >
|
|
|
|
<label for="" >出发城市</label>
|
|
|
|
<label for="" >出发城市</label>
|
|
|
|
<input name="departure" type="text" class="form-control"
|
|
|
|
<input name="departure" type="text" class="form-control"
|
|
|
@ -128,88 +132,105 @@ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
<label for=""> 到达城市</label> <input name="destination" type="text" class="form-control"
|
|
|
|
<label for=""> 到达城市</label> <input name="destination" type="text" class="form-control"
|
|
|
|
style="width: 85px;" value="" placeholder="到达城市">
|
|
|
|
style="width: 85px;" value="" placeholder="到达城市">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
|
|
|
<label for=""> 出发日期</label>
|
|
|
|
|
|
|
|
<div class="input-group">
|
|
|
|
|
|
|
|
<input name="departureYear" type="text" class="form-control"
|
|
|
|
|
|
|
|
style="width: 70px;" value="">
|
|
|
|
|
|
|
|
<span class="input-group-addon">年</span>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="input-group">
|
|
|
|
|
|
|
|
<input name="departureMonth" type="text" class="form-control"
|
|
|
|
|
|
|
|
style="width: 60px;" value="">
|
|
|
|
|
|
|
|
<span class="input-group-addon">月</span>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="input-group">
|
|
|
|
|
|
|
|
<input name="departureDay" type="text" class="form-control"
|
|
|
|
|
|
|
|
style="width: 60px;" value="">
|
|
|
|
|
|
|
|
<span class="input-group-addon">日</span>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<button type="submit" class="btn btn-warning mar-left-10"
|
|
|
|
<button type="submit" class="btn btn-warning mar-left-10"
|
|
|
|
style= "font-size:18px; border:#FFFFFF; color:#414582; background-color:#FFFFFF;">搜索</button>
|
|
|
|
style= "font-size:18px; border:#FFFFFF; color:#414582; background-color:#FFFFFF;">搜索</button>
|
|
|
|
</form>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- 搜索结束 -->
|
|
|
|
<!-- 搜索结束 -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 列表开始 -->
|
|
|
|
<!-- 列表开始 -->
|
|
|
|
<div class="container mar-bottom-30 " style="margin-left: 50px;">
|
|
|
|
<div class="container mar-bottom-30 " style="margin-left: 50px;">
|
|
|
|
<div class="hangbanlist">
|
|
|
|
<div class="hangbanlist">
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<%
|
|
|
|
<%
|
|
|
|
db_conn conn=new db_conn();
|
|
|
|
db_conn conn=new db_conn();
|
|
|
|
String sql="select * from flight";
|
|
|
|
String sql="select * from flight";
|
|
|
|
ResultSet res=conn.executeQuery(sql);
|
|
|
|
ResultSet res=conn.executeQuery(sql);
|
|
|
|
|
|
|
|
|
|
|
|
while(res.next()){
|
|
|
|
|
|
|
|
String f_i=res.getString(1);
|
|
|
|
|
|
|
|
String s_p=res.getString(2);
|
|
|
|
|
|
|
|
String a_p=res.getString(3);
|
|
|
|
|
|
|
|
String s_a=res.getString(4);
|
|
|
|
|
|
|
|
String a_a=res.getString(5);
|
|
|
|
|
|
|
|
String s_t=res.getString(6);
|
|
|
|
|
|
|
|
String a_t=res.getString(7);
|
|
|
|
|
|
|
|
String f_p=res.getString(8);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String sql2="select sum(t_b) from ticket where f_n='"+f_i+"' and t_d='"+todaydate+"'";
|
|
|
|
while(res.next()){
|
|
|
|
db_conn conn2=new db_conn();
|
|
|
|
String f_i=res.getString(1);
|
|
|
|
ResultSet res2=conn2.executeQuery(sql2);
|
|
|
|
String s_p=res.getString(2);
|
|
|
|
if(res2.next()) seat=res2.getString(1);
|
|
|
|
String a_p=res.getString(3);
|
|
|
|
if(seat=="null") seat="0";
|
|
|
|
String s_a=res.getString(4);
|
|
|
|
|
|
|
|
String a_a=res.getString(5);
|
|
|
|
%>
|
|
|
|
String s_t=res.getString(6);
|
|
|
|
|
|
|
|
String a_t=res.getString(7);
|
|
|
|
<!-- 表头 -->
|
|
|
|
String f_p=res.getString(8);
|
|
|
|
<ul class="list-inline bor-bottom-solid-1 ">
|
|
|
|
|
|
|
|
<li class="w-percentage-25" style="font-size:26px;color:#414582;"> <strong><%=f_i %></strong></li>
|
|
|
|
String sql2="select sum(t_b) from ticket where f_n='"+f_i+"' and t_d='"+todaydate+"'";
|
|
|
|
|
|
|
|
db_conn conn2=new db_conn();
|
|
|
|
|
|
|
|
ResultSet res2=conn2.executeQuery(sql2);
|
|
|
|
|
|
|
|
if(res2.next()) seat=res2.getString(1);
|
|
|
|
|
|
|
|
if(seat=="null") seat="0";
|
|
|
|
|
|
|
|
|
|
|
|
<li class="w20 time " ><strong><%=s_p %></strong> </li>
|
|
|
|
%>
|
|
|
|
<li class="text-right" style= "color:#414582;"><%=s_a %></li>
|
|
|
|
|
|
|
|
<li class="">—</li>
|
|
|
|
<!-- 表头 -->
|
|
|
|
<li class="w20 time " ><strong><%=a_p %></strong> </li>
|
|
|
|
<ul class="list-inline bor-bottom-solid-1 ">
|
|
|
|
<li class="w150" style= "color:#414582;"><%=a_a %></li>
|
|
|
|
<li class="w-percentage-25" style="font-size:26px;color:#414582;"> <strong><%=f_i %></strong></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="w20 time " ><strong><%=s_p %></strong> </li>
|
|
|
|
|
|
|
|
<li class="text-right" style= "color:#414582;"><%=s_a %></li>
|
|
|
|
|
|
|
|
<li class="">—</li>
|
|
|
|
|
|
|
|
<li class="w20 time " ><strong><%=a_p %></strong> </li>
|
|
|
|
|
|
|
|
<li class="w150" style= "color:#414582;"><%=a_a %></li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="time w100"><strong><%=s_t %></strong></li>
|
|
|
|
<li class="time w100"><strong><%=s_t %></strong></li>
|
|
|
|
<li class="">—</li>
|
|
|
|
<li class="">—</li>
|
|
|
|
<li class="time w80"><strong><%=a_t %></strong></li>
|
|
|
|
<li class="time w80"><strong><%=a_t %></strong></li>
|
|
|
|
<%if(session.getAttribute("user_id")!=null){ %>
|
|
|
|
<%if(session.getAttribute("user_id")!=null){ %>
|
|
|
|
<li class="pull-right "><button type="button" style= "border:#000000;color:#FFFFFF;background-color:#414582;"
|
|
|
|
<li class="pull-right "><button type="button" style= "border:#000000;color:#FFFFFF;background-color:#414582;"
|
|
|
|
class="btn btn-danger btn-sm" onClick="window.location.href ='order.jsp?flight_id=<%=f_i %>';">订票</button></li><%}
|
|
|
|
class="btn btn-danger btn-sm" onClick="window.location.href ='order.jsp?flight_id=<%=f_i %>';">订票</button></li><%}
|
|
|
|
if(session.getAttribute("user_id")==null){ %>
|
|
|
|
if(session.getAttribute("user_id")==null){ %>
|
|
|
|
<li class="pull-right "><button type="button" style= "border:#000000;color:#FFFFFF;background-color:#414582;"
|
|
|
|
<li class="pull-right "><button type="button" style= "border:#000000;color:#FFFFFF;background-color:#414582;"
|
|
|
|
class="btn btn-danger btn-sm" onClick="window.location.href ='error_login.jsp?flight_id=<%=f_i %>';">订票</button></li><%} %>
|
|
|
|
class="btn btn-danger btn-sm" onClick="window.location.href ='error_login.jsp?flight_id=<%=f_i %>';">订票</button></li><%} %>
|
|
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
<!-- 表头结束 -->
|
|
|
|
<!-- 表头结束 -->
|
|
|
|
<!-- 表BODY -->
|
|
|
|
<!-- 表BODY -->
|
|
|
|
<div class="collapse" id="collapseExample" style="display: block;">
|
|
|
|
<div class="collapse" id="collapseExample" style="display: block;">
|
|
|
|
<div class="hangbanlist-body " style="background-color: #f4f6f7;">
|
|
|
|
<div class="hangbanlist-body " style="background-color: #f4f6f7;">
|
|
|
|
<ul class="list-inline">
|
|
|
|
<ul class="list-inline">
|
|
|
|
|
|
|
|
|
|
|
|
<li class="w-percentage-25">今日剩余座位数:<%=seat %></li>
|
|
|
|
<li class="w-percentage-25">今日剩余座位数:<%=seat %></li>
|
|
|
|
<li class="w-percentage-25">价格:<span class="rmb">¥<%=f_p %></span></li>
|
|
|
|
<li class="w-percentage-25">价格:<span class="rmb">¥<%=f_p %></span></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- 表BODY 结束 -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<%
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
%>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- 表BODY 结束 -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<%
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
%>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="chat-container">
|
|
|
|
<div class="chat-container">
|
|
|
|
<div id="chat-history"></div>
|
|
|
|
<div id="chat-history"></div>
|
|
|
|
<div class="input-area">
|
|
|
|
<div class="input-area">
|
|
|
|