<%@ LANGUAGE="VBSCRIPT" %> <% Option Explicit %> <% Response.Buffer = True %> <% Dim m_Member, m_lngMileage ' create a reference to the Member class of the ExAir dll component Set m_Member = Server.CreateObject("ExAir.Member") ' retrieve the mileage for the current user m_lngMileage = m_Member.GetMileage(Application("DSN"), Session("AccountID")) %> Book a Flight using Miles
Exploration Air Frequent Flyer logo
">Return to Exploration Air Home Page  ">EXPLORATION AIR HOME PAGE
Book a Flight using Miles
Return to Frequent Flyer Home Page  FREQUENT FLYER HOME PAGE


<% If Request.Form("FlyFrom") = "" Then %>
Flights may be booked no more than one year in advance

  Exploration Air Flight Wizard
I wish to:
Fly from:
Fly to:
Fly on this date:
Fly this class:
 

<% Else Dim fFormErr, strFormErr fFormErr = False Dim strFrom, strTo, strClass, strFlyDateDay, strFlyDateMonth strFrom = Request.Form("FlyFrom") strTo = Request.Form("FlyTo") strClass = Request.Form("FlyClass") strFlyDateDay = Request.Form("FlyDateDay") strFlyDateMonth = Request.Form("FlyDateMonth") If strFrom="" Or strTo="" Or strClass="" Or strFlyDateMonth="" Or strFlyDateDay="" Then fFormErr = True strFormErr = "You must enter all the form data." End If If strFrom = strTo Then fFormErr = True strFormErr = "Origin and destination of flight must be different." End If Dim iDate, iMonth, strMonth iDate = strFlyDateDay strMonth = strFlyDateMonth If iDate="" Then iDate=0 Select Case strMonth Case "January" iMonth = 1 Case "February" iMonth = 2 Case "March" iMonth = 3 Case "April" iMonth = 4 Case "May" iMonth = 5 Case "June" iMonth = 6 Case "July" iMonth = 7 Case "August" iMonth = 8 Case "September" iMonth = 9 Case "October" iMonth = 10 Case "November" iMonth = 11 Case "December" iMonth = 12 Case Else fFormErr = True strFormErr = "You have entered an in appropriate month. Please re-enter." End Select Select Case strMonth Case "January", "March", "May", "July", "August", "October", "December" If iDate > 31 Or iDate < 1 Then fFormErr = True strFormErr = "You must enter an appropriate day (1-31) for the month of " & strMonth End If Case "February" ' HACK! Does not handle leap years yet If iDate > 28 Or iDate < 1 Then fFormErr = True strFormErr = "You must enter an appropriate day (1-28) for the month of " & strMonth End If Case Else If iDate > 30 Or iDate < 1 Then fFormErr = True strFormErr = "You must enter an appropriate day (1-30) for the month of " & strMonth End If End Select Dim Flights, FlightMiles, FlightNumber Set Flights = Server.CreateObject("Flight.Schedule") FlightMiles = Flights.CostOfFlightInMiles(Application("DSN"), strFrom,strTo,strClass) FlightNumber = Flights.FlightNumber(Application("DSN"), strFrom, strTo) If IsNull(m_lngMileage) Then m_lngMileage = 0 If FlightMiles > m_lngMileage Then fFormErr = True strFormErr = "You have insufficient frequent flier miles to fly from " & strFrom & " to " & strTo & ".
" & _ "You need " & FormatNumber(FlightMiles,0) & " but only have " & FormatNumber(m_lngMileage,0) & "." End If If fFormErr Then Response.Redirect "BookFlightError.asp?ErrorString=" & Server.URLEncode(strFormErr) Else Dim CheckDate, FlightDate CheckDate = CDate(Year(Now) & "/" & iMonth & "/" & iDate) If CheckDate > Date Then FlightDate = CheckDate Else FlightDate = CDate(Year(Now)+1 & "/" & iMonth & "/" & iDate) End If Dim strQueryString strQueryString = "From=" & Server.URLEncode(strFrom) & "&" & _ "To=" & Server.URLEncode(strTo) & "&" & _ "AccountID=" & Session("AccountID") & "&" & _ "FlightNumber=" & FlightNumber & "&" & _ "FlightDate=" & FlightDate & "&" & _ "FlightMiles=" & FlightMiles & "&" & _ "MilesLeft=" & m_lngMileage - FlightMiles & "&" & _ "Class=" & Server.URLEncode(strClass) Response.Redirect "DoBookFlight.asp?" & strQueryString End If End If %>

©1997 Microsoft Corporation. All rights reserved. Terms of Use.

<% Response.Flush %> <% Sub GetCities Dim strDest, Flights, DSN, Dest DSN = Application("DSN") Set Flights=Server.CreateObject("Flight.Schedule") Set Dest = Flights.Destinations(DSN) Do While Not Dest.EOF strDest = Dest("CityName") Response.Write("