<form action="<?php echo e(Utils::transformURL($grid->data->path())); ?>" ajax-request="<?php echo e($grid->htmlid); ?>" <?php echo e($grid->ajaxGrid ? 'ajax-enabled="true"' : ''); ?>>
<input type="hidden" name="sf" value="<?php echo e(request('sf')); ?>">
<input type="hidden" name="so" value="<?php echo e(request('so')); ?>">
<input type="hidden" name="page" value="<?php echo e($grid->data->currentPage()); ?>">
<input type="hidden" name="search" value="<?php echo e(request('search')); ?>" />
<?php $__currentLoopData = $grid->parameters; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $parameter): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<input type="hidden" name="<?php echo e($parameter); ?>" value="<?php echo e(request($parameter)); ?>">
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<table class="table table-hover table-striped table-bordered custom-table-grid">
    <thead>
        <tr>
        <?php $__empty_1 = true; $__currentLoopData = $grid->columns; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $grid_column): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <th>
            <?php if( $grid_column->sort ): ?>
                <?php
                    $sort_style = 'column-sort-default';
                    $sort_order = 'asc';
                    if( $grid->sort_field == $grid_column->position ) {
                        $sort_style = $grid->sort_order == 'asc' ? 'column-sort-asc' : 'column-sort-desc';
                        $sort_order = $grid->sort_order == 'desc' ? 'asc' : 'desc';
                    }
                ?>
                <a href="javascript:void(0)" onclick="submit_grid(this, '<?php echo e($grid_column->position); ?>', '<?php echo e($sort_order); ?>' )" class="<?php echo e($sort_style); ?>" ><?php echo $grid_column->title; ?></a>
            <?php else: ?>
                <?php echo $grid_column->title; ?>

            <?php endif; ?>
            <br>
            <?php if( $grid_column->filter ): ?>
                <?php
                    $filter_css_class = $grid_column->filter_field_type == 'date' ? 'date-range' : null;
                    $filter_user_value = request('filter')[$grid_column->position] ?? '';

                    if( $grid_column->filter_field_type == 'date' && !strtotime($filter_user_value) ) {
                        $filter_user_value = '';
                    }
                ?>

                <?php if( $grid_column->filter_values ): ?>
                    <select class="form-control" name="filter[<?php echo e($grid_column->position); ?>]" onchange="submit_grid(this,null,null,1);">
                    <option value="">Seleccionar</option>
                    <?php $__currentLoopData = $grid_column->filter_values; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php
                            $option_selected = ($key ==  $filter_user_value) ? 'selected' : '';
                        ?> 
                        <option value="<?php echo e($key); ?>" <?php echo e($option_selected); ?> ><?php echo e($value); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                <?php else: ?>
                    <input type="text" name="filter[<?php echo e($grid_column->position); ?>]" value="<?php echo e($filter_user_value); ?>" class="form-control <?php echo e($filter_css_class); ?>" onkeypress="if(event.which==13)submit_grid(this,null,null,1);">
                <?php endif; ?>
                
            <?php endif; ?>
            </th>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <th>No columns</th>
        <?php endif; ?>
        </tr>
    </thead>
    <tbody>
        <?php $__empty_1 = true; $__currentLoopData = $grid->data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $grid_record): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
        <?php 
            $row_style = null;
            if( !$grid->row_style ) {
                $row_style = '';
            } else if ( is_string($grid->row_style) ) {
                $row_style = $grid->row_style;
            } else {
                $row_style = ($grid->row_style)($grid, $grid_record);
            }
        ?>
        <tr <?php echo $row_style; ?> >
            <?php $__currentLoopData = $grid->columns; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $grid_column): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <td <?php echo $grid_column->style; ?>>
                <?php if( $grid_column->html_decorator ): ?>
                    <?php if($grid_column->encode): ?>
                        <?php echo e(($grid_column->html_decorator)($grid_record)); ?>

                    <?php else: ?>
                        <?php echo ($grid_column->html_decorator)($grid_record); ?>

                    <?php endif; ?>
                <?php else: ?>
                    <?php 
                        $attribute_name = explode('.', $grid_column->name);
                        $attribute_name = count($attribute_name) > 1 ? $attribute_name[1] : $attribute_name[0];
                        $column_value = $grid_record[$attribute_name];
                    ?>
                    <?php if($grid_column->encode): ?>
                        <?php echo e($column_value); ?>

                    <?php else: ?>
                        <?php echo $column_value; ?>

                    <?php endif; ?>
                <?php endif; ?>
            </td>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </tr>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
        <tr>
            <td colspan="1000" align="center"><?php echo e($grid->label_no_records); ?></td>
        </tr>
        <?php endif; ?>
    </tbody>
    <?php $paginator = $grid->data; ?>
    <?php if($paginator->hasPages()): ?>
    <tfoot>
        <tr>
            <td colspan="1000">
                <div class="row">
                    <div class="col text-left">Mostrando <?php echo e($grid->data->firstItem()); ?> a <?php echo e($grid->data->lastItem()); ?> de <?php echo e($grid->data->total()); ?> Registros</div>
                    <div class="col">
                        
                        <ul class="pagination justify-content-end">
                            
                            <?php if($paginator->onFirstPage()): ?>
                                <li class="page-item disabled">
                                    <span class="page-link"><?php echo app('translator')->get('pagination.previous'); ?></span>
                                </li>
                            <?php else: ?>
                                <li class="page-item">
                                    <input type="button" class="page-link cold-color" value="<?php echo app('translator')->get('pagination.previous'); ?>" onclick="submit_grid(this, null, null, <?php echo e($paginator->currentPage()-1); ?> )" />
                                </li>
                                
                            <?php endif; ?>

                            <?php if( $paginator->currentPage() > 2 ): ?>
                                <li class="page-item">
                                    <input type="button" class="page-link cold-color" value="1" onclick="submit_grid(this, null, null, 1)" />
                                </li>
                                <li class="page-item disabled"><span class="page-link"> ... </span></li>
                            <?php endif; ?>


                            <?php if( $paginator->currentPage() > 1 ): ?>
                                <li class="page-item">
                                    <input type="button" class="page-link cold-color" value="<?php echo e($paginator->currentPage()-1); ?>" onclick="submit_grid(this, null, null, <?php echo e($paginator->currentPage()-1); ?>)" />
                                </li>
                            <?php endif; ?>
                                
                            <li class="page-item">
                                <input type="button" class="page-link cold-color" style="background-color: #2E7178;color:white" value="<?php echo e($paginator->currentPage()); ?>" />
                            </li>

                            <?php if( $paginator->currentPage() < $paginator->lastPage() ): ?>
                                <li class="page-item">
                                    <input type="button" class="page-link cold-color" value="<?php echo e($paginator->currentPage()+1); ?>" onclick="submit_grid(this, null, null, <?php echo e($paginator->currentPage()+1); ?>)" />
                                </li>
                            <?php endif; ?>

                            
                            <?php if( $paginator->currentPage() < $paginator->lastPage() - 1 ): ?>
                                <li class="page-item disabled"><span class="page-link"> ... </span></li>
                                <li class="page-item">
                                    <input type="button" class="page-link cold-color" value="<?php echo e($paginator->lastPage()); ?>" onclick="submit_grid(this, null, null, <?php echo e($paginator->lastPage()); ?>)" />
                                </li>
                            <?php endif; ?>

                            
                            <?php if($paginator->hasMorePages()): ?>
                                <li class="page-item">
                                    <input type="button" class="page-link cold-color" value="<?php echo app('translator')->get('pagination.next'); ?>" onclick="submit_grid(this, null, null, <?php echo e($paginator->currentPage()+1); ?> )" />
                                </li>
                            <?php else: ?>
                                <li class="page-item disabled">
                                    <span class="page-link"> <?php echo app('translator')->get('pagination.next'); ?> </span>
                                </li>
                            <?php endif; ?>
                        </ul>
                    </div>
                </div>
            </td>
        </tr>
    </tfoot>
    <?php endif; ?>
</table>
</form>
<?php /**PATH C:\xampp74\htdocs\projects\lrvl_indicators\resources\views/helpers/grid.blade.php ENDPATH**/ ?>