?? index.asp
字號:
<!--#include file="conn.asp"-->
<%
lx=request("lx")
zd=trim(request("zd"))
zd1=request("zd1")
zd2=request("zd2")
action=request("action")
%>
<title>九江公交查詢</title>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
a:link {
color: #FFCC00;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #FFCC00;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
color: #FF0000;
}
.STYLE2 {
color: #0099FF;
font-weight: bold;
font-size: 18px;
}
.STYLE5 {font-size: 14px}
#Layer1 {
position:relative;
left:340px;
top:43px;
width:54px;
height:22px;
z-index:1;
}
-->
</style>
</head>
<body>
<table width="750" border="1" align="center" cellpadding="0" cellspacing="0">
<tr><td height="60" align="center" valign="bottom" style="background-color:#6699FF; color:#FFCC66; font-size:40px; font-family:'華文隸書'; b"><div align="left">九江公交查詢系統(tǒng)</div>
<div id="Layer1"><a href="admin/admin.asp" target="_self"><span style="font-size:16px; color:#6699FF">進入后臺管理</span></a></div></td>
</tr>
<tr>
<td height="483"><br><br><form name="form1" method="post" action="index.asp?action=oklx">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="16%"><div align="center">路線查詢</div></td>
<td width="64%"><label>
<input type="text" name="lx" size="15">
例如: <span class="STYLE1">101路</span> </label></td>
<td width="20%"><label>
<input type="submit" name="Submit" value="提交">
</label></td>
</tr>
</table>
</form>
<form name="form2" method="post" action="index.asp?action=okzd">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="16%"><div align="center">站點查詢</div></td>
<td width="64%"><label>
<input type="text" name="zd" size="15">
例如: <span class="STYLE1">火車站</span></label></td>
<td width="20%"><label>
<input type="submit" name="Submit2" value="提交">
</label></td>
</tr>
</table>
</form>
<form name="form3" method="post" action="index.asp?action=okdd">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="16%" height="21"><div align="center">
<%
Set czdrs1=Server.CreateObject("ADODB.RecordSet")
czdsql = "select distinct zhand from zhand order by zhand"
czdrs1.open czdsql,conn,1,1
if czdrs1.eof and czdrs1.bof then
response.write "未連接上數(shù)據(jù)庫"
else
%>
點對點查詢</div></td>
<td width="64%"><select name="zd1" size="1">
<option selected value="">選擇站點</option>
<%
do while not czdrs1.eof
%>
<option value="<%=czdrs1("zhand")%>"><%=czdrs1("zhand")%></option>
<%
czdrs1.movenext
loop
end if
czdrs1.close
set czdrs1=nothing %>
</select>
到
<%
Set czdrs2=Server.CreateObject("ADODB.RecordSet")
czdsq2 = "select distinct zhand from zhand order by zhand"
czdrs2.open czdsq2,conn,1,1
if czdrs2.eof and czdrs2.bof then
response.write "請先連接好!"
else
%>
<select name="zd2" size="1">
<option selected value="">選擇站點</option>
<%
do while not czdrs2.eof
%>
<option value="<%=czdrs2("zhand")%>"><%=czdrs2("zhand")%></option>
<%
czdrs2.movenext
loop
end if
czdrs2.close
set czdrs1=nothing %>
</select> </td>
<td width="20%"><label>
<input type="submit" name="Submit3" value="提交">
</label></td>
</tr>
</table>
</form>
<table cellpadding="5" cellspacing="20">
<tr>
<td>
<% if action="okzd" then
if zd="" then
response.write "<script>alert('請輸入你要查詢的站點');history.back();</script>"
else
end if
Set rs1=Server.CreateObject("ADODB.RecordSet")
sq="select distinct luxian from jj where zhand Like '%"&zd&"%' "
rs1.Open sq,conn,1,1
%>
<%if not Rs1.eof then
do while not rs1.eof
lx1=trim(rs1("luxian"))
set rsall=server.CreateObject("adodb.recordset")
sqlall="select allzhand from lx where luxian='"&lx1&"'"
rsall.open sqlall,conn,1,1
allzhandian=rsall(0)
rsall.close
set rsall=nothing
%>
<br><br><span class="STYLE2"><%=rs1("luxian")%> 共有 <%=allzhandian%> 站 :</span>
<br>
<% set rs=Server.CreateObject("ADODB.RecordSet")
sql="select zhand,leixing from jj where luxian='"&lx1&"'"
rs.Open sql,conn,1,1
%>
<%if not Rs.eof then
do while not rs.eof
leixing=rs("leixing")
%>
<%if leixing="下行 "then%>
<br><br><%=rs("leixing")%>: <% if trim(rs("zhand"))=zd then%><font color="#FF0000"><%=rs("zhand")%></font> <%else%>
<% if trim(rs("zhand"))=zd then%>
<font color="#FF0000"><%=rs("zhand")%></font> <%else%><a href="index.asp?action=okzd&zd=<%=rs("zhand")%>" " target="_self"><%=rs("zhand")%></a> <%end if%><%end if%>
<%elseif leixing="上行 "or leixing="環(huán)形 " then %>
<%=rs("leixing")%>: <% if trim(rs("zhand"))=zd then%><font color="#FF0000"><%=rs("zhand")%></font> <%else%><a href="index.asp?action=okzd&zd=<%=rs("zhand")%>" " target="_self"><%=rs("zhand")%></a> <%end if%>
<%else%>
<% if trim(rs("zhand"))=zd then%><font color="#FF0000"><%=rs("zhand")%></font> <%else%><a href="index.asp?action=okzd&zd=<%=rs("zhand")%>" " target="_self"><%=rs("zhand")%></a> <%end if%>
<%end if%>
<%
rs.movenext
loop
else%>
<BR>
<%
end if
rs.close
set rs=nothing%>
<%rs1.movenext
loop
else%>
<BR>
<%rs1.close
set rs1=nothing
end if
end if
%>
<% if action="oklx" then
if lx="" then
response.write "<script>alert('請輸入你要查詢的路線');history.back();</script>"
else
end if
Set rs1=Server.CreateObject("ADODB.RecordSet")
sq="select luxian from lx where luxian Like '%"&lx&"%' "
rs1.Open sq,conn,1,1
%>
<%if not Rs1.eof then
do while not rs1.eof
lx1=trim(rs1("luxian"))
set rsall=server.CreateObject("adodb.recordset")
sqlall="select allzhand from lx where luxian='"&lx1&"'"
rsall.open sqlall,conn,1,1
allzhandian=rsall(0)
rsall.close
set rsall=nothing
%>
<br><br><span class="STYLE2"><%=rs1("luxian")%> 共有 <%=allzhandian%> 站:</span>
<br>
<% set rs=Server.CreateObject("ADODB.RecordSet")
sql="select zhand,leixing from jj where luxian='"&lx1&"'"
rs.Open sql,conn,1,1
%>
<%if not Rs.eof then
do while not rs.eof
leixing=rs("leixing")
%>
<%if leixing="下行 "then%>
<br><br><%=rs("leixing")%>: <% if trim(rs("zhand"))=zd then%><a href="index.asp?action=okzd&zd=<%=rs("zhand")%>" " target="_self"><font color="#FF0000"><%=rs("zhand")%></font></a> <%else%><a href="index.asp?action=okzd&zd=<%=rs("zhand")%>" " target="_self"><%=rs("zhand")%></a> <%end if%>
<%elseif leixing="上行 "or leixing="環(huán)形 "OR leixing="上下 " then %>
<BR><%=rs("leixing")%>: <% if trim(rs("zhand"))=zd then%><a href="index.asp?action=okzd&zd=<%=rs("zhand")%>" " target="_self"><font color="#FF0000"><%=rs("zhand")%></font></a> <%else%><a href="index.asp?action=okzd&zd=<%=rs("zhand")%>" " target="_self"><%=rs("zhand")%></a> <%end if%>
<%else%>
<% if trim(rs("zhand"))=zd then%><a href="index.asp?action=okzd&zd=<%=rs("zhand")%>" " target="_self"><font color="#FF0000"><%=rs("zhand")%></font></a> <%else%><a href="index.asp?action=okzd&zd=<%=rs("zhand")%>" " target="_self"><%=rs("zhand")%></a> <%end if%>
<%end if%>
<%
rs.movenext
loop
else%>
<BR>
<%
end if
rs.close
set rs=nothing%>
<%rs1.movenext
loop
else%>
<BR>
<%rs1.close
set rs1=nothing
end if
end if
%> </td>
</tr>
</table>
<% if action="okdd" then %>
<table width="100%" align="center" cellpadding="2" cellspacing="5">
<tr>
<% if zd1=""or zd2="" then
response.write "<script>alert('請選擇站點');history.back();</script>"
elseif zd1=zd2 then
response.write "<script>alert('請選擇兩個不同的站點');history.back();</script>"
else
Set zdrs1=Server.CreateObject("ADODB.RecordSet")
zdsql ="select distinct a.luxian,b.luxian from (select zhand,luxian,shunx from jj where luxian in (select distinct luxian from jj where zhand in (select zhand from zhand where zhand like '%"&zd1&"%'))) a,(select zhand,luxian,shunx from jj where luxian in (select distinct luxian from jj where zhand in (select zhand from zhand where zhand like '%"&zd2&"%'))) b where a.zhand=b.zhand order by a.luxian,b.luxian asc"
zdrs1.open zdsql,conn,1,1
if not zdrs1.eof then
do while not zdrs1.eof
%>
<%if zdrs1(0)=zdrs1(1) then
luxiana=trim(zdrs1(0))%>
<script language='javascript'> alert(" 可以直接到<%=luxiana%>") </script>
<%
else
end if
%>
<% Set leixrs=Server.CreateObject("ADODB.RecordSet")
leixsql="select leixing from lx where luxian='"&zdrs1(0)&"'"
leixrs.open leixsql,conn,1,1
leixing=leixrs(0)
leixrs.close
set leixrs=nothing
Set shunxrs=Server.CreateObject("ADODB.RecordSet")
if leixing="環(huán)形" then
shunxsql="select min(shunx)as id from jj where luxian='"&zdrs1(0)&"'and zhand like '%"&zd1&"%'"
else
shunxsql="select max(shunx)as id from jj where luxian='"&zdrs1(0)&"'and zhand like '%"&zd1&"%'"
end if
shunxrs.open shunxsql,conn,1,1%>
<%
Set outrs=Server.CreateObject("ADODB.RecordSet")
outsql ="select distinct a.zhand,a.shunx from (select zhand,luxian,shunx from jj where luxian='"&zdrs1(0)&"') a,(select zhand,luxian,shunx from jj where luxian='"&zdrs1(1)&"') b where a.zhand=b.zhand and a.shunx>"&shunxrs(0)&" order by a.shunx"
'outsql ="select distinct a.zhand,a.luxian,b.luxian from (select zhand,luxian,shunx from jj where luxian='"&zdrs1(0)&"') a,(select zhand,luxian,shunx from jj where luxian='"&zdrs1(1)&"') b where a.zhand=b.zhand and a.shunx>"&shunxrs(0)&""
outrs.open outsql,conn,1,1%>
<td colspan="5"><div align="center"><%=zdrs1(0)%>(<%=zd1%>)轉(zhuǎn)<%=zdrs1(1)%>(<%=zd2%>)</div></td> </tr><tr>
<td bgcolor=#336600><a href="index.asp?action=okzd&zd=<%=zd1%>" " target="_self">
<div align="center"><%=zd1%></div>
</a></td>
<%i=0
if not outrs.eof then
do while not outrs.eof
i=i+1
%>
<%if i=4 then
i=5%>
<%else%>
<% end if%>
<%if i mod 5=0 then%>
<td ><a href="index.asp?action=okzd&zd=<%=outrs(0)%>" " target="_self"><span class="STYLE5"><%=outrs(0)%></span></a></td>
</tr><tr>
<% else%>
<td ><a href="index.asp?action=okzd&zd=<%=outrs(0)%>" " target="_self"><span class="STYLE5"><%=outrs(0)%></span></a></td>
<% end if%>
<%
outrs.movenext
loop
else %>
<%
Set outrs1=Server.CreateObject("ADODB.RecordSet")
outsql1 ="select distinct a.zhand,a.shunx from (select zhand,luxian,shunx from jj where luxian='"&zdrs1(0)&"') a,(select zhand,luxian,shunx from jj where luxian='"&zdrs1(1)&"') b where a.zhand=b.zhand and a.shunx<"&shunxrs(0)&"order by a.shunx"
outrs1.open outsql1,conn,1,1%>
<%if not outrs1.eof then
do while not outrs1.eof
i=i+1
%>
<%if i=4 then
i=5%>
<%else%>
<% end if%>
<%if i mod 5=0 then%>
<td ><a href="index.asp?action=okzd&zd=<%=outrs1(0)%>" " target="_self"><span class="STYLE5"><%=outrs1(0)%></span></a></td>
</tr><tr>
<% else%>
<td ><a href="index.asp?action=okzd&zd=<%=outrs1(0)%>" " target="_self"><span class="STYLE5"><%=outrs1(0)%></span></a></td>
<% end if%>
<%
outrs1.movenext
loop
else
end if
outrs1.close
set outrs1=nothing %>
<%
end if
shunxrs.close
set shunxrs=nothing
outrs.close
set outrs=nothing
%>
<td bgcolor="#B05800"><a href="index.asp?action=okzd&zd=<%=zd2%>" " target="_self">
<div align="center"><%=zd2%></div></a></td>
</tr><tr>
<%
zdrs1.movenext
loop
else
response.write "<script>alert('轉(zhuǎn)一次車到達不了,打的發(fā)的來!!');history.back();</script>"
end if
zdrs1.close
set zdrs1=nothing
end if
%>
</tr>
</table>
<% end if
conn.close
set conn=nothing %> </td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -