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

📄 classflight.asp

📁 依蓝旅游网站管理系统Elan2008.SP2
💻 ASP
📖 第 1 页 / 共 5 页
字号:
<%
Class ClassFlight
   
   Private HTML, CommonRegExp, EL_Channel
   Private EL_Flag, CurrentPage, URLParameters, ReplaceKeyType, EL_ArrFCY(3)
   Private Flight_DepartDate, Flight_BackDate, Flight_DepartCity, Flight_DestinationCity
   
   
   Private Sub Class_Initialize
      Set CommonRegExp = New RegExp
	  CommonRegExp.IgnoreCase = True 
      CommonRegExp.Global = True 	
	  EL_Flag = True  
	  ReplaceKeyType = 0 '内容页字符替换模式 0:站内链接  1:字符过滤  2:两者
	  EL_ArrFCY(0) = "-"
	  EL_ArrFCY(1) = EL_Common.Lang("Flight.SearchField.f10", "经济舱")
	  EL_ArrFCY(2) = EL_Common.Lang("Flight.SearchField.f11", "商务舱")
	  EL_ArrFCY(3) = EL_Common.Lang("Flight.SearchField.f12", "头等舱")
	  Set EL_Channel = New ClassChannel	 
	  EL_Channel.GetChannelConfig()	  
	  If EL_Channel.ErrorCode = 1 Or EL_Channel.ChannelType = 1 Then
	     EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.ChannelError", "频道参数错误"))
		 Call ApplicationTerminate()
	  End If
	  
	  If EL_Channel.ChannelModule <> 4 Then
	     EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.ChannelModuleError", "频道模块错误"))
		 Call ApplicationTerminate()
	  End If
	  
	  If EL_Channel.Disabled Then
	     EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.Disabled", "该频道已被禁用"))
		 Call ApplicationTerminate()
	  End If
	  CurrentPage = EL_Common.ELRequest("page", 2) 
	  URLParameters = request.ServerVariables("QUERY_STRING")
	  If CurrentPage<1 Then
	     CurrentPage = 1
	  Else
	     URLParameters = EL_Common.ReplaceText(URLParameters, "\&{0,}page=[0-9]*", "")
		 If URLParameters <> "" And Left(URLParameters, 1) = "&" Then URLParameters = Right(URLParameters, Len(URLParameters)-1) 
	  End If
	    	  
	  Flight_DepartDate = EL_Common.GetCookie(EL_Sn, "Flight_DepartDate")
	  Flight_BackDate = EL_Common.GetCookie(EL_Sn, "Flight_BackDate")
	  Flight_DepartCity = EL_Common.GetCookie(EL_Sn, "Flight_DepartCity")
	  Flight_DestinationCity = EL_Common.GetCookie(EL_Sn, "Flight_DestinationCity")
	  
	  
	  If Not IsDate(Flight_DepartDate) Then Flight_DepartDate = Date()
	  If DateDiff("d", Date(), Flight_DepartDate)<0 Then Flight_DepartDate = Date()
	  
	  If Not IsDate(Flight_BackDate) Then Flight_BackDate = DateAdd("d", 1, Flight_DepartDate)
	  If DateDiff("d", Flight_DepartDate, Flight_BackDate)<1 Then Flight_BackDate = DateAdd("d", 1, Flight_DepartDate)
	  	  
	  Flight_DepartDate = EL_Common.FormatDate(Flight_DepartDate)
	  Flight_BackDate = EL_Common.FormatDate(Flight_BackDate)  
 
	  Call EL_Common.SetCookie(EL_Sn, "Flight_DepartDate", Flight_DepartDate, 7)
	  Call EL_Common.SetCookie(EL_Sn, "Flight_BackDate", Flight_BackDate, 7)
	  Call EL_Common.SetCookie(EL_Sn, "Flight_DepartCity", Flight_DepartCity, 7)
	  Call EL_Common.SetCookie(EL_Sn, "Flight_DestinationCity", Flight_DestinationCity , 7)
	    
   End Sub
   
   Private Sub Class_Terminate
      Set CommonRegExp = Nothing
	  Set EL_Channel = Nothing
   End Sub
   
   Private Function ChannelCommonLabels(ByVal HTML)
      '频道通用标签
	  Dim TempHTML
	  
	  TempHTML = HTML
	  TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$ChannelID}", ChannelID)
	  TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$ChannelName}", EL_Channel.ChannelName)
	  TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$ChannelPictrue}", EL_Channel.ChannelPictrue)
	  TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$ChannelDir}", EL_Channel.ChannelDir)
	  TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$ItemName}", EL_Channel.ItemName)
	  TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$ItemUnit}", EL_Channel.ItemUnit)
	  TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$UploadDir}", EL_Channel.UploadDir)
	  TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$MetaKeywords}", "<meta name=""keywords"" content="""& EL_Channel.MetaKeywords &""" />")
	  TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$MetaDescription}", "<meta name=""description"" content="""& EL_Channel.MetaDescription &""" />")
	  TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$ShowSearchForm}", "<script language='JavaScript' type='text/JavaScript' src='"& InstallDir & EL_Channel.ChannelDir &"/Js/ShowSearchForm.js'></script>")

	  Dim TempDepartCity, TempDestinationCity
	  If Flight_DepartCity<>"" OR NOT ISNULL(Flight_DepartCity) Then TempDepartCity = EL_Common.ELSplit(Flight_DepartCity, "$")(1)
	  If Flight_DestinationCity<>"" OR NOT ISNULL(Flight_DestinationCity) Then TempDestinationCity = EL_Common.ELSplit(Flight_DestinationCity, "$")(1)
	  TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$Flight_DepartDate}", Flight_DepartDate)
	  TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$Flight_BackDate}", Flight_BackDate)
	  TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$Flight_DepartCity}", TempDepartCity)
	  TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$Flight_DestinationCity}", TempDestinationCity)
	  
	  ChannelCommonLabels = TempHTML
   End Function
   
   Public Sub CreateIndex()
      HTML = EL_Common.Template(ChannelID, 1, 0)
	  HTML = EL_Common.ReplaceCommonLabels(HTML)	
	  
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$PageTitle}", EL_Common.Join2String(EL_Channel.ChannelName, SiteTitle, EL_Common.TitleDivide))
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$DefaultSkin}", EL_Common.Skin(ChannelID, 0, 0))
	  
	  EL_Common.ShowPath = EL_Common.ShowPath & EL_Common.Lang("BaseConfig.Path", "&nbsp;&gt;&gt;&nbsp;") & EL_Channel.ChannelName
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowPath}", EL_Common.ShowPath)
	  
	  HTML = ChannelCommonLabels(HTML)	  
	  HTML = Label_GetFlightList(HTML)
	  
	  Response.Write HTML
   End Sub
   
   Public Sub BookSuccess()	  	  
	  '检查页面来源
	  If CheckComeURL = False Then
	     EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.ComeURLError", "禁止从本站外部提交数据"))
		 Exit Sub
	  End If
	  
	  Dim BookCmd, rsBook
	  Dim BookID, Consume, BookNumber, FlightType, DepartPriceOfDiscount, BackPriceOfDiscount
	  BookID = EL_Common.ELRequest("BookID", 2)
	  
	  Call EL_Common.InitCommonCmd(BookCmd, rsBook, "EL_FlightBook", "BookNumber, FlightType, DepartPriceOfDiscount, BackPriceOfDiscount", "ChannelID="& ChannelID &" And BookID="& BookID)
	  rsBook.Close()
	  
	  If BookCmd(0) <> 1 Then
	     EL_Common.ShowErrorMsg(EL_Common.Lang("Hotel.Error10", "指定的订单不存在"))
		 Exit Sub
	  End If
	  
	  rsBook.Open()
	  BookNumber = rsBook(0)
	  FlightType = rsBook(1)
	  DepartPriceOfDiscount = rsBook(2)
	  BackPriceOfDiscount = rsBook(3)
	  rsBook.Close()
	  Set rsBook = Nothing
	  
	  If FlightType = 2 Then
	     Consume = DepartPriceOfDiscount + BackPriceOfDiscount
	  Else 
	     Consume = DepartPriceOfDiscount
	  End If
	  
	  HTML = EL_Common.Template(ChannelID, 31, 0)
	  HTML = EL_Common.ReplaceCommonLabels(HTML)
	  
	  Dim PageTitle, StrPath
	  PageTitle = EL_Common.Join2String(EL_Channel.ChannelName, SiteTitle, EL_Common.TitleDivide)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$PageTitle}", PageTitle)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$DefaultSkin}", EL_Common.Skin(ChannelID, 0, 0))
	  
	  StrPath = EL_Common.Lang("BaseConfig.Path", "&nbsp;&gt;&gt;")
	  EL_Common.ShowPath = EL_Common.ShowPath & StrPath &"<a href='"& InstallDir & EL_Channel.ChannelDir &"/Index.asp'>"& EL_Channel.ChannelName &"</a>"
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowPath}", EL_Common.ShowPath)
	  HTML = ChannelCommonLabels(HTML)
	  
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$BookID}", BookID)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$BookNumber}", BookNumber)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$Consume}", Consume)
	  
	  Response.Write HTML
   End Sub
   
   Public Sub Booking()	  	  
	  Response.Write "<p>对不起,试用版本暂时不提供此功能! </p>"
	  Response.Write "<p>官方网站:<a href='http://www.elancom.net' target='_blank'>http://www.elancom.net</a><br><br>"
	  Response.Write "论坛交流:<a href='http://www.elancom.net/Forum/' target='_blank'>http://www.elancom.net/Forum/</a><br><br>"
	  Response.Write "在线演示功能:<a href='http://www.elancom.net/Demo/' target='_blank'>http://www.elancom.net/Demo/ </a></p>"
	  Response.Write "<p>联系方式:elancom@163.com  QQ:30735755 </p>"
   End Sub
   
   Public Sub PassengerInfo()
	  '检查页面来源
	  If CheckComeURL = False Then
	     EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.ComeURLError", "禁止从本站外部提交数据"))
		 Exit Sub
	  End If
	  
	  Call EL_Common.CheckEnableBook(EL_User.UserType)
	  
	  Dim AdultNum, ChildNum, InfantNum
	  Dim ContactUserName, Mobile, Phone, Email, Fax, ConfirmType, Demand
	  Dim DepartTicketID, BackTicketID, DepartDate, BackDate, FlightType
	  Dim DepartFlightID, BackFlightID, DepartCity, DestinationCity
	  Dim PriceDepartTicket, PriceBackTicket, TotalPrice, Discount, PriceOfDiscount
	  Dim DepartFlightNumber, BackFlightNumber, DepartIsDiscount, BackIsDiscount
	  
	  TotalPrice = 0
	  PriceOfDiscount = 0
	  Discount = 0
	  PriceDepartTicket = 0
	  PriceBackTicket = 0
	  
	  AdultNum = EL_Common.ELRequest("AdultNum", 2)
	  ChildNum = EL_Common.ELRequest("ChildNum", 2)
	  InfantNum = EL_Common.ELRequest("InfantNum", 2)
	  
	  DepartTicketID = EL_Common.ELRequest("DepartTicketID", 2)
	  BackTicketID = EL_Common.ELRequest("BackTicketID", 2)
	  DepartDate = EL_Common.ELRequest("DepartDate", 1)
	  BackDate = EL_Common.ELRequest("BackDate", 1)
	  FlightType = EL_Common.ELRequest("FlightType", 2)
	  DepartFlightID = EL_Common.ELRequest("DepartFlightID", 2)
	  BackFlightID = EL_Common.ELRequest("BackFlightID", 2)
	  DepartCity = EL_Common.ELRequest("DepartCity", 1)
	  DestinationCity = EL_Common.ELRequest("DestinationCity", 1)
	  
	  ContactUserName = EL_Common.ELRequest("ContactUserName", 1)
	  Mobile = EL_Common.ELRequest("Mobile", 1)
	  Phone = EL_Common.ELRequest("Phone", 1)
	  Email = EL_Common.ELRequest("Email", 1)
	  Fax = EL_Common.ELRequest("Fax", 1)
	  ConfirmType = EL_Common.ELRequest("ConfirmType", 1)
	  Demand = EL_Common.ELRequest("Demand", 1)
	  
	  '校验提交数据
	  If FlightType <>1 And FlightType <> 2 Then 
	     EL_Common.ShowErrorMsg(EL_Common.Lang("Flight.Error4", "航班类型错误"))
		 Exit Sub
	  End If
	  
	  If DepartTicketID <= 0 Then
	     EL_Common.ShowErrorMsg(EL_Common.Lang("Flight.Error5", "系统无法查询到去程机票"))
		 Exit Sub
	  End If
	  
	  If Not IsDate(DepartDate) Then
	     EL_Common.ShowErrorMsg(EL_Common.Lang("Flight.Error7", "出发日期格式错误,必须以“yyyy-mm-dd”的格式提交"))
		 Exit Sub
	  End If
	  If DateDiff("d", Date(), DepartDate)<0 Then
	     EL_Common.ShowErrorMsg(EL_Common.Lang("Flight.Error8", "出发日期必须大于或者等于现在日期"))
		 Exit Sub
	  End If
	  
	  DepartDate = EL_Common.FormatDate(DepartDate)
	  BackDate = EL_Common.FormatDate(BackDate)
	  
	  If FlightType = 2 Then
	     If BackTicketID <= 0 Then
	        EL_Common.ShowErrorMsg(EL_Common.Lang("Flight.Error6", "系统无法查询到返程机票"))
		    Exit Sub
	     End If
		 If Not IsDate(BackDate) Then
	        EL_Common.ShowErrorMsg(EL_Common.Lang("Flight.Error9", "返程日期格式错误,必须以“yyyy-mm-dd”的格式提交"))
		    Exit Sub
	     End If
	     If DateDiff("d", CDate(DepartDate), BackDate)<0 Then
	        EL_Common.ShowErrorMsg(EL_Common.Lang("Flight.Error10", "返程日期必须大于或者等于出发日期"))
		    Exit Sub
	     End If
		 BackDate = EL_Common.FormatDate(BackDate)
	  End If
	  	  
	  If DepartCity = "" Then

⌨️ 快捷键说明

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