<div class="table-responsive">
    <table class="table table-bordered align-middle" style="width:100%">
        <thead class="table-light">
            <tr>
                  <th class="thbutton">Sl No</th>
                  <th>Document Type</th>
                  <th>Document Code</th>
                  <th>Country</th>
                  <th>Priority</th>
                  <th class="thbutton">Mandatory</th>
                  <th class="thbutton">Show In Print</th>
                  <th class="thbutton">Status</th>
                  @if(in_array('company-licenses-edit', $authRolePermissions))
                  <th class="thbutton">Edit</th>
                  @endif
                  @if(in_array('company-licenses-delete', $authRolePermissions))
                  <th class="thbutton">Delete</th>
                  @endif
            </tr>
        </thead>
        <tbody>
            @php $i=1;@endphp
            @if(count($CompanyLicenceType)>0)
            @foreach($CompanyLicenceType as $key => $list)
            <tr>
            <td>{{$CompanyLicenceType->firstItem() + $key}}</td>
                <td>{{$list->license_type_name}}</td>
                <td>{{$list->license_code}}</td>
                <td style="white-space:pre-wrap; word-wrap:break-word">{{ $list->country }}</td>
                <td>{{$list->priority}}</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('license.changeIsMandatory')}}" data-id="{{$list->id}}" data-status="{{$list->is_mandatory=='0' ? '1' : '0'}}" {{ $list->is_mandatory=='1' ? 'checked' : ''}}>
                    </div>
                </td>
                <td align="center">
                    <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('license.changeShowPrint')}}" data-id="{{$list->id}}"
                        data-status="@if($list->show_in_print=='0'){{'1'}}@elseif($list->show_in_print=='1'){{'0'}}@endif"
                        @if($list->show_in_print=='1'){{'checked'}}@elseif($list->show_in_print=='0'){{''}}@endif>
                    </div>
                </td>
                <td align="center">
                    <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('license.changestatus')}}" data-id="{{$list->id}}"
                        data-status="@if($list->license_status=='0'){{'1'}}@elseif($list->license_status=='1'){{'0'}}@endif"
                        @if($list->license_status=='1'){{'checked'}}@elseif($list->license_status=='0'){{''}}@endif>
                    </div>
                </td>
                @if(in_array('company-licenses-edit', $authRolePermissions))
                <td>
                    <button data-id="{{ $list->id }}" class="btn btn-warning edit" data-bs-toggle="modal" data-bs-target="#commonModal" title="Edit">
                        <i class="bi bi-pencil-square text-white"></i>
                    </button>
                </td>
                @endif
                @if(in_array('company-licenses-delete', $authRolePermissions))
                <td>
                    <a href="#"  data-url="{{route('license.destroy')}}" data-id="{{$list->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>
                @endif
            </tr>
            @php $i++; @endphp
            @endforeach
            @else
            <tr>
                <td colspan="8">No Data Found</td>
            </tr>
            @endif
        </tbody>
    </table>
</div>


<nav class="row align-items-center mt-2">
    <div class="col-md-10">
        {!! $CompanyLicenceType->onEachSide(1)->render('company-license.pagination') !!}
    </div>
    <div class="col-lg-2 col-md-2 col-2 dataTables_length" id="example_length" style="text-align: right;">
        <i class="bi bi-funnel" style=" top: 11px;left: 20px;"></i>
        <select class="form-select sorting sorting-box" id="" name="example_length" aria-controls="example" style="padding-left: 30px;">
            <option value="10">Show: 10</option>
            <option value="30">Show: 30</option>
            <option value="50">Show: 50</option>
        </select>
    </div>
</nav>
</div>

