<?php $__env->startSection('titulo'); ?>
    <i class="fas fa-flask"></i> Fórmulas
<?php $__env->stopSection(); ?>

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

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

                <table id="tbFormula" class="table table-hover text-left">
                    <thead>
                        <tr>
                            <th>Descrição</th>
                            <th>Ações</th>
                        </tr>
                    </thead>
                    <tbody>

                        <?php $__currentLoopData = $formula; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $form): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td id="<?php echo e($form->getId()); ?>_descricao"><?php echo e($form->getDescricao()); ?></td>
                                <td>
                                    <span name="editBtn" class="fas fa-edit" data="<?php echo e($form->getId()); ?>" style="cursor: pointer;color: #009933;" title="Editar"></span>
                                    <span name="delBtn" class="fas fa-trash-alt" data="<?php echo e($form->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 Fórmula',
		'icone'=>'fa-flask',
        'rota' => 'adm.formula.salvar',
        'campos'=> 
        [
            [
                'id' =>'txtDescricao',
                'label'=>'Descrição',
                'nome'=>'descricao',
                'tamanho'=>'50',
                '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.formula.delete',
        'titulo'=>'Confirma Exclusão',
        'mensagem_delete'=>'Tem certeza que deseja excluir a Fórmula'
    ], \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(); ?>