<?php $request = app('Illuminate\Http\Request'); ?>


<?php $__env->startSection('content'); ?>
    <h3 class="page-title"><?php echo app('translator')->get('quickadmin.presentation-phone.title'); ?></h3>

    <div class="panel panel-default presentation-phone">
        <div class="panel-heading header-block">
            <?php echo $__env->make('partials.header-filter', [
                'model_key' => $model_key,
                'gate_key' => $gate_key,
                'search_id' => $search_id,
                'listForSelect' => $filterList
            ], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
        </div>

        <div class="panel-body table-responsive">
            <table class="table table-bordered table-striped <?php echo e(count($presentation_phones) > 0 ? 'datatable' : ''); ?>

            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('presentation_phone_delete')): ?> <?php if( request('show_deleted') != 1 ): ?> dt-select <?php endif; ?> <?php endif; ?>">
                <thead>
                <tr>
                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('presentation_phone_delete')): ?>
                        <?php if( request('show_deleted') != 1 ): ?>
                            <th style="text-align:center;"><input type="checkbox" id="select-all"/></th><?php endif; ?>
                    <?php endif; ?>

                    <th><?php echo app('translator')->get('quickadmin.presentation-phone.fields.phone'); ?></th>
                    <th><?php echo app('translator')->get('quickadmin.presentation-phone.fields.residential-complexes'); ?></th>
                        <?php if( request('show_deleted') == 1 ): ?>
                        <th><?php echo app('translator')->get('quickadmin.qa_action'); ?></th>
                    <?php else: ?>
                        <th><?php echo app('translator')->get('quickadmin.qa_action'); ?></th>
                    <?php endif; ?>
                </tr>
                </thead>

                <tbody>
                <?php if(count($presentation_phones) > 0): ?>
                    <?php $__currentLoopData = $presentation_phones; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $presentation_phone): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr data-entry-id="<?php echo e($presentation_phone->id); ?>">
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('presentation_phone_delete')): ?>
                                <?php if( request('show_deleted') != 1 ): ?>
                                    <td></td><?php endif; ?>
                            <?php endif; ?>
                            <td field-key='phone'><?php echo e($presentation_phone->phone); ?></td>
                            <td field-key='residential_complexes'><?php echo e($presentation_phone->residential_complex->name ?? ''); ?></td>

                            <?php if( request('show_deleted') == 1 ): ?>
                                <td class="action">
                                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('presentation_phone_delete')): ?>
                                        <?php echo Form::open(array(
        'style' => 'display: inline-block;',
        'method' => 'POST',
        'onsubmit' => "return confirm('".trans("quickadmin.qa_are_you_sure")."');",
        'route' => ['admin.customer_appeals.restore', $presentation_phone->id])); ?>

                                        <?php echo Form::submit(trans('quickadmin.qa_restore'), array('class' => 'btn btn-xs btn-success')); ?>

                                        <?php echo Form::close(); ?>

                                    <?php endif; ?>
                                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('presentation_phone_delete')): ?>
                                        <?php echo Form::open(array(
        'style' => 'display: inline-block;',
        'method' => 'DELETE',
        'onsubmit' => "return confirm('".trans("quickadmin.qa_are_you_sure")."');",
        'route' => ['admin.customer_appeals.perma_del', $presentation_phone->id])); ?>

                                        <?php echo Form::submit(trans('quickadmin.qa_permadel'), array('class' => 'btn btn-xs btn-danger')); ?>

                                        <?php echo Form::close(); ?>

                                    <?php endif; ?>
                                </td>
                            <?php else: ?>
                                <td class="action">
                                    
                                        
                                           
                                    
                                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('customer_appeal_edit')): ?>
                                        <a href="<?php echo e(route('admin.presentation_phones.edit',[$presentation_phone->id])); ?>"
                                           class="btn btn-xs btn-info"><?php echo app('translator')->get('quickadmin.qa_edit'); ?></a>
                                    <?php endif; ?>
                                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('presentation_phone_delete')): ?>
                                        <?php echo Form::open(array(
                                                                                'style' => 'display: inline-block;',
                                                                                'method' => 'DELETE',
                                                                                'onsubmit' => "return confirm('".trans("quickadmin.qa_are_you_sure")."');",
                                                                                'route' => ['admin.presentation_phones.destroy', $presentation_phone->id])); ?>

                                        <?php echo Form::submit(trans('quickadmin.qa_delete'), array('class' => 'btn btn-xs btn-danger')); ?>

                                        <?php echo Form::close(); ?>

                                    <?php endif; ?>
                                </td>
                            <?php endif; ?>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php else: ?>
                    <tr>
                        <td colspan="13"><?php echo app('translator')->get('quickadmin.qa_no_entries_in_table'); ?></td>
                    </tr>
                <?php endif; ?>
                </tbody>
            </table>
            <?php if( !isset($search_id) && request('show_deleted') != 1): ?>
                <?php echo e($presentation_phones->links()); ?>

            <?php endif; ?>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('javascript'); ?>
    <script>
        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('presentation_phone_delete')): ?>
                <?php if( request('show_deleted') != 1 ): ?> window.route_mass_crud_entries_destroy = '<?php echo e(route('admin.customer_appeals.mass_destroy')); ?>'; <?php endif; ?>
        <?php endif; ?>

    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/vdoma/resources/views/admin/presentation_phones/index.blade.php ENDPATH**/ ?>