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


<?php $__env->startSection('content'); ?>
    <h3 class="page-title"><?php echo app('translator')->get('quickadmin.qa_list'); ?> житлових комплексів</h3>
    <div class="panel panel-default">
        <div class="panel-heading header-block">
            <?php echo $__env->make('partials.rc-filter', [
                'page' => 'residential_complex',
                 'url_index' => route('admin.residential_complexes.index'),
                 'url_create' => route('admin.residential_complexes.create')
                 ], \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($residential_complexes) > 0 ? 'datatable' : ''); ?> <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('residential_complex_delete')): ?> <?php if( request('show_deleted') != 1 ): ?> dt-select <?php endif; ?> <?php endif; ?> residential-complexes-table">
                <thead>
                <tr>
                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('residential_complex_delete')): ?>
                        <?php if( request('show_deleted') != 1 ): ?>
                            <th rowspan="2" style="text-align:center;"><input type="checkbox" id="select-all"/>
                            </th><?php endif; ?>
                    <?php endif; ?>

                    <th rowspan="2"><?php echo app('translator')->get('quickadmin.residential-complex.fields.name'); ?></th>
                    <th rowspan="2"><?php echo app('translator')->get('quickadmin.residential-complex.fields.code'); ?></th>
                    <th rowspan="2"><?php echo app('translator')->get('quickadmin.residential-complex.fields.enabled'); ?></th>
                    <th rowspan="2"><?php echo app('translator')->get('quickadmin.residential-complex.fields.developer'); ?></th>

                    <th colspan="2" id="priority-border"><?php echo app('translator')->get('quickadmin.developer.fields.page-priority'); ?></th>

                    <th rowspan="2"><?php echo app('translator')->get('quickadmin.residential-complex.fields.min-price'); ?></th>
                    <th rowspan="2"><?php echo app('translator')->get('quickadmin.residential-complex.fields.city'); ?></th>
                    <th rowspan="2"><?php echo app('translator')->get('quickadmin.residential-complex.fields.district'); ?></th>
                    <th rowspan="2"><?php echo app('translator')->get('quickadmin.residential-complex.fields.street-name'); ?></th>
                    <th rowspan="2"><?php echo app('translator')->get('quickadmin.residential-complex.fields.stage-of-construction'); ?></th>
                    <?php if( request('show_deleted') == 1 ): ?>
                        <th rowspan="2"><?php echo app('translator')->get('quickadmin.qa_action'); ?></th>
                    <?php else: ?>
                        <th rowspan="2"><?php echo app('translator')->get('quickadmin.qa_action'); ?></th>
                    <?php endif; ?>
                </tr>
                <tr>
                    <th><?php echo app('translator')->get('quickadmin.residential-complex.fields.main-page-priority_index'); ?></th>
                    <th><?php echo app('translator')->get('quickadmin.residential-complex.fields.res-com-page-priority_index'); ?></th>
                </tr>
                </thead>

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

                            <td field-key='name'><?php echo e($residential_complex->name); ?></td>
                            <td field-key='code'><?php echo e($residential_complex->code); ?></td>
                            <td field-key='enabled'><?php echo e(Form::checkbox("enabled", 1, $residential_complex->enabled == 1 ? true : false, ["disabled"])); ?></td>
                            <td field-key='developer'><?php echo e($residential_complex->developer->name ?? ''); ?></td>
                            <td field-key='main_page_priority'><?php echo e($residential_complex->main_page_priority); ?></td>
                            <td field-key='res_com_page_priority'><?php echo e($residential_complex->res_com_page_priority); ?></td>
                            <td field-key='min_price'><?php echo e($residential_complex->min_price); ?></td>
                            <td field-key='city'><?php echo e($residential_complex->city->name ?? ''); ?></td>
                            <td field-key='district'><?php echo e($residential_complex->district->name ?? ''); ?></td>
                            <td field-key='street_name'><?php echo e($residential_complex->street_name->name ?? ''); ?></td>
                            <td field-key='stage_of_construction'><?php echo e($residential_complex->stageOfConstruction->name ?? ''); ?></td>
                            <?php if( request('show_deleted') == 1 ): ?>
                                <td class="action">
                                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('residential_complex_delete')): ?>
                                        <?php echo Form::open(array(
        'style' => 'display: inline-block;',
        'method' => 'POST',
        'onsubmit' => "return confirm('".trans("quickadmin.qa_are_you_sure")."');",
        'route' => ['admin.residential_complexes.restore', $residential_complex->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('residential_complex_delete')): ?>
                                        <?php echo Form::open(array(
        'style' => 'display: inline-block;',
        'method' => 'DELETE',
        'onsubmit' => "return confirm('".trans("quickadmin.qa_are_you_sure")."');",
        'route' => ['admin.residential_complexes.perma_del', $residential_complex->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('residential_complex_view')): ?>
                                        <a href="<?php echo e(route('admin.residential_complexes.show',[$residential_complex->id])); ?>"
                                           class="btn btn-xs btn-primary"><?php echo app('translator')->get('quickadmin.qa_view'); ?></a>
                                    <?php endif; ?>
                                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('residential_complex_edit')): ?>
                                        <a href="<?php echo e(route('admin.residential_complexes.edit',[$residential_complex->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('residential_complex_delete')): ?>
                                        <?php echo Form::open(array(
                                                                                'style' => 'display: inline-block;',
                                                                                'method' => 'DELETE',
                                                                                'onsubmit' => "return confirm('".trans("quickadmin.qa_are_you_sure")."');",
                                                                                'route' => ['admin.residential_complexes.destroy', $residential_complex->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="41"><?php echo app('translator')->get('quickadmin.qa_no_entries_in_table'); ?></td>
                    </tr>
                <?php endif; ?>
                </tbody>
            </table>
            <?php if( !isset($residental_complex_id) && request('show_deleted') != 1): ?>
                <?php echo e($residential_complexes->links()); ?>

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

<?php $__env->startSection('javascript'); ?>
    <script>
        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('residential_complex_delete')): ?>
                <?php if( request('show_deleted') != 1 ): ?> window.route_mass_crud_entries_destroy = '<?php echo e(route('admin.residential_complexes.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/residential_complexes/index.blade.php ENDPATH**/ ?>