
  <div class = "col-md-4 col-sm-4">
      <div class= "card card-collapsed">
        <div class="card-status bg-teal"></div>
        <div class="card-header"> 
              @php($hasPermission = array())

              @foreach($permission_list as $rows)
                 @php(array_push($hasPermission,$rows->name))
              @endforeach

            <h3 class="card-title" style="margin: 0px 0px 0px 0px;">

              <input @if(@count($hasPermission) > 0 && $user->hasAllPermissions($hasPermission)) checked @endif class="{{$module}}_module" type="checkbox" onchange="assignModulePermission(this,'{{Crypt::encrypt($user->id)}}','{{Crypt::encrypt($module)}}','{{$module}}')"> &nbsp;{{$module}}

            </h3>
            <div class="card-options">
               <a onclick="cardCollapse(event,this)" href="#" class="card-options-collapse" data-toggle="card-collapse"><i class="fe fe-chevron-up"></i></a>      
            </div>
        </div>
     

      <div class="table-responsive">
          <table class="table table-hover table-outline table-vcenter text-nowrap card-table">
            <thead>
              <tr>
                
              <th>Name</th>  
                <th>Status</th>                          
              </tr>
            </thead>
            <tbody>
               
              @foreach($permission_list as $rows)
                <tr>
                 
                  <td style ="width:60%;">{{$rows->name}}</td>
                  <td><input class="{{$module}}_permission" onchange="assignPermission(this,'{{Crypt::encrypt($user->id)}}','{{Crypt::encrypt($rows->id)}}','{{$rows->name}}');" type="checkbox" @if($user->hasAnyPermission($rows->name)) checked @endif name="permission_list[]" value="{{Crypt::encrypt($rows->id)}}"></td>
                </tr>
              @endforeach
            </tbody>
          </table>
        </div>                                   
    </div>
  </div>
