@extends('layouts.dashboard')

@section('page_title')
	Manage Permission
@endsection

@section('page_header_title')
	Manage Permission
@endsection



@section('page_body')
	<div class="row row-cards row-deck">
              <div class="col-12">
                <div class="card">
                	  <div class="card-header">
					    
					   
					    

					     <button  class="float-right btn btn-sm btn-outline-primary" data-toggle="modal" data-target="#md_add_permission"><i class="fa fa-plus"></i></button> &nbsp;&nbsp;

					     <h3 class="card-title">Manage Permission</h3>
					  </div>

                	<div class="card-status card-status-left bg-blue"></div>
                  <div class="table-responsive">
                    <table  class="table table-hover table-outline table-vcenter text-nowrap card-table cls_datatable">
                      <thead>
                        <tr>
                          
                          <th>#</th>
                          <th>Module</th>

                          <th>Feature</th>

                          <th>Created</th>
                      
                          <th style="text-align: center;"><i class="dropdown-icon fa fa-cogs"></i></th>
                          
                        </tr>
                      </thead>
                      <tbody>
                      	@isset($permission_list)
                          @php($pass_data = [])
                      		@foreach($permission_list as $rows)

                            @php(
                              $pass_data = array(
                                'permission'           => Crypt::encrypt($rows->id),
                                'feature'              => $rows->name,
                                'module'              => $rows->module,

                                  )

                            )
                      			<tr>
                      				<td>{{$loop->iteration}}</td>

                              <td>{{$rows->module}}</td>




                              <td>{{$rows->name}}</td>


                      	

                              <td>{{EF::dateFormat($rows->created_at)}}</td>

                      				<td class="text-center">

			                            <div class="item-action dropdown">
			                              <a href="javascript:void(0)" data-toggle="dropdown" class="icon"><i class="fa fa-list-ul"></i></a>
			                              <div class="dropdown-menu dropdown-menu-right">
			                              	 <a href="javascript:void(0)" class="dropdown-item"><i class="dropdown-icon fa fa-cogs"></i> Action</a>
			                              	<div class="dropdown-divider"></div>

			                                <a onclick="update(event,'{{json_encode($pass_data)}}','form_update_permission','md_update_permission')" href="javascript:void(0)" class="dropdown-item"><i class="dropdown-icon fa fa-edit"></i> Update </a>
			                                
			                               
			                               
			                               
			                              </div>
			                            </div>
			                         </td>
                      			</tr>


                      		@endforeach
                      	@endisset	
                        
                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
          </div>
@endsection

@section('page_modal')
  @include('permission.modals.add_permission')

  @include('permission.modals.update_permission')
@endsection

@section('page_script')
	
@endsection

  