Miles Dashboard
Suggested Agent Greeting (All Calls are Recorded):
"Thank you for calling United Taxi Services. For quality and insurance purposes, this call is recorded. My name is [Agent Name], how may I assist you today?"
Miles Dashboard
Suggested Agent Greeting (All Calls are Recorded):
"Thank you for calling United Taxi Services. For quality and insurance purposes, this call is recorded. My name is [Agent Name], how may I assist you today?"
Agent Dashboard
Agent Details | |
---|---|
Agent Name | N/A |
Phone Number | N/A |
Location | N/A |
N/A | |
Customer Details | |
Customer Name | N/A |
Extra Money | |
Extra Money Added | $0.00 |
Trip Breakdown | |
Booking Fee | 5.50 |
Miles Selected | 0 |
Mileage Charge (@ $2.75/mile up to 14 miles, $1.75/mile thereafter) | 0.00 |
Extra Money | $0.00 |
Tax (6.75%) | 6.75% of Subtotal |
Total Amount | $0.00 |
Driver's Share (40%) | $0.00 |
Total Driver Earnings | $0.00 |
Financial Summary
`; let afterPayHTML = ""; // Summaries: if (miles <= 19) { financialHTML += `Local Run (1-19 miles): $34.00 (Flat Rate)
`; } else if (miles <= 50) { financialHTML += `Booking Fee: $${bookingFee.toFixed(2)}
`; financialHTML += `Mileage Charge: $${mileageCost.toFixed(2)} (${miles} mi @ $1.55/mi)
`; } else { financialHTML += `Booking Fee: $${bookingFee.toFixed(2)}
`; financialHTML += `Mileage Charge: $${mileageCost.toFixed(2)} (${miles} mi @ $1.55/mi)
`; } if (miles > 19) { if (hourCost > 0) { financialHTML += `Hour Charge: $${hourCost.toFixed(2)}
`; } if (minuteCost > 0) { financialHTML += `Minute Charge: $${minuteCost.toFixed(2)}
`; } } if (waitCost > 0) { financialHTML += `Wait Cost: $${waitCost.toFixed(2)}
`; } if (passengerCost > 0) { financialHTML += `Extra Passenger Charge: $${passengerCost.toFixed(2)}
`; } if (extraStopCost > 0) { financialHTML += `Extra Stops: $${extraStopCost.toFixed(2)}
`; } if (isRoundTrip) { financialHTML += `Round Trip => Double One-Way Price
`; } if (discountValue === "applyDiscount") { financialHTML += `10% Discount Applied
`; } // After Pay breakdown if (afterPayChoice && afterPayChoice.value === "yes" && finalTotal > 0) { const dueToday = finalTotal * 0.25; financialHTML += `After Pay Chosen
`; if (miles <= 19) { financialHTML += `Local Run Sales Tax (6.75%): $${localTax.toFixed(2)}
`; } else { financialHTML += `Transaction Fee (3.3% + $0.30): $${transactionFee.toFixed(2)}
`; } financialHTML += `Due Today (25%): $${dueToday.toFixed(2)}
`; afterPayHTML = getAfterPayBreakdown(finalTotal); } else { // Normal final total if (miles <= 19) { financialHTML += `Local Run Sales Tax (6.75%): $${localTax.toFixed(2)}
`; financialHTML += `Total Cost (No Transaction Fee): $${finalTotal.toFixed(2)}
`; } else { financialHTML += `Transaction Fee (3.3% + $0.30): $${transactionFee.toFixed(2)}
`; financialHTML += `Total Cost: $${finalTotal.toFixed(2)}
`; } } if (afterPayHTML) { financialHTML += afterPayHTML; } if (finalTotal > 50) { financialHTML += `Disclaimer: This total is over $50. You can offer a 10% discount OR set up After Pay if the customer requests it.
`; } document.getElementById('financialSummaryContent').innerHTML = financialHTML; // Driver summary const finalDriverEarnings = finalTotal * driverPercentage; let driverHTML = `Driver's Summary (Internal Use Only)
Driver's Percentage: ${(driverPercentage * 100).toFixed(0)}%
Driver's Total Earnings: $${finalDriverEarnings.toFixed(2)}
${isRoundTrip ? `Each Trip Earning (If Round Trip): $${(finalDriverEarnings / 2).toFixed(2)}
` : ``}Reminder: Never share the full total with the driver, only their portion!
`; document.getElementById('driverSummaryContent').innerHTML = driverHTML; } /* ========== [6] Send Email on Submit (mailto:) ========== */ function sendEmail(event) { event.preventDefault(); const summary = document.getElementById('summaryContent').innerText; const financialSummary = document.getElementById('financialSummaryContent').innerText; const driverSummary = document.getElementById('driverSummaryContent').innerText; // Build mailto link with subject/body const subject = encodeURIComponent("Booking Request Summary"); const body = encodeURIComponent( summary + "\n\n" + financialSummary + "\n\n" + driverSummary + "\n\nPlease note that this is an estimate. The final price will be reviewed and confirmed." ); // This will open the default mail client window.location.href = `mailto:[email protected]?subject=${subject}&body=${body}`; } /* ========== [7] Clear Form ========== */ function clearForm() { if (confirm("Are you sure you want to clear all inputs?")) { document.getElementById('bookingForm').reset(); toggleSpecialInstructions(); toggleScheduleFields(); toggleRiderFields(); togglePayeeFields(); const extraStopsContainer = document.getElementById('extraStopsContainer'); while (extraStopsContainer.firstChild) { extraStopsContainer.removeChild(extraStopsContainer.firstChild); } document.getElementById('extraStopDisclaimer').classList.add('hidden'); // Reset Hours and Minutes visibility based on default miles toggleHoursMinutesVisibility(); document.getElementById('summaryContent').innerHTML = `Summary of Information
Your entered details will appear here...
`; document.getElementById('financialSummaryContent').innerHTML = `Financial Summary
Your charges will appear here...
`; document.getElementById('driverSummaryContent').innerHTML = ``; document.getElementById('discountContainer').classList.add('hidden'); } } /* ========== [8] Toggle Hours and Minutes Visibility Based on Miles ========== */ function toggleHoursMinutesVisibility() { const miles = parseFloat(document.getElementById('miles').value) || 0; const travelHoursContainer = document.getElementById('travelHoursContainer'); const travelMinutesContainer = document.getElementById('travelMinutesContainer'); if (miles <= 19) { travelHoursContainer.classList.add('hidden'); travelMinutesContainer.classList.add('hidden'); document.getElementById('travelHours').required = false; document.getElementById('travelMinutes').required = false; document.getElementById('travelHours').value = ''; document.getElementById('travelMinutes').value = ''; } else { travelHoursContainer.classList.remove('hidden'); travelMinutesContainer.classList.remove('hidden'); // Optionally, set required if needed // document.getElementById('travelHours').required = true; // document.getElementById('travelMinutes').required = true; } } /* ========== [9] DOMContentLoaded (On Page Load) ========== */ window.addEventListener('DOMContentLoaded', () => { populateStateSelects(); // Whenever an input changes, recalc summary const inputs = document.querySelectorAll('#bookingForm input, #bookingForm select, #bookingForm textarea'); inputs.forEach(input => { input.addEventListener('input', () => { updateSummary(); if (input.id === 'miles') { toggleHoursMinutesVisibility(); } }); input.addEventListener('change', () => { updateSummary(); if (input.id === 'miles') { toggleHoursMinutesVisibility(); } }); }); document.getElementById('tripType').addEventListener('change', toggleScheduleFields); document.getElementById('bookingType').addEventListener('change', toggleScheduleFields); document.getElementById('waitChoice').addEventListener('change', handleWaitChoice); // Discount & After Pay const discountRadios = document.querySelectorAll('input[name="discountChoice"]'); discountRadios.forEach(radio => radio.addEventListener('change', updateSummary)); const afterPayRadios = document.querySelectorAll('input[name="afterPayOption"]'); afterPayRadios.forEach(radio => radio.addEventListener('change', updateSummary)); // Rider & Payee const riderForRadios = document.querySelectorAll('input[name="riderFor"]'); riderForRadios.forEach(radio => radio.addEventListener('change', toggleRiderFields)); const payeeForRadios = document.querySelectorAll('input[name="payeeFor"]'); payeeForRadios.forEach(radio => radio.addEventListener('change', togglePayeeFields)); document.getElementById('addSpecialInstructions').addEventListener('change', toggleSpecialInstructions); document.getElementById('clearBtn').addEventListener('click', clearForm); // Initialize Hours and Minutes visibility based on default miles toggleHoursMinutesVisibility(); // Calculate summary on load updateSummary(); });