Viewing file: edit_order.blade.php (32.47 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
@extends('layouts.admin') @section('page-title') {{__('Taxi Order')}} @endsection @push('script-page')
<script>
var currentTab = 0; showTab(currentTab);
function showTab(n) {
var x = document.getElementsByClassName("tab"); x[n].style.display = "block"; if (n == 0) { document.getElementById("prevBtn").style.display = "none"; } else { document.getElementById("prevBtn").style.display = "inline"; } if (n == (x.length - 1)) { document.getElementById("nextBtn").innerHTML = "Submit"; } else { document.getElementById("nextBtn").innerHTML = "Next"; }
fixStepIndicator(n) }
function nextPrev(n) { // This function will figure out which tab to display var x = document.getElementsByClassName("tab"); // Exit the function if any field in the current tab is invalid: if (n == 1 && !validateForm()) return false; // Hide the current tab: x[currentTab].style.display = "none"; // Increase or decrease the current tab by 1: currentTab = currentTab + n; // if you have reached the end of the form... : if (currentTab >= x.length) { //...the form gets submitted: document.getElementById("regForm").submit(); return false; } // Otherwise, display the correct tab: showTab(currentTab); }
function validateForm() { // This function deals with validation of the form fields var x, y, i, valid = true; x = document.getElementsByClassName("tab"); y = x[currentTab].getElementsByTagName("input");
// A loop that checks every input field in the current tab: for (i = 0; i < y.length; i++) { // If a field is empty... if (y[i].value == "") { // add an "invalid" class to the field: y[i].className += " invalid"; // and set the current valid status to false: // valid = false; valid = true; //for remove requeired } } // If the valid status is true, mark the step as finished and valid: if (valid) { document.getElementsByClassName("step")[currentTab].className += " finish"; } return valid; // return the valid status }
function fixStepIndicator(n) { // This function removes the "active" class of all steps... var i, x = document.getElementsByClassName("step"); for (i = 0; i < x.length; i++) { x[i].className = x[i].className.replace(" active", ""); } //... and adds the "active" class to the current step: x[n].className += " active"; } $(document).on('click', '.payment-input-value', function (e) { const type = $(this).attr('data-payment-type'); $('.payment-input-value').removeClass('active');
$(this).addClass('active');
$('#payment_method').val(type); }); </script>
<script> $(document).ready(function() { const total_cost = {{isset($taxi_order->total_cost)?$taxi_order->total_cost:0}}; const destination_lat_lng = "{{isset($taxi_order->destination_lat_lng)?$taxi_order->destination_lat_lng:0}}"; const pickup_lat_lng = "{{isset($taxi_order->pickup_lat_lng)?$taxi_order->pickup_lat_lng:0}}"; let total_distc = {{isset($taxi_order->total_km)?$taxi_order->total_km:0}}; // console.log(recom_to,recom_from); $('#t-distance').text(total_distc); var t_distance_numeric_value = $('#t-distance').text(); var t_km = $('#total-km').text(); var t_km_currencySymbol = t_km.replace(/[\d\.,]/g, ''); var t_km_value = t_km.replace(new RegExp('\\' + t_km_currencySymbol, 'g'), ''); const t_km_numeric_value = t_km_value.replace(',',''); const t_sub_total = t_distance_numeric_value*t_km_numeric_value; console.log(t_distance_numeric_value,t_km_numeric_value,'pppepepep'); $('#t-sub-total').text(t_sub_total+ '$'); $('#grand-total-cost').text(total_cost+ '$'); $('#pickup_lat_lng').val(pickup_lat_lng); $('#destination_lat_lng').val(destination_lat_lng);
});
function initMap(e){ const center = { lat: 50.064192, lng: -130.605469 }; const defaultBounds = { north: center.lat + 0.1, south: center.lat - 0.1, east: center.lng + 0.1, west: center.lng - 0.1, }; const pickup_address = document.getElementById("pickup_address"); const destination_place = document.getElementById("destination_place"); const options = { bounds: defaultBounds, componentRestrictions: { country: "us" }, fields: ["address_components", "geometry", "icon", "name"], strictBounds: false, };
//pickup const pickup_autocomplete = new google.maps.places.Autocomplete(pickup_address, options); let pickup=''; let destination=''; google.maps.event.addListener(pickup_autocomplete, 'place_changed', () => { let place = pickup_autocomplete.getPlace(); let pickup_lat_lng = place.geometry.location.lat()+','+ place.geometry.location.lng();
pickup = {lat: place.geometry.location.lat(), lng: place.geometry.location.lng()};
$('#pickup_lat_lng').val(pickup_lat_lng);
calculate_distance() });
//destination const destination_autocomplete = new google.maps.places.Autocomplete(destination_place, options); google.maps.event.addListener(destination_autocomplete, 'place_changed', () => { let place = destination_autocomplete.getPlace(); const destination_lat_lng = place.geometry.location.lat()+','+ place.geometry.location.lng();
destination = {lat: place.geometry.location.lat(), lng: place.geometry.location.lng()};
$('#destination_lat_lng').val(destination_lat_lng);
calculate_distance() });
let distance = ''; let distance_meter = '';
function calculate_distance(){ if(!pickup || !destination){ return; } let directionsService = new google.maps.DirectionsService(); const route = { origin: pickup, destination: destination, travelMode: 'DRIVING' } directionsService.route(route, function(response, status) { // anonymous function to capture directions if (status !== 'OK') { window.alert('Directions request failed due to ' + status); return; } else { var directionsData = response.routes[0].legs[0]; // Get data about the mapped route if (!directionsData) { window.alert('Directions request failed'); return; } else { distance = directionsData.distance.text.replace('mi', '').replace(',',''); distance_meter = directionsData.distance.value; if(distance){ $('#t-distance').addClass('d-none'); $('#t-sub-total').addClass('d-none'); $('#grand-total-cost').addClass('d-none'); $('.meterege-text').addClass('d-none'); }else{ $('#t-distance').removeClass('d-none'); $('#t-sub-total').removeClass('d-none'); $('#grand-total-cost').removeClass('d-none'); $('.meterege-text').removeClass('d-none'); } const calculated_distance = $('#distance-mi').text(distance+ ' (Meterage)'); const total_distance = parseFloat(distance); // const total_miles = parseFloat($('#total-km').html()); var t_km = $('#total-km').text(); var t_km_currencySymbol = t_km.replace(/[\d\.,]/g, ''); var t_km_value = t_km.replace(new RegExp('\\' + t_km_currencySymbol, 'g'), ''); const total_miles = t_km_value.replace(',',''); const trip_charge = parseFloat($('#trip_charge').html()); const extra_charge = parseFloat($('#extra_charge').html()); const others_charge = trip_charge + extra_charge; const sub_total = total_distance * total_miles; const total_cost = sub_total + others_charge; $('#total-cost-cal').text(total_cost+ '$'); $('#sub-total-crg').text(sub_total+ '$'); $('#total-cost-calculation').val(total_cost); $('#total_distance').val(total_distance);
} } }); } } </script> <script async
src="https://maps.googleapis.com/maps/api/js?key={{config('app.GOOGLE_API_KEY')}}&loading=async&libraries=places&callback=initMap">
</script> @endpush @section('breadcrumb') <li class="breadcrumb-item"><a href="{{route('dashboard')}}">{{__('Dashboard')}}</a></li> <li class="breadcrumb-item">{{__('Taxi Order')}}</li> @endsection @section('action-btn') @endsection
@section('content')
<div class="step-sec d-none"> <span class="step"></span> <span class="step"></span> <span class="step"></span> <span class="step"></span> </div>
<div class="row"> <div class="col-xl-12"> <div class="card"> {{ Form::open(array('url' => 'customer-order-store','enctype' => 'multipart/form-data','id'=>'regForm')) }} <div class="card-body">
<div class="tab"> <div class="row"> <div class="col-lg-6 taxi-order-card-bg"> <div class="taxi-order-card"> <div class="row"> <div class="col-md-12"> <div class="row"> @php $auth_name = \Auth::user(); @endphp <div class="form-group col-md-12"> {{ Form::label('name', __('Customer Name'),['class'=>'form-label']) }} {{ Form::text('name', isset($auth_name->name)?$auth_name->name:'', array('class' => 'form-control','required'=>'required','readonly' => 'readonly')) }} </div> <div class="form-group col-md-12"> {{ Form::label('phone_number', __('Phone Number'),['class'=>'form-label']) }} {{ Form::text('phone_number', isset($auth_name->phone_number)?$auth_name->phone_number:'', array('class' => 'form-control','required'=>'required','readonly' => 'readonly')) }} </div> <div class="form-group col-md-12"> {{ Form::label('email', __('Email'),['class'=>'form-label']) }} {{ Form::text('email', isset($auth_name->email) ? $auth_name->email : '', ['class' => 'form-control', 'required' => 'required', 'readonly' => 'readonly']) }} </div>
<div class="show-filtered-result d-none"> </div> <div class="form-group col-12"> {{ Form::label('someone_knows_this_trip', __('We will need a few more details about ypur trip.'), ['class' => 'form-label']) }}
</div> <div class="form-group col-md-12"> {{ Form::label('someone_knows_this_trip', __('Can The Member Or Someone the member knows drive for this trip'), ['class' => 'form-label']) }} <br> <div class="form-check form-check-inline "> {{ Form::radio('someone_knows_this_trip', 'yes', null, ['class' => 'form-check-input', 'id' => 'yes']) }} {{ Form::label('yes', __('Yes'), ['class' => 'form-check-label']) }} </div> <div class="form-check form-check-inline "> {{ Form::radio('someone_knows_this_trip', 'no', null, ['class' => 'form-check-input', 'id' => 'no']) }} {{ Form::label('no', __('No'), ['class' => 'form-check-label']) }} </div> </div> </div> </div> </div> </div> </div> <div class="col-lg-6 taxi-order-card-bg-two"> <div class="taxi-order-card-two"> <div class="row"> <div class="form-group col-md-12"> {{ Form::label('how_mobile_in_the_member', __('How mobile is the member?'), ['class' => 'form-label']) }} <br> <div class="form-check form-check-inline"> {{ Form::radio('how_mobile_in_the_member', 'can_walk', null, ['class' => 'form-check-input', 'id' => 'can_walk']) }} {{ Form::label('can_walk', __('The member can walk'), ['class' => 'form-check-label']) }} </div> <div class="form-check form-check-inline"> {{ Form::radio('how_mobile_in_the_member', 'uses_a_wheelchair', null, ['class' => 'form-check-input', 'id' => 'uses_a_wheelchair']) }} {{ Form::label('uses_a_wheelchair', __('The member uses a wheelchair'), ['class' => 'form-check-label']) }} </div> </div>
<div class="form-group col-md-12 "> <label for="steps_or_ramp" class="col-form-label">{{__('Any Steps Or ramp at the home ?')}}</label> <select class="form-control" id="steps_or_ramp" name="steps_or_ramp"> <option value="{{$taxi_order->steps_or_ramp == 'yes' ? 'selected' : 'yes' }}">{{ __('Yes') }}</option> <option value="{{ $taxi_order->steps_or_ramp == 'no' ? 'selected' : 'no' }}">{{ __('No') }}</option> </select> </div> <div class="form-group col-md-12 "> <label for="special_needs" class="col-form-label">{{__('Any Special Needs ?')}}</label> <select class="form-control" id="" name="special_needs"> <option value="{{ $taxi_order->special_needs == 'yes' ? 'selected' : 'yes' }}">{{__('Yes')}}</option> <option value="{{ $taxi_order->special_needs == 'no' ? 'selected' : 'no' }}">{{__('No')}}</option> </select> </div> <div class="form-group col-md-12"> {{ Form::label('height_of_member', __('Height Of Member'),['class'=>'form-label']) }} {{ Form::text('height_of_member',isset($taxi_order->height_of_member) ? $taxi_order->height_of_member : '', array('class' => 'form-control ','required'=>'required')) }} </div> </div> </div> </div> </div> </div> <div class="tab"> <div class="row"> <div class="col-lg-6 taxi-order-card-bg"> <div class="taxi-order-card"> <div class="row"> <div class="form-group col-md-12"> {{ Form::label('weight_of_member', __('Weight Of Member'),['class'=>'form-label']) }} {{ Form::text('weight_of_member', isset($taxi_order->weight_of_member) ? $taxi_order->weight_of_member : '', array('class' => 'form-control ','required'=>'required')) }} </div> <div class="form-group col-md-12 "> <label for="service_lavel" class="col-form-label">{{__('What is the level of service ?')}}</label> <select class="form-control" id="" name="service_lavel"> <option value="{{ $taxi_order->service_lavel == 'ambulatory' ? 'selected' : 'ambulatory' }}" >{{__('Ambulatory')}}</option> </select> </div> <div class="form-group col-md-12 "> <label for="service_lavel" class="col-form-label">{{__('Member transfer from wheelchair to chair ?')}}</label> <select class="form-control" id="" name="transfer_wheelchair_to_car"> <option value="{{ $taxi_order->transfer_wheelchair_to_car == 'no' ? 'selected' : 'no' }}" >{{__('N/A')}}</option> <option value="{{ $taxi_order->transfer_wheelchair_to_car == 'yes' ? 'selected' : 'yes' }}" >{{__('Yes')}}</option> </select> </div> <div class="form-group col-md-12 "> <label for="service_lavel" class="col-form-label">{{__('Wheelchair Type ?')}}</label> <select class="form-control" id="" name="wheelchair_type"> <option value="{{ $taxi_order->wheelchair_type == 'no' ? 'selected' : 'no' }}">{{__('N/A')}}</option> <option value="{{ $taxi_order->wheelchair_type == 'yes' ? 'selected' : 'yes' }}">{{__('Yes')}}</option> </select> </div> </div> </div> </div> <div class="col-lg-6 taxi-order-card-bg-two"> <div class="taxi-order-card-two"> <div class="row"> <div class="form-group col-md-12"> {{ Form::label('child_seats', __('Enter a phone number for the pickup location:'),['class'=>'form-label']) }} {{ Form::number('pickup_location_phone_number', isset($taxi_order->pickup_location_phone_number) ? $taxi_order->pickup_location_phone_number : '', array('class' => 'form-control ','required'=>'required')) }} </div> <div class="form-group col-md-12"> {{ Form::label('child_seats', __('Do you have any instructions that might help your driver ?'),['class'=>'form-label']) }} <textarea name="instuctions_for_driver" class="form-control" required id="4" cols="4" rows="4">{{isset($taxi_order->pickup_location_phone_number)?$taxi_order->pickup_location_phone_number : ''}}</textarea> </div> <div class="form-group col-md-12"> {{ Form::label('pickup_date', __('Pickup Date'),['class'=>'form-label']) }} {{ Form::date('pickup_date', isset($taxi_order->pickup_date) ? $taxi_order->pickup_date : '', array('class' => 'form-control ','required'=>'required')) }} </div> <div class="form-group col-md-12"> {{ Form::label('preferred_pickup-time', __('Do you have a preferred pickup time'),['class'=>'form-label']) }} {{ Form::time('preferred_pickup_time', isset($taxi_order->preferred_pickup_time) ? $taxi_order->preferred_pickup_time : '', array('class' => 'form-control ','required'=>'required')) }} </div> <div class="form-group col-md-12"> {{ Form::label('appointment_time', __('Appointment time'),['class'=>'form-label']) }} {{ Form::time('appointment_time', isset($taxi_order->appointment_time) ? $taxi_order->appointment_time : '', array('class' => 'form-control ','required'=>'required','id'=>'appointment_time')) }} </div> <div class="form-group col-md-12"> {{ Form::label('drop_off_location_phone_number', __('Enter a phone number for the drop off location'),['class'=>'form-label']) }} {{ Form::number('drop_off_location_phone_number', isset($taxi_order->drop_off_location_phone_number)?$taxi_order->drop_off_location_phone_number : '', array('class' => 'form-control ','required'=>'required')) }} </div> </div> </div> </div> </div>
</div> <div class="tab"> <div class="row"> <div class="col-lg-6 taxi-order-card-bg"> <div class="taxi-order-card"> <div class="row"> <div class="form-group col-md-12 "> <label for="note" class="form-label">{{__('Please note anyone who will ride with this member for this trip:')}}</label> </div> <div class="form-group col-md-12"> {{ Form::label('personal_care_attendants', __('Personal care attendants'),['class'=>'form-label']) }} {{ Form::number('personal_care_attendants', isset($taxi_order->personal_care_attendants) ? $taxi_order->personal_care_attendants : '', array('class' => 'form-control ','required'=>'required')) }} </div> <div class="form-group col-md-12"> {{ Form::label('adult_escorts', __('Adult Escorts:'),['class'=>'form-label']) }} {{ Form::number('adult_escorts', isset($taxi_order->adult_escorts) ? $taxi_order->adult_escorts : '', array('class' => 'form-control ','required'=>'required')) }} </div> <div class="form-group col-md-12"> {{ Form::label('child_escorts', __('Child Escorts:'),['class'=>'form-label']) }} {{ Form::number('child_escorts', isset($taxi_order->child_seats) ? $taxi_order->child_seats : '', array('class' => 'form-control ','required'=>'required')) }} </div> <div class="form-group col-md-12"> {{ Form::label('child_seats', __('Child Seats:'),['class'=>'form-label']) }} {{ Form::number('child_seats', isset($taxi_order->child_seats) ? $taxi_order->child_seats : '', array('class' => 'form-control ','required'=>'required')) }} </div> <div class="form-group col-md-12 "> <label for="member_sign_drivers_log" class="col-form-label">{{__('Can member sign the drivers log ?')}}</label> <select class="form-control" id="" name="member_sign_drivers_log"> <option value="{{ $taxi_order->member_sign_drivers_log == 'yes' ? 'selected' : '' }}">{{__('Yes')}}</option> <option value="{{ $taxi_order->member_sign_drivers_log == 'no' ? 'selected' : '' }}">{{__('N/A')}}</option> </select> </div> </div> </div> </div> <div class="col-lg-6 taxi-order-card-bg-two"> <div class="taxi-order-card-two"> <div class="row "> <div class="col-md-12"> <div class="row"> <div class="form-group col-md-12"> {{ Form::label('pickup_address', __('Pickup Address'),['class'=>'form-label']) }} {{ Form::text('pickup_address', isset($taxi_order->pickup_address)?$taxi_order->pickup_address:'', array('class' =>'form-control','required'=>'required','id'=>'pickup_address')) }} </div> <div class="form-group col-md-12"> {{ Form::label('destination_address', __('Destination Address'),['class'=>'form-label']) }} {{ Form::text('destination_address', isset($taxi_order->destination_address)?$taxi_order->destination_address:'', array('class' => 'form-control','required'=>'required','id'=>'destination_place')) }} </div> @if(isset($last_order) && $last_order) <div class="col-lg-12"> <div class="suggested-destination-sec"> <div class="last-order-title"> Last Order </div> <div class="user-last-order-from"> Destination Address : <span id="recom-from-destination">{{isset($last_order->destination_address)?$last_order->destination_address:''}}</span> </div> <div class="user-last-order-from"> Pickup Address : <span id="pick_up_address">{{isset($last_order->pickup_address)?$last_order->pickup_address:''}}</span> </div> <div class="destination-choose-button"> <a href="#" class="btn-choose-location">Choose this Location</a> </div> </div> </div> @endif
<input type="hidden" id="pickup_lat_lng" name="pickup_lat_lng" value="{{isset($taxi_order->pickup_lat_lng)?$taxi_order->pickup_lat_lng:''}}"> <input type="hidden" id="destination_lat_lng" name="destination_lat_lng" value="{{isset($taxi_order->destination_lat_lng)?$taxi_order->destination_lat_lng:''}}"> <input type="hidden" id="total-cost-calculation" name="total_cost" value=""> <input type="hidden" id="total_distance" name="total_km" value=""> <div class="col-md-12"> <div class="card mt-3"> <div class="card-body"> <div class="total-calculation-sec"> <div class="total_km"> {{__('Total Distance')}} : <span id="distance-mi"></span> <span id="t-distance">{{isset($taxi_order->total_km)?$taxi_order->total_km:''}}</span> </div> <div class="km-price"> {{__('Per Meterage Charge')}} : <span id="total-km">{{\Auth::user()->priceFormat(isset($meterage->per_meterage_charge)?$meterage->per_meterage_charge:0)}}</span> </div> <div class="sub-total-devider-line"></div> <div class="sub-total-sec mb-3"> <strong> {{__('Sub Total')}} : <span id="sub-total-crg"></span> <span id="t-sub-total"></span></strong> </div> <div> {{__('Trip Charge')}} : <span id="trip_charge">{{isset($meterage->trip_charge)?$meterage->trip_charge:0}}$</span> </div> <div> {{__('Extra Charge')}} : <span id="extra_charge">{{isset($meterage->extra_charge)?$meterage->extra_charge:0}}$</span> </div> <div class="sub-total-devider-line"></div> <div class="total-cost"> <strong> {{__('Grand Total')}} : <span id="total-cost-cal"> </span> <span id="grand-total-cost"></span></strong> </div> </div> </div> </div> </div> <div class="form-group col-md-12"> {{ Form::label('payment_type', __('Choose Payment Method'), ['class' => 'form-label']) }} <br> <input type="hidden" value="offline" name="payment_type" id="payment_method"> <div class="accordion accordion-flush" id="accordionFlushExample"> @if (isset($company_payment_setting['is_bank_transfer_enabled']) && $company_payment_setting['is_bank_transfer_enabled']=='on') <div class="accordion-item payment-type-sec"> <h2 class="accordion-header" id="flush-headingOne"> <button data-payment-type='offline' class="accordion-button payment-input-value payment-accordion-button collapsed show active" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseOne" aria-expanded="true" aria-controls="flush-collapseOne"> Bank Transfer </button> </h2> <div id="flush-collapseOne" class="accordion-collapse collapse show" aria-labelledby="flush-headingOne" data-bs-parent="#accordionFlushExample"> <div class="accordion-body"> {{isset($company_payment_setting['bank_details'])?$company_payment_setting['bank_details']:'N/A'}}</div> </div> </div> @endif @if (isset($company_payment_setting['is_paypal_enabled']) && $company_payment_setting['is_paypal_enabled']=='on') <div class="accordion-item payment-type-sec"> <h2 class="accordion-header" id="flush-headingTwo"> <button data-payment-type='paypal' class="accordion-button payment-input-value payment-accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseTwo" aria-expanded="false" aria-controls="flush-collapseTwo"> Paypal </button> </h2> <div id="flush-collapseTwo" class="accordion-collapse collapse" aria-labelledby="flush-headingTwo" data-bs-parent="#accordionFlushExample"> <div class="accordion-body">Paypal</div> </div> </div> @endif <div class="accordion-item payment-type-sec d-none"> <h2 class="accordion-header" id="flush-headingThree"> <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseThree" aria-expanded="false" aria-controls="flush-collapseThree"> Stripe </button> </h2> <div id="flush-collapseThree" class="accordion-collapse collapse" aria-labelledby="flush-headingThree" data-bs-parent="#accordionFlushExample"> <div class="accordion-body">Placeholder content for this accordion, which is intended to demonstrate the <code>.accordion-flush</code> class. This is the third item's accordion body. Nothing more exciting happening here in terms of content, but just filling up the space to make it look, at least at first glance, a bit more representative of how this would look in a real-world application.</div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div>
<div class="card-footer d-none"> <input type="button" value="{{__('Cancel')}}" class="btn btn-light" data-bs-dismiss="modal"> <input type="submit" value="{{__('Create')}}" class="btn btn-primary"> </div> <div style="overflow:auto;"> <div style="float:right;"> <button type="button" id="prevBtn" onclick="nextPrev(-1)">Previous</button> <button type="button" id="nextBtn" onclick="nextPrev(1)">Next</button> {{-- <button type="submit" id="submitbtn" onclick="submtBtn()">Submit</button> --}} </div> </div>
<style> .pac-container { z-index: 10000 !important; } .search-box-result-sec { background: #fafafa; padding: 5px 3px; } .custom-radio-inline{ display: block !important; } .offline-payment-info { padding: 10px 18px; margin-left: 23px; border: 1px solid #d3d3d3; border-radius: 5px; margin-bottom: 15px; } </style> {{ Form::close() }} </div> </div> </div> </div> @endsection @section('extra-scripts') @endsection
|