PageSourceSearch

https://portfolio.haripriyawealth.com/js/login.js

js haripriyawealth.com collected 2026-10-02 01:31:33 UTC 20,924 bytes, 546 lines download raw bytes

1function verifyDeskOtp()
2{
3    ////var otp =  $('#desk_otp').val();
4    var formData = $('#desk_otp_form').serialize();
5    var validatorArray = {
6        'desk_otp': 'Enter Valid OTP Number',
7    };
8    var response = formValidationCheck(validatorArray);
9    if (response.status == false) {
10        showNotificationMessage('error', response.errorMess);
11        $('#' + response.fieldName).focus();
12    } else {
13        var error = '';
14        var OTP_NUM = $('#desk_otp').val();
15        var numbers = /^[0-9]+$/;
16        if (!OTP_NUM.match(numbers))
17        {
18            error += 'Please Enter Only Numbers<br>';
19        }
20
21        if (error == '') {
22            var formData = $('#desk_otp_form').serialize();
23            var response = ajaxCall('verify-desk-otp', "POST", "json", formData, "", "", "", "return");
24            var Status = response.status;
25            var msg = response.msg;
26            var MsgType = response.msgType;
27            showNotificationMessage(MsgType, msg);
28            if (Status == '100') {
29                //redirect to desk access// 
30                var fromDeskOtp = $('input[name="forget-security-otp"]').val();
31                if(fromDeskOtp == 1){
32                    // For Security Question
33                    window.location.href = "get-security-question?fromDeskOtp=1";
34                }else{
35                    window.location.href = "authentication-continue";
36                }
37            }
38
39        } else {
40            showNotificationMessage('error', error);
41            if (response.status == "102") {
42                var hostName = window.location.host;
43                window.location.host = hostName;
44            }
45        }
46    }
47}
48
49function GetStarted(TimeBound) {
50    if (TimeBound === undefined) {
51        TimeBound = 300000;
52    }
53
54    var x = "";
55    clearInterval(x);
56    document.getElementById("OTP_timer").innerHTML = "START";
57    document.getElementById("otp_timer_m").value = 0;
58    document.getElementById("otp_timer_s").value = 0;
59    //var countDownDate = new Date().getTime() + (15000*60*1);
60    var countDownDate = new Date().getTime() + TimeBound;
61    // Update the count down every 1 second
62    var x = setInterval(function () {
63        var Break_val = $('#Re_apply').val();
64        //if resend status Yes"Y"
65        if (Break_val == 'Y') {
66            clearInterval(x);
67            //countDownDate = new Date().getTime() + (15000*60*1);
68            countDownDate = new Date().getTime() + TimeBound;
69            $('#Re_apply').val('');
70        }
71        // Get todays date and time
72        var now = new Date().getTime();
73        // Find the distance between now an the count down date
74        var distance = countDownDate - now;
75
76        // Time calculations for days, hours, minutes and seconds
77        var days = Math.floor(distance / (1000 * 60 * 60 * 24));
78        var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
79        var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
80        var seconds = Math.floor((distance % (1000 * 60)) / 1000);
81        // Output the result in an element with id="demo"
82        document.getElementById("OTP_timer").innerHTML = minutes + ":" + seconds;
83        document.getElementById("otp_timer_m").value = minutes;
84        document.getElementById("otp_timer_s").value = seconds;
85
86
87        // If the count down is over, write some text 
88        if (distance < 0) {
89            clearInterval(x);
90            document.getElementById("OTP_timer").innerHTML = "EXPIRED !";
91            document.getElementById("otp_timer_m").value = 0;
92            document.getElementById("otp_timer_s").value = 0;
93            $('#user_entered_opt').val('');
94
95            var desk = document.getElementById("desk_type_v").value;
96            var DU = 'arn-login';
97            if (desk == 'arn') {
98                DU = 'arn-login';
99            }
100            if (desk == 'advisor') {
101                DU = 'advisor-login';
102            }
103            if (desk == 'client') {
104                DU = 'client-login';
105            }
106            if (desk == 'asm') {
107                DU = 'asm-login';
108            }
109            if (desk == 'emp') {
110                DU = 'emp-login';
111            }
112
113
114            window.location = '/Login/login/' + DU;
115            //after time complete otp has been deleted
116        }
117    }, 1000);
118
119}
120//end 
121
122function ResandDeskOtp()
123{
124
125    var dataParam = 'statue=1';
126    var response = ajaxCall('resand-desk-otp', "POST", "json", dataParam, "", "", "", "return");
127    var Status = response.status;
128    if (Status == 1) {
129        var Resand_Status = $('#resend_status').val();
130        var Resand_Status_add = (Resand_Status + 1);
131        $('#resend_status').val(Resand_Status_add);
132        var OTP_Mnutes = $('#otp_timer_m').val();
133        var OTP_Seconds = $('#otp_timer_s').val();
134        var Time_bond = (OTP_Mnutes * 1000 * 60) + OTP_Seconds * 1000;
135        GetStarted(Time_bond);
136
137        if (Resand_Status_add > 3) {
138            $('#resand_space').html("");
139        }
140    } else if (Status == 2) {
141        showNotificationMessage("error", "You can resend OTP after 30 seconds.");
142    } else if (Status == 3) {
143        showNotificationMessage("error", "OTP resend limit exceeded. Please contact to your advisor.");
144    }
145}
146
147function ForgotPassword(desk) {
148    var deskType = $('#loginFor').val();
149    var data = "deskType=" + deskType;
150    window.location = "/Login/login/forget-password-new?deskType=" + deskType
151}
152
153function submitForgetPwdUserName() {
154    var formData = $('#forgetPwdForm').serialize();
155    var validatorArray = {
156        'userName': 'Please Enter User Name',
157        'type': 'Invalid Type',
158    };
159
160    // Check Resend
161    var resend = $('#resendOtp').val();
162    if (resend == "resend") {
163        DisableResent();
164    }
165
166    var response = formValidationCheck(validatorArray);
167    if (response.status == false) {
168        showNotificationMessage('error', response.errorMess);
169        $('#' + response.fieldName).focus();
170    } else {
171        var source = $('#source').val();
172        var inputData = {'source': source};
173        //var response = ajaxCall('/Login/login/send-forget-password-otp', "POST", "json", formData, "", "");
174        var response = ajaxCall('/Login/login/send-forget-password-otp', "POST", "json", formData, "submitForgetPwdUserNamecallback", "", "", "", "", true, inputData);
175    }
176}
177
178
179
180
181
182function submitForgetPwdUserNamecallback(response, inputData) {
183    var fSource = inputData.source;
184    showNotificationMessage(response.msgType, response.msg);
185    if (fSource == "link") {
186        if (response.msgType == "error") {
187            $('#loginPageAlertErrorFp').html(response.msg);
188            $('#loginPageAlertErrorFp').css("display", "block");
189        }
190    }
191    if (response.msgType == "success") {
192        //var mobileNo = response.mobileNo;
193        var encryptedMobileNo = response.encryptedMobileNo;
194        var mobileLastFourDigit = response.mobileLastFourDigit;
195        var emailOtpDigit = response.email;
196
197
198        if (fSource == "link") {
199            var otpHtml = otpPageForLink(mobileLastFourDigit, emailOtpDigit);
200            $('#forgetPwdFormVerify').html(otpHtml);
201            $('#forgetPwdFormVerify').css("display", "block");
202            $('#forgetPwdForm').css("display", "none");
203        }
204
205        $("#otpDiv").css("display", "block");
206        $("#userNameDiv").css("display", "none");
207
208        $('#emailOtpDigit').html(emailOtpDigit);
209        $('#OtpMobileNo').val(encryptedMobileNo);
210        $('#mobileLastFourDigit').html(mobileLastFourDigit);
211        $("#submitButtonDiv").css("display", "block");
212    }
213    // enable Resend Button After 40 second.
214    setTimeout('enableResent()', 40000);
215}
216
217function otpPageForLink(mobileLastFourDigit = "", emailOtpDigit = "") {
218    var showEmail = "";
219    if (emailOtpDigit != '') {
220        var showEmail = " And e-mail to " + emailOtpDigit;
221    }
222    var html = '<div>\
223        <input type="hidden" name="resendOtp" id="resendOtp" value="">\
224        <div style="text-align: center;margin-bottom: 15px;">\
225            <p><small>One Time Password (OTP) has been sent to your mobile <span>******' + mobileLastFourDigit + showEmail + '<span><span></span> , please enter the same here to login.</spam></span></small></p>\
226        </div>\
227            <input type="hidden" id="OtpMobileNo" name="OtpMobileNo">\
228        <div style="width: fit-content;margin: auto;">\
229            <label>Enter OTP</label><br>\
230            <input type="password" id="mobileOtp" name="mobileOtp" required="">\
231            <button class="" type="button" onclick="verifyForgetPwdOTP(\'link\');" style="margin-left: 10px;font-size: 12px;line-height: 20px;vertical-align: top;">Verify OTP</button>\
232            <button id="resend" style="display: none;margin-left: 5px;font-size: 12px;vertical-align: top;line-height: 20px;" type="button" onclick="submitForgetPwdUserName();">Resend OTP</button>\
233        </div>\
234    </div>';
235    // <input type="hidden" name="resendOtp" id="resendOtp" value="">\
236    //            <div class="col-md-12">\
237    //                <p class="password-hint"><small class="font-11 d-block">One Time Password (OTP) has been sent to your mobile <span>******<spam id="mobileLastFourDigit"><span></span>, please enter the same here to login. </small></p>\
238    //            </div>\
239    //            <input type="hidden" id="OtpMobileNo" name="OtpMobileNo" class="form-control">\
240    //            <div class="col-md-12">\
241    //                <label >Enter OTP</label>\
242    //                <input type="password" id="mobileOtp" name="mobileOtp" class="form-control" required>\
243    //            </div>\
244    //            <div class="col-md-12">\
245    //                <div class="row">\
246    //                    <div class="col-md-6" id="submitButtonDiv">\
247    //                        <button class="" type="button" onclick="verifyForgetPwdOTP(\'link\');">Verify OTP</button>\
248    //                    </div>\
249    //                    <div class="col-md-6" id="resend" style="display: none;">\
250    //                        <button class="" type="button" onclick="submitForgetPwdUserName();">Resend OTP</button>\
251    //                    </div>\
252    //                </div>\
253    //            </div>';
254    return html;
255}
256
257
258function verifyForgetPwdOTP(source) {
259    if (source == "link") {
260        var formData = $('#forgetPwdFormVerify').serialize();
261    } else {
262        var formData = $('#forgetPwdOtpForm').serialize();
263    }
264
265    var validatorArray = {
266        'mobileOtp': 'Please Enter OTP',
267        'OtpMobileNo': 'Invalid Request',
268    };
269    var response = formValidationCheck(validatorArray);
270    if (response.status == false) {
271        showNotificationMessage('error', response.errorMess);
272        $('#' + response.fieldName).focus();
273    } else {
274        var inputData = {'source': source};
275        //var response = ajaxCall('/Login/login/submit-forget-password-otp', "POST", "json", formData, "", "");
276        var response = ajaxCall('/Login/login/submit-forget-password-otp', "POST", "json", formData, "verifyForgetPwdOTPCallBack", "", "", "", "", true, inputData);
277    }
278}
279
280function verifyForgetPwdOTPCallBack(response, inputData) {
281    showNotificationMessage(response.msgType, response.msg);
282    var source = inputData.source;
283    var showMsg = "";
284    if (source == "link") {
285        showMsg = response.msg;
286        //$('#forgetPwdForm').html("<div style='text-align: center;'>" + showMsg + "</div>");
287        if (response.msgType == "error") {
288            $('#loginPageAlertErrorFp').html(showMsg);
289            $('#loginPageAlertErrorFp').css("display", "block");
290        } else {
291            $('#forgetPwdFormVerify').css("display", "none")
292            $('#forgetPwdFormVerify').html('');
293            $('#loginPageAlertSuccessFp').html(showMsg);
294            $('#loginPageAlertSuccessFp').css("display", "block");
295            $('#loginPageAlertErrorFp').html('');
296            $('#loginPageAlertErrorFp').css("display", "none");
297        }
298    } else {
299        if (response.msgType == "success") {
300            $("#submitButtonDiv").css("display", "none");
301            $("#resend").css("display", "none");
302            setTimeout(function () {
303                location.reload();
304            }, 8000); // 5 seconds
305        }
306    }
307
308}
309
310
311
312function enableResent() {
313    $("#resend").css("display", "block");
314    $("#resendOtp").val('resend');
315
316}
317
318function DisableResent() {
319    $("#resend").css("display", "none");
320}
321
322function setForgetPwd() {
323    var formData = $('#setforgetPwdForm').serialize();
324    var validatorArray = {
325        'newPassword': 'Please Enter New Password',
326        'mailLink': 'Invalid Request',
327    };
328    var response = formValidationCheck(validatorArray);
329    if (response.status == false) {
330        showNotificationMessage('error', response.errorMess);
331        $('#' + response.fieldName).focus();
332    } else {
333        //var response = ajaxCall('/Login/login/change-forget-pwd', "POST", "json", formData, "", "");
334        var response = ajaxCall('/Login/login/change-forget-pwd', "POST", "json", formData, "setForgetPwdCallBack", "", "", "", "", true, "");
335    }
336}
337
338function setForgetPwdCallBack(response) {
339    var deskType = response.deskType;
340    var weburl = response.weburl;
341    var backLoginUrl = "";
342    showNotificationMessage(response.msgType, response.msg);
343    if (deskType != "") {
344        //var desk = deskType.toLowerCase();
345        if(weburl != "") {
346            backLoginUrl = weburl;
347        } else {
348            backLoginUrl = "/Login/login/" + deskType + "-login";
349        }
350    }
351    $('#backTologin').attr("href", backLoginUrl);
352    $('#newPassword').val('');
353
354    if (response.msgType == "success") {
355        $("#userNameDiv").css("display", "none");
356        $("#submitButtonDiv").css("display", "none");
357    }
358}
359
360function loginRemeberMe() {
361    if ($('#loginRememberMe').prop("checked") == true) {
362        var formData = $('#signinForm').serialize();
363        var response = ajaxCall('/Login/login/remember-login', "POST", "json", formData, "", "");
364        var deskType = response.deskType;
365    }
366}
367
368function resetForgetPasswordForm() {
369    $('#forgetPwdForm')[0].reset();
370    $('#loginPageAlertErrorFp').html("");
371    $('#loginPageAlertSuccessFp').html("");
372    $('#loginPageAlertErrorFp').css("display", "none");
373    $('#loginPageAlertSuccessFp').css("display", "none");
374    $('#forgetPwdFormVerify').css("display", "none");
375    $('#forgetPwdForm').css("display", "block");
376}
377
378
379function submitForgetPwdUserNameForWeb() {
380    var formData = $('#forgetPwdForm').serialize();
381    var validatorArray = {
382        'userName': 'Please Enter User Name',
383        'type': 'Invalid Type',
384    };
385
386    // Check Resend
387    var resend = $('#resendOtp').val();
388    if (resend == "resend") {
389        DisableResent();
390    }
391
392    var response = formValidationCheck(validatorArray);
393    if (response.status == false) {
394        showNotificationMessage('error', response.errorMess);
395        $('#' + response.fieldName).focus();
396    } else {
397        var source = $('#source').val();
398        var inputData = {'source': source};
399        //var response = ajaxCall('/Login/login/send-forget-password-otp', "POST", "json", formData, "", "");
400        var response = ajaxCall('send-forget-password-otp.php', "POST", "json", formData, "submitForgetPwdUserNamecallbackForWeb", "", "", "", "", true, inputData);
401    }
402}
403
404function submitForgetPwdUserNamecallbackForWeb(response, inputData) {
405    var fSource = inputData.source;
406    showNotificationMessage(response.msgType, response.msg);
407    if (fSource == "link") {
408        if (response.msgType == "error") {
409            $('#loginPageAlertErrorFp').html(response.msg);
410            $('#loginPageAlertErrorFp').css("display", "block");
411        }
412    }
413    if (response.msgType == "success") {
414        var encryptedMobileNo = response.encryptedMobileNo;
415        var mobileLastFourDigit = response.mobileLastFourDigit;
416        var mailSendTo = response.email;
417        console.log("got email " + mailSendTo);
418
419        if (fSource == "link") {
420            var otpHtml = otpPageForLinkForWeb(mobileLastFourDigit, mailSendTo);
421            $('#forgetPwdFormVerify').html(otpHtml);
422            $('#forgetPwdFormVerify').css("display", "block");
423            $('#forgetPwdForm').css("display", "none");
424        }
425
426        //var mobileNo = response.mobileNo;
427        //var encryptedMobileNo = response.encryptedMobileNo;
428        //var mobileLastFourDigit = response.mobileLastFourDigit;
429
430        $("#otpDiv").css("display", "block");
431        $("#userNameDiv").css("display", "none");
432
433
434        $('#OtpMobileNo').val(encryptedMobileNo);
435        $('#mobileLastFourDigit').html(mobileLastFourDigit);
436        $("#submitButtonDiv").css("display", "block");
437    }
438    // enable Resend Button After 40 second.
439    setTimeout('enableResent()', 40000);
440}
441
442
443function otpPageForLinkForWeb(mobileLastFourDigit = "", mailSendTo = "") {
444    var showEmail = "";
445    if (mailSendTo != '') {
446        var showEmail = " And e-mail to " + mailSendTo;
447    }
448    var html = '<div>\
449        <input type="hidden" name="resendOtp" id="resendOtp" value="">\
450        <div style="text-align: center;margin-bottom: 15px;">\
451            <p><small>One Time Password (OTP) has been sent to your mobile <span>******' + mobileLastFourDigit + showEmail + '<span> <span></span> , please enter the same here to login.</spam></span></small></p>\
452        </div>\
453            <input type="hidden" id="OtpMobileNo" name="OtpMobileNo">\
454        <div style="width: fit-content;margin: auto;">\
455            <label>Enter OTP</label><br>\
456            <input type="password" id="mobileOtp" name="mobileOtp" required="">\
457            <button class="" type="button" onclick="verifyForgetPwdOTPForWeb(\'link\');" style="margin-left: 10px;font-size: 12px;line-height: 20px;vertical-align: top;">Verify OTP</button>\
458            <button id="resend" style="display: none;margin-left: 5px;font-size: 12px;vertical-align: top;line-height: 20px;" type="button" onclick="submitForgetPwdUserNameForWeb();">Resend OTP</button>\
459        </div>\
460    </div>';
461
462    return html;
463}
464
465
466
467function verifyForgetPwdOTPForWeb(source) {
468    if (source == "link") {
469        var formData = $('#forgetPwdFormVerify').serialize();
470    } else {
471        var formData = $('#forgetPwdOtpForm').serialize();
472    }
473
474    var validatorArray = {
475        'mobileOtp': 'Please Enter OTP',
476        'OtpMobileNo': 'Invalid Request',
477    };
478    var response = formValidationCheck(validatorArray);
479    if (response.status == false) {
480        showNotificationMessage('error', response.errorMess);
481        $('#' + response.fieldName).focus();
482    } else {
483        var inputData = {'source': source};
484        //var response = ajaxCall('/Login/login/submit-forget-password-otp', "POST", "json", formData, "", "");
485        var response = ajaxCall('submit-forget-password-otp.php', "POST", "json", formData, "verifyForgetPwdOTPCallBack", "", "", "", "", true, inputData);
486    }
487}
488function submitRequestCallForm() {
489
490    const submitButton = document.getElementById('rightcall');
491    submitButton.disabled = true; // Disable the button
492
493    setTimeout(function() {
494      submitButton.disabled = false;
495    }, 2000);
496
497    var formData = $('#requestcallbackformid').serialize();
498    $('#requestcallbackformid')[0].reset();
499
500    var response = ajaxCall('/Login/login/submit-request-call-back-right', "POST", "json", formData, "requestCallBackformrespond", "", "", "", "", true);
501
502}
503function requestCallBackformrespond(response) {
504    debugger;
505
506    if (response.msgType == "success") {
507//        $("#cont_one").css("display", "none");
508//        $("#cont_two").css("display", "none");
509//        $("#thankYou").css("display", "block");
510        window.open('/thankyou.php', '_blank');
511        //setTimeout(removeThank,4000);
512    }
513    if (response.msgType == "error") {
514        showNotificationMessage(response.msgType, response.msg);
515    }
516}
517//function removeThank(){
518//$("#thankYou").css("display","none");    
519//}
520
521function submitRequestCallFormRight() {
522
523    const submitButton = document.getElementById('rightcall');
524    submitButton.disabled = true; // Disable the button
525
526    setTimeout(function() {
527      submitButton.disabled = false;
528    }, 2000);
529
530    var formData = $('#cal_form').serialize();
531    $('#cal_form')[0].reset();
532    var response = ajaxCall('/Login/login/submit-request-call-back-right', "POST", "json", formData, "requestCallBackformrespondRight", "", "", "", "", true);
533
534}
535function requestCallBackformrespondRight(response) {
536    if (response.msgType == "success") {
537//        $("#head_msg").css("display", "none");
538//        $("#success_msg").css("display", "block");
539//        $("#cal_form").hide();
540        window.open('/thankyou.php', '_blank');
541    }
542    if (response.msgType == "error") {
543        showNotificationMessage(response.msgType, response.msg);
544    }
545
546}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.