📄 trainto.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Inc/Config.asp"-->
<% MenuID=3 : OpenDB = True : Title = "通过 地名 的查询结果 - " & SiteName %>
<!--#include file="Inc/Menus.asp"-->
<!--#include file="Inc/Function.asp"-->
<br>
<!-------------------------------------------------------------------------->
<%
Dim Word,Rs,SQL,I,Msg_All,Temp_CheCi,TheType,Show
Word = Trim(Request("Train"))
Show = Trim(Request("Show"))
Word = FormatStr(Word,1)
If Len(Word)<2 Then
Response.Write("<center><br> <br>请先输入关键字(最少两个字)!<br> <br><a href=""Javascript:history.back();"">点击返回</a><br></center>")
Else
Call AddSearch(Word,9)'写入查询记录
Set Rs=Server.CreateObject("ADODB.RecordSet")
Dim CheNumeric : CheNumeric=Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Word,"K",""),"N",""),"T",""),"Z",""),"A",""),"B",""),"C",""),"/","")
If ((IsNumeric(Word) And Len(Word)>=4) Or (InStr(Word,"K")>0 Or InStr(Word,"N")>0 Or InStr(Word,"T")>0 Or InStr(Word,"Z")>0 Or InStr(Word,"/")>0 Or InStr(Word,"A")>0)) And IsNumeric(CheNumeric) Then
If Show="FromAddress" Then
SQL="Select Top 500 [Stationno],[CheCi],[Name],[ArrTime],[StartTime],[Distance],[CostTime] From [sInfo] Where [CheCi] = '"&Word&"' Group By [CheCi],[Stationno],[Name],[ArrTime],[StartTime],[Distance],[CostTime]"
Else
SQL="Select Top 500 [Stationno],[CheCi],[Name],[ArrTime],[StartTime],[Distance],[CostTime] From [sInfo] Where [CheCi] Like '%"&Word&"%' Group By [CheCi],[Stationno],[Name],[ArrTime],[StartTime],[Distance],[CostTime]"
End If
TheType="ToCheCi"
Else
If Show="ToTheTrainList" Then
SQL="Select Top 500 * From [sInfo2] Where [FromAddress] = '"&Word&"' Or [ToAddress] = '"&Word&"'"
Else
SQL="Select Top 500 * From [sInfo2] Where [FromAddress] Like '%"&Word&"%' Or [ToAddress] Like '%"&Word&"%'"
End If
TheType="ToAddress"
End If
Rs.Open SQL,Conn
If Rs.Eof Then
Response.Write("<center><br> <br>没有找到包含“<strong style='Color:Red;'>"&Word&"</strong>”的数据!<br> <br><a href=""Javascript:history.back();"">点击返回</a><br></center>")
Else
If TheType="ToCheCi" Then
'-----------------------------
Response.Write("<center><fieldset style='width:685;cursor:default;' align='center'><legend style='font-size:16px;font-family:黑体;color:#CC5200;'>车次为 <strong><span style='color:red;'>"&Rs("CheCi")&"</span></strong> 的信息</legend> <br>")
%>
<table width="680" height="30" border="0" align="center" cellpadding="0" cellspacing="0">
<tr align="center" onmousemove=this.style.backgroundColor='#EEEEEE'; onmouseout=this.style.backgroundColor='';>
<td width="89" style="font-size:14px;"><strong>历经几站</strong></td>
<td width="153" style="font-size:14px;"><strong>车站名</strong></td>
<td width="98" style="font-size:14px;"><strong>到达时间</strong></td>
<td width="90" style="font-size:14px;"><strong>开车时间</strong></td>
<td width="63" style="font-size:14px;"><strong>里程(KM)</strong></td>
<td width="63" style="font-size:14px;"><strong>历时</strong></td>
</tr>
</table>
<%
I = 0
Msg_All = ""
Temp_CheCi=Rs("CheCi")
Do While Not Rs.Eof
%>
<table width="680" height="30" border="0" align="center" cellpadding="0" cellspacing="0">
<tr align="center" onmousemove=this.style.backgroundColor='#EEEEEE'; onmouseout=this.style.backgroundColor='';>
<td width="89" style="font-size:14px;">第 <strong><%= Rs("stationno") %></strong> 站</td>
<td width="153" style="font-size:14px;"><a href="?Train=<%=Rs("name")%>&Show=ToTheTrainList"><%=Rs("name")%></a></td>
<td width="98" style="font-size:14px;"><%= Rs("arrtime") %></td>
<td width="90" style="font-size:14px;"><%= Rs("starttime") %></td>
<td width="63" style="font-size:14px;"><%= Rs("distance") %></td>
<td width="63" style="font-size:14px;"><%= Rs("costtime") %></td>
</tr>
</table>
<%
I = I+1
Msg_All = Msg_All & ""
Rs.MoveNext
If Not Rs.Eof Then
If Rs("CheCi")<>Temp_CheCi Then
Response.Write("<br></fieldset>")
Response.Write("<br> <br> <br> <br> <br>")
Response.Write("<fieldset style='width:685;cursor:default;' align='center'><legend style='font-size:16px;font-family:黑体;color:#CC5200;'>车次为 <strong><span style='color:red;'>"&Rs("CheCi")&"</span></strong> 的信息</legend> <br>")
Temp_CheCi=Rs("CheCi")%>
<table width="680" height="30" border="0" align="center" cellpadding="0" cellspacing="0">
<tr align="center" onmousemove=this.style.backgroundColor='#EEEEEE'; onmouseout=this.style.backgroundColor='';>
<td width="89" style="font-size:14px;"><strong>历经几站</strong></td>
<td width="153" style="font-size:14px;"><strong>车站名</strong></td>
<td width="98" style="font-size:14px;"><strong>到达时间</strong></td>
<td width="90" style="font-size:14px;"><strong>开车时间</strong></td>
<td width="63" style="font-size:14px;"><strong>里程(KM)</strong></td>
<td width="63" style="font-size:14px;"><strong>历时</strong></td>
</tr>
</table><%
End If
End If
Loop
Response.Write("<br></fieldset></center>")
'-----------------------------
ElseIf TheType="ToAddress" Then %>
<table width="680" height="30" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
<tr align="center" onmousemove=this.style.backgroundColor='#EEEEEE'; onmouseout=this.style.backgroundColor='';>
<td width="83" style="font-size:14px;font-family:黑体;"><strong>车次</strong></td>
<td width="198" style="font-size:14px;"><strong>起始站</strong></td>
<td width="107" style="font-size:14px;"><strong>终点站</strong></td>
<td width="164" style="font-size:14px;"><strong> 全部里程</strong></td>
<td width="128" style="font-size:14px;"><strong>到达时间</strong></td>
</tr>
</table>
<% Do While Not Rs.Eof %>
<table width="680" height="30" border="0" align="center" cellpadding="0" cellspacing="0">
<tr onmousemove=this.style.backgroundColor='#EEEEEE'; onmouseout=this.style.backgroundColor=''; onClick="location.href='?Train=<%=Rs("CheCi")%>&Show=FromAddress';">
<td width="170" style="cursor:hand;font-size:14px;font-family:黑体;"> <a href="?Train=<%=Rs("CheCi")%>&Show=FromAddress"><strong><%=Rs("CheCi")%></strong></a></td>
<td width="148" style="cursor:hand;font-size:14px;"><%=Rs("FromAddress")%></td>
<td width="150" style="cursor:hand;font-size:14px;"><%=Rs("ToAddress")%></td>
<td width="124" style="cursor:hand;font-size:14px;"><%=Rs("Distance")%></td>
<td width="88" style="cursor:hand;font-size:14px;"><%=Rs("CostTime")%></td>
</tr>
</table>
<%
Rs.MoveNext
Loop
End If
Rs.Close
Set Rs=Nothing
End If
End If '是否未输入数据?
%>
<!-------------------------------------------------------------------------->
<br> <br>
<!--#include file="Inc/Bottom.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -