<div class="table-responsive">
    <div class="d-flex justify-content-between">
        <h5 class="mb-0">Notices</h5>
        <a href="{!! route('notices.create') !!}?redirect=courses&id={!! $course_id !!}" 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>Notice Title</th>
                  <!-- <th>Start Date</th>
                  <th>Expire Date</th> -->
                 <th class="thbutton">New Status</th>
                  <th class="thbutton">Notice Status</th>
                  @if(in_array('notice-edit', $authRolePermissions))
                  <th class="thbutton">Edit</th>
                  @endif
                  @if(in_array('notice-delete', $authRolePermissions))
                  <th class="thbutton">Delete</th>
                  @endif
              </tr>
        </thead>
        <tbody>
            @php $i=1;@endphp
            @if(count($notices)>0)
            @foreach($notices as $key=> $row)
            <tr>
                <td class="text-center">{{++$key}}</td>
                <td style="font-size: 15px;">
                  {{$row->notice_title}}
                  @if($row->new_flag==1)
                  <span class="badge bg-info"> New </span>
                  @endif
                  <br>
                  <span class="text-secondary">
                  Start Date- {{  formatedDate($row->start_date)}}, 
                  @if($row->expiry_date)
                  Ex. Date- {{ formatedDate($row->expiry_date)}}
                  @endif
                  </span>
                </td>

                {{-- <td>@if(isset($row->priority_status)){{$row->priority_status}}@endif</td> --}}
                <td align="center">
                    <div class="form-check form-check-inline{{$i}}">
                        <input class="form-check-input{{$i}} btn-lg changeStatusCustom notices" type="checkbox" id="inlineCheckbox{{$i}}" data-url="{{route('notices.changeFlagStatus')}}" data-id="{{$row->id}}" data-status="{{$row->new_flag=='0' ? '1' : '0'}}" {{ $row->new_flag=='1' ? 'checked' : ''}}>
                    </div>

                </td>
                <td align="center">
                    <div class="form-check form-check-inline{{$i}}">
                        <input class="form-check-input{{$i}} btn-lg changeStatusCustom notices" type="checkbox" id="inlineCheckbox{{$i}}" data-url="{{route('notices.changestatus')}}" data-id="{{$row->id}}" data-status="{{$row->status=='0' ? '1' : '0'}}" {{ $row->status=='1' ? 'checked' : ''}}>
                    </div>

                </td>
                <td align="center">
                  @if(in_array('notice-edit', $authRolePermissions))
                    <a href="{{route('notices.edit',$row->id)}}?redirect=courses&id={!! $course_id !!}" class="btn btn-outline-secondary edit" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Edit">
                    <i class="bi bi-pencil-square"></i>
                    </a>
                @endif
                </td>
                <td align="center">
                    @if(in_array('notice-delete', $authRolePermissions))
                    <a data-url="{{route('notice.delete')}}" data-id="{{$row->id}}" class="btn btn-danger deleteDataCustom notices" class="text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Delete">
                        <i class="bi bi-trash text-white"></i>
                    </a>
                @endif
                </td>

            </tr>
            @php $i++; @endphp
            @endforeach
            @else
            <tr>
                <td colspan="10">No Data Found</td>
            </tr>
            @endif
        </tbody>

    </table>
</div>
</div>