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

📄 busstationtostation_do.asp

📁 公交车查询系统
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT"%>
<% option explicit %>
<!--#include file="function.asp"-->
<%
dim busStart,busTo
dim busStateList,busInfo,busIdList
dim flag,flag2,flag3,strTemp,arrBusId
dim i,j
flag=false
flag2=false
busStart=trim((request("text3")))
busTo=trim((request("text4")))
'将所有站点读入数组当中
busStateList=getBusStateList
for i=0 to ubound(busStateList)
	if busStart=busStateList(i) then
		flag=true
	end if
	if busTo=busStateList(i) then
		flag2=true
	end if
	if (flag and flag2) then exit for
next
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>站点查询</title>
<style type="text/css">
a,body,tr,td {
	text-align: center;
	font-family: 宋体;
	font-size: 13px
}
</style>
</head>

<body>
<base target="_blank">
<table width="650" border="0" bgcolor="#003399" cellpadding="3" cellspacing="1" align="center">
  <tr> 
    <td height="20" background="images/topbg.gif"></td>
  </tr>
  <tr bgcolor="#7DA4EC"> 
    <td><strong><font color="#FFFFFF">站点查询结果</font></strong></td>
  </tr>
  <tr bgcolor="#E8F3FF"> 
    <td>
	<!--查询结果显示开始-->
<%
If not(flag and flag2) Then
    '至少有一个站点是不存在的
	if not flag then
    	response.write ("抱歉,站点 <strong><font color=""#FF0000"">" & busStart & "</font></strong>不存在!<br>")
	end if
	if not flag2 then
		response.write ("抱歉,站点 <strong><font color=""#FF0000"">" & busTo & "</font></strong>不存在!")
	end if
else
	'两个站点都有,判断有没有直达车
	busIdList=getBusIdList
	'遍历所有车次
	strTemp=""
	for i=0 to ubound(busIdList)
		busInfo=getInfoByBusid(busIdList(i))
		flag3=0
		for j=3 to ubound(busInfo)		'数组的第四个元素才开始记录站点名
			if busInfo(j)=busStart then
				flag3=flag3+1
			end if
			if busInfo(j)=busTo then
				flag3=flag3+1
			end if
			if flag3=2 then exit for
		next
		if flag3=2 then
			strTemp=strTemp+cstr(busInfo(0))+"||"  'strTemp 保存查到的有效车次
		end if
	next
	if strTemp="" then
		response.write ("<strong><font color=""#FF0000"">" & busStart & "</font></strong> 到 <strong><font color=""#FF0000"">" & busTo & "</font></strong> 没有直达车!请参照下列换乘建议.<br>")
		'查询一级中转站点
		'起点站 busStart
		'终点站 busTo
		'
		dim passStartStationBusID
		dim passToStationBusID
		dim ii,jj,mm,nn,kk
		dim busInfoA,busInfoB
		'dim flagII		'转车成功标志
		dim firstBusID
		dim secondBusID
		dim changeStation
		dim ResultII
		'flagII=false
		ResultII=""
		passStartStationBusID=getBusIDInfoByStation(busStart)
		passToStationBusID=getBusIDInfoByStation(busTo)
		'得到经过起点站和终点站的全部组合
		for ii=0 to ubound(passStartStationBusID)
			for jj=0 to ubound(passToStationBusID)
				'判断两辆车有没有交叉点
				busInfoA=getInfoByBusid(passStartStationBusID(ii))
				busInfoB=getInfoByBusid(passToStationBusID(jj))
				for mm=3 to ubound(busInfoA)
					for nn=3 to ubound(busInfoB)
						if busInfoA(mm)=busInfoB(nn) then
							'成功找到两辆车的交汇处
							'flagII=true
							firstBusID=passStartStationBusID(ii)
							secondBusID=passToStationBusID(jj)
							changeStation=busInfoA(mm)
							ResultII=ResultII+firstBusID+";"+secondBusID+";"+changeStation+"||"
							'response.Write("<br>")
							'response.Write(firstBusID+"==>"+changeStation+"==>"+secondBusID)
							'response.Write("<br>")
						end if
					next
				next
			next
		next
		if ResultII="" then
			'我靠,中转车都没有
			response.write ("<br>抱歉,<strong><font color=""#FF0000"">" & busStart & "</font></strong> 到 <strong><font color=""#FF0000"">" & busTo & "</font></strong>没有直达车,换乘一次也无法到达!")
		else
			'去掉最后一个分割符
			ResultII=left(ResultII,len(ResultII)-2)
			dim arrChangeI
			dim arrChangeII
			arrChangeI=split(ResultII,"||")
			response.Write ("<table width=""600"" border=""0"" bgcolor=""#003399"" cellpadding=""3"" cellspacing=""1"">")
			response.Write ("<tr bgcolor=""#FDDD90"">")
			response.Write ("<td width=""150""><strong>起点</strong></td>")
			response.Write ("<td width=""70""><strong>车次</strong></td>")
			response.Write ("<td width=""160""><strong>中转站</strong></td>")
			response.Write ("<td width=""70""><strong>车次</strong></td>")
			response.Write ("<td width=""150""><strong>终点</strong></td>")
			response.Write ("</tr>")
			for kk=0 to ubound(arrChangeI)
				arrChangeII=split(arrChangeI(kk),";")
				'arrChangeII 保存了一条转乘信息
				'arrChangeII(0)  firstBusID
				'arrChangeII(1)  secondBusID
				'arrChangeII(2)	 changeStation
				response.Write ("<tr bgcolor=""#E8F3FF"" onMouseOver = ""this.style.backgroundColor = '#FFF9EE'"" onMouseOut = ""this.style.backgroundColor = ''"">")
				response.Write ("<td width=""150""><strong><font color=""#FF0000"">" & busStart & "</strong></font></td>")
				response.Write ("<td width=""70""><a href=""buffer/busIDInfo/bus" & getBusIndexByBusID(arrChangeII(0)) &".htm"">" & arrChangeII(0) & "</a></td>")
				response.Write ("<td width=""160""> ==> <strong><font color=""#FF0000"">" & arrChangeII(2) & "</strong></font> ==> </td>")
				response.Write ("<td width=""70""><a href=""buffer/busIDInfo/bus" & getBusIndexByBusID(arrChangeII(1)) &".htm"">" & arrChangeII(1) & "</a></td>")
				response.Write ("<td width=""150""><strong><font color=""#FF0000"">" & busTo & "</strong></font></td>")
				response.Write("</tr>")
			next
			response.Write ("</table>")
		end if
	else
		response.Write ("<table width=""600"" border=""0"" bgcolor=""#003399"" cellpadding=""3"" cellspacing=""1"">")
		response.Write ("<tr bgcolor=""#FDDD90"">")
		response.Write ("<td width=""100""><strong>车次</strong></td>")
		response.Write ("<td width=""100""><strong>起点</strong></td>")
		response.Write ("<td width=""100""><strong>经过</strong></td>")
		response.Write ("<td width=""100""><strong>经过</strong></td>")
		response.Write ("<td width=""100""><strong>终点</strong></td>")
		response.Write ("<td width=""100""><strong>详情</strong></td>")
		response.Write ("</tr>")
		'去掉最后一个分割符
		strTemp=left(strTemp,len(strTemp)-2)
		arrBusId=split(strTemp,"||")
		for i=0 to (ubound(arrBusId))
			busInfo=getInfoByBusid(arrBusid(i))
			response.Write ("<tr bgcolor=""#E8F3FF"" onMouseOver = ""this.style.backgroundColor = '#FFF9EE'"" onMouseOut = ""this.style.backgroundColor = ''"">")
			response.Write ("<td width=""100"">" & busInfo(0) & "</td>")
			response.Write ("<td width=""100"">" & busInfo(1) & "</td>")
			response.Write ("<td width=""100""><strong><font color=""#FF0000"">" & busStart & "</strong></font></td>")
			response.Write ("<td width=""100""><strong><font color=""#FF0000"">" & busTo & "</strong></font></td>")
			response.Write ("<td width=""100"">" & busInfo(2) & "</td>")
			response.Write ("<td width=""100""><a href=""buffer/busIDInfo/bus" & getBusIndexByBusID(busInfo(0)) &".htm""><img src=""images/detail.gif"" border=""0""></a></td>")
			response.Write("</tr>")
		next
		response.Write ("</table>")
	end if
end if
%>	
	<!--查询结果显示结束-->
	<br><img border="0" src="images/close_window.gif" style="CURSOR: hand;" onClick="window.close()">
	</td>
  </tr>
  <tr> 
    <td height="20" background="images/bottombg.gif"></td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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