
<?php $__env->startSection('title'); ?>
<title><?php echo e($websiteLang->where('lang_key','admin')->first()->custom_text); ?></title>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('admin-content'); ?>
    <!-- Page Heading -->
    <h1 class="h3 mb-2 text-gray-800"><a href="<?php echo e(route('admin.admin-list.create')); ?>" class="btn btn-primary"><i class="fas fa-plus" aria-hidden="true"></i> <?php echo e($websiteLang->where('lang_key','create')->first()->custom_text); ?> </a></h1>
    <!-- DataTales Example -->
    <div class="card shadow mb-4">
        <div class="card-header py-3">
            <h6 class="m-0 font-weight-bold text-primary"><?php echo e($websiteLang->where('lang_key','admin_table')->first()->custom_text); ?></h6>
        </div>
        <div class="card-body">
            <div class="table-responsive">
                <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
                    <thead>
                        <tr>
                            <th width="5%"><?php echo e($websiteLang->where('lang_key','serial')->first()->custom_text); ?></th>
                            <th width="20%"><?php echo e($websiteLang->where('lang_key','name')->first()->custom_text); ?></th>
                            <th width="20%"><?php echo e($websiteLang->where('lang_key','email')->first()->custom_text); ?></th>
                            <th width="15%"><?php echo e($websiteLang->where('lang_key','img')->first()->custom_text); ?></th>
                            <th width="15%"><?php echo e($websiteLang->where('lang_key','status')->first()->custom_text); ?></th>
                            <th width="15%"><?php echo e($websiteLang->where('lang_key','action')->first()->custom_text); ?></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $__currentLoopData = $admins; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <td><?php echo e(++$index); ?></td>
                            <td><?php echo e($item->name); ?></td>
                            <td><?php echo e($item->email); ?></td>
                            <td><?php if($item->image): ?>
                                <img src="<?php echo e(url($item->image)); ?>"  width="100px">
                            <?php endif; ?></td>
                            <td>
                                <?php if($currentAdmin->id !=$item->id): ?>
                                <?php if($item->status==1): ?>
                                <a href="" onclick="adminStatus(<?php echo e($item->id); ?>)"><input type="checkbox" checked data-toggle="toggle" data-on="<?php echo e($websiteLang->where('lang_key','active')->first()->custom_text); ?>" data-off="<?php echo e($websiteLang->where('lang_key','inactive')->first()->custom_text); ?>" data-onstyle="success" data-offstyle="danger"></a>
                                <?php else: ?>
                                    <a href="" onclick="adminStatus(<?php echo e($item->id); ?>)"><input type="checkbox" data-toggle="toggle" data-on="<?php echo e($websiteLang->where('lang_key','active')->first()->custom_text); ?>" data-off="<?php echo e($websiteLang->where('lang_key','inactive')->first()->custom_text); ?>" data-onstyle="success" data-offstyle="danger"></a>

                                <?php endif; ?>
                                <?php endif; ?>
                            </td>
                            <td>
                                <?php if($currentAdmin->id !=$item->id): ?>

                                <?php if($item->properties->count()==0): ?>
                                <a data-toggle="modal" data-target="#deleteModal" href="javascript:;" onclick="deleteData(<?php echo e($item->id); ?>)" class="btn btn-danger btn-sm"><i class="fas fa-trash    "></i></a>
                                <?php endif; ?>

                                <?php endif; ?>



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

                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <script>
        function deleteData(id){
            $("#deleteForm").attr("action",'<?php echo e(url("admin/admin-list/")); ?>'+"/"+id)
        }

        function adminStatus(id){
            // project demo mode check
            var isDemo="<?php echo e(env('PROJECT_MODE')); ?>"
            var demoNotify="<?php echo e(env('NOTIFY_TEXT')); ?>"
            if(isDemo==0){
                toastr.error(demoNotify);
                return;
            }
            // end
            $.ajax({
                type:"get",
                url:"<?php echo e(url('/admin/admin-status/')); ?>"+"/"+id,
                success:function(response){
                   toastr.success(response)
                },
                error:function(err){
                    console.log(err);

                }
            })
        }
    </script>
<?php $__env->stopSection(); ?>

















<?php echo $__env->make('layouts.admin.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/cloudelite/imobi.eliteteclda.com/resources/views/admin/admin/index.blade.php ENDPATH**/ ?>