<style type="text/css">
.new-bill {
    width: 95px !important;
    height: auto !important;
    line-height: 1.5 !important;
    padding: 0.275rem 0.5rem !important;
}
</style>
<div class="table-responsive">
    <table id="example" class="table table-bordered align-middle" style="width:100%">
        <thead class="table-light">
            <tr>
                
                <th class="thbutton">Serial No.</th>
                <th class="thbutton">Vehicle No</th>
                <th > Model</th>
                <th >Manufacture </th>
                <th >Ownership </th>
                <th >Vehicle Type</th>
                <th > Capacity</th>
                <th >Driver Account </th>
                <th >Vendor Account </th>
                <th class="thbutton">Document</th>
                <th class="thbutton">Status</th>
                <th class="thbutton">Edit</th>
                <th class="thbutton">Delete</th>
               
            </tr>
        </thead>
        <tbody>
            @php $i=1;@endphp
            @if($vehicles->count() > 0)
                @foreach($vehicles as $list)
                <tr>
                      <td>{{$i++}}</td>
                    <td>{{$list->vehicle_no}}</td>
                    <td>{{$list->vehicle_model}}</td>
                    <td>{{$list->manufacture_year}}</td>
                    <td>{{OwnershipTypes($list->ownership_type)}}</td>
                    <td>{{$list->vehicle_type_name}}</td>
                    <td>{{$list->vehicle_capacity}}</td>
                    <td>
                        {{$list->driver_account_name}} <br>
                        {{$list->driver_phone_no}} <br> 
                    </td> 
                    <td>
                        {{$list->vendor_account_name}} <br> 
                        {{$list->vendor_phone_no}} <br> 
                    </td>
                    <td class="text-center">
                        <a href="#" class="btn btn-primary text-white" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Validity">
                            Validity
                        </a>
                    </td>
                    <td>
                        <div class="form-check form-check-inline{{$i}}">
                            <input class="form-check-input{{$i}} btn-lg changeStatusCustom" type="checkbox" id="inlineCheckbox{{$i}}" data-url="{{route('vehicle-register-changestatus')}}" data-id="{{$list->vehicle_register_id}}" data-status="{{$list->status=='0' ? '1' : '0'}}" {{ $list->status=='1' ? 'checked' : '0'}}>
                        </div>
                    </td> 
                    <td class="thbutton">
                        <a data-id="{{ $list->vehicle_register_id }}" class="btn btn-warning edit edit_vehicle" type="button" data-bs-toggle="modal" data-bs-target="#commonModal" id="edit_vehicle">
                            <i class="bi bi-pencil-square text-white"></i>
                        </a>
                    </td>

                    <td class="thbutton">
                        <a 
                            data-url="{{ route('vehicle-register.destroy' , $list->vehicle_register_id) }}" class="btn btn-danger deleteDataCustom" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Delete">
                            <i class="bi bi-trash text-white"></i>
                        </a>
                    </td>
                </tr>
                @endforeach
            @else
                <tr>
                    <td colspan="10">No Data Found</td>
                </tr>
            @endif
</tbody>

    </table>
</div>
<nav class="mt-2 row d-flex align-items-center">
    <div class="col-lg-12 col-md-12 col-12 d-flex justify-content-end align-items-center">
        <div class="btn-group mb-0 me-2">
            <a href="{{ route('vehicle-register-import.modal') }}" class="btn btn-outline-primary">
                <i class="bx bx-upload"></i> Import Vehicles From Excel
            </a>
        </div>
        <div class="d-flex align-items-center">
            <select class="form-select sorting sorting-box" id="example_length" name="example_length" aria-controls="example">
                <option value="10">Show: 10</option>
                <option value="30">Show: 30</option>
                <option value="50">Show: 50</option>
            </select>
        </div>
    </div>
</nav>


</div>
