<?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">
            <div class="col-xs-12 col-lg-4">
                <div class="row">
                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('developer_create')): ?>
                        <a href="<?php echo e(route('admin.developers.create')); ?>"
                           class="btn btn-success"><?php echo app('translator')->get('quickadmin.qa_add_new'); ?></a>
                    <?php endif; ?>
                </div>
            </div>

            <?php if(request('show_deleted') != 1): ?>
                <div class="col-xs-12 col-lg-4">
                    <?php echo $__env->make('partials.main-search', [
                    'route' => route('admin.developers.index'),
                    'search_id' => $search_id,
                    'listForSelect' => $developersFilter
                    ], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                </div>
            <?php endif; ?>

            <div class="col-xs-12 col-lg-4">
                <div class="row">
                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('developer_delete')): ?>
                        <ul class="list-inline">
                            <li><a href="<?php echo e(route('admin.developers.index')); ?>"
                                   style="<?php echo e(request('show_deleted') == 1 ? '' : 'font-weight: 700'); ?>"><?php echo app('translator')->get('quickadmin.qa_all'); ?></a>
                            </li>
                            |
                            <li><a href="<?php echo e(route('admin.developers.index')); ?>?show_deleted=1"
                                   style="<?php echo e(request('show_deleted') == 1 ? 'font-weight: 700' : ''); ?>"><?php echo app('translator')->get('quickadmin.qa_trash'); ?></a>
                            </li>
                        </ul>
                    <?php endif; ?>
                </div>
            </div>
        </div>

        <div class="panel-body table-responsive">
            <table class="table table-bordered table-striped <?php echo e(count($developers) > 0 ? 'datatable' : ''); ?> <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('developer_delete')): ?> <?php if( request('show_deleted') != 1 ): ?> dt-select <?php endif; ?> <?php endif; ?> developers-table">
                <thead>
                <tr>
                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('developer_delete')): ?>
                        <?php if( request('show_deleted') != 1 ): ?>
                            <th style="text-align:center;" rowspan="2"><input type="checkbox" id="select-all"/>
                            </th><?php endif; ?>
                    <?php endif; ?>
                    <th rowspan="2"><?php echo app('translator')->get('quickadmin.developer.fields.name'); ?></th>
                    <th rowspan="2"><?php echo app('translator')->get('quickadmin.developer.fields.code'); ?></th>
                    <th rowspan="2"><?php echo app('translator')->get('quickadmin.developer.fields.enabled'); ?></th>
                    <th rowspan="2"><?php echo app('translator')->get('quickadmin.developer.fields.email'); ?></th>
                    <th rowspan="2"><?php echo app('translator')->get('quickadmin.developer.fields.phone'); ?></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.developer.fields.birthday'); ?></th>
                    <th rowspan="2"><?php echo app('translator')->get('quickadmin.developer.fields.city'); ?></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.developer.fields.main-page-priority_index'); ?></th>
                    <th><?php echo app('translator')->get('quickadmin.developer.fields.developer-page-priority_index'); ?></th>
                </tr>
                </thead>

                <tbody>
                <?php if(count($developers) > 0): ?>
                    <?php $__currentLoopData = $developers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $developer): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr data-entry-id="<?php echo e($developer->id); ?>">
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('developer_delete')): ?>
                                <?php if( request('show_deleted') != 1 ): ?>
                                    <td></td><?php endif; ?>
                            <?php endif; ?>
                            <td field-key='name'><?php echo e($developer->name); ?></td>
                            <td field-key='code'><?php echo e($developer->code); ?></td>
                            <td field-key='enabled'><?php echo e(Form::checkbox("enabled", 1, $developer->enabled == 1 ? true : false, ["disabled"])); ?></td>
                            <td field-key='email'><?php echo e($developer->email); ?></td>
                            <td field-key='phone'><?php echo e($developer->phone); ?></td>
                            <td field-key='main_page_priority'><?php echo e($developer->main_page_priority); ?></td>
                            <td field-key='developer_page_priority'><?php echo e($developer->developer_page_priority); ?></td>
                            <td><?php echo e($developer->birthday ? $developer->birthday : ""); ?></td>
                            <td field-key='city'><?php echo e($developer->city->name ?? ''); ?></td>
                            <?php if( request('show_deleted') == 1 ): ?>
                                <td>
                                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('developer_delete')): ?>
                                        <?php echo Form::open(array(
        'style' => 'display: inline-block;',
        'method' => 'POST',
        'onsubmit' => "return confirm('".trans("quickadmin.qa_are_you_sure")."');",
        'route' => ['admin.developers.restore', $developer->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('developer_delete')): ?>
                                        <?php echo Form::open(array(
        'style' => 'display: inline-block;',
        'method' => 'DELETE',
        'onsubmit' => "return confirm('".trans("quickadmin.qa_are_you_sure")."');",
        'route' => ['admin.developers.perma_del', $developer->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('developer_view')): ?>
                                        <a href="<?php echo e(route('admin.developers.show',[$developer->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('developer_edit')): ?>
                                        <a href="<?php echo e(route('admin.developers.edit',[$developer->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('developer_delete')): ?>
                                        <?php echo Form::open(array(
                                                                                'style' => 'display: inline-block;',
                                                                                'method' => 'DELETE',
                                                                                'onsubmit' => "return confirm('".trans("quickadmin.qa_are_you_sure")."');",
                                                                                'route' => ['admin.developers.destroy', $developer->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="23"><?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($developers->links()); ?>

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

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