<?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(session('login') == 'yes' ? 'active' : ''); ?>"><?php echo e(__('members.login')); ?></a>
                                <a href="<?php echo e(route('user.register')); ?>" class="link <?php echo e(session('login') == 'no' ? 'active' : ''); ?>"><?php echo e(__('members.register')); ?></a>
                            </div>
                            <p class="p text-center mt-4 mb-4"><?php echo e(__('members.login_register_hint')); ?>  </p>
                            <form method="post" action="<?php echo e(route('user.doRegAndLogin')); ?>" class="register_login_form">
                                <div class="form-group">
                                    <input name="phone" class="form-control" type="tel" placeholder="<?php echo e(__('members.phone')); ?>"/>
                                </div>
                                <div class="mt-5">
                                    <button class="butn m-auto d-block register_login_button"><span><b><?php echo e($buttonTitle); ?></b></span></button>
                                </div>
                                <p class="another_opt text-center mt-4"><?php echo e(__('members.dont_have_account')); ?> <a href="<?php echo e(route('user.register')); ?>"><?php echo e(__('members.register')); ?></a></p>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
<?php $__env->stopSection(); ?>

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

    <script>
        $('.register_login_button').click(async function (e) {
            e.preventDefault();
            $(this).attr('disabled', true);
            let form = $('.register_login_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 C:\wamp64\www\legal\resources\views/web/users/register_login.blade.php ENDPATH**/ ?>