403Webshell
Server IP : 103.234.187.230  /  Your IP : 216.73.216.216
Web Server : Apache
System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/b2b.hellogtx.com/public/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/b2b.hellogtx.com/public/js/login.js
$(document).ready(function() {
    $("#agentLoginForm").on('submit', function(e) {
        e.preventDefault();
        var data = $(this).serialize();
        if ($('#agentLoginForm input[name="username"]').val() == '') {
            $('#msg').html('Please enter your email').css('color', '#9f1717').fadeIn().delay(3000).fadeOut();
            $('#agentLoginForm input[name="username"]').focus();
            return false;
        }
        if ($('#agentLoginForm input[name="pass"]').val() == '') {
            $('#msg').html('Please enter your password').css('color', '#9f1717').fadeIn().delay(3000).fadeOut();
            $('#agentLoginForm input[name="pass"]').focus();
            return false;
        }
        if ($('#agentLoginForm input[name="captcha"]').val() == '') {
            $('#msg').html('Please enter captcha').css('color', '#9f1717').fadeIn().delay(3000).fadeOut();
            $('#agentLoginForm input[name="captcha"]').focus();
            return false;
        }
        
        var userrole = $('.userrole:checked').val();
         var redirectUrl = $('#redirectUrl').val();
        $('.loging').attr('disabled', 'disabled');
        var sendtype = $('#sendtype').val();
        $.ajax({
            url: SITEURL + 'index/agentcustomerlogin',
            type: 'POST',
            data: data+'&userrole='+userrole+'&redirectUrl'+redirectUrl,
            dataType: 'json',
            beforeSend: function() {
                if(sendtype == 0){
                    $('.loging').html('<i class="ace-icon fa fa-spinner fa-spin orange bigger-125"></i> Authentication...');
                }
                
            },
            success: function(result) {
                $('#sendtype').val(0);
                $('.resendOtpBtn').html('Resend');
                var steps = $('#steps').val();
                if (result.OTPAllow) {
                    $('.agentLoginFormDiv').hide();
                    $('.agentLoginOTPFormDiv').show();
                    $('#steps').val(2);
                    
                    $('.loging').html('Login').attr('disabled',false);
                    if(sendtype == 1){
                        $('.mobilenumber_otp').html('One Time Password(OTP) has been resent successfully.');
                    }else{
                        $('.mobilenumber_otp').html('One Time Password(OTP) has been sent your on your mobile ('+result.ContactNo1+') and email ID ('+result.EmailId+'), Please enter the same OTP here to login.');
                    }
                    
                    $('.loginOtp').hide();
                    $('.loginOtp,.register,.forgotpass,.resendOtpBtn').hide();
                    $('.timerDiv').show();
                    timer(30);
                    return false;
                } else if (result.status) {
                    $('#msg').html(result.message).css('color', 'green').fadeIn().delay(3000).fadeOut();
                    $('.loging,.agentLoginOTPFormDiv').hide();
                    $('#AgencySysId_').val(result.AgencySysId);
                    $('#MasterAgencySysId').val(result.MasterAgencySysId);
                    $('#SuperAgencySysId').val(result.SuperAgencySysId);
                    $('#UserSysId').val(result.UserSysId);
                    $('#CustomerSysId').val(result.CustomerSysId);
                    $('#EmailId').val(result.EmailId);
                    $('#AgentSalutation').val(result.Salutation);
                    $('#FirstName').val(result.FirstName); 
                    $('#LastName').val(result.LastName);
                    $('#AgencyCode').val(result.AgencyCode);
                    $('#AgencyName').val(result.AgencyName);
                    $('#Password_cu').val(result.Password);
                    $('#Contact_no').val(result.ContactNo1);
                    $('#MarkupType').val(result.MarkupType);
                    $('#Markup').val(result.Markup);
                    $('#SecurityKey').val(result.SecurityKey);
                    $('#Address').val(result.Address);
                    $('#PinCode').val(result.PinCode);
                    $('#TrxCurrency').val(result.TrxCurrency);
                    $('#CurrencySymbol').val(result.CurrencySymbol);
                    $('#AgencyMarketPlaceSysId').val(result.AgencyMarketPlaceSysId);
                    $('#auth_login_submit').submit();
                } else {
                    if(result.UserStatus == 'Deactivate'){
                        $('.agentLoginFormDiv,.resendBtn,.agentLoginOTPFormDiv,.userroleHtml,.login-form').hide(); 
                        $('#msg').show().html('Please contact administrator.').css('color', '#9f1717'); 
                        return false;
                    }
                    $('.loging').html('Login');
                    $('.loging').removeAttr('disabled', 'disabled');
                    $('#msg').html(result.message).css('color', '#9f1717').fadeIn().delay(3000).fadeOut();
                    //                    location.reload(true);
                    if(steps == 1){
                        getCaptchaImage();
                    }
                    
                    return false;
                }
            },
            error: function() {
                $('.loging').html('Login');
                $('.loging').removeAttr('disabled', 'disabled');
                alert('Oops unable to connect with server!!');
                getCaptchaImage();
            }
        });
    });

    $("#forgot_password").on('submit', function(e) {
        e.preventDefault();
        var data = $(this).serialize();
        if ($('#forgot_password input[name="forget"]').val() == '') {
            $('#msgForgot').html('Please enter your registered email id').css('color', 'red').fadeIn().delay(3000).fadeOut();
            $('#forgot_password input[name="forget"]').focus();
            return false;
        }
        var userrole = $('.userrole:checked').val();
        $('.forgot').attr('disabled', 'disabled');
        $.ajax({
            url: SITEURL + 'index/forgotpassword',
            type: 'POST',
            data: data+'&userrole='+userrole,
            dataType: 'json',
            beforeSend: function() {
                $('.forgot').html('<i class="ace-icon fa fa-spinner fa-spin orange bigger-125"></i> Please wait..');
            },
            success: function(result) {
                if (result.status) {
                    $('#msgForgot').html("<center color='green'>Your password has been sent. Please check your mailbox.</center>").css('color', 'green').fadeIn().delay(10000).fadeOut();
                    $('.hidedivs').hide();
                    $('.forgot').hide();
                } else {
                    $('.forgot').html('Submit');
                    $('.forgot').removeAttr('disabled', 'disabled');
                    $('#msgForgot').html(result.message).css('color', 'red').fadeIn().delay(3000).fadeOut();
                    return false;
                }
            },
            error: function() {
                $('.forgot').html('Submit');
                $('.forgot').removeAttr('disabled', 'disabled');
                alert('Oops unable to connect with server!!');
            }
        });
    });

    $("#reset_password").on('submit', function(e) {
        e.preventDefault();
        var data = $(this).serialize();
        if ($('#reset_password input[name="npass"]').val() === '') {
            $('.passchange_msg').html('Please enter new password').css('color', 'red').fadeIn().delay(3000).fadeOut();
            $('#reset_password input[name="npass"]').focus();
            return false;
        }
        if ($('#reset_password input[name="copass"]').val() === '') {
            $('.passchange_msg').html('Please enter confirm password').css('color', 'red').fadeIn().delay(3000).fadeOut();
            $('#reset_password input[name="copass"]').focus();
            return false;
        }
        if ($('#reset_password input[name="npass"]').val() !== $('#reset_password input[name="copass"]').val()) {
            $('.passchange_msg').html('Confirm password does not match with new password').css('color', 'red').fadeIn().delay(3000).fadeOut();
            $('#reset_password input[name="copass"]').focus();
            return false;
        }
        $('.change').attr('disabled', 'disabled');
        $.ajax({
            url: SITEURL + 'index/resetpassword',
            type: 'POST',
            data: data,
            dataType: 'json',
            beforeSend: function() {
                $('.change').html('<i class="ace-icon fa fa-spinner fa-spin orange bigger-125"></i> Please wait...');
            },
            success: function(result) {
                if (result.status) {
                    $('.change').html('Submit');
                    $('.change').removeAttr('disabled', 'disabled').hide();
                    $('.passchange_msg').html(result.message).css('color', 'green').fadeIn().delay(10000).fadeOut();
                    $('.passchangesuccess').show();
                    //window.location.href = SITEURL + "index/unsetresetdata";
                } else {
                    $('.change').html('Submit');
                    $('.change').removeAttr('disabled', 'disabled');
                    $('.passchange_msg').html(result.message).css('color', 'red');
                    return false;
                }
            },
            error: function() {
                $('.change').html('Submit');
                $('.change').removeAttr('disabled', 'disabled');
                alert('Oops unable to connect with server!!');
            }
        });
    });

    $("#register").on('submit', function(e) {
        $('.error').html('');
        //var EmailReg = new RegExp(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/);
        var EmailReg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
        e.preventDefault();
        var data = $(this).serialize();

        if ($('#register input[name="username"]').val() === '') {
            $('.register_msg,.errorCompanyName').html('Please enter Agency Name').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
            $('#register input[name="username"]').focus();
            return false;
        }
        //        if($('#register input[name="contact_person_name"]').val()===''){
        //            $('.register_msg').html('Please enter Contact Person Name').css('color','red').fadeIn().delay(3000).fadeOut();
        //            $('#register input[name="contact_person_name"]').focus();return false;
        //        }
        if ($('#register select[name="salutation"]').val() === '') {
            $('.register_msg,.errorFirstName').html('Please select salutation').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
            $('#register select[name="salutation"]').focus();
            return false;
        }
        if ($('#register input[name="first_name"]').val() === '') {
            $('.register_msg,.errorFirstName').html('Please enter first Name').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
            $('#register input[name="first_name"]').focus();
            return false;
        }
        if ($('#register input[name="last_name"]').val() === '') {
            $('.register_msg,.errorLastName').html('Please enter last Name').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
            $('#register input[name="last_name"]').focus();
            return false;
        }
        if ($('#register input[name="mobile_no"]').val() === '') {
            $('.register_msg,.errorMobileNumber').html('Please enter mobile Number').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
            $('#register input[name="mobile_no"]').focus();
            return false;
        }
        var countrycode = $('#register input[name="countrycode"]').val();
        if(countrycode == '+91' || countrycode == '91'){
            if ($('#register input[name="mobile_no"]').val().length != '10') {
                $('.register_msg').html('Mobile Number should be 10 digit?').css('color', 'red').fadeIn().delay(3000).fadeOut();
                $('#register input[name="mobile_no"]').focus(); return false;
            }
        }
        
        if (!$.isNumeric($('#register input[name="mobile_no"]').val())) {
            $('.register_msg,.errorMobileNumber').html('Mobile Number should be numeric!!').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
            $('#register input[name="mobile_no"]').focus();
            return false;
        }

        if ($('#register input[name="email_id"]').val() === '') {
            $('.register_msg,.errorEmailId').html('Please enter email Id').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
            $('#register input[name="email_id"]').focus();
            return false;
        }
        if (!EmailReg.test($('#register input[name="email_id"]').val())) {
            $('.register_msg,.errorEmailId').html('Please enter valid email address!!!').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
            $('#register input[name="email_id"]').focus();
            return false;
        }
         if ($('#register select[name="country_name"]').val() === '' || $('#register select[name="country_name"]').val() == 0) {
             $('.register_msg,.errorCountryName').html('Please select country').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
             $('#register select[name="country_name"]').focus();
             return false;
         }
         if ($('#register select[name="city_name"]').val() === '' || $('#register select[name="city_name"]').val() == 0) {
             $('.register_msg,.errorCity').html('Please select city from suggestion dropdown.').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
             $('#register select[name="city_name"]').focus();
             return false;
         }

        //        if ($('#register input[name="state_name"]').val() === '') {
        //            $('.register_msg').html('Please select State Name').css('color', 'red').fadeIn().delay(3000).fadeOut();
        //            $('#register input[name="state_name"]').focus(); return false;
        //        }
        $('.changeRegister').attr('disabled', 'disabled');

        $.ajax({
            url: SITEURL + 'index/request-for-registration',
            type: 'POST',
            data: data,
            dataType: 'json',

            beforeSend: function() {
                $('.changeRegister').html('<i class="ace-icon fa fa-spinner fa-spin orange bigger-125"></i> Please wait...');
            },
            success: function(result) {
                if (result.status) {
                    $('.changeRegister').hide();
                    //                    $('.changeRegister').html('Register Now');
                    $('#register').trigger("reset");
                    //alert('test');
                    $('.register_msg').html('Thanks for submitting your information and showing interest in our services. Our support executive will contact you soon and activate your account.</br> Thanks!').show().css('color', 'green').fadeIn().delay(50000).fadeOut();
                    //alert('test2');
                    $('.login-form').hide();
                    // $('.login-content-newbox').css('min-height','485px');
                    $('.login-content-newbox').css('min-height', '408px');
                } else {
                    $('.changeRegister').html('Register Now');
                    $('.changeRegister').removeAttr('disabled', 'disabled');
                    $('.passchange_msg').html(result.message);
                    $('.register_msg').html(result.message).show().css('color', 'red');
                    return false;
                }
            },
            error: function() {
                $('.changeRegister').html('Submit');
                $('.changeRegister').attr('disabled', false);
                alert('Oops unable to connect with server!!');
            }
        });
    });
    $("#registernew").on('submit', function(e) {
        $('.error,.register_msg').html('');
        //var EmailReg = new RegExp(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/);
        var EmailReg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
        e.preventDefault();
        var data = $(this).serialize();
        if ($('#registernew input[name="registerCountry_hidden"]').val() === '' || $('#registernew input[name="registerCountry_hidden"]').val() == 0) {
            $('.register_msg,.errorCountryName').html('Please select country').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
            $('#registernew input[name="country_name"]').focus();
            return false;
        }
        if ($('#registernew input[name="registerCityId_hidden"]').val() === '' || $('#registernew input[name="registerCityId_hidden"]').val() == 0) {
            $('.register_msg,.errorCity').html('Please select city from suggestion dropdown').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
            $('#registernew input[name="city_name"]').focus();
            return false;
        }
        if ($('#registernew input[name="username"]').val() === '') {
            $('.register_msg,.errorCompanyName').html('Please enter Agency Name').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
            $('#registernew input[name="username"]').focus();
            return false;
        }
        //        if($('#registernew input[name="contact_person_name"]').val()===''){
        //            $('.register_msg').html('Please enter Contact Person Name').css('color','red').fadeIn().delay(3000).fadeOut();
        //            $('#registernew input[name="contact_person_name"]').focus();return false;
        //        }
        if ($('#registernew select[name="salutation"]').val() === '') {
            $('.register_msg,.errorFirstName').html('Please select salutation').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
            $('#registernew select[name="salutation"]').focus();
            return false;
        }
        if ($('#registernew input[name="first_name"]').val() === '') {
            $('.register_msg,.errorFirstName').html('Please enter first Name').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
            $('#registernew input[name="first_name"]').focus();
            return false;
        }
        if ($('#registernew input[name="last_name"]').val() === '') {
            $('.register_msg,.errorLastName').html('Please enter last Name').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
            $('#registernew input[name="last_name"]').focus();
            return false;
        }
        if ($('#registernew input[name="mobile_no"]').val() === '') {
            $('.register_msg,.errorMobileNumber').html('Please enter mobile Number').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
            $('#registernew input[name="mobile_no"]').focus();
            return false;
        }
        //        if ($('#registernew input[name="mobile_no"]').val().length != '10') {
        //            $('.register_msg').html('Mobile Number should be 10 digit?').css('color', 'red').fadeIn().delay(3000).fadeOut();
        //            $('#registernew input[name="mobile_no"]').focus(); return false;
        //        }
        if (!$.isNumeric($('#registernew input[name="mobile_no"]').val())) {
            $('.register_msg,.errorMobileNumber').html('Mobile Number should be numeric!!').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
            $('#registernew input[name="mobile_no"]').focus();
            return false;
        }
//
        if ($('#registernew input[name="email_id"]').val() === '') {
            $('.register_msg,.errorEmailId').html('Please enter email Id').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
            $('#registernew input[name="email_id"]').focus();
            return false;
        }
        if (!EmailReg.test($('#registernew input[name="email_id"]').val())) {
            $('.register_msg,.errorEmailId').html('Please enter valid email address!!!').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
            $('#registernew input[name="email_id"]').focus();
            return false;
        }


        //        if ($('#registernew input[name="state_name"]').val() === '') {
        //            $('.register_msg').html('Please select State Name').css('color', 'red').fadeIn().delay(3000).fadeOut();
        //            $('#registernew input[name="state_name"]').focus(); return false;
        //        }
        $('.changeRegister').attr('disabled', 'disabled');
        var fd = new FormData();
        var files1 = $('#document_file3')[0].files[0];
        var files2 = $('#document_file1')[0].files[0];
        var files3 = $('#document_file18')[0].files[0];
        var CompanyLogo = $('#CompanyLogo')[0].files[0];
        fd.append('file3', files1);
        fd.append('file1', files2);
        fd.append('file18', files3);
        fd.append('CompanyLogo', CompanyLogo);
        fd.append('data', data); 
        $.ajax({
            url: SITEURL + 'index/request-for-registration-new',
            type: 'POST',
            data: fd,
            dataType: 'json',
            contentType: false,
            processData: false,
            beforeSend: function() {
                $('.changeRegister').html('<i class="ace-icon fa fa-spinner fa-spin orange bigger-125"></i> Please wait...');
            },
            success: function(result) {
                if (result.status) {
                    $('.changeRegister').hide();
                    $('#registernew').trigger("reset"); 
                    $('.register_msg').html('Thanks for submitting your information and showing interest in our services. Our support executive will contact you soon and activate your account.</br> Thanks!').show().css('color', 'green');
                    $('.login-form').hide();
                    $('.login-content-newbox').css('min-height', '408px');
                    
                    if(result.data.B2BType == 3){
                        $('#salutationAgenct').val(result.data.salutationAgenct);
                        $('#firstNameAgent').val(result.data.firstNameAgent);
                        $('#lastNameAgent').val(result.data.lastNameAgent);
                        $('#emailIdAgent').val(result.data.emailIdAgent);
                        $('#mobileNoAgent').val(result.data.mobileNoAgent);
                        $('#B2bAgencySysId').val(result.data.AgencySysId);  
                        $('#CustomerSysId').val(result.data.CustomerSysId);  
                        $('#registernewVipPartner').submit();
                    }
                    
                    
                } else {
                    $('.changeRegister').html('Register Now');
                    $('.changeRegister').removeAttr('disabled', 'disabled');
                    $('.passchange_msg').html(result.message);
                    $('.register_msg').html(result.message).show().css('color', 'red');
                    return false;
                }
            },
            error: function() {
                $('.changeRegister').html('Submit');
                $('.changeRegister').attr('disabled', false);
                alert('Oops unable to connect with server!!');
            }
        });
    });


    // $("#login_otp").click(function(){
    $(document).on('click', '#login_otp1', function(e) {
        // $("#login_otp").submit();
        e.preventDefault();
        var mobile_no = $('#login_otp input[name="mobile_no"]').val();
        var captcha = $('#login_otp input[name="captcha"]').val();
        var captcha__ = "resend";
        console.log("test data");
        console.log(mobile_no);
        if ($('#login_otp input[name="mobile_no"]').val() == '') {
            $('#msgForgot').html('Please enter your registered mobile no').css('color', 'red').fadeIn().delay(3000).fadeOut();
            $('#login_otp input[name="mobile_no"]').focus();
            return false;
        }
        $('.forgot').attr('disabled', 'disabled');
        $.ajax({
            url: SITEURL + 'index/loginsendotp',
            type: 'POST',
            data: {
                mobile_no: mobile_no,
                captcha__: captcha__,
                captcha: captcha
            },
            dataType: 'json',
            beforeSend: function() {
                $('.forgot').html('<i class="ace-icon fa fa-spinner fa-spin orange bigger-125"></i> Please wait..');
            },
            success: function(result) {
                if (result.status) {
                    $('#msgForgot1').html("<center color='green'>Your OTP has been sent.</center>").css('color', 'green').fadeIn().delay(10000).fadeOut();
                    $('.hidedivs').hide();
                    $('.forgot').hide();
                    $('.sendBtn').hide();
                    // $('#login_otp').hide();
                    $('.resendBtn').show();
                } else {
                    $('.forgot').html('Submit');
                    $('.forgot').removeAttr('disabled', 'disabled');
                    $('#msgForgot1').html(result.message).css('color', 'red').fadeIn().delay(3000).fadeOut();
                    return false;
                }
            },
            error: function() {
                $('.forgot').html('Submit');
                $('.forgot').removeAttr('disabled', 'disabled');
                alert('Oops unable to connect with server!!');
            }
        });
    });
    // $("#varifyOtp").on('submit', function (e) {
    $(document).on('click', '#varifyOtp', function(e) {
        e.preventDefault();
        var mobile_no = $('#login_otp input[name="mobile_no"]').val();
        var otp = $('#login_otp input[name="otp"]').val();
        // console.log(data)
        if ($('#varifyOtp input[name="otp"]').val() == '') {
            $('#msgForgot').html('Please enter your OTP').css('color', 'red').fadeIn().delay(3000).fadeOut();
            $('#varifyOtp input[name="otp"]').focus();
            return false;
        }
        $('.forgot').attr('disabled', 'disabled');
        $.ajax({
            url: SITEURL + 'index/login-with-otp',
            type: 'POST',
            data: {
                mobile_no: mobile_no,
                otp: otp
            },
            dataType: 'json',
            beforeSend: function() {
                $('.forgot').html('<i class="ace-icon fa fa-spinner fa-spin orange bigger-125"></i> Please wait..');
            },
            success: function(result) {
                if (result.status) {
                    $('#login_otp').html(result.message).css('color', 'green').fadeIn().delay(10000).fadeOut();
                    $('#AgencySysId_').val(result.AgencySysId);
                    $('#MasterAgencySysId').val(result.MasterAgencySysId);
                    $('#SuperAgencySysId').val(result.SuperAgencySysId);
                    $('#UserSysId').val(result.UserSysId);
                    $('#CustomerSysId').val(result.CustomerSysId);
                    $('#EmailId').val(result.EmailId);
                    $('#AgentSalutation').val(result.Salutation);
                    $('#FirstName').val(result.FirstName);
                    $('#LastName').val(result.LastName);
                    $('#AgencyCode').val(result.AgencyCode);
                    $('#AgencyName').val(result.AgencyName);
                    $('#Password_cu').val(result.Password);
                    $('#Contact_no').val(result.ContactNo1);
                    $('#MarkupType').val(result.MarkupType);
                    $('#Markup').val(result.Markup);
                    $('#SecurityKey').val(result.SecurityKey);
                    $('#Address').val(result.Address);
                    $('#PinCode').val(result.PinCode);
                    $('#TrxCurrency').val(result.TrxCurrency);
                    $('#CurrencySymbol').val(result.CurrencySymbol);
                    $('#auth_login_submit').submit();
                } else {
                    $('#msgForgot1').html(result.message).css('color', 'red').fadeIn().delay(3000).fadeOut();
                    return false;
                }
            },
            error: function() {
                $('.forgot').html('Submit');
                $('.forgot').removeAttr('disabled', 'disabled');
                alert('Oops unable to connect with server!!');
            }
        });
    });

    $(document).on('click', '.loginOtp', function() {
        //alert('here');
        $('#agentLoginForm').hide();
        $('#login_otp').trigger("reset");
        $('#agentLoginForm').trigger("reset");
        $('#login_otp').show();
        $('#register').hide();


    });
    $(document).on('click', '.forgotpass', function() {
        $('#agentLoginForm').hide();
        $('#forgot_password').trigger("reset");
        $('#agentLoginForm').trigger("reset");
        $('#forgot_password').show();
        $('#forget').focus();
        $('#register').hide();
        $('#varifyOtp').hide();
    });
    $(document).on('click', '.login', function() {
        $('#agentLoginForm').show();
        $('#forgot_password').trigger("reset");
        $('#agentLoginForm').trigger("reset");
        $('#forgot_password').hide();
        $('#login_otp').hide();
        $('#register').hide();
        $('#varifyOtp').hide();
    });
    $(document).on('click', '.register', function() {
        $('#register').show();
        $('#loginPanel').hide();
        $('#forgot_password').hide();
        $('#login_otp').hide();
        $('#forgot_password').trigger("reset");
        $('#agentLoginForm').trigger("reset");
    });

    $('.login-form input[name="captcha"]').keydown(function(event) {
        if (event.ctrlKey == true && (event.which == '118' || event.which == '86')) {
            //alert('thou. shalt. not. PASTE!');
            event.preventDefault();
        }
    });
});



$("#change_password").on('submit', function(e) {

    e.preventDefault();
    var data = $(this).serialize();
    if ($('#change_password input[name="old_password"]').val() === '') {
        $('.passchange_msg').show().html('Please enter old password ');

        $('#change_password input[name="old_password"]').focus();
        return false;
    }
    if ($('#change_password input[name="new_password"]').val() === '') {
        $('.passchange_msg').show().html('Please enter new password');

        $('#change_password input[name="new_password"]').focus();
        return false;
    }
    if ($('#change_password input[name="confirm_password"]').val() === '') {

        $('.passchange_msg').show().html('Please enter confirm password');
        $('#change_password input[name="confirm_password"]').focus();
        return false;
    }
    if ($('#change_password input[name="new_password"]').val() != $('#change_password input[name="confirm_password"]').val()) {

        $('.passchange_msg').show().html('Confirm password does not match with new password');
        $('#change_password input[name="confirm_password"]').focus();
        return false;
    }
    $('.update').attr('disabled', 'disabled');
    $.ajax({
        url: SITEURL + 'dashboard/index/changepassword',
        type: 'POST',
        data: data,
        dataType: 'json',
        beforeSend: function() {
            $('.updatepass').html('<i class="ace-icon fa fa-spinner fa-spin orange bigger-125"></i>');
        },
        success: function(result) {
            console.log(result);
            if (result.status) {
                $('.updatepass').html('Submit');
                $('.update').removeAttr('disabled', 'disabled');

                $('.passchange_msg').show().html(result.message).css('color', 'green');
                $('#change_password input[name="old_password"]').val('');
                $('#change_password input[name="new_password"]').val('');
                $('#change_password input[name="confirm_password"]').val('');
                //                    window.location.href=SITEURL+"users/index/unsetchangedata";
            } else {
                $('.updatepass').html('Submit');
                $('.update').removeAttr('disabled', 'disabled');
                $('.passchange_msg').show().html(result.message).css('color', 'red');
                return false;
            }
        },
        error: function() {
            $('.updatepass').html('Submit');
            $('.update').removeAttr('disabled', 'disabled');
            alert('Oops unable to connect with server!!');
        }
    });
});

$(document).on('click', '.register', function() {
    $('#Registrationbox').show();
    $('#loginPanel').hide();
    $('#forgot_password').hide();
    $('#forgot_password').trigger("reset");
    $('#agentLoginForm').trigger("reset");
});
$(document).on('click', '.login', function() {
    $('#loginPanel').show();
    $('#forgot_password').trigger("reset");
    $('#agentLoginForm').trigger("reset");
    $('#forgot_password').hide();
    $('#Registrationbox').hide();
});

function getCaptchaImage() {
    $.ajax({
        url: SITEURL + 'index/set-captcha-image',
        type: 'post',
        data: '',
        dataType: 'json',
        success: function(response) {
            if (response.status == true) {
                $('.captchaLogin').val(response.img);
            }

        }
    });

}
$('.sent-otp-mobile').on('click', function() {
    var mobile_no = $('#mobile_no').val();
    var mobile_code = $('#mobile_code').val();
    var email_id = $('#email_id').val();
    if (mobile_no === '') {
        $('.errorMobileNumber').html('Please enter mobile Number').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
        $('#register input[name="mobile_no"]').focus();
        return false;
    }
    if (!$.isNumeric(mobile_no)) {
        $('.errorMobileNumber').html('Mobile Number should be numeric!!').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
        $('#register input[name="mobile_no"]').focus();
        return false;
    }
    $('.sent-otp-mobile').html('Please Wait').attr('disabled', true);
    $.ajax({
        url: SITEURL + 'index/send-otp',
        type: 'post',
        data: 'mobile_no=' + mobile_no + '&mobile_code=' + mobile_code + '&email_id=' + email_id + '&type=mobile',
        dataType: 'json',
        success: function(response) {
            $('.sent-otp-mobile').html('SEND OTP');
            if (response.status == true) {
                $('.mobile-verify-otp-html').show();
                $('#mobile_no').attr('readonly', true);
            } else {
                $('.mobile-verify-otp-html').hide();
                $('.sent-otp-mobile').attr('disabled', false);
            }

        }
    });
})
$('.verify-otp-mobile').on('click', function() {
    var mobile_no = $('#mobile_no').val();
    $('.verify-otp-mobile').html('Please Wait').attr('disabled', true);
    var otpinput = [];
    $('.otp-mobile-input').each(function() {
        otpinput.push($(this).val());
    })
    var otpinput1 = otpinput.join('');
    var email_id = $('#email_id').val();
    $.ajax({
        url: SITEURL + 'index/verify-otp',
        type: 'post',
        data: 'mobile_no=' + mobile_no + '&email_id=' + email_id + '&otp=' + otpinput1 + '&type=mobile',
        dataType: 'json',
        success: function(response) {
            $('.verify-otp-mobile').html('Verify Otp').attr('disabled', false);
            if (response.status == true) {
                $('.mobile-verify-otp-html').hide();
                $('.sent-otp-mobile').hide();
                $('.verify-mobile-success').show();
                if (response.count == 2) {
                    $('.isDisabled').attr('disabled', false);
                }
            } else {
                $('.mobile-verify-otp-html').show();
                $('.sent-otp-mobile').show();
                $('.verify-mobile-success').hide();
                alert(response.message);
            }
            return false;
        }
    });
})
$(document).ready(function(){
    $("#registerCityName").autocomplete({

        source: function(request, response) {
            var query = $("#registerCityName").val();
            var countryId = '';
            $.getJSON("byo/index/get-citydata", {
                    query: query,
                    countryId: countryId
                },
                response);
        },
        minLength: 2,
        select: function(event, ui) {
            var CityId = ui.item.CityId;
            var CityName = ui.item.CityName;
            $("#registerCityId_hidden").val(CityId);
        }
    });
    });
$('.modify-resend-mobile-otp').on('click', function() {
    $('#mobile_no').attr('readonly', false);
    $('.sent-otp-mobile').attr('disabled', false);
    $('.mobile-verify-otp-html').hide();
})
$('.sent-otp-email').on('click', function() {
    var EmailReg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;

    var email_id = $('#email_id').val();
    if (email_id === '') {
        $('.register_msg,.errorEmailId').html('Please enter email Id').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
        $('#register input[name="email_id"]').focus();
        return false;
    }
    if (!EmailReg.test(email_id)) {
        $('.register_msg,.errorEmailId').html('Please enter valid email address!!!').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
        $('#register input[name="email_id"]').focus();
        return false;
    }
    $('.sent-otp-email').html('Please Wait').attr('disabled', true);
    var mobile_no = $('#mobile_no').val();
    var mobile_code = $('#mobile_code').val();
    $.ajax({
        url: SITEURL + 'index/send-otp',
        type: 'post',
        data: 'mobile_no=' + mobile_no + '&mobile_code=' + mobile_code + '&email_id=' + email_id + '&type=email',
        dataType: 'json',
        success: function(response) {
            $('.sent-otp-email').html('SEND MAIL');
            if (response.status == true) {
                $('.email-verify-otp-html').show();
                $('#email_id').attr('readonly', true);
            } else {
                $('.email-verify-otp-html').hide();
                $('.sent-otp-email').attr('disabled', false);
            }

        }
    });
})
$('.verify-otp-email').on('click', function() {
    var email_id = $('#email_id').val();
    $('.verify-otp-email').html('Please Wait').attr('disabled', true);
    var otpinput = [];
    $('.otp-email-input').each(function() {
        otpinput.push($(this).val());
    })
    var otpinput1 = otpinput.join('');
    var mobile_no = $('#mobile_no').val();
    $.ajax({
        url: SITEURL + 'index/verify-otp',
        type: 'post',
        data: 'mobile_no=' + mobile_no + '&email_id=' + email_id + '&otp=' + otpinput1 + '&type=email',
        dataType: 'json',
        success: function(response) {
            $('.verify-otp-email').html('Verify Otp').attr('disabled', false);
            if (response.status == true) {
                $('.email-verify-otp-html').hide();
                $('.sent-otp-email').hide();
                $('.verify-email-success').show();
                if (response.count == 2) {
                    $('.isDisabled').attr('disabled', false);
                }
            } else {
                $('.email-verify-otp-html').show();
                $('.sent-otp-email').show();
                $('.verify-email-success').hide();
                alert(response.message);
            }
            return false;
        }
    });
})
$('.modify-resend-email-otp').on('click', function() {
    $('#email_id').attr('readonly', false);
    $('.sent-otp-email').attr('disabled', false);
    $('.email-verify-otp-html').hide();
})
$('.sent-otp-aadhar').on('click', function() {
    var AadharNumber = $('#AadharNumber').val();
    var AadharReg1 = /^[2-9]{1}[0-9]{3}\s[0-9]{4}\s[0-9]{4}$/;
    var AadharReg2 = /^[2-9]{1}[0-9]{11}$/;
    if (AadharNumber == '') {
        $('.register_msg,.errorAadharNumber').html('Please enter aadhar number!!!').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
    }
    if (!AadharReg1.test(AadharNumber) && !AadharReg2.test(AadharNumber)) {
        $('.register_msg,.errorAadharNumber').html('Please enter valid aadhar number!!!').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
        $('#register input[name="AadharNumber"]').focus();
        return false;
    }
    var email_id = $('#email_id').val();
    var mobile_no = $('#mobile_no').val();
    $('.sent-otp-aadhar').html('Please Wait..').attr('disabled', true);
    $.ajax({
        url: SITEURL + 'index/verify-document',
        type: 'post',
        data: 'AadharNumber=' + AadharNumber + '&mobile_no=' + mobile_no + '&email_id=' + email_id + '&doctype=aadhar',
        dataType: 'json',
        success: function(response) {
            $('.sent-otp-aadhar').html('Verify Aadhar');
            if (response.status == true) {
                $('.aadhar-verify-otp-html').show();
                $('#AadharNumber').attr('readonly', true);
            } else {
                $('.aadhar-verify-otp-html').hide();
                $('.sent-otp-aadhar').attr('disabled', false);
                alert(response.message);
            }
            return false;
        }
    });
})
$('.sent-otp-pan').on('click', function() {
    var PANNumber = $('#PANNumber').val();
    var FirstName = $('#FirstName').val();
    var LastName = $('#LastName').val();
    if (FirstName === '') {
        $('.register_msg,.errorFirstName').html('Please enter first Name').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
        $('#registernew input[name="first_name"]').focus();
        return false;
    }
    if (LastName === '') {
        $('.register_msg,.errorLastName').html('Please enter last Name').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
        $('#registernew input[name="last_name"]').focus();
        return false;
    }
    if (PANNumber == '') {
        $('.register_msg,.errorPANNumber').html('Please enter pan number!!!').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
        $('#registernew input[name="PANNumber"]').focus();
        return false;
    }

    var email_id = $('#email_id').val();
    var mobile_no = $('#mobile_no').val();
    $('.sent-otp-pan').html('Please Wait..').attr('disabled', true);
    $.ajax({
        url: SITEURL + 'index/verify-document',
        type: 'post',
        data: 'PANNumber=' + PANNumber + '&FirstName=' + FirstName + '&LastName=' + LastName + '&mobile_no=' + mobile_no + '&email_id=' + email_id + '&doctype=pan',
        dataType: 'json',
        success: function(response) {
            $('.sent-otp-pan').html('Verify PAN');
            if (response.status == true) {
                $('.verify-pan-success').show();
                $('.sent-otp-pan').attr('disabled', true).hide();
                $('#PANNumber').attr('readonly', true);
                //$('.pan-verify-otp-html').html('<div>'+response+'</div>').show();
            } else {
                $('.verify-pan-success').hide();
                $('.sent-otp-pan').attr('disabled', false).show();
                $('#PANNumber').attr('readonly', false);
                //$('.pan-verify-otp-html').html('').hide();
                alert(response.message);
            }
            return false;
        }
    });
})
$('.sent-otp-gst').on('click', function() {
    var GSTNumber = $('#GSTNumber').val();
    var username = $('#username').val();

    if (username === '') {
        $('.register_msg,.errorCompanyName').html('Please enter company name').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
        $('#registernew input[name="username"]').focus();
        return false;
    }
    if (GSTNumber == '') {
        $('.register_msg,.errorGSTNumber').html('Please enter gst number!!!').show().css('color', 'red').fadeIn().delay(10000).fadeOut();
        $('#registernew input[name="GSTNumber"]').focus();
        return false;
    }
    var email_id = $('#email_id').val();
    var mobile_no = $('#mobile_no').val();
    $('.sent-otp-gst').html('Please Wait..').attr('disabled', true);
    $.ajax({
        url: SITEURL + 'index/verify-document',
        type: 'post',
        data: 'GSTNumber=' + GSTNumber + '&username=' + username + '&mobile_no=' + mobile_no + '&email_id=' + email_id + '&doctype=gst',
        dataType: 'json',
        success: function(response) {
            $('.sent-otp-gst').html('Verify PAN');
            if (response.status == true) {
                $('.verify-gst-success').show();
                $('.sent-otp-gst').attr('disabled', true).hide();
                //$('.gst-verify-otp-html').html('<div>'+response+'</div>').show();
            } else {
                $('.verify-gst-success').hide();
                $('.sent-otp-gst').attr('disabled', false).show();
                //$('.pan-verify-otp-html').html('').hide();
                alert(response.message);
            }
            return false;
        }
    });
})
$('.modify-resend-aadhar-otp').on('click', function() {
    $('#AadharNumber').attr('readonly', false);
    $('.sent-otp-aadhar').attr('disabled', false);
    $('.aadhar-verify-otp-html').hide();
})
$('.verify-otp-aadhar').on('click', function() {
    var email_id = $('#email_id').val();
    $('.verify-otp-aadhar').html('Please Wait').attr('disabled', true);
    var otpinput = [];
    $('.otp-aadhar-input').each(function() {
        otpinput.push($(this).val());
    })
    var otpinput1 = otpinput.join('');
    var mobile_no = $('#mobile_no').val();
    var AadharNumber = $('#AadharNumber').val();
    $.ajax({
        url: SITEURL + 'index/verify-document-otp',
        type: 'post',
        data: 'AadharNumber=' + AadharNumber + '&mobile_no=' + mobile_no + '&email_id=' + email_id + '&otp=' + otpinput1 + '&type=aadhar',
        dataType: 'json',
        success: function(response) {
            $('.verify-otp-aadhar').html('Verify Otp').attr('disabled', false);
            if (response.status == true) {
                $('.aadhar-verify-otp-html').hide();
                $('.sent-otp-aadhar').hide();
                $('.verify-aadhar-success').show();
                if (response.count == 2) {
                    $('.isDisabled').attr('disabled', false);
                }
            } else {
                $('.aadhar-verify-otp-html').show();
                $('.sent-otp-aadhar').show();
                $('.verify-aadhar-success').hide();
                alert(response.message);
            }
            return false;
        }
    });
})
function timer(remaining) {
    let timerOn = true;
  var m = Math.floor(remaining / 60);
  var s = remaining % 60;
  
  m = m < 10 ? '0' + m : m;
  s = s < 10 ? '0' + s : s;
  document.getElementById('timer').innerHTML = m + ':' + s;
  remaining -= 1;
  
  if(remaining >= 0 && timerOn) {
    setTimeout(function() {
        timer(remaining);
    }, 1000);
    return;
  }

  if(!timerOn) {
    return;
  }
  $('.resendOtpBtn').show();
  $('.timerDiv').hide();
}
function resendOtpFun(){
    $('.otpinput').val('');
    $('#steps').val(1);
    $('#sendtype').val(1);
    $('.resendOtpBtn').html('Sending..');
    $('#agentLoginForm').submit();
}
$('.B2BType').on('click',function(){
    if($(this).val() == 3){
        $('.payble_amount_vip').html('Pay INR 1,179/-');
        $('.changeRegister').html('Continue to Pay');
    }else{
        $('.payble_amount_vip').html('');
        $('.changeRegister').html('Submit');
    }
})

Youez - 2016 - github.com/yon3zu
LinuXploit