<?php $__env->startSection('content'); ?>
    <section class="register-pg">
        <div class="container">
            <div class="inner">
                <div class="row">
                    <div class="col-md-6">
                        <div class="logo-box">
                            <img src="<?php echo e(asset('assets/web/images/logo.svg')); ?>" alt="" class="logo"/>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="text-box">
                            <div class="links-top mb-5">
                                <a href="<?php echo e(route('user.login')); ?>" class="link "><?php echo e(__('members.login')); ?></a>
                                <a href="<?php echo e(route('user.register')); ?>" class="link active"><?php echo e(__('members.register')); ?></a>
                            </div>
                            <p class="p text-center mt-4 mb-4"><?php echo e(__('members.register_hint')); ?> </p>
                            <form method="post" action="<?php echo e(route('user.doCompleteRegister')); ?>" class="complete_register_form">
                                <div class="form-group">
                                    <input name="name" class="form-control" type="text" placeholder="<?php echo e(__('members.name')); ?>"/>
                                </div>
                                <div class="form-group">
                                    <input name="email" class="form-control" type="text" placeholder="<?php echo e(__('members.email')); ?>"/>
                                </div>
                                <div class="form-group">
                                    <select name="city_id" class="form-select form-control" aria-label="Default select example">
                                        <option selected value=""><?php echo e(__('members.city_id')); ?></option>
                                        <?php if(count($cities)): ?>
                                            <?php $__currentLoopData = $cities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $city): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($city->id); ?>"><?php echo e($city->name); ?></option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        <?php endif; ?>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <select name="gender" class="form-select form-control" aria-label="Default select example">
                                        <option selected value=""><?php echo e(__('members.gender')); ?></option>
                                        <option value="male"><?php echo e(__('members.male')); ?></option>
                                        <option value="female"><?php echo e(__('members.female')); ?></option>
                                    </select>
                                </div>
                                <div class="form-group form-check mt-4">
                                    <input name="agreement" class="form-check-input" type="checkbox" value="1" id="flexCheckDefault">
                                    <label class="form-check-label" for="flexCheckDefault">
                                        <?php echo e(__('members.agree_to')); ?> <a target="_blank" href="<?php echo e(route('termsConditions')); ?>"><?php echo e(__('members.term_conditions')); ?></a>
                                    </label>
                                </div>
                                <div class="mt-5">
                                    <button class="butn m-auto d-block complete_register_button"><span><b><?php echo e(__('members.register')); ?></b></span></button>
                                </div>
                                <p class="another_opt text-center mt-4"> <?php echo e(__('members.already_have_account')); ?> <a href="<?php echo e(route('user.login')); ?>"><?php echo e(__('members.login')); ?></a></p>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
<?php $__env->stopSection(); ?>

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

    <script>

        $('.complete_register_button').click(async function (e) {
            e.preventDefault();
            $(this).attr('disabled', true);
            let form = $('.complete_register_form'),
                data = new FormData(form[0]),
                url = form.attr('action'),
                method = form.attr('method');

            const response=await ajax({
                url,
                data,
                dataType: 'json',
                method,
                contentType: false,
                processData: false,
            });

            if (response.errors) {
                $(this).attr('disabled', false);
                toasterError(response.errors);
            }
            if (response.url) {
                window.location.href = response.url;
            }
        });


    </script>

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

<?php echo $__env->make('web.layouts.container', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/balyomhost/public_html/legal/resources/views/web/users/complete_register.blade.php ENDPATH**/ ?>