
<div class="table-responsive">
    <div class="d-flex justify-content-between">
        <h5 class="mb-0">Study Materials Types <i class="bi bi-info-circle-fill text-info show-help-support" data-id="39"></i></h5>
        <a data-bs-toggle="modal" data-bs-target="#commonModal" id="create_study_material_types" class="btn btn-success" ><i class="bx bx-plus-circle"></i> Add New</a>
    </div>
    <hr class="mb-2">
    <table id="example" class="table table-bordered align-middle" style="width:100%">
        <thead class="table-light">
            <tr>
                
                <th class="thbutton">Sl No.</th>
                <th>Material Name</th>
                <th class="text-center" style="width: 5%;">Document & Materials</th>
                <th class="thbutton"> Status</th>
                <th class="thbutton"> Edit</th>
                <th class="thbutton"> Delete</th>
            </tr>
        </thead>
        <tbody>
            @php $i=1;@endphp
            @if($study_material_types->count() > 0)
                @foreach($study_material_types as $list)
                <tr>
                    <td class="text-center">{{$i++}}</td>
                    <td class="text-left">
                        <a href="{!! route('study-material-types.details',['course_id'=>$course_id,'material_type_id'=>$list->id]) !!}">
                            <b>{{$list->name}}</b> 
                            @if(countStudyMaterials($course_id,$list->id)>0)
                            <span class="badge bg-secondary"> {!! countStudyMaterials($course_id,$list->id) !!} </span>
                            @endif
                        </a>
                    </td>
                    <td class="text-center">
                        <a href="{!! route('study-material-types.details',['course_id'=>$course_id,'material_type_id'=>$list->id]) !!}" class="btn btn-info">
                            <i class="bi bi-list text-white"></i> Material Management
                        </a>
                    </td> 
                    <td class="text-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('study-material-types-changestatus')}}" data-id="{{$list->id}}" data-status="{{$list->status=='0' ? '1' : '0'}}" {{ $list->status=='1' ? 'checked' : '0'}}>
                            </div>
                    </td> 
                    <td class="thbutton">
                        <a data-id="{{ $list->id }}" class="btn btn-warning edit edit_study_material_types" type="button" data-bs-toggle="modal" data-bs-target="#commonModal" id="edit_study_material_types">
                            <i class="bi bi-pencil-square text-white"></i>
                        </a>
                    </td>

                    <td class="thbutton">
                        <a data-url="{{ route('study-material-types.destroy', $list->id) }}" class="btn btn-danger deleteDataCustom" class="text-danger" 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">
    <div class="col-lg-10 col-md-10 col-10 float-start">
    </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>
