📄 config.asp
字号:
<%
'本程序由源代码下载提供发布
'极品源码提供大量企业及门户整站免费下载
'网址 http://www.ydaima.com
'网址 http://www.jpcode.com
%>
<!-- #include file="conn.asp" -->
<!-- #include file="md5.asp" -->
<!-- #include file="constant.asp" -->
<%
response.Expires=-999
Session.Timeout=200
'---------------------
'定义常量
'---------------------
set rs=server.createobject("adodb.recordset")
set rst=server.createobject("adodb.recordset")
'---------------------
'错误显示信息函数
'---------------------
Function ShowErr(ErrStr,Going)
call pagend()
if Going="1" then
Response.Write "<Script>alert('"& ErrStr &"');location.href='javascript:history.go(-1)';</Script>"
else
Response.Write "<Script>alert('"& ErrStr &"');location.href='"& Going &"';</Script>"
end if
Response.End()
End Function
'---------------------
'结束对象函数
'---------------------
Function pagend()
set rs=nothing
conn.close
set conn=nothing
End Function
'---------------------
'字符转换函数
'---------------------
Function HTMLEncode(fString)
If Not IsNull(fString) Then
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")
fString = Replace(fString, CHR(32), " ")
fString = Replace(fString, CHR(34), """)
fString = Replace(fString, CHR(39), "'")
fString = Replace(fString, CHR(9), " ")
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P> ")
fString = Replace(fString, CHR(10), "<BR> ")
HTMLEncode = fString
End If
End Function
'---------------------
'字符转回函数
'---------------------
function HTMLDncode(fString)
If Not IsNull(fString) Then
fString = Replace(fString, ">",">" )
fString = Replace(fString, "<", "<")
fString = Replace(fString, " ", CHR(32))
fString = Replace(fString, " ", CHR(9))
fString = Replace(fString, """, CHR(34))
fString = Replace(fString, "'", CHR(39))
fString = Replace(fString, "", CHR(13))
fString = Replace(fString, "</P><P> ",CHR(10) & CHR(10) )
fString = Replace(fString, "<BR> ",CHR(10) )
HTMLDncode = fString
End If
End Function
'---------------------
'截取字符函数
'---------------------
Function Jiequ(fString,fNum)
if len(fString)>cint(fNum) then
Jiequ=left(fString,cint(fNum)) & "..."
else
Jiequ=fString
end if
End Function
'---------------------
'判断字符串长度
'---------------------
Function CheckStringLength(txt)
txt=trim(txt)
x = len(txt)
y = 0
for ii = 1 to x
if asc(mid(txt,ii,1))<0 or asc(mid(txt,ii,1))>255 then
y = y + 2
else
y = y + 1
end if
next
CheckStringLength = y
End Function
'---------------------
'判断是否数字
'---------------------
Function CheckNum(checkstr)
if not isnumeric(checkstr) or checkstr="" then
call ShowErr("参数错误","1")
end if
End Function
'---------------------
'公交车费用查询
'---------------------
Function SearchRate1(BusStr)
sqlstr="select * from [Bus] where qmbus_name='"& BusStr &"'"
rs.open sqlstr,conn,1,3
if not rs.eof then
bus_rate=rs("qmbus_rate")
bus_ratebz=rs("qmbus_ratebz")
else
response.Write("数据库数据出错!")
response.End()
end if
rs.close
response.Write(" 单程票价:"&bus_rate&"<hr style='height:1px; width:750px; color:#ECEEF5;'>票价说明:"&bus_ratebz&"<hr style='height:1px; width:750px; color:#ECEEF5;'>")
End Function
Function SearchRate2(BusInfo1,BusInfo2)
sqlstr="select * from [Bus] where qmbus_name='"& BusInfo1 &"'"
rs.open sqlstr,conn,1,3
if not rs.eof then
bus_rate=rs("qmbus_rate")
bus_ratebz=rs("qmbus_ratebz")
else
response.Write("数据库数据出错!")
response.End()
end if
rs.close
BusString1="("&BusInfo1&": "&bus_rate&" "
Busratebz1=""&BusInfo1&": "&bus_ratebz&"<br>"
sqlstr="select * from [Bus] where qmbus_name='"& BusInfo2 &"'"
rs.open sqlstr,conn,1,3
if not rs.eof then
bus_rate=rs("qmbus_rate")
bus_ratebz=rs("qmbus_ratebz")
else
response.Write("数据库数据出错!")
response.End()
end if
rs.close
BusString2=BusInfo2&": "&bus_rate&")<hr style='height:1px; width:750px; color:#ECEEF5;'>"
Busratebz2=""&BusInfo2&": "&bus_ratebz&"<hr style='height:1px; width:750px; color:#ECEEF5;'>"
response.Write(" 相关票价:"&BusString1&BusString2)
response.Write(" 相关票价说明:"&Busratebz1&Busratebz2)
End Function
Function SearchRate3(InfoBus1,InfoBus2,InfoBus3)
sqlstr="select * from [Bus] where qmbus_name='"& InfoBus1 &"'"
rs.open sqlstr,conn,1,3
if not rs.eof then
bus_rate=rs("qmbus_rate")
bus_ratebz=rs("qmbus_ratebz")
else
response.Write("数据库数据出错q!")
response.End()
end if
rs.close
InfoString1="("&InfoBus1&": "&bus_rate&" "
Busratebz1=""&BusInfo1&": "&bus_ratebz&"<br>"
sqlstr="select * from [Bus] where qmbus_name='"& InfoBus2 &"'"
rs.open sqlstr,conn,1,3
if not rs.eof then
bus_rate=rs("qmbus_rate")
bus_ratebz=rs("qmbus_ratebz")
else
response.Write("数据库数据出错w!")
response.End()
end if
rs.close
InfoString2=InfoBus2&": "&bus_rate&" "
Busratebz2=""&BusInfo2&": "&bus_ratebz&"<br>"
sqlstr="select * from [Bus] where qmbus_name='"& InfoBus3 &"'"
rs.open sqlstr,conn,1,3
if not rs.eof then
bus_rate=rs("qmbus_rate")
bus_ratebz=rs("qmbus_ratebz")
else
response.Write("数据库数据出错e!")
response.End()
end if
rs.close
InfoString3=InfoBus3&": "&bus_rate&")<hr style='height:1px; width:750px; color:#ECEEF5;'>"
Busratebz3=""&BusInfo3&": "&bus_ratebz&"<hr style='height:1px; width:750px; color:#ECEEF5;'>"
response.Write(" 相关票价:"&InfoString1&InfoString2&InfoString3)
response.Write(" 相关票价说明:"&Busratebz1&Busratebz2&Busratebz3)
End Function
'---------------------
'其他本系统常用的数据
'---------------------
Function RouteErr(RouteStr)
response.Write("<div id='div_2'>")
response.Write("对不起,未找到与<span style='color:#FF0000'><strong>")
response.Write(RouteStr)
response.Write("</strong></span>相关的信息<br>主要原因如下:")
response.Write("<li>您输入的线路有误!请重新输入正确的线路进行查询</li>")
response.Write("<li>本系统里没有该线路的详细资料,如果您确信系统资料有误的话请")
response.Write("<a href='writemsg.asp'><font color=#FF0000>联系我们</font></a>(系统资料需要我们大家的共同维护)</li>")
response.Write("</div>")
End Function
Function StatioinErr(StationStr)
response.Write("<div id='div_2'>")
response.Write("对不起,未找到与<span style='color:#FF0000'><strong>")
response.Write(StationStr)
response.Write("</strong></span>相关的信息<br>主要原因如下:")
response.Write("<li>您输入的站点有误!请重新输入正确的站点进行查询</li>")
response.Write("<li>本系统里没有该站点的详细资料,如果您确信系统数据有误的话请")
response.Write("<a href='writemsg.asp'><font color=#FF0000>联系我们</font></a>(系统资料需要我们大家的共同维护)</li>")
response.Write("</div>")
End Function
Function Suggestion(info_name,info_date)
response.Write("<div id='div_2_4'>")
response.Write("<a href='writemsg.asp' target=_blank>如果您发现与<font color='#FF0000'><strong>"&info_name&"</strong></font>有出入的地方,请联系我们,数据需要大家共同维护</a> 最后更新日期为:"&info_date)
response.Write("<hr style='height:1px; color:#999'>")
response.Write("</div>")
End Function
Function NonSearch(info_1,info_2)
response.Write("对不起,未找到<font color=#FF0000><strong>")
response.Write(info_1&"</strong></font>到<font color=#FF0000><strong>"&info_2&"</strong></font>的具体乘车方案")
response.Write("<li>您输入的站点有误!请重新输入正确的点进行站查询</li>")
response.Write("<li>您要查的站点可能需要三次或三次以上的换乘才能够到达,本系统最多只支持查询二次换乘!")
response.Write("<li>本系统里没有该站点的详细资料,如果您确信本系统资料有误的话请")
response.Write("<a href='writemsg.asp'>联系我们</a> (系统资料需要我们大家的共同维护)</li>")
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -