πŸš– Cleveland Hopkins Airport Transportation

Professional Ground Transportation β€’ 80+ Airports β€’ 75+ Cities Nationwide

πŸ“ž (216) 321-3000
🌐 airport-transportation.net
πŸ“§ reservations@chatp.com

Select Transportation Service

Choose your service type to begin your reservation

✈️
One-Way
Single trip to/from airport
πŸ”„
Round Trip
To airport & back home
πŸ“
Point to Point
Any location to location
🚐
Multi-City
Multiple destinations
πŸšͺ
4 Door
Complete travel package
🏠
One-Way Home
Airport to home
πŸ›©οΈ
Private Aviation
FBO & Executive Terminals
✈️
Flight Tracker
FREE - Track any flight
Staff & Partner Portals
πŸ“ž
Call Center
Phone reservations & support
πŸ“‘
Dispatch
Driver assignment & tracking
🀝
Partner Portal
Provider network management
πŸ‘€
Client Portal
Customer account & bookings
🚘
Driver Portal
Driver app & earnings
πŸŽ›οΈ
Admin Hub
Master command center
πŸ€–
AI Command
AI assistant & automation
🏠 Home
πŸ” Lookup:
1
Customer
2
Trip Details
3
Route & Map
4
Payment
5
Confirm
πŸ‘€
Customer Information
Step 1 of 5
πŸ›«
To Airport
Departure
πŸ›¬
From Airport
Arrival
πŸ”„
Round Trip
Both Ways
πŸ“
Point to Point
Local
πŸ™οΈ
Multi-City
City to City
πŸ”
John Smith
(216) 555-0123 β€’ customer@example.com
First name is required
Last name is required
Valid phone number required
MJ
Marcus Johnson
β˜… 4.9
πŸš— 1,247 trips
πŸ“ Available
πŸ’° Fare Summary
Base Fare $45.00
Distance (0.0 mi) $0.00
Airport Fee $5.00
Gratuity (0%) $0.00
Discount -$0.00
Total $50.00
Driver Earnings
$42.50
85% of fare
✈️
CHATP
Best Value
$50.00
Fixed rate
U
Uber
+ Surge
$67.00
L
Lyft
+ Prime
$74.00
Your Savings
$24
🌀️ Cleveland Weather
Updated 2:32 PM
🌫️
46Β°F
Mist
Wind
13 mph
Humidity
95%
Visibility
3 mi
✈️ CLE Airport: Good flying conditions
`; // Plain text fallback const plainMessage = ` ✈️ CHATP RESERVATION CONFIRMATION ============================== Confirmation #: ${reservation.id} Booking Date: ${new Date().toLocaleString()} CUSTOMER INFO: - Name: ${reservation.customer.firstName} ${reservation.customer.lastName} - Phone: ${reservation.customer.phone} - Email: ${reservation.customer.email} TRIP DETAILS: - Pickup Date: ${pickupDate} - Pickup Time: ${reservation.trip.time} - Passengers: ${reservation.trip.passengers} - Vehicle: ${reservation.trip.vehicleType} PICKUP LOCATION: ${pickupAddress} πŸ“ Google Maps: ${googleMapsLink} πŸ—ΊοΈ Waze: ${wazeLink} DESTINATION: - ${reservation.destination.airport} Airport PAYMENT: - Method: ${reservation.payment.method} - Total: $${reservation.payment.total} Special Instructions: ${reservation.specialInstructions || 'None'} ✈️ TRACK YOUR FLIGHT: ${flightAwareLink} STATUS: CONFIRMED βœ“ ━━━━━━━━━━━━━━━━━━━━ πŸ“ž Need changes? Call (216) 321-3000 Your driver will contact you 30 minutes before pickup. Thank you for choosing CHATP! www.chatp.com `; // Web3Forms - using JSON format const payload = { access_key: 'da6bd937-6a88-4e66-be7a-4d5e6d39113e', subject: `✈️ CHATP Booking Confirmed: ${reservation.id}`, from_name: 'CHATP Reservations', message: plainMessage }; fetch('https://api.web3forms.com/submit', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' }, body: JSON.stringify(payload) }) .then(res => res.json()) .then(data => { if(data.success) { console.log('βœ… Email sent successfully!', data); } else { console.log('❌ Email failed:', data); } }) .catch(err => { console.log('❌ Email error:', err); }); } function collectReservationData() { const total = state.baseFare + (state.distance * state.distanceRate) + state.airportFee; const gratuity = total * (state.gratuityPercent / 100); const grandTotal = total + gratuity - state.discount; return { tripType: state.tripType, customer: { firstName: document.getElementById('firstName')?.value || '', lastName: document.getElementById('lastName')?.value || '', phone: document.getElementById('phone')?.value || '', email: document.getElementById('email')?.value || '' }, trip: { date: document.getElementById('pickupDate')?.value || '', time: document.getElementById('pickupTime')?.value || '', passengers: document.getElementById('passengers')?.value || '1', vehicleType: document.getElementById('vehicleType')?.value || 'sedan' }, pickup: { street: document.getElementById('pickupStreet')?.value || '', city: document.getElementById('pickupCity')?.value || '', state: document.getElementById('pickupState')?.value || '', zip: document.getElementById('pickupZip')?.value || '' }, destination: { airport: document.getElementById('destinationAirport')?.value || 'CLE', terminal: document.getElementById('terminal')?.value || '', door: document.getElementById('door')?.value || '' }, payment: { method: state.selectedPaymentMethodNew, baseFare: state.baseFare, distanceFare: state.distance * state.distanceRate, airportFee: state.airportFee, gratuity: gratuity, discount: state.discount, total: grandTotal.toFixed(2) }, specialInstructions: document.getElementById('specialInstructions')?.value || '' }; } function showSuccessMessage(reservation) { // Hide the confirmation content and action buttons document.getElementById('confirmationContent').style.display = 'none'; document.getElementById('confirmActionButtons').style.display = 'none'; // Show success message const successMessage = document.getElementById('successMessage'); successMessage.style.display = 'block'; // Populate success details document.getElementById('successConfirmationNumber').textContent = reservation.id; document.getElementById('successName').textContent = reservation.customer.firstName + ' ' + reservation.customer.lastName; document.getElementById('successDateTime').textContent = reservation.trip.date + ' at ' + reservation.trip.time; const paymentLabels = { 'card': 'πŸ’³ Credit Card', 'wallet': 'πŸ“± Mobile Wallet', 'venmo': 'β“‹ Venmo', 'zelle': 'Z Zelle', 'cash': 'πŸ’΅ Cash' }; document.getElementById('successPayment').textContent = paymentLabels[reservation.payment.method] || 'Cash'; document.getElementById('successTotal').textContent = '$' + reservation.payment.total; } // ==================================================== // UTILITY FUNCTIONS // ==================================================== function showProcessingOverlay() { const overlay = document.createElement('div'); overlay.id = 'processingOverlay'; overlay.className = 'processing-overlay'; overlay.innerHTML = '
Processing your reservation...
'; document.body.appendChild(overlay); } function hideProcessingOverlay() { const overlay = document.getElementById('processingOverlay'); if (overlay) overlay.remove(); } function copyToClipboard(text, label) { navigator.clipboard.writeText(text).then(() => { alert(label + ' copied to clipboard!'); }).catch(() => { alert('Could not copy. Please copy manually: ' + text); }); } function formatCardNumber(input) { let value = input.value.replace(/\D/g, ''); let formatted = ''; for (let i = 0; i < value.length && i < 16; i++) { if (i > 0 && i % 4 === 0) formatted += ' '; formatted += value[i]; } input.value = formatted; } // ==================================================== // WHATSAPP INTEGRATION // ==================================================== function sendToWhatsApp() { // CHATP WhatsApp Business Number const chatpWhatsApp = '12163213000'; // (216) 321-3000 // Get reservation details const confNum = document.getElementById('successConfirmationNumber')?.textContent || document.getElementById('confirmationNumber')?.textContent || 'N/A'; const name = document.getElementById('successName')?.textContent || document.getElementById('confirmName')?.textContent || ''; const dateTime = document.getElementById('successDateTime')?.textContent || ''; const total = document.getElementById('successTotal')?.textContent || document.getElementById('confirmTotal')?.textContent || ''; const pickup = document.getElementById('confirmPickup')?.textContent || ''; const dropoff = document.getElementById('confirmDropoff')?.textContent || ''; const phone = document.getElementById('confirmPhone')?.textContent || ''; const vehicle = document.getElementById('confirmVehicle')?.textContent || ''; const payment = document.getElementById('successPayment')?.textContent || document.getElementById('confirmPaymentMethod')?.textContent || ''; // Get flight number if available const flightNumber = document.getElementById('flightNumber')?.value || ''; const flightLink = flightNumber ? `https://flightaware.com/live/flight/${flightNumber.replace(/\s+/g, '')}` : 'https://flightaware.com/live/airport/KCLE'; // Build maps links const pickupEncoded = encodeURIComponent(pickup); const googleMapsLink = `https://maps.google.com/?q=${pickupEncoded}`; const wazeLink = `https://waze.com/ul?q=${pickupEncoded}`; // Build the message with clickable links const message = `✈️ *CHATP RESERVATION CONFIRMED* ━━━━━━━━━━━━━━━━━━━━ πŸ“‹ *Confirmation #:* ${confNum} ━━━━━━━━━━━━━━━━━━━━ πŸ‘€ *Passenger:* ${name} πŸ“ž *Phone:* ${phone} πŸ“… *Pickup:* ${dateTime} πŸš— *Vehicle:* ${vehicle} ━━━━━━━━━━━━━━━━━━━━ πŸ“ *PICKUP ADDRESS:* ${pickup} πŸ—ΊοΈ *Open in Maps:* πŸ“ Google Maps: ${googleMapsLink} 🟣 Waze: ${wazeLink} ━━━━━━━━━━━━━━━━━━━━ πŸ“ *TO:* ${dropoff} πŸ’° *Total:* ${total} πŸ’³ *Payment:* ${payment} ━━━━━━━━━━━━━━━━━━━━ ✈️ *TRACK YOUR FLIGHT:* ${flightLink} ━━━━━━━━━━━━━━━━━━━━ 🚘 Your driver will contact you 30 minutes before pickup. πŸ“ž *Need changes?* Call/Text: (216) 321-3000 Tap to call: tel:+12163213000 ━━━━━━━━━━━━━━━━━━━━ Thank you for choosing CHATP! www.chatp.com`; // URL encode the message const encodedMessage = encodeURIComponent(message); // Create WhatsApp link - opens chat with CHATP number and pre-filled message const whatsappUrl = `https://wa.me/${chatpWhatsApp}?text=${encodedMessage}`; // Open WhatsApp window.open(whatsappUrl, '_blank'); } // SMS Text Message Function function sendSMSConfirmation() { // Get reservation details const confNum = document.getElementById('successConfirmationNumber')?.textContent || document.getElementById('confirmationNumber')?.textContent || 'N/A'; const name = document.getElementById('successName')?.textContent || document.getElementById('confirmName')?.textContent || ''; const dateTime = document.getElementById('successDateTime')?.textContent || ''; const pickup = document.getElementById('confirmPickup')?.textContent || ''; const total = document.getElementById('successTotal')?.textContent || ''; // Get flight number if available const flightNumber = document.getElementById('flightNumber')?.value || ''; const flightLink = flightNumber ? `flightaware.com/live/flight/${flightNumber.replace(/\s+/g, '')}` : 'flightaware.com/live/airport/KCLE'; // Build maps link const pickupEncoded = encodeURIComponent(pickup); const mapsLink = `maps.google.com/?q=${pickupEncoded}`; // Build SMS message (shorter for text limits) const smsMessage = `CHATP CONFIRMED βœ“ #${confNum} ${name} ${dateTime} ${pickup} Total: ${total} πŸ“ Maps: ${mapsLink} ✈️ Flight: ${flightLink} Call: (216) 321-3000 Driver contacts you 30min before pickup.`; // Open SMS app with pre-filled message const customerPhone = document.getElementById('phone')?.value || ''; if (customerPhone) { const smsUrl = `sms:${customerPhone}?body=${encodeURIComponent(smsMessage)}`; window.open(smsUrl, '_blank'); } return smsMessage; } function openPickupInMaps() { const pickup = document.getElementById('confirmPickup')?.textContent || document.getElementById('printPickup')?.textContent || ''; if (pickup) { const encoded = encodeURIComponent(pickup); window.open(`https://www.google.com/maps/search/?api=1&query=${encoded}`, '_blank'); } else { alert('Pickup address not found'); } } function openPickupInWaze() { const pickup = document.getElementById('confirmPickup')?.textContent || document.getElementById('printPickup')?.textContent || ''; if (pickup) { const encoded = encodeURIComponent(pickup); window.open(`https://waze.com/ul?q=${encoded}`, '_blank'); } else { alert('Pickup address not found'); } } function bookAnother() { // Reset the form document.getElementById('confirmationContent').style.display = 'block'; document.getElementById('confirmActionButtons').style.display = 'flex'; document.getElementById('successMessage').style.display = 'none'; document.getElementById('termsAccept').checked = false; // Keep customer info but clear trip details goToStep(1); // Clear trip-specific fields document.getElementById('pickupDate').value = new Date().toISOString().split('T')[0]; document.getElementById('pickupTime').value = ''; // Scroll to top window.scrollTo({ top: 0, behavior: 'smooth' }); } function printConfirmation() { // Populate the print-only version with current data const setValue = (id, value) => { const el = document.getElementById(id); if (el) el.textContent = value || 'β€”'; }; // Get values from confirmation page setValue('printConfNum', document.getElementById('confirmationNumber')?.textContent || document.getElementById('successConfirmationNumber')?.textContent); setValue('printName', document.getElementById('confirmName')?.textContent); setValue('printPhone', document.getElementById('confirmPhone')?.textContent); setValue('printEmail', document.getElementById('confirmEmail')?.textContent); setValue('printService', document.getElementById('confirmTripType')?.textContent); setValue('printDate', document.getElementById('confirmDate')?.textContent); setValue('printTime', document.getElementById('confirmTime')?.textContent); setValue('printPassengers', document.getElementById('confirmPassengers')?.textContent); setValue('printVehicle', document.getElementById('confirmVehicle')?.textContent); setValue('printPickup', document.getElementById('confirmPickup')?.textContent); setValue('printDropoff', document.getElementById('confirmDropoff')?.textContent); setValue('printBaseFare', document.getElementById('confirmBaseFare')?.textContent); setValue('printDistanceFare', document.getElementById('confirmDistanceFare')?.textContent); setValue('printAirportFee', document.getElementById('confirmAirportFee')?.textContent); setValue('printGratuity', document.getElementById('confirmGratuity')?.textContent); setValue('printTotal', document.getElementById('confirmTotal')?.textContent || document.getElementById('successTotal')?.textContent); setValue('printPaymentMethod', document.getElementById('confirmPaymentMethod')?.textContent); setValue('printInstructions', document.getElementById('confirmInstructions')?.textContent); // Trigger print window.print(); } // ==================================================== // MANAGE RESERVATION MODAL FUNCTIONS // ==================================================== // Store looked up reservation data let currentManagedReservation = null; function showManageModal() { const modal = document.getElementById('manageModal'); if (modal) { modal.style.display = 'flex'; // Reset to lookup form document.getElementById('manageLookupForm').style.display = 'block'; document.getElementById('manageDetails').style.display = 'none'; // Clear inputs document.getElementById('manageConfNum').value = ''; document.getElementById('managePhone').value = ''; } } function hideManageModal() { const modal = document.getElementById('manageModal'); if (modal) { modal.style.display = 'none'; } currentManagedReservation = null; } function lookupReservation() { const confNum = document.getElementById('manageConfNum')?.value?.trim().toUpperCase() || ''; const phone = document.getElementById('managePhone')?.value || ''; // Validation if (!confNum || confNum.length < 5) { alert('Please enter your confirmation number.'); document.getElementById('manageConfNum')?.focus(); return; } if (!phone || phone.replace(/\D/g, '').length < 10) { alert('Please enter a valid 10-digit phone number.'); document.getElementById('managePhone')?.focus(); return; } // Simulate API lookup - in production this would call your backend // For demo, we'll simulate finding a reservation simulateReservationLookup(confNum, phone); } function simulateReservationLookup(confNum, phone) { // Show loading state const lookupForm = document.getElementById('manageLookupForm'); const originalContent = lookupForm.innerHTML; lookupForm.innerHTML = `
⏳
Looking up your reservation...
`; // Simulate API delay setTimeout(function() { // For demo purposes, create sample reservation data // In production, this would come from your database currentManagedReservation = { confirmationNumber: confNum, phone: phone, service: 'Airport Pickup', date: 'January 15, 2026', time: '2:30 PM', passengers: '2 Adults', vehicle: 'Executive Sedan', pickup: 'Cleveland Hopkins International Airport (CLE)', dropoff: '123 Main Street, Cleveland, OH 44114', total: '$65.00', payment: 'Cash' }; // Populate the details view document.getElementById('manageFoundConfNum').textContent = confNum; document.getElementById('manageService').textContent = currentManagedReservation.service; document.getElementById('manageDate').textContent = currentManagedReservation.date; document.getElementById('manageTime').textContent = currentManagedReservation.time; document.getElementById('managePassengers').textContent = currentManagedReservation.passengers; document.getElementById('manageVehicle').textContent = currentManagedReservation.vehicle; document.getElementById('managePickup').textContent = currentManagedReservation.pickup; document.getElementById('manageDropoff').textContent = currentManagedReservation.dropoff; document.getElementById('manageTotal').textContent = currentManagedReservation.total; document.getElementById('managePayment').textContent = currentManagedReservation.payment; // Restore lookup form content (hidden) lookupForm.innerHTML = originalContent; // Show details, hide lookup lookupForm.style.display = 'none'; document.getElementById('manageDetails').style.display = 'block'; }, 1500); } function backToLookup() { document.getElementById('manageLookupForm').style.display = 'block'; document.getElementById('manageDetails').style.display = 'none'; currentManagedReservation = null; } function editReservation() { if (!currentManagedReservation) return; // Close manage modal hideManageModal(); // Go to step 1 and pre-fill data // In production, you would populate all form fields with the reservation data goToStep(1); // Show notification alert('You can now edit your reservation details. Make your changes and click "Confirm Reservation" to update.'); } function cancelFromManage() { if (!currentManagedReservation) return; // Close manage modal and open cancel modal with pre-filled data hideManageModal(); const cancelModal = document.getElementById('cancelModal'); if (cancelModal) { cancelModal.style.display = 'flex'; // Pre-fill with managed reservation data const cancelPhone = document.getElementById('cancelPhone'); const cancelConf = document.getElementById('cancelConfirmation'); if (cancelPhone) cancelPhone.value = currentManagedReservation.phone; if (cancelConf) cancelConf.value = currentManagedReservation.confirmationNumber; } } // Close manage modal on escape key document.addEventListener('keydown', function(e) { if (e.key === 'Escape') { hideManageModal(); } }); // Close manage modal on outside click document.getElementById('manageModal')?.addEventListener('click', function(e) { if (e.target === this) { hideManageModal(); } }); // ==================================================== // CANCELLATION MODAL FUNCTIONS // ==================================================== function showCancelModal() { const modal = document.getElementById('cancelModal'); if (modal) { modal.style.display = 'flex'; // Pre-fill phone if available const phone = document.getElementById('confirmPhone')?.textContent || ''; const cancelPhone = document.getElementById('cancelPhone'); if (cancelPhone && phone && phone !== 'β€”') { cancelPhone.value = phone; } // Pre-fill confirmation number if available const confNum = document.getElementById('confirmationNumber')?.textContent || ''; const cancelConf = document.getElementById('cancelConfirmation'); if (cancelConf && confNum && confNum !== 'β€”') { cancelConf.value = confNum; } } } function hideCancelModal() { const modal = document.getElementById('cancelModal'); if (modal) { modal.style.display = 'none'; } } function formatPhoneNumber(input) { let value = input.value.replace(/\D/g, ''); if (value.length > 0) { if (value.length <= 3) { value = '(' + value; } else if (value.length <= 6) { value = '(' + value.slice(0, 3) + ') ' + value.slice(3); } else { value = '(' + value.slice(0, 3) + ') ' + value.slice(3, 6) + '-' + value.slice(6, 10); } } input.value = value; } function processCancellation() { const phone = document.getElementById('cancelPhone')?.value || ''; const confNum = document.getElementById('cancelConfirmation')?.value || ''; // Validation if (!phone || phone.replace(/\D/g, '').length < 10) { alert('Please enter a valid 10-digit phone number.'); document.getElementById('cancelPhone')?.focus(); return; } if (!confNum || confNum.length < 5) { alert('Please enter your confirmation number.'); document.getElementById('cancelConfirmation')?.focus(); return; } // Show processing const modal = document.getElementById('cancelModal'); if (modal) { modal.querySelector('div > div').innerHTML = `
⏳
Processing Cancellation
Please wait while we verify your information
`; } // Simulate API call setTimeout(function() { // Show success if (modal) { modal.querySelector('div > div').innerHTML = `
Cancellation Complete
βœ“
Reservation Cancelled
Your reservation has been successfully cancelled
Confirmation Details
Phone ${phone}
Cancellation # ${confNum}
A confirmation text has been sent to your phone number
`; } }, 2000); } function closeCancelAndReset() { hideCancelModal(); // Reset the form and go to step 1 goToStep(1); // Reset confirmation section const confSection = document.getElementById('confirmationIdSection'); if (confSection) confSection.style.display = 'none'; // Scroll to top window.scrollTo({ top: 0, behavior: 'smooth' }); } // Close modal on escape key document.addEventListener('keydown', function(e) { if (e.key === 'Escape') { hideCancelModal(); } }); // Close modal on outside click document.getElementById('cancelModal')?.addEventListener('click', function(e) { if (e.target === this) { hideCancelModal(); } }); function copyLastTrip() { const lastReservations = JSON.parse(localStorage.getItem('chatp_reservations') || '[]'); if (lastReservations.length > 0) { const last = lastReservations[lastReservations.length - 1]; // Populate customer info if (last.customer) { document.getElementById('firstName').value = last.customer.firstName || ''; document.getElementById('lastName').value = last.customer.lastName || ''; document.getElementById('phone').value = last.customer.phone || ''; document.getElementById('email').value = last.customer.email || ''; } // Populate pickup address if (last.pickup) { document.getElementById('pickupStreet').value = last.pickup.street || ''; document.getElementById('pickupCity').value = last.pickup.city || ''; document.getElementById('pickupState').value = last.pickup.state || ''; document.getElementById('pickupZip').value = last.pickup.zip || ''; } alert('Previous trip info loaded!'); } else { alert('No previous trips found.'); } } function todayTemplate() { console.log('todayTemplate called'); const pickupDate = document.getElementById('pickupDate'); if (pickupDate) { const today = new Date().toISOString().split('T')[0]; pickupDate.value = today; console.log('Set pickupDate to:', today); // Also trigger any change events pickupDate.dispatchEvent(new Event('change')); // Show confirmation alert('Date set to today: ' + today); } else { console.error('pickupDate element not found'); alert('Could not find pickup date field. Make sure you are on Step 2.'); } } function saveTemplate() { const template = collectReservationData(); localStorage.setItem('chatp_template', JSON.stringify(template)); alert('Template saved!'); } function initiateApplePay() { alert('Apple Pay integration coming soon!'); } function initiateGooglePay() { alert('Google Pay integration coming soon!'); } // ==================================================== // MISSING UTILITY FUNCTIONS // ==================================================== function showDatabaseSchema() { alert('Database Schema view - Coming soon!'); } function hideSchema() { // Hide schema section if exists const schemaSection = document.getElementById('schemaSection'); if (schemaSection) schemaSection.style.display = 'none'; } function printPreview() { window.print(); } function selectCustomer(customerId) { console.log('Customer selected:', customerId); // Would populate customer fields from database } function trackFlight() { const flightNumber = document.getElementById('flightNumber')?.value || ''; if (flightNumber) { openFlightTracker(flightNumber); } else { openFlightTracker(); } } function openFlightTracker(prefillFlight = '') { // Create modal if it doesn't exist if (!document.getElementById('flightTrackerModal')) { const modal = document.createElement('div'); modal.id = 'flightTrackerModal'; modal.innerHTML = `
CHATP
Cleveland Hopkins Airport Transportation Partners
✈️
Flight Tracker
Real-time status β€’ Gate info β€’ Delays
Quick:
Airlines at Cleveland Hopkins (CLE)
CHATP
Cleveland Hopkins Airport Transportation Partners
Flight data by FlightAware
(216) 321-3000
`; document.body.appendChild(modal); } document.getElementById('flightTrackerModal').style.display = 'block'; document.getElementById('trackerFlightInput').value = prefillFlight; if (prefillFlight) { document.getElementById('trackerFlightInput').focus(); } } function closeFlightTracker() { const modal = document.getElementById('flightTrackerModal'); if (modal) modal.style.display = 'none'; } function searchFlight() { const flightInput = document.getElementById('trackerFlightInput').value.trim().toUpperCase().replace(/\s+/g, ''); if (!flightInput) { alert('Please enter a flight number'); return; } // Extract airline code and flight number const match = flightInput.match(/([A-Z]{2})(\d+)/); if (match) { const airline = match[1]; const flightNum = match[2]; const flightAwareUrl = `https://flightaware.com/live/flight/${airline}${flightNum}`; window.open(flightAwareUrl, '_blank'); // Show loading state document.getElementById('flightResults').style.display = 'block'; document.getElementById('flightResultsContent').innerHTML = `
✈️
Opening FlightAware...
Flight ${airline} ${flightNum}
`; } else { alert('Please enter a valid flight number (e.g., AA 1234)'); } } // Close modal on escape key document.addEventListener('keydown', function(e) { if (e.key === 'Escape') closeFlightTracker(); }); function selectTSAOption(option) { state.tsaProgram = option; document.querySelectorAll('.tsa-option').forEach(opt => opt.classList.remove('active')); event.target.closest('.tsa-option')?.classList.add('active'); } function setDestinationCity(city, stateCode, distance) { const destCity = document.getElementById('destinationCity'); const destState = document.getElementById('destinationState'); if (destCity) destCity.value = city; if (destState) destState.value = stateCode; state.distance = distance; updateFare(); } function addStop() { alert('Multi-stop functionality coming soon!'); } function switchTab(tabName) { document.querySelectorAll('.tab-button').forEach(btn => btn.classList.remove('active')); document.querySelectorAll('.tab-content').forEach(content => content.classList.remove('active')); event.target.classList.add('active'); const tabContent = document.getElementById(tabName + '-tab'); if (tabContent) tabContent.classList.add('active'); } function selectPaymentMethod(method) { // Legacy function - redirect to new payment method selectPaymentMethodNew(method === 'stripe' ? 'card' : method); } function applyPromo() { const promoCode = document.getElementById('promoCode')?.value || ''; if (promoCode.toUpperCase() === 'CHATP10') { state.discount = state.baseFare * 0.1; alert('Promo code applied! 10% discount.'); updateFare(); } else if (promoCode) { alert('Invalid promo code.'); } } function switchSchemaTab(tabName) { document.querySelectorAll('.tab-button').forEach(btn => btn.classList.remove('active')); document.querySelectorAll('.tab-content').forEach(content => content.style.display = 'none'); const tabContent = document.getElementById(tabName + '-schema'); if (tabContent) tabContent.style.display = 'block'; } // ==================================================== // FORM EVENT HANDLERS // ==================================================== function searchCustomers(query) { const resultsContainer = document.getElementById('customerResults'); if (!resultsContainer) return; if (query.length < 2) { resultsContainer.style.display = 'none'; return; } // Filter customers (mock implementation) const filtered = customers.filter(c => (c.firstName + ' ' + c.lastName + ' ' + c.phone + ' ' + c.email) .toLowerCase().includes(query.toLowerCase()) ); if (filtered.length > 0) { resultsContainer.innerHTML = filtered.map(c => `
${c.firstName} ${c.lastName} - ${c.phone}
` ).join(''); resultsContainer.style.display = 'block'; } else { resultsContainer.style.display = 'none'; } } function updateCustomerType() { const type = document.getElementById('customerType')?.value; const corporateFields = document.getElementById('corporateFields'); if (corporateFields) { corporateFields.style.display = (type === 'corporate') ? 'block' : 'none'; } state.customerType = type; } // OpenWeatherMap API Integration const WEATHER_API_KEY = '0050f0254ffaf152759ca19d0f3d242e'; const CLEVELAND_LAT = 41.4993; const CLEVELAND_LON = -81.6944; function updateWeather() { fetchLiveWeather(); } async function fetchLiveWeather() { try { const url = `https://api.openweathermap.org/data/2.5/weather?lat=${CLEVELAND_LAT}&lon=${CLEVELAND_LON}&appid=${WEATHER_API_KEY}&units=imperial`; const response = await fetch(url); const data = await response.json(); if (data && data.main) { // Update temperature const temp = Math.round(data.main.temp); document.getElementById('weatherTemp').textContent = `${temp}Β°F`; // Update description const desc = data.weather[0]?.description || 'Clear'; document.getElementById('weatherDesc').textContent = desc.charAt(0).toUpperCase() + desc.slice(1); // Update icon based on weather condition const weatherIcon = getWeatherEmoji(data.weather[0]?.id, data.weather[0]?.icon); document.getElementById('weatherIcon').textContent = weatherIcon; // Update wind, humidity, visibility const windSpeed = Math.round(data.wind?.speed || 0); document.getElementById('weatherWind').textContent = `${windSpeed} mph`; const humidity = data.main.humidity || 0; document.getElementById('weatherHumidity').textContent = `${humidity}%`; const visibility = data.visibility ? Math.round(data.visibility / 1609.34) : 10; // Convert meters to miles document.getElementById('weatherVisibility').textContent = `${visibility} mi`; // Update timestamp const now = new Date(); document.getElementById('weatherTime').textContent = `Updated ${now.toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit' })}`; // Update flight conditions updateFlightConditions(visibility, windSpeed, data.weather[0]?.id); } } catch (error) { console.log('Weather fetch error:', error); document.getElementById('weatherDesc').textContent = 'Unable to load'; } } function getWeatherEmoji(conditionId, iconCode) { const isNight = iconCode?.includes('n'); if (conditionId >= 200 && conditionId < 300) return 'β›ˆοΈ'; // Thunderstorm if (conditionId >= 300 && conditionId < 400) return '🌧️'; // Drizzle if (conditionId >= 500 && conditionId < 600) return '🌧️'; // Rain if (conditionId >= 600 && conditionId < 700) return '❄️'; // Snow if (conditionId >= 700 && conditionId < 800) return '🌫️'; // Fog/Mist if (conditionId === 800) return isNight ? 'πŸŒ™' : 'β˜€οΈ'; // Clear if (conditionId > 800) return isNight ? '☁️' : 'β›…'; // Clouds return '🌀️'; } function updateFlightConditions(visibility, windSpeed, conditionId) { const flightStatus = document.querySelector('[id="weatherWidget"]')?.parentElement?.querySelector('div:last-child') || document.querySelector('.weather-flight-status'); let status = '✈️ CLE Airport: '; let condition = 'Good flying conditions'; if (visibility < 1 || windSpeed > 35 || (conditionId >= 200 && conditionId < 300)) { condition = '⚠️ Delays possible - Check flight status'; } else if (visibility < 3 || windSpeed > 25 || conditionId >= 600 && conditionId < 700) { condition = 'Minor delays possible'; } else if (visibility >= 5 && windSpeed < 20) { condition = 'Excellent flying conditions'; } // Update the flight status element const flightDiv = document.querySelector('div[style*="margin-top: 10px"][style*="text-align: center"]'); if (flightDiv && flightDiv.textContent.includes('CLE Airport')) { flightDiv.innerHTML = `✈️ CLE Airport: ${condition}`; } } // Fetch weather on load and refresh every 10 minutes document.addEventListener('DOMContentLoaded', function() { fetchLiveWeather(); setInterval(fetchLiveWeather, 600000); // 10 minutes }); function updateAirlineInfo() { const airline = document.getElementById('airline')?.value; // Could update terminal suggestions based on airline console.log('Airline selected:', airline); } function formatFlightNumber(input) { let value = input.value.toUpperCase().replace(/[^A-Z0-9]/g, ''); if (value.length > 2 && !value.includes(' ')) { value = value.slice(0, 2) + ' ' + value.slice(2); } input.value = value.slice(0, 8); } function updateRoute() { // Calculate and display route info const pickupZip = document.getElementById('pickupZip')?.value; const destAirport = document.getElementById('destinationAirport')?.value; // Mock distance calculation const distances = { 'CLE': { '44114': 12, '44115': 14, '44120': 18, '44107': 15, '44122': 22 }, 'CAK': { '44114': 55, '44115': 53, '44120': 48, '44107': 58, '44122': 45 } }; let distance = 15; // Default if (destAirport && pickupZip && distances[destAirport]) { distance = distances[destAirport][pickupZip] || 15; } state.distance = distance; updateFare(); // Update route display const routeDistance = document.getElementById('routeDistance'); const routeDuration = document.getElementById('routeDuration'); if (routeDistance) routeDistance.textContent = distance + ' mi'; if (routeDuration) routeDuration.textContent = Math.round(distance * 2) + ' min'; } function lookupZip(zipCode, type) { // Mock ZIP code lookup const zipData = { '44114': { city: 'Cleveland', state: 'OH' }, '44115': { city: 'Cleveland', state: 'OH' }, '44120': { city: 'Shaker Heights', state: 'OH' }, '44107': { city: 'Lakewood', state: 'OH' }, '44122': { city: 'Beachwood', state: 'OH' }, '44135': { city: 'Cleveland', state: 'OH' } }; const data = zipData[zipCode]; if (data) { if (type === 'pickup') { const cityEl = document.getElementById('pickupCity'); const stateEl = document.getElementById('pickupState'); if (cityEl) cityEl.value = data.city; if (stateEl) stateEl.value = data.state; } } updateRoute(); } function updateAirportDetails() { const airport = document.getElementById('destinationAirport')?.value; // Update terminal options based on airport console.log('Airport selected:', airport); updateRoute(); } function updateReturnTripDisplay() { const returnPickup = document.getElementById('returnPickupDisplay'); const returnDest = document.getElementById('returnDestDisplay'); const destAirport = document.getElementById('destinationAirport')?.value || 'CLE'; const pickupCity = document.getElementById('pickupCity')?.value || 'Cleveland'; if (returnPickup) returnPickup.textContent = destAirport + ' Airport'; if (returnDest) returnDest.textContent = pickupCity; } function toggleMultiCityReturn() { const checkbox = document.getElementById('multiCityReturn'); const fareDisplay = document.getElementById('multiCityFare'); if (checkbox && checkbox.checked && fareDisplay) { fareDisplay.style.display = 'block'; } else if (fareDisplay) { fareDisplay.style.display = 'none'; } } // ==================================================== // KEYBOARD SHORTCUTS // ==================================================== document.addEventListener('keydown', function(e) { if (e.ctrlKey || e.metaKey) { switch(e.key) { case 's': e.preventDefault(); saveTemplate(); break; case 'p': e.preventDefault(); printConfirmation(); break; case '1': case '2': case '3': case '4': case '5': e.preventDefault(); goToStep(parseInt(e.key)); break; } } }); // ==================================================== // INITIALIZATION // ==================================================== document.addEventListener('DOMContentLoaded', function() { console.log('DOMContentLoaded fired'); // Set today's date as default const today = new Date().toISOString().split('T')[0]; const pickupDateField = document.getElementById('pickupDate'); if (pickupDateField) pickupDateField.value = today; // Initialize fare updateFare(); // Initialize payment method selectPaymentMethodNew('cash'); // Make sure step 1 is visible and update progress state.currentStep = 1; updateProgress(); // Ensure step 1 is shown const step1 = document.getElementById('step1'); if (step1) { step1.style.display = 'block'; console.log('Step 1 initialized'); } console.log('Initialization complete'); // Initialize login UI updateLoginUI(); // Add event listeners for header buttons document.getElementById('loginBtn').addEventListener('click', function() { if (typeof showLoginModal === 'function') showLoginModal(); }); document.getElementById('manageBtn').addEventListener('click', function() { if (typeof showManageModal === 'function') showManageModal(); }); document.getElementById('printBtn').addEventListener('click', function() { if (typeof printPreview === 'function') printPreview(); }); }); // Backup initialization in case DOMContentLoaded already fired if (document.readyState === 'complete' || document.readyState === 'interactive') { setTimeout(function() { const step1 = document.getElementById('step1'); if (step1 && step1.style.display === 'none') { step1.style.display = 'block'; console.log('Backup: Step 1 shown'); } if (typeof updateLoginUI === 'function') updateLoginUI(); }, 100); } // ========== SERVICE SELECTION NAVIGATION ========== function showServiceSelection() { document.getElementById('serviceSelectionPage').style.display = 'block'; document.getElementById('reservationFormPage').style.display = 'none'; window.scrollTo(0, 0); } function openReservationForm(serviceType) { document.getElementById('serviceSelectionPage').style.display = 'none'; document.getElementById('reservationFormPage').style.display = 'block'; window.scrollTo(0, 0); // Set service type if the function exists if (typeof setServiceType === 'function') { setServiceType(serviceType); } console.log('Opening reservation form for:', serviceType); } function openPortal(portalType) { if (portalType === 'dispatch') { // Try to open dispatch file - user needs both files uploaded to Netlify window.location.href = 'CHATP_ATC_Dispatch_Command_Center.html'; } else if (portalType === 'driver') { window.location.href = 'CHATP_Driver_App.html'; } else if (portalType === 'client') { window.location.href = 'CHATP_Rider_App.html'; } else if (portalType === 'admin') { window.location.href = 'CHATP_Admin_Command_Hub.html'; } else if (portalType === 'ai') { window.location.href = 'CHATP_AI_Command_Center.html'; } else if (portalType === 'tracker') { window.location.href = 'CHATP_Flight_Tracker.html'; } else { alert('Portal: ' + portalType); } } // ========== EXPOSE ALL FUNCTIONS TO GLOBAL SCOPE ========== window.nextStep = nextStep; window.prevStep = prevStep; window.goToStep = goToStep; window.selectTripType = typeof selectTripType !== 'undefined' ? selectTripType : function(){}; window.selectTSAOption = typeof selectTSAOption !== 'undefined' ? selectTSAOption : function(){}; window.setGratuity = typeof setGratuity !== 'undefined' ? setGratuity : function(){}; window.selectPaymentMethodNew = typeof selectPaymentMethodNew !== 'undefined' ? selectPaymentMethodNew : function(){}; window.showServiceSelection = showServiceSelection; window.openReservationForm = openReservationForm; window.openPortal = openPortal; window.updateFare = typeof updateFare !== 'undefined' ? updateFare : function(){}; window.lookupZip = typeof lookupZip !== 'undefined' ? lookupZip : function(){}; window.searchCustomers = typeof searchCustomers !== 'undefined' ? searchCustomers : function(){}; console.log('CHATP v2026-01-08-1145 - All functions loaded');
v2026-01-08-1145

πŸ’¬ Your Feedback

⭐⭐⭐⭐⭐
βœ…

Thank You!

Your feedback has been received. We appreciate you taking the time to help us improve!