⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 look_by_user.jsp

📁 一个在线售票系统
💻 JSP
字号:
<%@ page language="java"  contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<jsp:useBean id="search" class="com.db.Common"/>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    
    <title>查看信息</title>
    
	<meta http-equiv="content-type" content="text/html; charset=gb2312">
    <link rel="stylesheet" href="../css/mm_lodging1.css" type="text/css">
 

  </head>
  <%
   request.setCharacterEncoding("gb2312");
   String train_serial=request.getParameter("train_serial");
  %>
  <body text=#003300 vLink=#002200 leftMargin=0 topMargin=0>
  <table width="600"  border="0" align="center" cellpadding="0" cellspacing="0">
      <tr width="600">
        <td><img src="../image/16.gif"></td>
      </tr>
    </table>
    <table cellSpacing=0 cellPadding=0 width=600 align="center" bgcolor="#033D7C">
       <TBODY>
       <tr width="600" bgcolor="#a4c2c2">
          <td height="36" colspan="3" id="navigation" class="navText" align="center"><a href="../system_admin/index.jsp">首页</a>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <a href="../user/inf_edit.jsp">控制面板</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="../common/exit.jsp">退出</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
        </tr>
       </TBODY>
    </table>
    <form name="search" method="post" action="../user/do_search.jsp">
  <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
     <tr>
      <td width="700" bgcolor="#ebebeb"><span class="style2">搜索车次:</span>
           关键字:<input type="text" name="keywords">
        <input type="submit" value="Search">
      </table>
    </form>
    <table cellSpacing=0 cellPadding=0 width=600 align="center" align="center">
      <tr>
           <td width="600" align="center" bgcolor="#cccccc">
           硬座票量
           </td>
           <td width="600" align="center" bgcolor="#cccccc">
           软座票量
           </td>
           <td width="600" align="center" bgcolor="#cccccc">
           硬卧票量
           </td>
           <td width="600" align="center" bgcolor="#cccccc">
           软卧票量
           </td>
         </tr>
      </table>
    
    <table cellSpacing=0 cellPadding=0 width=600 align="center" align="center">
    <%
      ResultSet rs=search.getResultSetBySql("select * from traininf where train_serial='"+train_serial+"'");
      int stations_num=0;
      int h_s_num=0;
      int s_s_num=0;
      int h_r_num=0;
      int s_r_num=0;
      if(rs.next())
      {
         %>
         <tr>
         <%
         stations_num=rs.getInt(5);
         h_s_num=rs.getInt(7);
         s_s_num=rs.getInt(8);
         h_r_num=rs.getInt(9);
         s_r_num=rs.getInt(10);
         %>
          <td width="600" align="center" bgcolor="#EBEBEB">
            <%=h_s_num%>
          </td>
          <td width="600" align="center" bgcolor="#EBEBEB">
            <%=s_s_num%>
          </td>
          <td width="600" align="center" bgcolor="#EBEBEB">
            <%=h_r_num%>
          </td>
          <td width="600" align="center" bgcolor="#EBEBEB">
            <%=s_r_num%>
          </td>  
         </tr>
         <%
      }
    %>
    </table>
    <%
      ResultSet rs_stations=search.getResultSetByTable(""+train_serial+"_stations_inf"); 
      ResultSet rs_start_time=search.getResultSetByTable(""+train_serial+"_start_time");
      ResultSet rs_to_time=search.getResultSetByTable(""+train_serial+"_to_time");
      ResultSet rs_hs_price=search.getResultSetByTable(""+train_serial+"_hard_seat_price");
      ResultSet rs_ss_price=search.getResultSetByTable(""+train_serial+"_soft_seat_price");
      ResultSet rs_hr_price=search.getResultSetByTable(""+train_serial+"_hard_recumbency_price");
      ResultSet rs_sr_price=search.getResultSetByTable(""+train_serial+"_soft_recumbency_price");
      String[] stations=new String[stations_num];
      String[] start_time=new String[stations_num-1];
      String[] to_time=new String[stations_num-1];
      float[] hs_price=new float[stations_num-1];
      float[] ss_price=new float[stations_num-1];
      float[] hr_price=new float[stations_num-1];
      float[] sr_price=new float[stations_num-1];
      if(rs_stations!=null&&rs_stations.next())
      {
         for(int i=1;i<=stations_num;i++)
         {
            stations[i-1]=rs_stations.getString(i+1);
         }
      }
      if(rs_start_time!=null&&rs_start_time.next())
      {
         for(int i=1;i<stations_num;i++)
         {
            start_time[i-1]=rs_start_time.getString(i+1);
         }
      }
      if(rs_to_time!=null&&rs_to_time.next())
      {
         for(int i=1;i<stations_num;i++)
         {
            to_time[i-1]=rs_to_time.getString(i+1);
         }
      }
      
      if(rs_hs_price!=null&&rs_hs_price.next())
      {
         for(int i=1;i<stations_num;i++)
         {
            hs_price[i-1]=rs_hs_price.getFloat(i+1);
         }
      }
      
      if(rs_ss_price!=null&&rs_ss_price.next())
      {
         for(int i=1;i<stations_num;i++)
         {
            ss_price[i-1]=rs_ss_price.getFloat(i+1);
         }
      }
      
      if(rs_hr_price!=null&&rs_hr_price.next())
      {
         for(int i=1;i<stations_num;i++)
         {
            hr_price[i-1]=rs_hr_price.getFloat(i+1);
         }
      }
      
      if(rs_sr_price!=null&&rs_sr_price.next())
      {
         for(int i=1;i<stations_num;i++)
         {
            sr_price[i-1]=rs_sr_price.getFloat(i+1);
         }
      }
    %>
    <br>
    <table cellSpacing=0 cellPadding=0 width=600 align="center" align="center">
      <tr>
        <td width="600" align="center" bgcolor="#cccccc">
        站点
        </td>
        <td width="600" align="center" bgcolor="#cccccc">
        发车时间
        </td>
        <td width="600" align="center" bgcolor="#cccccc">
        到达时间
        </td>
      </tr>
      <tr>
        <td width="600" align="center" bgcolor="#cccccc" height="3">
        </td>
        <td width="600" align="center" bgcolor="#cccccc" height="3">
        </td>
        <td width="600" align="center" bgcolor="#cccccc" height="3">
        </td>
      </tr>
      <tr>
        <td width="600" align="center" bgcolor="#EBEBEB">
           <%=stations[0]%>
        </td>
        <td width="600" align="center" bgcolor="#EBEBEB">
           <%=start_time[0]%>
        </td>
        <td width="600" align="center" bgcolor="#EBEBEB">
        ---
        </td>
      </tr>
      <tr>
        <td width="600" align="center" bgcolor="#cccccc" height="3">
        </td>
        <td width="600" align="center" bgcolor="#cccccc" height="3">
        </td>
        <td width="600" align="center" bgcolor="#cccccc" height="3">
        </td>
      </tr>
      <%
       for(int i=1;i<=stations_num-2;i++)
       {
          %>
          <tr>
            <td width="600" align="center" bgcolor="#EBEBEB">
               <%=stations[i]%>
            </td>
            <td width="600" align="center" bgcolor="#EBEBEB">
               <%=start_time[i]%>
            </td>
            <td width="600" align="center" bgcolor="#EBEBEB">
               <%=to_time[i-1]%>
            </td>
          </tr>
          <tr>
           <td width="600" align="center" bgcolor="#cccccc" height="3">
           </td>
           <td width="600" align="center" bgcolor="#cccccc" height="3">
           </td>
           <td width="600" align="center" bgcolor="#cccccc" height="3">
           </td>
          </tr>
          <%
       } 
      %>
      <tr>
        <td width="600" align="center" bgcolor="#EBEBEB">
           <%=stations[stations_num-1]%>
        </td>
        <td width="600" align="center" bgcolor="#EBEBEB">
           ---
        </td>
        <td width="600" align="center" bgcolor="#EBEBEB">
           <%=to_time[stations_num-2]%>
        </td>
      </tr>
   </table>
   <br>
   <table cellSpacing=0 cellPadding=0 width=600 align="center" align="center">
     <tr>
       <td width="600" align="center" bgcolor="#cccccc">
       相邻站点
       </td>
       <td width="600" align="center" bgcolor="#cccccc">
       硬座价格
       </td>
       <td width="600" align="center" bgcolor="#cccccc">
       软座价格
       </td>
       <td width="600" align="center" bgcolor="#cccccc">
       硬卧价格
       </td>
       <td width="600" align="center" bgcolor="#cccccc">
       软卧价格
       </td>
     </tr>
     <%
     for(int i=1;i<stations_num;i++)
     {
        %>
        <tr>
          <td width="600" align="center" bgcolor="#EBEBEB">
            <%=stations[i-1]%>--<%=stations[i]%>
          </td>
          <td width="600" align="center" bgcolor="#EBEBEB">
            <%=hs_price[i-1]%>
          </td>
          <td width="600" align="center" bgcolor="#EBEBEB">
            <%=ss_price[i-1]%>
          </td>
          <td width="600" align="center" bgcolor="#EBEBEB">
            <%=hr_price[i-1]%>
          </td>
          <td width="600" align="center" bgcolor="#EBEBEB">
            <%=sr_price[i-1]%>
          </td>
        </tr>
        <tr>
          <td width="600" align="center" bgcolor="#cccccc" height="3">
          </td>
          <td width="600" align="center" bgcolor="#cccccc" height="3">
          </td>
          <td width="600" align="center" bgcolor="#cccccc" height="3">
          </td>
          <td width="600" align="center" bgcolor="#cccccc" height="3">
          </td>
          <td width="600" align="center" bgcolor="#cccccc" height="3">
          </td>
        </tr>
        <%
     } 
     %>
   </table>
  </body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -