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

📄 classflight.asp

📁 依蓝旅游网站管理系统Elan2008.SP2
💻 ASP
📖 第 1 页 / 共 5 页
字号:
	     EL_Common.ShowErrorMsg(EL_Common.Lang("Flight.Error1", "请选择出发城市"))
		 Exit Sub
	  End If
	  
	  If DestinationCity = "" Then
	     EL_Common.ShowErrorMsg(EL_Common.Lang("Flight.Error2", "请选择目的城市"))
		 Exit Sub
	  End If
	  
	  If ContactUserName = "" Then
	     EL_Common.ShowErrorMsg(EL_Common.Lang("Flight.Error12", "请输入送票联系人名"))
		 Exit Sub
	  End If
	  
	  If Phone = "" Then
	     EL_Common.ShowErrorMsg(EL_Common.Lang("Flight.Error13", "请输入联系电话"))
		 Exit Sub
	  End If
	  
	  If Email = "" Then
	     EL_Common.ShowErrorMsg(EL_Common.Lang("Flight.Error14", "请输入电子邮件"))
		 Exit Sub
	  ElseIf EL_Common.CheckEmail(Email) = False Then
	     EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.EmailError", "电子邮件格式错误"))
		 Exit Sub
	  End If
	  
	  Dim rsDepart, rsBack 
	  rsDepart = EL_Common.GetFieldValue("EL_Flight.FlightNumber,EL_FlightTicket.IsDiscount", "EL_Flight,EL_FlightTicket", "EL_Flight.ChannelID="& ChannelID &" And EL_Flight.FlightID="& DepartFlightID &" And EL_Flight.FlightID=EL_FlightTicket.FlightID And EL_FlightTicket.TicketID="& DepartTicketID)
	  DepartFlightNumber = rsDepart(0)
	  DepartIsDiscount = rsDepart(1)
	  
	  If FlightType = 2 Then
	     rsBack = EL_Common.GetFieldValue("EL_Flight.FlightNumber,EL_FlightTicket.IsDiscount", "EL_Flight,EL_FlightTicket", "EL_Flight.ChannelID="& ChannelID &" And EL_Flight.FlightID="& BackFlightID &" And EL_Flight.FlightID=EL_FlightTicket.FlightID And EL_FlightTicket.TicketID="& BackTicketID)
	     BackFlightNumber = rsBack(0)
	     BackIsDiscount = rsBack(1)
	  End If  
	  	  
	  
	  HTML = EL_Common.Template(ChannelID, 33, 0)
	  
	  HTML = EL_Common.ReplaceCommonLabels(HTML)	  
	  
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$PageTitle}", EL_Common.Join2String(DepartCity &"-"& DestinationCity, SiteTitle, EL_Common.TitleDivide))
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$DefaultSkin}", EL_Common.Skin(ChannelID, 0, 0))
	  
	  Dim StrPath
	  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>" 
	  EL_Common.ShowPath = EL_Common.ShowPath & StrPath & EL_Common.RegExpStaticLabel(EL_Common.Lang("BaseConfig.BookPath.Book", "{$ItemName}预订"), "{$ItemName}", EL_Channel.ItemName) & StrPath & EL_Common.Lang("BaseConfig.BookPath.Confirm", "订单信息确认")
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowPath}", EL_Common.ShowPath)
	  
	  HTML = ChannelCommonLabels(HTML)	  
	  	  	  
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$DepartFlightNumber}", DepartFlightNumber)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$BackFlightNumber}", BackFlightNumber)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$DepartCity}", DepartCity)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$DestinationCity}", DestinationCity)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$FlightType}", FlightType)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$DepartFlightID}", DepartFlightID)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$BackFlightID}", BackFlightID)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$DepartDate}", DepartDate)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$BackDate}", BackDate)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$DepartTicketID}", DepartTicketID)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$BackTicketID}", BackTicketID)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$AdultNum}", AdultNum)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$ChildNum}", ChildNum)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$InfantNum}", InfantNum)
	  
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$ContactUserName}", ContactUserName)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$Mobile}", Mobile)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$Phone}", Phone)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$Email}", Email)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$Fax}", Fax)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$ConfirmType}", ConfirmType)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$Demand}", Demand)
	  
	  Dim FlightInfo
	  If FlightType = 1 Then
		 FlightInfo = EL_Common.Lang("Flight.SearchField.f14", "单程") &"("& EL_Common.Lang("Flight.SearchField.f3", "出发日期:") & DepartDate &")"
	  ElseIf FlightType = 2 Then	 
		 FlightInfo = EL_Common.Lang("Flight.SearchField.f15", "往返") &"("& EL_Common.Lang("Flight.SearchField.f3", "出发日期:") & DepartDate &" "& EL_Common.Lang("Flight.SearchField.f5", "返程日期:") & BackDate &")"
	  End If
	  
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$FlightInfo}", FlightInfo)
	  
	  Dim DiscountHTML, d0, d1  
	  If DepartIsDiscount Then
	     If EL_User.DiscountOfFlight = 0 Then
		    d0 = 1
			DiscountHTML = EL_Common.Lang("Flight.Discount.d0", "您不可以享受折扣")
		 Else
		    d0 = EL_Common.FormatDecimal(EL_User.DiscountOfFlight / 10)
			DiscountHTML = EL_Common.Lang("Flight.Discount.d1", "您可享受{$Discount}折优惠")
			DiscountHTML = EL_Common.RegExpStaticLabel(DiscountHTML, "{$Discount}", EL_User.DiscountOfFlight)
		 End If
	  Else
	     d0 = 1
		 DiscountHTML = EL_Common.Lang("Flight.NoDiscount", "此航班机票不允许打折")
	  End If	  
	 
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowDepartDiscount}", DiscountHTML)	
	  
	  If BackIsDiscount Then
	     If EL_User.DiscountOfFlight = 0 Then
		    d1 = 1
			DiscountHTML = EL_Common.Lang("Flight.Discount.d0", "您不可以享受折扣")
		 Else
		    d1 = EL_Common.FormatDecimal(EL_User.DiscountOfFlight / 10)
			DiscountHTML = EL_Common.Lang("Flight.Discount.d1", "您可享受{$Discount}折优惠")
			DiscountHTML = EL_Common.RegExpStaticLabel(DiscountHTML, "{$Discount}", EL_User.DiscountOfFlight)
		 End If
	  Else
	     d1 = 1
		 DiscountHTML = EL_Common.Lang("Flight.NoDiscount", "此航班机票不允许打折")
	  End If
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowBackDiscount}", DiscountHTML)
	  
	  Dim PriceList_Depart, PriceList_Back
	  PriceList_Depart = Label_PriceList(HTML, DepartFlightID, DepartTicketID, AdultNum, ChildNum, InfantNum, TotalPrice, d0)
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$PriceList_Depart}", PriceList_Depart)
	  If FlightType = 2 Then
	     PriceList_Back = Label_PriceList(HTML, BackFlightID, BackTicketID, AdultNum, ChildNum, InfantNum, TotalPrice, d1)
		 HTML = EL_Common.RegExpStaticLabel(HTML, "{$PriceList_Back}", PriceList_Back)
	  Else
	     HTML = EL_Common.RegExpStaticLabel(HTML, "{$PriceList_Back}", EL_Common.Lang("BaseConfig.PriceIcon", "&#xFFE5;") &"0")
	  End If
	  
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$TotalPrice}", TotalPrice)	  
	  
	  
	  HTML = EL_Common.RegExpStaticLabel(HTML, "{$Points}", EL_Common.ELClng(TotalPrice / ConsumeProportion))
	  
	  HTML = Label_InputAdult(HTML, AdultNum, "Adult")
	  HTML = Label_InputAdult(HTML, ChildNum, "Child")
	  HTML = Label_InputAdult(HTML, InfantNum, "Infant")	  
	  
	  
	  Response.Write HTML
   End Sub
   
   Private Function Label_PriceList(ByVal HTML, ByVal FlightID, ByVal TicketID, ByVal AdultNum, ByVal ChildNum, ByVal InfantNum, TotalPrice, Discount)
      Dim PriceCmd, ReturnString
	  Dim PriceAdult, PriceChild, PriceInfant, BunkerSurcharge, AirportTax
	  Dim BS_Adult, BS_Child, BS_Infant
	  Dim AT_Adult, AT_Child, AT_Infant
	  Call EL_Common.InitCommand(PriceCmd, "EL_SP_GetFlightTicketPrice")	    
	  With PriceCmd
	     .Parameters.Append .CreateParameter("RETURN", 2, 4)
		 .Parameters.Append .CreateParameter("@TicketID", 3, 1, 4, TicketID)
		 .Parameters.Append .CreateParameter("@FlightID", 3, 1, 4, FlightID)
		 .Parameters.Append .CreateParameter("@ChannelID", 3, 1, 4, ChannelID)
		 .Parameters.Append .CreateParameter("@PriceAdult", 6, 2, 8)
		 .Parameters.Append .CreateParameter("@PriceChild", 6, 2, 8)
		 .Parameters.Append .CreateParameter("@PriceInfant", 6, 2, 8)
		 .Parameters.Append .CreateParameter("@BunkerSurcharge", 200, 2, 30)
		 .Parameters.Append .CreateParameter("@AirportTax", 200, 2, 30)
		 .Execute()
	  End With
	  Select Case PriceCmd(0)
	     Case 40: 
		    Set PriceCmd = Nothing
			EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.ChannelError", "频道参数错误"))
			Exit Function
		 Case 42:
		    Set PriceCmd = Nothing
			EL_Common.ShowErrorMsg(EL_Common.Lang("User.Error15", "非法会员类型"))
			Exit Function
		 Case 41:
		    Set PriceCmd = Nothing
			EL_Common.ShowErrorMsg(EL_Common.Lang("Flight.Error11", "系统查询的机票信息有误"))
			Exit Function
	  End Select
	  PriceAdult = PriceCmd(4)
	  PriceChild = PriceCmd(5)
	  PriceInfant = PriceCmd(6)
	  BunkerSurcharge = PriceCmd(7)
	  AirportTax = PriceCmd(8)
	  Set PriceCmd = Nothing
	  
	  Dim arr
	  arr = EL_Common.ELSplit(BunkerSurcharge, ",")
	  BS_Adult = EL_Common.ELClng(arr(0))
	  BS_Child = EL_Common.ELClng(arr(1))
	  BS_Infant = EL_Common.ELClng(arr(2))
	  arr = EL_Common.ELSplit(AirportTax, ",")
	  AT_Adult = EL_Common.ELClng(arr(0))
	  AT_Child = EL_Common.ELClng(arr(1))
	  AT_Infant = EL_Common.ELClng(arr(2))
	  
	  Dim Total_Adult, Total_Child, Total_Infant, PriceIcon
	  Total_Adult = (PriceAdult * Discount + BS_Adult + AT_Adult) * AdultNum
	  Total_Child = (PriceChild * Discount + BS_Child + AT_Child) * ChildNum
	  Total_Infant = (PriceInfant * Discount + BS_Infant + AT_Infant) * InfantNum
	  TotalPrice = TotalPrice + Total_Adult + Total_Child + Total_Infant
	  PriceIcon = EL_Common.Lang("BaseConfig.PriceIcon", "&#xFFE5;")
	  ReturnString = "<ul style='list-style-type:none; margin-top:0px'>"
	  If AdultNum>0 Then
	     ReturnString = ReturnString &"<li>"& EL_Common.Lang("Flight.Adult", "成人") &" (<span style='width:25px;'>"& PriceAdult &"</span>"
		 If Discount <> 1 Then
		    ReturnString = ReturnString &" * <span style='width:15px;'>"& Discount &"</span>"
		 End If
		 ReturnString = ReturnString &" + <span style='width:15px;'>"& BS_Adult &"</span> + <span style='width:18px;'>"& AT_Adult &"</span>) * <span style='width:10px;'>"& AdultNum &"</span> = "& PriceIcon & Total_Adult &"</li>"
	  End If
	  If ChildNum>0 Then
	     ReturnString = ReturnString &"<li>"& EL_Common.Lang("Flight.Child", "儿童") &" (<span style='width:25px;'>"& PriceChild &"</span>"
		 If Discount <> 1 Then
		    ReturnString = ReturnString &" * <span style='width:15px;'>"& Discount &"</span>"
		 End If
		 ReturnString = ReturnString &" + <span style='width:15px;'>"& BS_Child &"</span> + <span style='width:18px;'>"& AT_Child &"</span>) * <span style='width:10px;'>"& ChildNum &"</span> = "& PriceIcon & Total_Child &"</li>"
	  End If
	  If InfantNum>0 Then
	     ReturnString = ReturnString &"<li>"& EL_Common.Lang("Flight.Infant", "婴儿") &" (<span style='width:25px;'>"& PriceInfant &"</span>"
		 If Discount <> 1 Then
		    ReturnString = ReturnString &" * <span style='width:15px;'>"& Discount &"</span>"
		 End If
		 ReturnString = ReturnString &" + <span style='width:15px;'>"& BS_Infant &"</span> + <span style='width:18px;'>"& AT_Infant &"</span>) * <span style='width:10px;'>"& InfantNum &"</span> = "& PriceIcon & Total_Infant &"</li>"
	  End If  
	  Set PriceCmd = Nothing
	  Label_PriceList = ReturnString
   End Function
   
   Private Function Label_InputAdult(ByVal HTML, ByVal Num, ByVal lType)
      Dim Match, Matches, ReturnString
	  Dim TempString, MatchString, i, LableName, IndexName
	  
	  Select Case lType
	     Case "Adult":
		    LableName = "InputAdult"
			IndexName = "Adult_Index"
		 Case "Child":
		    LableName = "InputChild"
			IndexName = "Child_Index"
		 Case "Infant":
		    LableName = "InputInfant"
			IndexName = "Infant_Index"
	  End Select
	  
	  CommonRegExp.Pattern = "\["& LableName &"\][\w\W]*\[\/"& LableName &"\]"        
      Set Matches = CommonRegExp.Execute(HTML)
	  ReturnString = HTML
	  EL_Flag = False
	  For Each Match in Matches
	     MatchString = Match.Value
		 MatchString = EL_Common.ReplaceText(MatchString, "\["& LableName &"\]", "")
		 MatchString = EL_Common.ReplaceText(MatchString, "\[\/"& LableName &"\]", "")
		 Dim ItemHTML
		 TempString = ""
		 For i = 1 To Num
		    ItemHTML = ""
			ItemHTML = EL_Common.RegExpStaticLabel(MatchString, "{$"& IndexName &"}", i)
			TempString = TempString & ItemHTML
		 Next
		 ReturnString = Replace(ReturnString, Match.Value, TempString)
	  Next
	  Label_InputAdult = ReturnString
   End Function
   

⌨️ 快捷键说明

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