<div class="modal-header">
    <h4>Update Trip # {{ $trip->id }}</h4>
</div>
<form id="udpate_trip_form">
    <div class="modal-body">
        <div class="row">
            <div class="col-md-4">
                {{-- <div class="form-group"> --}}
                <label for="vehicle">Vehicle Name <span class="text-danger">*</span></label><br>
                <select id="u_vehicle" onchange="get_meter_reading('yes')" name="vehicle" class="form-control w-100">
                    <option value="">-- SELECT--</option>
                    <option value="{{ $vehicle->id }}" selected>{{ $vehicle->vehicle_no }}</option>
                    @forelse ($vehicles as $vehicle)
                        <option
                            value="{{ $vehicle->id }}" @selected($trip->vehicle_id == $vehicle->id)>{{ $vehicle->vehicle_no }}</option>
                    @empty
                        <option value="">No Vehicle Available</option>
                    @endforelse
                </select>
                <span class="text-danger error" id="u_vehicle_error"></span>
                {{-- </div> --}}
            </div>
            <div class="col-md-4">
                {{-- <div class="form-group"> --}}
                <label for="reading_start">Meter Start Reading <span class="text-danger">*</span></label>
                <input type="number" min="0" id="u_reading_start" value="{{ $trip->start_reading }}" name="reading_start"
                       class="form-control">
                <span class="text-danger error" id="u_reading_start_error"></span>
                {{-- </div> --}}
            </div>
            <div class="col-md-4">
                {{-- <div class="form-group"> --}}
                <label for="start_date">Trip Starting Date <span class="text-danger">*</span></label>
                <input value="{{ date('Y-m-d', strtotime($trip->starting_date)) }}" type="date" id="start_date"
                       name="start_date"
                       class="form-control">
                <span class="text-danger error" id="u_start_date_error"></span>
                {{-- </div> --}}
            </div>
        </div>
    </div>
    <div class="modal-footer">
        @csrf
        <button name="createCitySubmit" id="update_btn" class="btn btn-sm btn-primary" type="submit">
            Update
        </button>
        <input type="hidden" value="{{$trip->id}}" name="update_id">
    </div>
</form>
