<?php $__env->startSection('titulo'); ?>
    <i class="fas fa-key"></i> Permissões
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
    <script src="<?php echo e(URL::asset('js/views/adm/permissao.js')); ?>"></script>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('pagina'); ?>
    
    <div class="container-fluid">
        <div class="row" >
            <div class="col text-left">
                <button id="btnNovaPermissao" type="button" class="btn btn-primary" aria-label="Left Align" >
                    <i class="fas fa-plus-circle"></i> Nova Permissão
                </button>
            </div>
        </div>
    <br/>
    <div class="row" >
        <div class="col panel panel-primary table-responsive">

                <table id="tbPermissao" class="table table-hover text-left">
                    <thead>
                        <tr>
                            <th>Usuário</th>
                            <th>Classe</th>
                            <th>Ações</th>
                        </tr>
                    </thead>
                    <tbody>

                        <?php $__currentLoopData = $permissao; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $perm): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <!-- <td id="<?php echo e($perm->getId()); ?>_usuario"
									data="<?php echo e($perm->getFkUsuario()); ?>"
									data2="<?php echo e($perm->FkUsuario->getFkUsuario()); ?>">
									<?php echo e($perm->Usuario->getNome()); ?>

								</td>
                                <td id="<?php echo e($perm->getId()); ?>_classe"
									data="<?php echo e($perm->getFkClasse()); ?>"
									data2="<?php echo e($perm->FkClasse->getFkClasse()); ?>">
									<?php echo e($perm->Classe->getDescricao()); ?>

								</td> -->

                                <td id="<?php echo e($perm->getId()); ?>_fk_usuario"><?php echo e($perm->getFkUsuario()); ?></td>
                                <td id="<?php echo e($perm->getId()); ?>_fk_classe"><?php echo e($perm->getFkClasse()); ?></td>
                                <td>
                                    <span name="editBtn" class="fas fa-edit" data="<?php echo e($perm->getId()); ?>" style="cursor: pointer; color: #009933;" title="Editar"></span>
                                    <span name="delBtn" class="fas fa-trash-alt" data="<?php echo e($perm->getId()); ?>" style="cursor: pointer;color: #ff0000;" title="Excluir"></span>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                    </tbody>
                </table>

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

    <!-- Inclui formulário modal -->
    <?php echo $__env->make('partials._modal_form',
    [
        'titulo'=> 'Nova Permissão',
		'icone'=>'fa-lock',
        'rota' => 'adm.permissao.salvar',
        'campos'=> 
        [
            [
                'id' =>'cbSistema',
                'label'=>'Sistema',
                'nome'=>'sistema',
                'tipo'=>'combo',
                'opcoes'=> $sistema,
                'default'=>'Selecione o Sistema'
            ],
            [
                'id' =>'cbUsuario',
                'label'=>'Usuário',
                'nome'=>'usuario',
                'tipo'=>'combo',
                'opcoes'=> $usuario,
                'default'=>'Selecione o Usuário'
            ],
            [
                'id' =>'cbClasse',
                'label'=>'Classe',
                'nome'=>'classe',
                'tipo'=>'combo',
                'opcoes'=> $classe,
                'default'=>'Selecione a Classe'
            ],
        ]
    ], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>

    <?php echo $__env->make('partials._modal_delete',
    [
        'rota'=>'adm.permissao.delete',
        'titulo'=>'Confirma Exclusão',
        'mensagem_delete'=>'Tem certeza que deseja excluir a Permissão'
    ], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>