<?php
  $search = isset($_GET['search']) ? $_GET['search'] : $_GET['search']= '';
?>
<div class="card prodcard">
  <div class="card-body">
    <form action="<?php echo e(route('admin.pesqCategoria')); ?>" method="get">
      <?php echo e(csrf_field()); ?>

      <div class="input-group mb-sm-3">
        <input type="text" class="form-control" name="search" placeholder="Ex: Categoria" value="<?php echo e($search); ?>">
        <div class="input-group-append">
          <button class="btn btn-outline-secondary" type="submit">Pesquisar</button>
        </div>
        <div class="input-group-append">
          <button class="btn btn-outline-secondary" type="button"
                  onclick="location.href = '<?php echo e(route('admin.cadastrarCategoria')); ?>'">Cadastrar
          </button>
        </div>
      </div>
    </form>
    <table class="table table-sm table-hover ">
      <thead>
      <tr class="row small">
        <th class="col-xs-2 col-sm-2 col-md-2 col-lg-2">Código</th>
        <th class="col-xs-7 col-sm-7 col-md-7 col-lg-5">Descrição</th>
        <th class="text-center col-xs-3 col-sm-3 col-md-3 col-lg-5">Ação</th>
      </tr>
      </thead>
      <tbody>
      <?php $__currentLoopData = $categorias; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cat): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <tr class="row">
          <td class="col-xs-2 col-sm-2 col-md-2 col-lg-2"><?php echo e($cat->codigo); ?></td>
          <td class="col-xs-5 col-sm-5 col-md-5 col-lg-5"><?php echo e($cat->descricao); ?></td>
          <td class="text-center col-xs-3 col-sm-3 col-md-3 col-lg-5">
            
            <button class="btn btn-sm btn-outline-success col-lg-4 col-md-6 col-sm-12" type="submit"
                    onclick="location.href = '<?php echo e(route('admin.manCategoria',$cat->codigo)); ?>'">Editar
            </button>
            <button class="btn btn-sm btn-outline-danger col-lg-4 col-md-6 col-sm-12" type="button" data-toggle="modal"
                    data-target="#modalDel<?php echo e($cat->codigo); ?>">Deletar
            </button>
          </td>
        </tr>
        
        <div class="modal fade" id="modalDel<?php echo e($cat->codigo); ?>" tabindex="-1" role="dialog"
             aria-labelledby="modalDel.<?php echo e($cat->codigo); ?>" aria-hidden="true">
          <div class="modal-dialog modal-dialog" role="document">
            <div class="modal-content">
              <div class="modal-header text-right">
                <h5 class="text-center">Deseja realmente excluir esta Categoria?</h5>
              </div>
              <div class=" modal-footer align-content-center">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Fechar</button>
                <button type="button" class="btn btn-danger "
                        onclick="location.href = '<?php echo e(route('admin.deleteCategoria',$cat->codigo  )); ?>'">Excluir
                </button>
              </div>
            </div>
          </div>
        </div>
      <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
      </tbody>
    </table>
    <div class="row justify-content-sm-center pagprod">
      <?php echo e($categorias->links()); ?>

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

<?php /**PATH C:\projects\lara\projectwix\resources\views/painel/_includes/_produtos/listaCategorias.blade.php ENDPATH**/ ?>