北京地铁查询系统(三)
chaxun.jsp
<%-- Created by IntelliJ IDEA. User: 榕宝 Date: 2022/4/3 Time: 8:23 To change this template use File | Settings | File Templates. --%> <%@ page import="bean.station" %> <%@ page import="java.util.List" %> <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %> <html> <head> <title>Title</title> <style type="text/css"> .ziti { font-size: 18px; font-weight: 666; font-family:"幼圆";/*设置字体*/ color:#494949; }</style> </head> <body> <jsp:useBean id="util" class="dao.dao"/> <% request.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8"); response.setContentType("text/html;charset=utf-8"); String id=(String)request.getParameter("number"); %> <%if (id == null){%> <img src="https://wx4.sinaimg.cn/mw2000/008aq7W6ly1h0ukeojflcj30oo0gdtgv.jpg" alt=""> <%}else{ List<station> list = util.readStation(id); %> <form action=" " method="get" id="form" onsubmit="return check()" > <table border="0" style="width: 650px; height: 350px;"> <tr> <td class ="ziti"> </td> <td class ="ziti"> </td> <td class ="ziti"> </td> </tr> <%for (station s : list) { %> <tr> <td class ="ziti"> 第<%=s.getId()%>站</td> <td class ="ziti" name="sation1"><%=s.getStation()%></td> <td class="ziti">------------></td> </tr> <%} %> </table> </form> <%}%> </body> </html>
chaxun2.jsp
<%-- Created by IntelliJ IDEA. User: 榕宝 Date: 2022/4/3 Time: 8:53 To change this template use File | Settings | File Templates. --%> <%@ page import="bean.station" %> <%@ page import="dao.dao" %> <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %> <html> <head> <title>Title</title> <style type="text/css"> .ziti { list-style-type:square ; font-size: 18px; font-weight: 666; font-family:"幼圆";/*设置字体*/ color:#494949; }</style> </head> <body> <% request.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8"); response.setContentType("text/html;charset=utf-8"); String zd = (String) request.getParameter("zhandian"); %> <% if (zd == null) {%> <img src="https://wx4.sinaimg.cn/mw2000/008aq7W6ly1h0ukeojflcj30oo0gdtgv.jpg" alt=""> <%} else { int line = dao.search_bukeline(zd); int line1= dao.search_keline1(zd); int line2= dao.search_keline2(zd); if(line!=0){ %> <div style="border-radius:30px;width:600px;height:300px;float:right; position: absolute; "> <p> </p> <p class="ziti"> <span style="color:#531ad7;font-size:22px;"><%=zd%></span>站为<span style="color:#c93243;">不可</span>换乘站 该站点历经以下线路: </p> <HR style="border:2 dashed #808080" width="100%" color=#808080 SIZE=2> <p> </p> <ul> <li class ="ziti"> <%=line%>号线</li> </ul> </div> <%} if(line==0){ %> <div style="border-radius:30px;width:600px;height:300px;float:right; position: absolute; "> <p> </p> <p class="ziti"> <span style="color:#531ad7;font-size:22px;"><%=zd%></span>站为<span style="color:#c93243;">可</span>换乘站 该站点历经以下线路: </p> <HR style="border:2 dashed #808080" width="100%" color=#808080 SIZE=2> <p> </p> <ul> <li class ="ziti"> <%=line1%>号线</li> <li class ="ziti"> <%=line2%>号线</li> </ul> </div> <%} if("西直门".equals(zd)) { %> <div style="border-radius:30px;width:600px;height:300px;float:right; position: absolute; "> <p> </p> <p class="ziti"> <span style="color:#531ad7;font-size:22px;"><%=zd%></span>站为<span style="color:#c93243;">可</span>换乘站 该站点历经以下线路: </p> <HR style="border:2 dashed #808080" width="100%" color=#808080 SIZE=2> <p> </p> <ul> <li class ="ziti"> 2号线</li> <li class ="ziti"> 4号线</li> <li class ="ziti"> 13号线</li> </ul> </div> <%}}%> </body> </html>
chaxun3.jsp
<%-- Created by IntelliJ IDEA. User: 榕宝 Date: 2022/4/3 Time: 9:29 To change this template use File | Settings | File Templates. --%> <%@ page import="bean.station" %> <%@ page import="dao.dao" %> <%@ page import="java.util.List" %> <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %> <html> <head> <title>Title</title> <style type="text/css"> .ziti { list-style-type:square ; font-size: 18px; font-weight: 666; font-family:"幼圆";/*设置字体*/ color:#494949; }</style> </head> <body> <% request.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8"); response.setContentType("text/html;charset=utf-8"); String start = (String) request.getParameter("start"); String stop = (String) request.getParameter("stop"); %> <% if (start == null) {%> <img src="https://wx4.sinaimg.cn/mw2000/008aq7W6ly1h0ukeojflcj30oo0gdtgv.jpg" alt=""> <%} else { boolean f1=dao.judgestation(start); boolean f2=dao.judgestation(stop); boolean f=dao.judgeline(start,stop,f1,f2); if(f==true){ int line =dao.search_bukeline(start); int id1=dao.readId(line,start); int id2=dao.readId(line,stop); List<station> list = dao.readStations(line,id1-1,id2-id1+1); %> <div style="border-radius:30px;width:600px;height:300px;float:right; position: absolute; "> <p class="ziti"> <%=line%>号线</p> <%for (station s : list) { %> <ul> <li class ="ziti"> 第<%=s.getId()%>站 ------------- <%=s.getStation()%></li> </ul> <%} %> </div> <% }}%> </body> </html>