📄 classflight.asp
字号:
MatchString = EL_Common.RegExpStaticLabel(MatchString, "{$Back_AirportTax}", rsTicket("AirportTax"))
MatchString = EL_Common.RegExpStaticLabel(MatchString, "{$Back_FlightNumber}", rsTicket("FlightNumber"))
MatchString = EL_Common.RegExpStaticLabel(MatchString, "{$Back_CompanyID}", rsTicket("CompanyID"))
MatchString = EL_Common.RegExpStaticLabel(MatchString, "{$Back_CompanyShortName}", rsTicket("CompanyShortName"))
MatchString = EL_Common.RegExpStaticLabel(MatchString, "{$Back_CompanyFullName}", rsTicket("CompanyFullName"))
MatchString = EL_Common.RegExpStaticLabel(MatchString, "{$Back_PlaneID}", rsTicket("PlaneID"))
MatchString = EL_Common.RegExpStaticLabel(MatchString, "{$Back_PlaneShortName}", rsTicket("PlaneShortName"))
MatchString = EL_Common.RegExpStaticLabel(MatchString, "{$Back_PlaneFullName}", rsTicket("PlaneFullName"))
MatchString = EL_Common.RegExpStaticLabel(MatchString, "{$Back_TicketName}", rsTicket("TicketName"))
MatchString = EL_Common.RegExpStaticLabel(MatchString, "{$Back_FCY}", EL_ArrFCY(rsTicket("FCY")))
MatchString = EL_Common.RegExpStaticLabel(MatchString, "{$Back_FullPrice}", PriceIcon & rsTicket("FullPrice"))
MatchString = EL_Common.RegExpStaticLabel(MatchString, "{$Back_BookPrice}", PriceIcon & rsTicket("Price_Adult"))
MatchString = EL_Common.RegExpStaticLabel(MatchString, "{$Back_PriceChild}", PriceIcon & rsTicket("Price_Child"))
MatchString = EL_Common.RegExpStaticLabel(MatchString, "{$Back_PriceInfant}", PriceIcon & rsTicket("Price_Infant"))
ReturnString = Replace(ReturnString, Match.Value, MatchString)
Next
rsTicket.Close()
End If
Set rsTicket = Nothing
Set TicketCmd = Nothing
End If
Set Matches = Nothing
Label_BackTicket = ReturnString
End Function
Public Sub ShowFlight()
Dim FlightCmd, rsFlight, i, RowCount, StrPath
Dim FlightID, FlightNumber, Schedule, BunkerSurcharge, AirportTax, Takeoff_City, Takeoff_Time, Takeoff_Airdrome, Transfer_City, Transfer_Time, Transfer_Airdrome
Dim Fall_City, Fall_Time, Fall_Airdrome, ETicket, Special, SkinID, TemplateID
Dim CompanyID, CompanyShortName, CompanyFullName, CompanyLogo, PlaneID, PlaneShortName, PlaneFullName
Dim TakeoffCityName, TransferCityName, FallCityName
FlightID = EL_Common.ELRequest("FlightID", 2)
Call EL_Common.InitCommand(FlightCmd, "EL_SP_GetFlightInfo")
With FlightCmd
.Parameters.Append .CreateParameter("RETURN", 2, 4)
.Parameters.Append .CreateParameter("@FlightID", 3, 1, 4, FlightID)
.Parameters.Append .CreateParameter("@ChannelID", 3, 1, 4, ChannelID)
Set rsFlight = .Execute()
End With
rsFlight.Close()
If FlightCmd(0)<>1 Then
EL_Common.ShowErrorMsg(EL_Common.RegExpStaticLabel(EL_Common.Lang("BaseConfig.InfoError", "指定{$ItemName}不存在"), "{$ItemName}", EL_Channel.ItemName))
Set rsFlight = Nothing
Set FlightCmd = Nothing
Exit Sub
End If
rsFlight.Open()
FlightNumber = rsFlight("FlightNumber")
Schedule = rsFlight("Schedule")
BunkerSurcharge = rsFlight("BunkerSurcharge")
AirportTax = rsFlight("AirportTax")
Takeoff_City = rsFlight("Takeoff_City")
Takeoff_Time = rsFlight("Takeoff_Time")
Takeoff_Airdrome = rsFlight("Takeoff_Airdrome")
Transfer_City = rsFlight("Transfer_City")
Transfer_Time = rsFlight("Transfer_Time")
Transfer_Airdrome = rsFlight("Transfer_Airdrome")
Fall_City = rsFlight("Fall_City")
Fall_Time = rsFlight("Fall_Time")
Fall_Airdrome = rsFlight("Fall_Airdrome")
ETicket = rsFlight("ETicket")
Special = rsFlight("Special")
SkinID = rsFlight("SkinID")
TemplateID = rsFlight("TemplateID")
CompanyID = rsFlight("CompanyID")
CompanyShortName = rsFlight("CompanyShortName")
CompanyFullName = rsFlight("CompanyFullName")
CompanyLogo = rsFlight("LogoURL")
PlaneID = rsFlight("PlaneID")
PlaneShortName = rsFlight("PlaneShortName")
PlaneFullName = rsFlight("PlaneFullName")
TakeoffCityName = EL_Common.ELSplit(Takeoff_City, "$")(1)
If Transfer_City <> "" Then TransferCityName = EL_Common.ELSplit(Transfer_City, "$")(1)
FallCityName = EL_Common.ELSplit(Fall_City, "$")(1)
HTML = EL_Common.Template(ChannelID, 3, TemplateID)
HTML = EL_Common.ReplaceCommonLabels(HTML)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PageTitle}", EL_Common.Join2String(TakeoffCityName &"-"& FallCityName &"("& FlightNumber &")", SiteTitle, EL_Common.TitleDivide))
HTML = EL_Common.RegExpStaticLabel(HTML, "{$DefaultSkin}", EL_Common.Skin(ChannelID, 0, SkinID))
StrPath = EL_Common.Lang("BaseConfig.Path", " >> ")
EL_Common.ShowPath = EL_Common.ShowPath & StrPath &"<a href='"& InstallDir & EL_Channel.ChannelDir &"/Index.asp'>"& EL_Channel.ChannelName &"</a>"& StrPath & TakeoffCityName &"-"& FallCityName &"("& FlightNumber &")"
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowPath}", EL_Common.ShowPath)
HTML = ChannelCommonLabels(HTML)
'自定义字段标签
Dim FieldCmd, rsField, FieldCount
Call EL_Common.InitCommonCmd(FieldCmd, rsField, "EL_Field", "FieldName", "ChannelID="& ChannelID)
rsField.Close()
FieldCount = FieldCmd(0)
If FieldCount = 0 Then
Set rsField = Nothing
Set FieldCmd = Nothing
Else
rsField.Open()
For i = 1 To FieldCount
HTML = EL_Common.RegExpStaticLabel(HTML, "{$"& rsField(0) &"}", rsFlight(rsField(0).value))
If i<FieldCount Then rsField.MoveNext
Next
rsField.Close()
Set rsField = Nothing
Set FieldCmd = Nothing
End If
rsFlight.Close()
Set rsFlight = Nothing
Set FlightCmd = Nothing
HTML = EL_Common.RegExpStaticLabel(HTML, "{$FlihgtID}", FlightID)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$FlightNumber}", FlightNumber)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Schedule}", Schedule)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$BunkerSurcharge}", BunkerSurcharge)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$AirportTax}", AirportTax)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$TakeoffCity}", TakeoffCityName)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$TakeoffTime}", Takeoff_Time)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$TakeoffAirdrome}", Takeoff_Airdrome)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$TransferCity}", TransferCityName)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$TransferTime}", Transfer_Time)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$TransferAirdrome}", Transfer_Airdrome)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$FallCity}", FallCityName)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$FallTime}", Fall_Time)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$FallAirdrome}", Fall_Airdrome)
If ETicket = True Then
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ETicket}", "<img src='"& InstallDir & EL_Channel.ChannelDir &"/Images/ETicket.gif' border=0>")
Else
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ETicket}", "")
End If
HTML = EL_Common.RegExpStaticLabel(HTML, "{$CompanyID}", CompanyID)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$CompanyShortName}", CompanyShortName)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$CompanyFullName}", CompanyFullName)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$CompanyLogo}", "<img src='"& CompanyLogo &"' border=0>")
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PlaneID}", PlaneID)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PlaneShortName}", PlaneShortName)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PlaneFullName}", PlaneFullName)
Dim EnableWeek
EnableWeek = Replace(Schedule, "7", "0")
HTML = EL_Common.RegExpStaticLabel(HTML, "{$EnableWeek}", EnableWeek)
'初始化出发日期
Dim DayInWeek, DepartDate
For i = CDate(Flight_DepartDate) To DateAdd("d", 7, CDate(Flight_DepartDate))
DayInWeek = WeekDay(i)
If DayInWeek = 1 Then
DayInWeek = 7
Else
DayInWeek = DayInWeek - 1
End If
If InStr(Schedule, CStr(DayInWeek))>0 Then
DepartDate = i
Exit For
End If
Next
Flight_DepartDate = EL_Common.FormatDate(DepartDate)
Call EL_Common.SetCookie(EL_Sn, "Flight_DepartDate", Flight_DepartDate, 7)
Call EL_Common.SetCookie(EL_Sn, "Flight_DepartCity", Takeoff_City, 7)
Call EL_Common.SetCookie(EL_Sn, "Flight_DestinationCity", Fall_City, 7)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Flight_DepartDate}", Flight_DepartDate)
HTML = Label_ArrTicket(HTML, FlightID)
HTML = Label_GetFlightList(HTML)
Response.Write HTML
End Sub
Private Function Label_ArrTicket(ByVal HTML, ByVal FlightID)
Dim TicketCmd, rsTicket, i, RowCount
Dim Match, Matches, ReturnString
Dim TempString, MatchString
Call EL_Common.InitCommonCmd(TicketCmd, rsTicket, "EL_FlightTicket", "*", "ChannelID="& ChannelID &" And FlightID="& FlightID)
rsTicket.Close()
RowCount = TicketCmd(0)
CommonRegExp.Pattern = "\[ArrTicket\][\w\W]*\[\/ArrTicket\]"
ReturnString = HTML
Set Matches = CommonRegExp.Execute(HTML)
If RowCount = 0 Then
For Each Match in Matches
ReturnString = Replace(ReturnString, Match.Value, "")
Next
Else
Dim BookButtonText, PriceIcon
BookButtonText = EL_Common.Lang("BaseConfig.BookButtonText", "预订")
PriceIcon = EL_Common.Lang("BaseConfig.PriceIcon", "¥")
rsTicket.Open
For Each Match in Matches
rsTicket.MoveFirst
MatchString = Match.Value
MatchString = EL_Common.ReplaceText(MatchString, "\[ArrTicket\]", "")
MatchString = EL_Common.ReplaceText(MatchString, "\[\/ArrTicket\]", "")
TempString = ""
Dim ItemHTML
For i = 1 To RowCount
ItemHTML = MatchString
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_TicketID}", rsTicket("TicketID"))
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_TicketName}", EL_Common.ServerHTMLEncode(rsTicket("TicketName")))
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_FCY}", EL_ArrFCY(rsTicket("FCY")))
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_FullPrice}", PriceIcon & rsTicket("FullPrice"))
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_BookPrice}", PriceIcon & rsTicket("Price_Adult"))
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_RuleText}", rsTicket("RuleText"))
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_BookButton}", "<input type='button' value='"& BookButtonText &"' class='bookbutton' onClick=""getObject('DepartTicketID').value='"& rsTicket("TicketID") &"';onBooking("& rsTicket("TicketID") &")""/>")
TempString = TempString & ItemHTML
If i<RowCount Then rsTicket.MoveNext
Next
ReturnString = Replace(ReturnString, Match.Value, TempString)
Next
rsTicket.Close()
End If
Set rsTicket = Nothing
Set TicketCmd = Nothing
Label_ArrTicket = ReturnString
End Function
Public Sub Search()
Dim SearchCmd, rsSearch, i, RowCount, PageSizes, PageCounts, TotalRowCount, StrPath
Dim Search_FlightType, Search_DepartTime, Search_BackTime, Search_CompanyID, Search_FCY, Search_ETicket
Dim SearchStep, SearchDate, SearchTime, Search_DepartCity, Search_DestinationCity
Dim SearchInfo, ShowStep, Temp
Dim Selected_TicketID
If ComeURL = "" Then Response.Redirect InstallDir & EL_Channel.ChannelDir
If IsDate(Session("EL_LastSearchDateTime")) Then
If DateDiff("s", Session("EL_LastSearchDateTime"), Now()) < SearchInterval Then
EL_Common.ShowErrorMsg(EL_Common.RegExpStaticLabel(EL_Common.Lang("Search.Error1", "为节省系统资源,请在{$SearchInterval}秒后再执行搜索……"), "{$SearchInterval}", SearchInterval))
Exit Sub
End If
End If
Flight_DepartCity = EL_Common.ELRequest("DepartCity", 1)
Flight_DestinationCity = EL_Common.ELRequest("DestinationCity", 1)
Flight_DepartDate = EL_Common.ELRequest("DepartDate", 1)
Flight_BackDate = EL_Common.ELRequest("BackDate", 1)
Search_DepartCity = Flight_DepartCity
Search_DestinationCity = Flight_DestinationCity
Search_FlightType = EL_Common.ELRequest("FlightType", 2)
Search_DepartTime = EL_Common.ELRequest("DepartTime", 2)
Search_BackTime = EL_Common.ELRequest("BackTime", 2)
Search_CompanyID = EL_Common.ELRequest("CompanyID", 2)
Search_FCY = EL_Common.ELRequest("FCY", 2)
Search_ETicket = EL_Common.ELRequest("ETicket", 2)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -