修改样式

Wangyanyixiang_branch
RichardWang 1 month ago
parent 3281e92d7f
commit e10f4ed351

@ -6,23 +6,18 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk21">
<attributes>
<attribute name="module" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/> <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/> <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="lib" path="D:/apache-tomcat-9.0.87-windows-x64/apache-tomcat-9.0.87/lib/jsp-api.jar"/>
<classpathentry kind="lib" path="D:/apache-tomcat-9.0.87-windows-x64/apache-tomcat-9.0.87/lib/servlet-api.jar"/>
<classpathentry kind="lib" path="D:/apache-tomcat-9.0.87-windows-x64/apache-tomcat-9.0.87/lib/tomcat-api.jar"/>
<classpathentry kind="lib" path="D:/college/SE2/jar_files/mysql-connector-java-8.0.16.jar"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="lib" path="D:/college/SE2/jar_files/json-20240303.jar"/> <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/C-_Program Files_Apache Software Foundation_Tomcat 9.0"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-fileupload-1.4.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-io-2.6.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/json-20240303.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/mysql-connector-java-8.0.16.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>

@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding//src/servlet/search_fly.java=UTF-8

@ -12,7 +12,7 @@ body {
*/ */
/* 调整聊天框的样式 */ /* 调整聊天框的样式 */
.chat-container { /*.chat-container {
position: fixed; position: fixed;
bottom: 220px; bottom: 220px;
right: 20px; right: 20px;
@ -24,11 +24,31 @@ body {
background-color: white; background-color: white;
z-index: 1000; z-index: 1000;
box-shadow: 0 0 10px rgba(0,0,0,0.1); box-shadow: 0 0 10px rgba(0,0,0,0.1);
.chat-container #chat-history {
height: 340px;
overflow-y: auto;
padding: 10px;
}
}*/
.chat-container {
position: fixed;
top: 20%;
bottom: 10%;
right: 3%;
width: 30%;
height: 75%;
border: 1px solid #ccc;
border-radius: 5px;
overflow: hidden;
background-color: white;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
} }
/* 其他样式保持不变 */ /* 其他样式保持不变 */
.chat-container #chat-history { .chat-container #chat-history {
height: 340px; height: 90%;
overflow-y: auto; overflow-y: auto;
padding: 10px; padding: 10px;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

@ -1,13 +1,15 @@
<%@page import="javabean.flight"%> <%@page import="javabean.flight"%>
<%@page import="java.util.ArrayList"%> <%@page import="java.util.ArrayList"%>
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@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="javabean.db_conn"%>
<%@page import="java.sql.ResultSet"%> <%@page import="java.sql.ResultSet"%>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>机票预订系统</title> <title>机票推荐系统</title>
<link href="/air_ticket_book/default/css/bootstrap.min.css" rel="stylesheet"> <link href="/air_ticket_book/default/css/bootstrap.min.css" rel="stylesheet">
<link href="/air_ticket_book/default/css/common.css" rel="stylesheet"> <link href="/air_ticket_book/default/css/common.css" rel="stylesheet">
<link href="/air_ticket_book/default/css/corptravel.css" rel="stylesheet"> <link href="/air_ticket_book/default/css/corptravel.css" rel="stylesheet">
@ -20,7 +22,13 @@
<%! db_conn conn2=new db_conn(); <%! db_conn conn2=new db_conn();
String seat; String seat;
String user_name; String user_name;
String todaydate="2019-12-01";%> Date date = new Date();
//设置要获取到什么样的时间
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//获取String类型的时间
String todaydate = sdf.format(date);
%>
</head> </head>
<body class="bg-body"> <body class="bg-body">
<!-- header --> <!-- header -->
@ -40,8 +48,7 @@
</div> </div>
<ul class="nav navbar-nav nav-top-small" style="margin-left: -15px;"> <ul class="nav navbar-nav nav-top-small" style="margin-left: -15px;">
<li class="dropdown"> <li class="dropdown">
<% <%
String todaydate="2019-12-01";
if(session.getAttribute("user_id")!=null){ if(session.getAttribute("user_id")!=null){
db_conn conn2=new db_conn(); db_conn conn2=new db_conn();
String sql2="select * from p_inf where p_tel='"+session.getAttribute("user_id")+"'"; String sql2="select * from p_inf where p_tel='"+session.getAttribute("user_id")+"'";
@ -79,8 +86,8 @@
class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span
class="icon-bar"></span> class="icon-bar"></span>
</button> </button>
<a class=" " href="/air_ticket_book/default/index.jsp"><img src="/air_ticket_book/default/images/newlogo.png" <a class=" " href="/air_ticket_book/default/index.jsp"><img src="/air_ticket_book/default/images/newlogo11.png"
width="350" height="70" alt="系统LOGO" class="pull-left mar-right-30" width="420" height="84" alt="系统LOGO" class="pull-left mar-right-30"
style="margin-left: -15px;"></a> style="margin-left: -15px;"></a>
</div> </div>
@ -157,10 +164,22 @@
<li class="time w100"><strong><%=flight_info.getF_s_t() %></strong></li> <li class="time w100"><strong><%=flight_info.getF_s_t() %></strong></li>
<li class="">—</li> <li class="">—</li>
<li class="time w80"><strong><%=flight_info.getF_a_t() %></strong></li> <li class="time w80"><strong><%=flight_info.getF_a_t() %></strong></li>
<%
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){ %>
<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 ='default/order.jsp?flight_id=<%=f_i%>';">订票</button></li><%} %> class="btn btn-danger btn-sm" onClick="window.location.href ='<%= Domainname%>';">订票</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 ='default/error_login.jsp?flight_id=<%=f_i%>';">订票</button></li><%} %> class="btn btn-danger btn-sm" onClick="window.location.href ='default/error_login.jsp?flight_id=<%=f_i%>';">订票</button></li><%} %>
@ -171,8 +190,10 @@
<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-15">价格:<span class="rmb">¥<%=flight_info.getF_p() %></span></li>
<li class="w-percentage-25">价格:<span class="rmb">¥<%=flight_info.getF_p() %></span></li> <li class="w-percentage-15">延误率:<span class=""><%=flight_info.getF_delay() %></span></li>
<li class="w-percentage-15">餐食:<span class=""><%=flight_info.getF_food() %></span></li>
<li class="w-percentage-15">座位宽度:<span class=""><%=flight_info.getF_wide() %></span></li>
</ul> </ul>
</div> </div>
</div> </div>

Binary file not shown.

@ -13,7 +13,7 @@ public class db_conn {
//数据库初始化连接 //数据库初始化连接
public db_conn() { public db_conn() {
String URL="jdbc:mysql://localhost:3307/fly_ticket?useSSL=false&useUnicode=true&characterEncoding=UTF8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC"; //数据库名3306 String URL="jdbc:mysql://localhost:3306/fly_ticket?useSSL=false&useUnicode=true&characterEncoding=UTF8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC"; //数据库名3306
String USER="root"; //数据库用户名 String USER="root"; //数据库用户名
String PWD="123456"; //数据库密码 String PWD="123456"; //数据库密码
try{ try{

@ -8,8 +8,35 @@ public class flight { //
private String f_s_t=null;//起飞时间 private String f_s_t=null;//起飞时间
private String f_a_t=null;//到达时间 private String f_a_t=null;//到达时间
private String f_p=null;//票价 private String f_p=null;//票价
private String f_d=null;//出发日期
private String f_delay=null;//延误率
private String f_food=null;//餐食情况
private String f_wide=null;//座位宽度
public String getF_wide() {
return f_wide;
}
public void setF_wide(String f_wide) {
this.f_wide=f_wide;
}
public String getF_food() {
return f_food;
}
public void setF_food(String f_food) {
this.f_food=f_food;
}
public String getF_delay() {
return f_delay;
}
public void setF_delay(String f_delay) {
this.f_delay=f_delay;
}
public String getF_d() {
return f_d;
}
public void setF_d(String f_d) {
this.f_d=f_d;
}
public String getF_n() { public String getF_n() {
return f_n; return f_n;
} }

@ -41,7 +41,7 @@ public class search_fly extends HttpServlet {
String sql = null; String sql = null;
if (departure.isEmpty() && destination.isEmpty() && departureYear.isEmpty() && departureMonth.isEmpty() && departureDay.isEmpty()) { if (departure.isEmpty() && destination.isEmpty() && departureYear.isEmpty() && departureMonth.isEmpty() && departureDay.isEmpty()) {
// 如果所有字段都为空,重定向到原页面 // 濡傛灉鎵<EFBFBD>鏈夊瓧娈甸兘涓虹┖锛岄噸瀹氬悜鍒板師椤甸潰
resp.sendRedirect(url); resp.sendRedirect(url);
} else { } else {
sql = "SELECT * FROM flight WHERE 1=1"; sql = "SELECT * FROM flight WHERE 1=1";
@ -53,7 +53,7 @@ public class search_fly extends HttpServlet {
sql += " AND f_a_p='" + destination + "'"; sql += " AND f_a_p='" + destination + "'";
} }
if (!departureYear.isEmpty() && !departureMonth.isEmpty() && !departureDay.isEmpty()) { if (!departureYear.isEmpty() && !departureMonth.isEmpty() && !departureDay.isEmpty()) {
// 验证日期格式 // 楠岃瘉鏃ユ湡鏍煎紡
try { try {
int year = Integer.parseInt(departureYear); int year = Integer.parseInt(departureYear);
int month = Integer.parseInt(departureMonth); int month = Integer.parseInt(departureMonth);
@ -62,10 +62,10 @@ public class search_fly extends HttpServlet {
String departureDate = String.format("%04d-%02d-%02d", year, month, day); String departureDate = String.format("%04d-%02d-%02d", year, month, day);
sql += " AND DATE(f_Date)='" + departureDate + "'"; sql += " AND DATE(f_Date)='" + departureDate + "'";
} else { } else {
req.setAttribute("errorMsg", "日期格式不正确,请输入有效的年、月、日"); req.setAttribute("errorMsg", "鏃ユ湡鏍煎紡涓嶆纭紝璇疯緭鍏ユ湁鏁堢殑骞淬<EFBFBD>佹湀銆佹棩");
} }
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
req.setAttribute("errorMsg", "日期格式不正确,请输入数字"); req.setAttribute("errorMsg", "鏃ユ湡鏍煎紡涓嶆纭紝璇疯緭鍏ユ暟瀛<EFBFBD>");
} }
} }
@ -84,11 +84,15 @@ public class search_fly extends HttpServlet {
flight_info.setF_s_t(res.getString(6)); flight_info.setF_s_t(res.getString(6));
flight_info.setF_a_t(res.getString(7)); flight_info.setF_a_t(res.getString(7));
flight_info.setF_p(res.getString(8)); flight_info.setF_p(res.getString(8));
flight_info.setF_d(res.getString(9));
flight_info.setF_delay(res.getString(10));
flight_info.setF_food(res.getString(11));
flight_info.setF_wide(res.getString(12));
flightlist.add(flight_info); flightlist.add(flight_info);
} }
req.setAttribute("flightlist", flightlist); req.setAttribute("flightlist", flightlist);
} catch (SQLException e) { } catch (SQLException e) {
System.out.println("错误信息:" + e); System.out.println("閿欒淇℃伅锛<EFBFBD>" + e);
} finally { } finally {
conn.closeDB(); conn.closeDB();
} }

@ -1,4 +1,4 @@
Manifest-Version: 1.0 Manifest-Version: 1.0
Build-Jdk-Spec: 21 Build-Jdk-Spec: 22
Created-By: Maven Integration for Eclipse Created-By: Maven Integration for Eclipse

@ -1,7 +1,7 @@
#Generated by Maven Integration for Eclipse #Generated by Maven Integration for Eclipse
#Sun Oct 06 18:10:33 CST 2024 #Thu Oct 17 20:23:36 CST 2024
artifactId=air_ticket_book artifactId=air_ticket_book
groupId=air_ticket_book groupId=air_ticket_book
m2e.projectLocation=D\:\\college\\SE2\\air_ticket_book-master\\\u8F6F\u4EF6\u5DE5\u7A0B\u8BFE\u7A0B\u8BBE\u8BA1\\air_ticket_book m2e.projectLocation=C\:\\Users\\RichardWang\\Desktop\\ai_agent
m2e.projectName=air_ticket_book m2e.projectName=air_ticket_book
version=0.0.1-SNAPSHOT version=0.0.1-SNAPSHOT

Loading…
Cancel
Save