
<?php $__env->startSection('title'); ?>
    <title><?php echo e($menus->where('id',12)->first()->navbar); ?></title>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('user-content'); ?>

<!--===BREADCRUMB PART START====-->
  <section class="wsus__breadcrumb" style="background: url(<?php echo e(url($banner_image->image)); ?>);">
    <div class="wsus_bread_overlay">
        <div class="container">
            <div class="row">
                <div class="col-12 text-center">
                    <h4><?php echo e($menus->where('id',12)->first()->navbar); ?></h4>
                    <nav style="--bs-breadcrumb-divider: '-';" aria-label="breadcrumb">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item"><a href="<?php echo e(route('home')); ?>"><?php echo e($menus->where('id',1)->first()->navbar); ?></a></li>
                            <li class="breadcrumb-item active" aria-current="page"><?php echo e($menus->where('id',12)->first()->navbar); ?></li>
                        </ol>
                    </nav>
                </div>
            </div>
        </div>
    </div>
</section>
<!--===BREADCRUMB PART END====-->


<!--=======LOGON PART START=========-->
<section class="wsus__logon mt_45 mb_45">
    <div class="container">
        <div class="row justify-content-center">
            <div class="col-xl-5 col-md-6">
                <div class="wsus__login_form">
                    <h3><?php echo e($websiteLang->where('lang_key','if_account_exist')->first()->custom_text); ?> <?php echo e($websiteLang->where('lang_key','login_here')->first()->custom_text); ?></h3>
                    <form id="loginFormSubmit">
                        <?php echo csrf_field(); ?>
                        <div class="form-group">
                            <div class="input-group input-group-lg">
                                <div class="input-group-prepend">
                                    <span class="input-group-text">
                                        <i class="fad fa-user-circle"></i>
                                    </span>
                                </div>
                                <input id="loginEmail" class="form-control form-control-lg" type="email" name="email" placeholder="<?php echo e($websiteLang->where('lang_key','email')->first()->custom_text); ?>" value="<?php echo e(env('PROJECT_MODE')==0 ? 'agent@gmail.com' : ''); ?>">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="input-group input-group-lg">
                                <div class="input-group-prepend">
                                    <span class="input-group-text">
                                        <i class="fas fa-key"></i>
                                    </span>
                                </div>
                                <input id="loginPassword" class="form-control form-control-lg" type="password" name="password" placeholder="<?php echo e($websiteLang->where('lang_key','pass')->first()->custom_text); ?>" value="<?php echo e(env('PROJECT_MODE')==0 ? 1234 : ''); ?>">
                            </div>
                        </div>

                        <?php if($setting->allow_captcha==1): ?>
                            <div class="form-group mt-2">
                                <div class="input-group input-group-lg">
                                    <div class="g-recaptcha" data-sitekey="<?php echo e($setting->captcha_key); ?>"></div>
                                </div>
                            </div>
                            <?php endif; ?>

                        <div class="wsus__check_area">
                            <div class="form-check">
                                <input name="remember" class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
                                <label class="form-check-label" for="flexCheckDefault">
                                    <?php echo e($websiteLang->where('lang_key','remember')->first()->custom_text); ?>

                                </label>
                            </div>
                            <a href="<?php echo e(route('forget.password')); ?>"><?php echo e($websiteLang->where('lang_key','forget_your_pass')->first()->custom_text); ?></a>
                        </div>
                        <div class="wsus__reg_forget">
                            <button class="common_btn" type="submit" id="userLoginBtn"><?php echo e($websiteLang->where('lang_key','login')->first()->custom_text); ?></button>
                        </div>
                    </form>
                </div>
            </div>
            <div class="col-xl-5 col-md-6 offset-xl-1 ml_to_mr">
                <div class="wsus__login_form ">
                    <h3><?php echo e($websiteLang->where('lang_key','dont_have_account')->first()->custom_text); ?> <?php echo e($websiteLang->where('lang_key','please_register')->first()->custom_text); ?></h3>
                    <form id="registerFormSubmit">
                        <?php echo csrf_field(); ?>
                        <div class="form-group">
                            <div class="input-group input-group-lg">
                                <div class="input-group-prepend">
                                    <span class="input-group-text">
                                        <i class="fad fa-user-circle"></i>
                                    </span>
                                </div>
                                <input class="form-control form-control-lg" type="text" name="name" id="regName" placeholder="<?php echo e($websiteLang->where('lang_key','name')->first()->custom_text); ?>">
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="input-group input-group-lg">
                                <div class="input-group-prepend">
                                    <span class="input-group-text">
                                        <i class="fas fa-envelope"></i>
                                    </span>
                                </div>
                                <input class="form-control form-control-lg" type="email" id="regEmail" name="email" placeholder="<?php echo e($websiteLang->where('lang_key','email')->first()->custom_text); ?>">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="input-group input-group-lg">
                                <div class="input-group-prepend">
                                    <span class="input-group-text">
                                        <i class="fas fa-key"></i>
                                    </span>
                                </div>
                                <input class="form-control form-control-lg" type="password" id="regPassword" name="password" placeholder="<?php echo e($websiteLang->where('lang_key','pass')->first()->custom_text); ?>">
                            </div>
                        </div>

                        <?php if($setting->allow_captcha==1): ?>
                        <div class="form-group mt-2">
                            <div class="input-group input-group-lg">
                                <div class="g-recaptcha" data-sitekey="<?php echo e($setting->captcha_key); ?>"></div>
                            </div>
                        </div>
                        <?php endif; ?>

                        <button id="registerBtn" class="common_btn" type="submit"><i id="reg-spinner" class="loading-icon fa fa-spin fa-spinner d-none"></i> <?php echo e($websiteLang->where('lang_key','create_account')->first()->custom_text); ?></button>
                    </form>
                </div>
            </div>
        </div>
    </div>
</section>
<!--======= LOGON PART END========-->



<?php
    $search_url = request()->fullUrl();
?>


<script>
    (function($) {
    "use strict";
    $(document).ready(function () {
        $("#userLoginBtn").on('click',function(e) {
            e.preventDefault();
            $.ajax({
                url: "<?php echo e(route('login')); ?>",
                type:"post",
                data:$('#loginFormSubmit').serialize(),
                success:function(response){
                    if(response.success){
                        window.location.href = "<?php echo e(route('user.dashboard')); ?>";
                        toastr.success(response.success)

                    }
                    if(response.error){
                        toastr.error(response.error)

                        var query_url='<?php echo $search_url; ?>';
                        window.location.href = query_url;

                    }
                },
                error:function(response){
                    if(response.responseJSON.errors.email)toastr.error(response.responseJSON.errors.email[0])
                    if(response.responseJSON.errors.password){
                        toastr.error(response.responseJSON.errors.password[0])
                    }else{
                        toastr.error('Please Complete the recaptcha to submit the form')
                    }


                }

            });


        })


        $(document).on('keyup', '#loginEmail, #loginPassword', function (e) {
            if(e.keyCode == 13){
                e.preventDefault();

                $.ajax({
                url: "<?php echo e(route('login')); ?>",
                type:"post",
                data:$('#loginFormSubmit').serialize(),
                success:function(response){
                    if(response.success){
                        window.location.href = "<?php echo e(route('user.dashboard')); ?>";
                        toastr.success(response.success)

                    }
                    if(response.error){
                        toastr.error(response.error)

                        var query_url='<?php echo $search_url; ?>';
                        window.location.href = query_url;

                    }
                },
                error:function(response){


                    if(response.responseJSON.errors.email)toastr.error(response.responseJSON.errors.email[0])
                    if(response.responseJSON.errors.password){
                        toastr.error(response.responseJSON.errors.password[0])
                    }else{
                        toastr.error('Please Complete the recaptcha to submit the form')
                    }

                }

            });
            }

        })



        $("#registerBtn").on('click',function(e) {
            e.preventDefault();
                // 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
            $("#reg-spinner").removeClass('d-none')
            $("#registerBtn").addClass('custom-opacity')
            $("#registerBtn").attr('disabled',true);
            $.ajax({
                url: "<?php echo e(route('register')); ?>",
                type:"post",
                data:$('#registerFormSubmit').serialize(),
                success:function(response){
                    if(response.success){
                        $("#registerFormSubmit").trigger("reset");
                        $("#reg-spinner").addClass('d-none')
                        $("#registerBtn").removeClass('custom-opacity')
                        $("#registerBtn").attr('disabled',false);
                        toastr.success(response.success)
                    }
                    if(response.error){
                        toastr.error(response.error)

                        var query_url='<?php echo $search_url; ?>';
                        window.location.href = query_url;
                    }
                },
                error:function(response){
                    if(response.responseJSON.errors.name){
                        $("#reg-spinner").addClass('d-none')
                        $("#registerBtn").removeClass('custom-opacity')
                        $("#registerBtn").attr('disabled',false);
                        $("#registerBtn").addClass('site-btn-effect')
                        toastr.error(response.responseJSON.errors.name[0])
                    }

                    if(response.responseJSON.errors.email){
                        $("#reg-spinner").addClass('d-none')
                        $("#registerBtn").removeClass('custom-opacity')
                        $("#registerBtn").attr('disabled',false);
                        $("#registerBtn").addClass('site-btn-effect')
                        toastr.error(response.responseJSON.errors.email[0])
                    }

                    if(response.responseJSON.errors.password){
                        $("#reg-spinner").addClass('d-none')
                        $("#registerBtn").removeClass('custom-opacity')
                        $("#registerBtn").attr('disabled',false);
                        $("#registerBtn").addClass('site-btn-effect')
                        toastr.error(response.responseJSON.errors.password[0])
                    }else{
                        $("#reg-spinner").addClass('d-none')
                        $("#registerBtn").removeClass('custom-opacity')
                        $("#registerBtn").attr('disabled',false);
                        $("#registerBtn").addClass('site-btn-effect')
                        toastr.error('Please Complete the recaptcha to submit the form')
                    }



                }

            });


        })

        $(document).on('keyup', '#regEmail, #regPassword, #regName', function (e) {
            if(e.keyCode == 13){
                e.preventDefault();
                // 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
            $("#reg-spinner").removeClass('d-none')
            $("#registerBtn").addClass('custom-opacity')
            $("#registerBtn").attr('disabled',true);
            $.ajax({
                url: "<?php echo e(route('register')); ?>",
                type:"post",
                data:$('#registerFormSubmit').serialize(),
                success:function(response){
                    if(response.success){
                        $("#registerFormSubmit").trigger("reset");
                        $("#reg-spinner").addClass('d-none')
                        $("#registerBtn").removeClass('custom-opacity')
                        $("#registerBtn").attr('disabled',false);
                        toastr.success(response.success)
                    }
                    if(response.error){
                        toastr.error(response.error)
                        var query_url='<?php echo $search_url; ?>';
                        window.location.href = query_url;
                    }
                },
                error:function(response){
                    if(response.responseJSON.errors.name){
                        $("#reg-spinner").addClass('d-none')
                        $("#registerBtn").removeClass('custom-opacity')
                        $("#registerBtn").attr('disabled',false);
                        $("#registerBtn").addClass('site-btn-effect')
                        toastr.error(response.responseJSON.errors.name[0])
                    }

                    if(response.responseJSON.errors.email){
                        $("#reg-spinner").addClass('d-none')
                        $("#registerBtn").removeClass('custom-opacity')
                        $("#registerBtn").attr('disabled',false);
                        $("#registerBtn").addClass('site-btn-effect')
                        toastr.error(response.responseJSON.errors.email[0])
                    }

                    if(response.responseJSON.errors.password){
                        $("#reg-spinner").addClass('d-none')
                        $("#registerBtn").removeClass('custom-opacity')
                        $("#registerBtn").attr('disabled',false);
                        $("#registerBtn").addClass('site-btn-effect')
                        toastr.error(response.responseJSON.errors.password[0])
                    }else{
                        $("#reg-spinner").addClass('d-none')
                        $("#registerBtn").removeClass('custom-opacity')
                        $("#registerBtn").attr('disabled',false);
                        $("#registerBtn").addClass('site-btn-effect')
                        toastr.error('Please Complete the recaptcha to submit the form')
                    }


                }

            });

            }

        })

    });

    })(jQuery);
</script>

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



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