%@page import="javabean.flight"%>
<%@page import="java.util.ArrayList"%>
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page contentType="text/html; charset=UTF-8" import="java.util.Date"%>
<%@page contentType="text/html; charset=UTF-8" import="java.text.SimpleDateFormat"%>
<%@page import="javabean.db_conn"%>
<%@page import="java.sql.ResultSet"%>
机票推荐系统
<%! db_conn conn2=new db_conn();
String seat;
String user_name;
Date date = new Date();
//设置要获取到什么样的时间
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//获取String类型的时间
String todaydate = sdf.format(date);
%>
<%
ArrayList flightlist=(ArrayList)request.getAttribute("flightlist");
if(flightlist.size()==0){
out.println("对不起,未找到您需要的航班,请重新查找");
}else{
for(int i=0;i
- <%=flight_info.getF_n()%>
- <%=flight_info.getF_s_p()%>
- <%=flight_info.getF_s_a() %>
- —
- <%=flight_info.getF_a_p() %>
- <%=flight_info.getF_a_a() %>
- <%=flight_info.getF_s_t() %>
- —
- <%=flight_info.getF_a_t() %>
<%
db_conn conn3=new db_conn();
String a_code="";//出发地机场三字码
String d_code="";//到达地机场三字码
String sql3="SELECT code FROM codetoname WHERE airportname = '"+flight_info.getF_a_a()+"'";
String sql4="SELECT code FROM codetoname WHERE airportname = '"+flight_info.getF_s_a()+"'";
ResultSet res3=conn3.executeQuery(sql3);
if(res3.next()) a_code=res3.getString(1);
ResultSet res4=conn3.executeQuery(sql4);
if(res4.next()) d_code=res4.getString(1);
String Domainname="https://flights.ctrip.com/";
Domainname+="online/list/oneway-"+d_code+"-"+a_code+"?_=1&depdate="+flight_info.getF_d()+"&containstax=1";
%>
<%if(session.getAttribute("user_id")!=null){ %>
<%} %>
<%if(session.getAttribute("user_id")==null){ %>
<%} %>
- 价格:¥<%=flight_info.getF_p() %>
- 延误率:<%=flight_info.getF_delay() %>
- 餐食:<%=flight_info.getF_food() %>
- 座位宽度:<%=flight_info.getF_wide() %>
<%
}
}
%>