<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.util.*" %>
<jsp:useBean id="connDbBean" scope="application" class="classes.conn"/>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<STYLE type=text/css>BODY {
	FONT-SIZE: 13px; FONT-FAMILY: 宋体; TEXT-ALIGN: center
}
TR {
	FONT-SIZE: 13px; FONT-FAMILY: 宋体; TEXT-ALIGN: center
}
TD {
	FONT-SIZE: 13px; FONT-FAMILY: 宋体; TEXT-ALIGN: center
}
</STYLE>

<META content="MSHTML 6.00.2900.2995" name=GENERATOR><title>车次查询结果</title></HEAD>
<BODY>
<%	String BusID=new String(request.getParameter("query1").getBytes("ISO8859_1"),"GBK");
     String a_startime="";
	 String a_endtime="";
	 String w_startime="";
	 String w_endtime="";
     int t_value=0;
    
	String stations[]=new String[100];
	int count=0;
     
     
  		 

	    String statement="select * from bus where BusID='"+BusID+"'";
		 ResultSet result=connDbBean.executeQuery(statement);
		  if(!result.next())
		  { response.sendRedirect("errorquery1.jsp");
		  }
		  else{ result.previous();
		  //显示站点的详细信息
          while(result.next()){
           String busid=result.getString("BusID");
	       String Detail=result.getString("Detail");
           a_startime=result.getString("A_STime");
	       a_endtime=result.getString("A_ETime");
	       w_startime=result.getString("W_STime");
	       w_endtime=result.getString("W_ETime");
           t_value=result.getInt("T_Value");

		   StringTokenizer str1=new StringTokenizer(Detail,"->");
		  while(str1.hasMoreTokens())
		      { stations[count]=str1.nextToken();
			 count++;
			  }//endwhile
			 }
	          }//endelse
		    
			  
		
			  
		result.close();
  
	
	 
%>
<TABLE cellSpacing=1 cellPadding=3 width=650 align=center 
border=0>
  <TBODY>
    <TR>
    <TD><STRONG><FONT color=#000000>
      
      车次查询结果</FONT></STRONG></TD>
  </TR>
  <TR>
    <TD><!--查询结果显示开始-->
      <TABLE cellSpacing=1 cellPadding=3 width=500 border=0>
        <TBODY>
        <TR >
          <TD width=150 rowspan="2">车次: <font color="#000000"><%=BusID%></font>
          路车</TD>
          <TD width="91" rowspan="2">票价:<font color="#000000"><%=t_value%></font>元</TD>
          <TD width="237">夏季时间：<%=a_startime%>--<%=a_endtime%></TD>
        </TR>
        <TR>
          <TD>冬季时间：<%=w_startime%>--<%=w_endtime%></TD>
        </TR>
        <TR>
          <TD width=150>经过站次</TD>
          <TD colspan="2">经过站点</TD>
        </TR>
       <% for(int i=0;i<count;i++) {  %>
		<TR onmouseover="this.style.backgroundColor = '#FFF9EE'" 
        onmouseout="this.style.backgroundColor = ''" bgColor=#e8f3ff>
        
		  <TD><%=i+1%></TD>
          <TD colspan="2"><a href="resultquery2.jsp?query2=<%=stations[i]%>" target="_blank"><%=stations[i]%></a></TD>
		</TR>
		<% }  %>
		</TBODY></TABLE>
      <!--查询结果显示结束--><BR>        <input type=button name="close6" value="关闭窗口"
      width="78" height="21" border=0 
       onclick=window.close()> </TD>
  </TR>
  
  </TBODY></TABLE> 
</BODY></HTML>
