<?php $__env->startSection('content'); ?>
    
    <form action="<?php echo e(route('reseller-area.update', $model)); ?>" method="POST">
        <?php echo method_field('PUT'); ?>
        <?php echo csrf_field(); ?>
        <div class="card">
            <div class="card-body">

                <input type="hidden" name="id" value="<?php echo e($model->id); ?>">
                <div class="row">
                <div class="form-group col-md-4">
                    <label for="reseller_id" class="block text-sm font-medium text-gray-700">
                        Manager*
                    </label>
                    <select class="select2 form-control" name="reseller_id" id="reseller">
                        <option value="">Select One</option>
                        <?php $__empty_1 = true; $__currentLoopData = $reseller; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <option value="<?php echo e($item->id); ?>" <?php echo e($item->id == $model->reseller_id ? 'selected' : ''); ?>>
                                <?php echo e($item->name); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <?php endif; ?>
                    </select>
                    <?php $__errorArgs = ['reseller_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <div class="alert alert-danger mt-1">
                            <?php echo e($message); ?>

                        </div>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>

                <div class="form-group col-md-4 <?php if(globalPermission('hidePopOnCreateArea')): ?> d-none <?php endif; ?> "">
                    <label> Select POP </label>
                    <select name="pop_id" id="pop" class="select2 form-control ">
                        <option value="<?php echo e($model->pop_id); ?>">
                            <?php echo e($model->pop->popname ?? ''); ?></option>
                    </select>
                </div>

                <div class="form-group col-md-4">
                    <label for="area" class="block text-sm font-medium text-gray-700">
                        Area*
                    </label>
                    <input type="text" name="area" id="area" class="form-control" placeholder="Area"
                        value="<?php echo e($model->area); ?>" autocomplete="off">
                    <?php $__errorArgs = ['area'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <div class="alert alert-danger mt-1">
                            <?php echo e($message); ?>

                        </div>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>
            </div>
                <div class="form-group">
                    <button type="submit" class="btn btn-primary float-right">
                        Update
                    </button>
                </div>

            </div>
        </div>


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

<?php $__env->startSection('ajax'); ?>
    <script type="text/javascript">
        window.setTimeout(function() {
            window.location.reload();
        }, 100000);

        $(function() {

            $('#reseller').on('change', function(e) {
                e.preventDefault();
                $('body').append('<div class="hidden" id="processing">processing.....</div>');

                $.ajax({
                    type: 'get',
                    url: '<?php echo e(route('getResellerPopList')); ?>',
                    data: {
                        id: $(this).val()
                    },
                    success: function(result) {
                        $('#pop').html(result);
                        $('#processing').remove();
                    }
                });
            });

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

<?php echo $__env->make('layout.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/spacewalker/radius-circle/resources/views/resellerArea/edit.blade.php ENDPATH**/ ?>