<?php $__env->startSection('titulo'); ?>
    <i class="fas fa-cog"></i> Parâmetros
<?php $__env->stopSection(); ?>

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

<?php $__env->startSection('pagina'); ?>
    
    <div class="container-fluid">
        <div class="card rounded text-left">
            <div class="card-body">
                <div class="row" >
                    <div class="col text-right">
                        <button id="btnNovoParametro" type="button" class="btn btn-primary" aria-label="Left Align" >
                            <i class="fas fa-plus-circle"></i> Novo Parâmetro
                        </button>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="card mt-2">
            <div class="card-body">
                <div class="row" >
                    <div class="col panel panel-primary table-responsive">

                        <table id="tbParametros" class="table table-hover text-left">
                            <thead>
                                <tr>
                                    <th>Código</th>
                                    <th>Descrição</th>
                                    <th>Valor</th>
                                    <th>Ações</th>
                                </tr>
                            </thead>
                            <tbody>

                                <?php $__currentLoopData = $parametros; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $param): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td id="<?php echo e($param->getId()); ?>_codigo"><?php echo e($param->getCodigo()); ?></td>
                                        <td id="<?php echo e($param->getId()); ?>_descricao"><?php echo e($param->getDescricao()); ?></td>
                                        <td id="<?php echo e($param->getId()); ?>_valor"><?php echo e($param->getValor()); ?></td>
                                        <td>
                                            <span name="editBtn" class="fas fa-edit fa-lg" data="<?php echo e($param->getId()); ?>" style="cursor: pointer; color: #009933;" title="Editar"></span>
                                            <span name="delBtn" class="fas fa-trash-alt fa-lg" data="<?php echo e($param->getId()); ?>" style="cursor: pointer;color: #ff0000;" title="Excluir"></span>
                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                            </tbody>
                        </table>

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

    <!-- Inclui formulário modal -->
    <?php echo $__env->make('partials._modal_form',
    [
        'titulo'=> 'Novo Parâmetro',
		'icone'=>'fa-cog',
        'rota' => 'adm.parametro.salvar',
        'campos'=> 
        [
            [
                'id' =>'txtCodigo',
                'label'=>'Código',
                'nome'=>'codigo',
                'tamanho'=>'6',
                'tipo'=>'txt',
                'required'=> true,
                'autofocus'=> true,
                'disabled'=>false
            ],
            [
                'id' =>'txtDescricao',
                'label'=>'Descrição',
                'nome'=>'descricao',
                'tamanho'=>'50',
                'tipo'=>'txt',
                'required'=> true,
                'autofocus'=> true,
                'disabled'=>false
            ],
            [
                'id' =>'txtValor',
                'label'=>'Valor',
                'nome'=>'valor',
                'tamanho'=>'100',
                'tipo'=>'txt',
                'required'=> true,
                'autofocus'=> true,
                'disabled'=>false
            ]
        ]
    ], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>

    <?php echo $__env->make('partials._modal_delete',
    [
        'rota'=>'adm.parametro.delete',
        'titulo'=>'Confirma Exclusão',
        'mensagem_delete'=>'Tem certeza que deseja excluir o Parâmetro'
    ], \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(); ?>