<?php $__env->startSection('title', 'المستخدمين'); ?>

<?php if (isset($component)) { $__componentOriginal87153cb05046bd89775d952622994180bb7c1b1e = $component; } ?>
<?php $component = App\View\Components\Dashboard\Css::resolve(['link' => 'admin/admins'] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('dashboard.css'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\Dashboard\Css::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal87153cb05046bd89775d952622994180bb7c1b1e)): ?>
<?php $component = $__componentOriginal87153cb05046bd89775d952622994180bb7c1b1e; ?>
<?php unset($__componentOriginal87153cb05046bd89775d952622994180bb7c1b1e); ?>
<?php endif; ?>

<?php $__env->startSection('content'); ?>

    <?php
        $addBtn = null;
    ?>
    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('create_admin')): ?>
        <?php
            $addBtn = [
                'name' => 'إضافة مستخدم',
                'class' => 'btn-main',
                'options' => [
                    'data-toggle' => 'modal',
                    'data-target' => '#createModel',
                    'type' => 'button',
                ],
            ];
        ?>
    <?php endif; ?>

    <?php if (isset($component)) { $__componentOriginal342b33bfa6f7d125441314a0164864e25786c1fa = $component; } ?>
<?php $component = App\View\Components\Dashboard\LinksBar::resolve(['links' => [
        [
            'link' => adminUrl('admins'),
        ],
    ],'buttons' => [
        $addBtn,
        [
            'name' => 'بحث',
            'class' => 'btn btn-soft-main',
            'options' => [
                'data-toggle' => 'modal',
                'data-target' => '.bd-example-modal-lg',
                'type' => 'button',
            ],
        ],
    ]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('dashboard.links-bar'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\Dashboard\LinksBar::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal342b33bfa6f7d125441314a0164864e25786c1fa)): ?>
<?php $component = $__componentOriginal342b33bfa6f7d125441314a0164864e25786c1fa; ?>
<?php unset($__componentOriginal342b33bfa6f7d125441314a0164864e25786c1fa); ?>
<?php endif; ?>

    <section id="admins">
        <div class="row">

            <?php $__currentLoopData = $admins; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div class="col-xxl-3 col-xl-4 col-lg-6 col-md-4">
                    <div class="box admin-card p-0">

                        <div class="cover">
                            <?php if($row->cover == null || !file_exists(smallPath($coverPath . '/' . $row->cover))): ?>
                                <img class="w-100 object-cover"
                                    src="<?php echo e(asset('dashboard/images/admin/covers/small/' . rand(1, 7) . '.jpg')); ?>"
                                    alt="">
                            <?php else: ?>
                                <img class="w-100 object-cover" src="<?php echo e(smallAsset($coverPath . '/' . $row->cover)); ?>"
                                    alt="">
                            <?php endif; ?>
                        </div><!-- cover -->

                        <div class="p-4">

                            <div class="avatar p-1 rounded-circle text-center">
                                <?php if($row->avatar == null || !file_exists(smallPath($avatarPath . '/' . $row->avatar))): ?>
                                    <span
                                        class=" font-28"><?php echo e(mb_substr($row->f_name, 0, 1) . mb_substr($row->l_name, 0, 1)); ?></span>
                                <?php else: ?>
                                    <img class="rounded-circle  object-cover w-100 h-100"
                                        src="<?php echo e(smallAsset($avatarPath . '/' . $row->avatar)); ?>" alt="">
                                <?php endif; ?>
                            </div><!-- avatar -->


                            <div class="info text-center mt-5">

                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('show_another_admins_profile')): ?>
                                    <a href="<?php echo e(adminUrl('profile/show/' . $row->id)); ?>">
                                        <h6 class="admin-name font-18 text-center d-inline text-primary">
                                            <?php echo e($row->f_name . ' ' . $row->l_name); ?></h6>
                                        <?php if($row->status == 0): ?>
                                            <small class=" badge badge-soft-danger font-11 status-badge">الحساب محظور</small>
                                        <?php endif; ?>
                                    </a>
                                <?php else: ?>
                                    <h6 class="admin-name font-18 text-center d-inline text-black">
                                        <?php echo e($row->f_name . ' ' . $row->l_name); ?>

                                    </h6>
                                    <?php if($row->status == 0): ?>
                                        <small class=" badge badge-soft-danger font-11 status-badge">الحساب محظور</small>
                                    <?php endif; ?>
                                <?php endif; ?>


                                <small class=" text-second d-block">
                                    <?php if($row->job == null): ?>
                                        لم يتم إدخال المسمى الوظيفي
                                    <?php else: ?>
                                        <?php echo e($row->job); ?>

                                    <?php endif; ?>
                                </small>

                            </div><!-- info -->


                            <div class=" text-center mt-3">

                                <?php $__empty_1 = true; $__currentLoopData = $row->roles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $role): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    <span class=" badge badge-light border"><?php echo e(Str::headLine($role->name)); ?></span>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                    <span class=" badge badge-warning ">لا يوجد أدوار</span>
                                <?php endif; ?>
                            </div>



                        </div><!-- padding -->

                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any(['activate_deactivate_admin'])): ?>
                            <?php if(!in_array(owner(), $row->roles->pluck('name')->toArray()) && $row->id != adminId()): ?>
                                <div class="controls">
                                    <div class="btn-group">
                                        <button class="dropdown-toggle" type="button" id="triggerId" data-toggle="dropdown"
                                            aria-haspopup="true" aria-expanded="false">
                                            <i class="fa-solid fa-ellipsis"></i>
                                        </button>

                                        <div class="dropdown-menu dropdown-menu-right" aria-labelledby="triggerId">

                                            <?php if(\Spatie\Permission\PermissionServiceProvider::bladeMethodWrapper('hasRole', owner())): ?>
                                                <a class="dropdown-item font-14 text-second"
                                                    href="<?php echo e(adminUrl('admins/edit/' . $row->id)); ?>">تعديل</a>
                                            <?php endif; ?>

                                            <?php if($row->status > 0): ?>
                                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('activate_deactivate_admin')): ?>
                                                    <form class="form-status" action="<?php echo e(route('closed-admin-account')); ?>"
                                                        method="POST">
                                                        <?php echo csrf_field(); ?>
                                                        <?php echo method_field('PATCH'); ?>
                                                        <input type="hidden" name="id" value="<?php echo e($row->id); ?>">
                                                        <button type="submit"
                                                            class="btn-change-status dropdown-item font-14 text-second">حظر
                                                            الحساب</button>
                                                    </form>
                                                <?php endif; ?>
                                            <?php else: ?>
                                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('create_admin')): ?>
                                                    <form class="form-status" action="<?php echo e(route('active-admin-account')); ?>"
                                                        method="POST">
                                                        <?php echo csrf_field(); ?>
                                                        <?php echo method_field('PATCH'); ?>
                                                        <input type="hidden" name="id" value="<?php echo e($row->id); ?>">
                                                        <button type="submit"
                                                            class="btn-change-status dropdown-item font-14 text-second">إلغاء حظر
                                                            الحساب</button>
                                                    </form>
                                                <?php endif; ?>
                                            <?php endif; ?>

                                        </div><!-- End Menu -->

                                    </div>
                                </div><!-- controls -->
                            <?php endif; ?>
                        <?php endif; ?>

                    </div><!-- box -->
                </div><!-- admin card -->
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

        </div><!-- row -->
    </section><!-- admins -->

    <!-- Search Modal -->
    <div class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel"
        aria-hidden="true">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">

                <div class="modal-header">
                    <h5 class="modal-title">بحث</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="إغلاق">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>

                <div class="modal-body">

                    <form id="form-search" action="<?php echo e(route('admin-search')); ?>" method="POST">
                        <?php echo csrf_field(); ?>
                        <div class="row">
                            <div class="col-9 pr-remove pl-remove">
                                <?php if (isset($component)) { $__componentOriginal1c669f5858ba8e548f3c58b275327fb2f8e6401a = $component; } ?>
<?php $component = App\View\Components\FormGroup::resolve(['properties' => [
                                    'input' => [
                                        'name' => 'name',
                                        'options' => [
                                            'placeholder' => 'الاسم',
                                            'class' => 'input-search',
                                        ],
                                    ],
                                ]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('form-group'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\FormGroup::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal1c669f5858ba8e548f3c58b275327fb2f8e6401a)): ?>
<?php $component = $__componentOriginal1c669f5858ba8e548f3c58b275327fb2f8e6401a; ?>
<?php unset($__componentOriginal1c669f5858ba8e548f3c58b275327fb2f8e6401a); ?>
<?php endif; ?>
                            </div>
                            <div class="col-3">
                                <button type="submit" class="btn btn-search btn-main btn-block"><i
                                        class="fa-solid fa-magnifying-glass"></i></button>
                            </div>
                        </div>

                    </form>

                    <div id="response-data"></div><!-- response from js -->

                </div>

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

    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('create_admin')): ?>
        <!-- Create Model -->
        <div class="modal fade" id="createModel" tabindex="-1" role="dialog" aria-labelledby="modelTitleId"
            aria-hidden="true">
            <div class="modal-dialog" role="document">
                <div class="modal-content">

                    <div class="modal-header">
                        <h5 class="modal-title">إضافة مشرف</h5>
                        <button type="button" class="close" data-dismiss="modal" aria-label="إغلاق">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>

                    <form class="ajax-post" action="<?php echo e(route('create-admin')); ?>" method="POST"
                        enctype="multipart/form-data">
                        <?php echo csrf_field(); ?>
                        <div class="modal-body">

                            <div class="row">

                                <div class="col-6">
                                    <?php if (isset($component)) { $__componentOriginal1c669f5858ba8e548f3c58b275327fb2f8e6401a = $component; } ?>
<?php $component = App\View\Components\FormGroup::resolve(['properties' => [
                                        'input' => [
                                            'name' => 'f_name',
                                            'options' => ['required'],
                                        ],
                                        'label' => [
                                            'text' => 'الاسم الأول',
                                            'options' => ['class' => 'required'],
                                        ],
                                    ]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('form-group'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\FormGroup::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal1c669f5858ba8e548f3c58b275327fb2f8e6401a)): ?>
<?php $component = $__componentOriginal1c669f5858ba8e548f3c58b275327fb2f8e6401a; ?>
<?php unset($__componentOriginal1c669f5858ba8e548f3c58b275327fb2f8e6401a); ?>
<?php endif; ?><!-- f_name -->
                                </div>

                                <div class="col-6">
                                    <?php if (isset($component)) { $__componentOriginal1c669f5858ba8e548f3c58b275327fb2f8e6401a = $component; } ?>
<?php $component = App\View\Components\FormGroup::resolve(['properties' => [
                                        'input' => [
                                            'name' => 'l_name',
                                            'options' => ['required'],
                                        ],
                                        'label' => [
                                            'text' => 'الاسم الاخير',
                                            'options' => ['class' => 'required'],
                                        ],
                                    ]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('form-group'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\FormGroup::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal1c669f5858ba8e548f3c58b275327fb2f8e6401a)): ?>
<?php $component = $__componentOriginal1c669f5858ba8e548f3c58b275327fb2f8e6401a; ?>
<?php unset($__componentOriginal1c669f5858ba8e548f3c58b275327fb2f8e6401a); ?>
<?php endif; ?><!-- l_name -->
                                </div>

                                <div class="col-12">
                                    <?php if (isset($component)) { $__componentOriginal1c669f5858ba8e548f3c58b275327fb2f8e6401a = $component; } ?>
<?php $component = App\View\Components\FormGroup::resolve(['properties' => [
                                        'input' => [
                                            'name' => 'email',
                                            'type' => 'email',
                                            'options' => ['required'],
                                        ],
                                        'label' => [
                                            'text' => 'البريد الإلكتروني',
                                            'options' => ['class' => 'required'],
                                        ],
                                    ]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('form-group'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\FormGroup::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal1c669f5858ba8e548f3c58b275327fb2f8e6401a)): ?>
<?php $component = $__componentOriginal1c669f5858ba8e548f3c58b275327fb2f8e6401a; ?>
<?php unset($__componentOriginal1c669f5858ba8e548f3c58b275327fb2f8e6401a); ?>
<?php endif; ?><!-- email -->
                                </div>

                                <div class="col-9">
                                    <?php if (isset($component)) { $__componentOriginal1c669f5858ba8e548f3c58b275327fb2f8e6401a = $component; } ?>
<?php $component = App\View\Components\FormGroup::resolve(['properties' => [
                                        'input' => [
                                            'name' => 'password',
                                            'options' => ['required', 'class' => 'accept-random'],
                                        ],
                                        'label' => [
                                            'text' => 'كلمة المرور',
                                            'options' => ['class' => 'required'],
                                        ],
                                    ]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('form-group'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\FormGroup::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal1c669f5858ba8e548f3c58b275327fb2f8e6401a)): ?>
<?php $component = $__componentOriginal1c669f5858ba8e548f3c58b275327fb2f8e6401a; ?>
<?php unset($__componentOriginal1c669f5858ba8e548f3c58b275327fb2f8e6401a); ?>
<?php endif; ?><!-- password -->
                                </div>

                                <div class="col-3 mt-2">
                                    <button type="button" class="generate-random btn btn-soft-info mt-4">عشوائية</button>
                                </div>


                                <div class="col-12">
                                    <label class=" font-weight-600">الأدوار</label>
                                    <div class="row">
                                        <?php $__currentLoopData = $roles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $role): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <div class="col-md-6 col-12">
                                                <div class="form-group mb-0">
                                                    <label class=" d-inline-block cursor-pointer">
                                                        <input class=" d-inline-block" type="checkbox" name="roles[]"
                                                            value="<?php echo e($role->name); ?>">
                                                        <?php echo e(Str::headLine(Str::limit($role->name, 25))); ?>

                                                    </label>
                                                </div>
                                            </div>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </div>
                                </div>


                            </div> <!-- row -->

                        </div>
                        <div class="modal-footer">
                            <button type="submit" class="btn btn-primary btn-block">إضافة جديد</button>
                        </div>
                    </form>

                </div>
            </div>
        </div>
    <?php endif; ?>

<?php $__env->stopSection(); ?>

<?php if (isset($component)) { $__componentOriginal4a1e9f4471bc858522cc3c6bd393eb0685be0fb1 = $component; } ?>
<?php $component = App\View\Components\Dashboard\Js::resolve(['links' => [
    [
        'link' => 'admin/admins.js',
        'from' => 'pages',
        'type' => 'module',
    ],
    [
        'link' => 'generate-random-characters.js',
        'from' => 'components',
    ],
]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('dashboard.js'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\Dashboard\Js::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal4a1e9f4471bc858522cc3c6bd393eb0685be0fb1)): ?>
<?php $component = $__componentOriginal4a1e9f4471bc858522cc3c6bd393eb0685be0fb1; ?>
<?php unset($__componentOriginal4a1e9f4471bc858522cc3c6bd393eb0685be0fb1); ?>
<?php endif; ?>

<?php echo $__env->make('dashboard.layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\internal-real-estate\resources\views/dashboard/admin/all.blade.php ENDPATH**/ ?>