From 66bf8c062a409ba3b5ee9841709524bce462474b Mon Sep 17 00:00:00 2001 From: RichardWang <948658573@qq.com> Date: Thu, 17 Oct 2024 22:17:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E9=A1=B5=E9=9D=A2=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebContent/default/index.jsp | 69 ++++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 23 deletions(-) diff --git a/WebContent/default/index.jsp b/WebContent/default/index.jsp index f9b994f..c19fa32 100644 --- a/WebContent/default/index.jsp +++ b/WebContent/default/index.jsp @@ -21,7 +21,7 @@ session.setAttribute("url", request.getRequestURI()); -机票预订系统 +机票推荐系统 @@ -31,15 +31,17 @@ session.setAttribute("url", request.getRequestURI()); -<%! String user_name,seat; - /*Date date = new Date(); +<%! +String user_name,seat; +Date date = new Date(); //设置要获取到什么样的时间 -SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); +SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); //获取String类型的时间 - String todaydate = sdf.format(date);*/ +String todaydate = sdf.format(date); + //也可以用这个 // String datetime = tempDate.format(new Date(System.currentTimeMillis())); - String todaydate="2019-12-01"; + //String todaydate="2019-12-01"; //注意原本的设定是每天的机票都是不同的,因此数据库中要有每天不同的机票,这里为了方便,就设置了一个固定的时间 %> @@ -99,8 +101,8 @@ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); class="icon-bar"> - 系统LOGO系统LOGO @@ -123,16 +125,16 @@ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-
+
-
+
-
+
+ style= "font-size:18px; border:#FFFFFF; color:#414582; background-color:#FFFFFF;margin-left: 5%">搜索
@@ -159,7 +161,7 @@ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); -
+
<% @@ -176,8 +178,13 @@ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String s_t=res.getString(6); String a_t=res.getString(7); String f_p=res.getString(8); + String f_d=res.getString(9); + String f_delay=res.getString(10); + String f_food=res.getString(11); + String f_wide=res.getString(12); 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); @@ -188,19 +195,31 @@ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  • <%=f_i %>
  • -
  • <%=s_p %>
  • <%=s_a %>
  • <%=a_p %>
  • -
  • <%=a_a %>
  • - +
  • <%=a_a %>
  • <%=s_t %>
  • <%=a_t %>
  • + + <% + db_conn conn3=new db_conn(); + String a_code="";//出发地机场三字码 + String d_code="";//到达地机场三字码 + String sql3="SELECT code FROM codetoname WHERE airportname = '"+a_a+"'"; + String sql4="SELECT code FROM codetoname WHERE airportname = '"+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="+f_d+"&containstax=1"; + %> <%if(session.getAttribute("user_id")!=null){ %>
  • <%} + class="btn btn-danger btn-sm" onClick="window.location.href ='<%= Domainname%>';">订票<%} if(session.getAttribute("user_id")==null){ %>
  • <%} %> @@ -212,10 +231,11 @@ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
      -
    • 今日剩余座位数:<%=seat %>
    • -
    • 价格:¥<%=f_p %>
    • - - + +
    • 价格:¥<%=f_p %>
    • +
    • 延误率:<%=f_delay %>
    • +
    • 餐食:<%=f_food %>
    • +
    • 座位宽度:<%=f_wide %>
@@ -231,7 +251,8 @@ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-
+ +
@@ -239,8 +260,10 @@ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- + + + \ No newline at end of file