
<?php $__env->startSection('title'); ?>
<title><?php echo e($websiteLang->where('lang_key','menu_section')->first()->custom_text); ?></title>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('admin-content'); ?>
    <!-- DataTales Example -->
    <div class="row">
        <div class="col-md-8">
            <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','menu_section')->first()->custom_text); ?></h6>
                </div>
                <div class="card-body">

                    <form action="<?php echo e(route('admin.menu-update')); ?>" method="POST">
                        <?php echo csrf_field(); ?>
                    <table class="table table-bordered">
                        <?php $__currentLoopData = $navigations; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td><?php echo e($item->name); ?></td>
                                <td><input type="text" class="form-control" name="navbars[]" value="<?php echo e($item->navbar); ?>"></td>
                                <input type="hidden" value="<?php echo e($item->id); ?>" name="ids[]">
                                <input type="hidden" value="<?php echo e($item->name); ?>" name="names[]">
                                <td>
                                    <?php if($item->status==1): ?>
                                <a href="" onclick="menuStatus(<?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="menuStatus(<?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; ?>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </table>
                    <button type="submit" class="btn btn-success"><?php echo e($websiteLang->where('lang_key','update')->first()->custom_text); ?></button>
                </div>
            </form>
            </div>
        </div>
    </div>


<script>
    function menuStatus(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/menu-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/navbar/index.blade.php ENDPATH**/ ?>