@extends('web::backend.layouts.kpm.base')

@section('content')


<div class="box-head-single box-head-single-candidate" style="padding:10px !important;border-radius: 10px;">
    <div class="container">
        <div class="">
            <h6> <i data-feather="aperture" class="w-14 h-14 mr-2"></i> @lang('web::user-management.permission-label')
            </h6>
            <br>
            <br>

            
            <div class="head-info-profile">
              <p class="m-0 subtitle font-weight-700" style="color:#000480"><b style="font-size: 20px">@lang('web::user-management.permission-index')</b> : {{$permission->count()}} @lang('web::user-management.permission-label')
            </div>
            
        </div>
    </div>
  </div>
<br>
<br>
<div class="col-span-12 lg:col-span-4 xxl:col-span-3">
          <div class="intro-y pr-1">
              <div class="box p-2">
                  <div class="chat__tabs nav nav-tabs justify-center" role="tablist"> 

                    <a id="all-tab" data-toggle="tab" data-target="#all" href="javascript:;" class="flex-1 py-2 rounded-md text-center active" role="tab" aria-controls="all" aria-selected="true">@lang('web::user-management.permission-list')</a> 

                  </div>
              </div>
          </div>
          <div class="tab-content">
              <div id="all" class="tab-pane active" role="tabpanel" aria-labelledby="all-tab">
                 <div class="grid grid-cols-12 gap-6 mt-5 p-5">
                      @foreach($permission->sortBy('type') as $key => $perm)

                         <div class="col-span-12 sm:col-span-6 xl:col-span-6 intro-y">
                             <a href="/user/editpermission/{{$perm->id}}" style="color:white !important" onclick="">
                                <div class="report-box zoom-in">
                                    <div class="box p-3 zoom-in" style="background: linear-gradient(45deg, #00CCB0, #00B89A) !important;height: 110px;font-size: 12px">
                                        <div class="text-base"><b><i data-feather="aperture" class="w-14 h-14 mr-2"></i>@lang('web::user-management.permission-title') :  {{$perm->name}}</b></div>
                                         <div>&nbsp;</div>
                                        <span>@if($perm->description) {{$perm->description}} @else @lang('web::user-management.permission-desc') @endif</span>
                                    </div>
                                </div>
                                </a>
                        </div>
                      @endforeach
                  </div>
              </div>
              <div id="manager" class="tab-pane" role="tabpanel" aria-labelledby="manager-tab">
                  <div class="grid grid-cols-12 gap-6 mt-5">
                      @foreach($permission->where('type','=',1) as $key => $perm)

                         <div class="col-span-12 sm:col-span-6 xl:col-span-6 intro-y">
                             <a href="/admin/permissionedit/{{$perm->id}}" style="color:white !important" onclick="">
                                <div class="report-box zoom-in">
                                    <div class="box p-3 zoom-in" style="background: linear-gradient(45deg, #309a9f, #75d62c) !important;height: 120px;font-size: 14px">
                                        <div class="text-base"><b><i data-feather="aperture" class="w-14 h-14 mr-2"></i>Type :  @if($perm->type == 1) Manager @elseif($perm->type == 2) Provider @elseif($perm->type == 3) Consumer @else Other(System Default) @endif</b></div>
                                         <div>&nbsp;</div>
                                        <span>{{ $perm->description ?? "No description" }}</span>
                                    </div>
                                </div>
                                </a>
                        </div>
                      @endforeach
                  </div>
              </div>
              <div id="provider" class="tab-pane" role="tabpanel" aria-labelledby="provider-tab">
                   <div class="grid grid-cols-12 gap-6 mt-5">
                      @foreach($permission->where('type','=',2) as $key => $perm)

                         <div class="col-span-12 sm:col-span-6 xl:col-span-6 intro-y">
                             <a href="/admin/permissionedit/{{$perm->id}}" style="color:white !important" onclick="">
                                <div class="report-box zoom-in">
                                    <div class="box p-3 zoom-in" style="background: linear-gradient(45deg, #309a9f, #75d62c) !important;height: 120px;font-size: 14px">
                                        <div class="text-base"><b><i data-feather="aperture" class="w-14 h-14 mr-2"></i>Type :  @if($perm->type == 1) Manager @elseif($perm->type == 2) Provider @elseif($perm->type == 3) Consumer @else Other(System Default) @endif</b></div>
                                         <div>&nbsp;</div>
                                        <span>{{ $perm->description ?? "No description" }}</span>
                                    </div>
                                </div>
                                </a>
                        </div>
                      @endforeach
                  </div>
              </div>
              <div id="consumer" class="tab-pane" role="tabpanel" aria-labelledby="consumer-tab">
                  <div class="grid grid-cols-12 gap-6 mt-5">
                      @foreach($permission->where('type','=',3) as $key => $perm)

                         <div class="col-span-12 sm:col-span-6 xl:col-span-6 intro-y">
                             <a href="/admin/permissionedit/{{$perm->id}}" style="color:white !important" onclick="">
                                <div class="report-box zoom-in">
                                    <div class="box p-3 zoom-in" style="background: linear-gradient(45deg, #309a9f, #75d62c) !important;height: 120px;font-size: 14px">
                                        <div class="text-base"><b><i data-feather="aperture" class="w-14 h-14 mr-2"></i>Type :  @if($perm->type == 1) Manager @elseif($perm->type == 2) Provider @elseif($perm->type == 3) Consumer @else Other(System Default) @endif</b></div>
                                         <div>&nbsp;</div>
                                        <span>{{ $perm->description ?? "No description" }}</span>
                                    </div>
                                </div>
                                </a>
                        </div>
                      @endforeach
                  </div>
              </div>
          </div>
      </div>


@endsection