File: //home/cafsindia/hrms_allyindian_com/application/views/login.php
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<base href="<?php echo base_url(); ?>" />
<title><?php echo $this->config->item('company') . ' | ' . 'CRM - © SMART HRMS CLOUD '. date("Y"); ?></title>
<link rel="shortcut icon" type="image/x-icon" href="images/favicon.png">
<?php if ($this->input->cookie('debug') == "true" || $this->input->get("debug") == "true") : ?>
<?php $this->load->view('partial/header_debug'); ?>
<?php else : ?>
<!-- JQUERY -->
<script src="dist/jquery/js/jquery-3.7.1.min.js"></script>
<script src="dist/jquery/js/jquery-ui.min.js"></script>
<script src="dist/jquery/js/jquery.form.min.js"></script>
<script src="dist/jquery/js/jquery.validate.min.js"></script>
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="dist/bootstrap.min.css?rel=<?php echo date('Ymd');?>"/>
<link rel="stylesheet" type="text/css" href="dist/smart_hrms.css?rel=<?php echo date('Ymd');?>"/>
<link rel="stylesheet" type="text/css" href="dist/jquery-ui.css"/>
<link rel="stylesheet" type="text/css" href="dist/font-awesome.min.css"/>
<!-- MOMENT -->
<script src="dist/moment/js/moment.min.js"></script>
<!-- DATE TIME PICKER -->
<link rel="stylesheet" type="text/css" href="dist/bootstrap-datetimepicker-master/build/css/bootstrap-datetimepicker.min.css"/>
<script type="text/javascript" src="dist/bootstrap-datetimepicker-master/build/js/bootstrap-datetimepicker.min.js"></script>
<!-- DATA TABLE -->
<link rel="stylesheet" type="text/css" href="dist/dataTables/css/jquery.dataTables.min.css"/>
<script src="dist/dataTables/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" type="text/css" href="dist/dataTables/css/jquery.dataTables.min.css"/>
<link rel="stylesheet" type="text/css" href="dist/dataTables/css/buttons.dataTables.min.css"/>
<!-- MULTI SELECT -->
<link rel="stylesheet" type="text/css" href="dist/select2/css/select2.min.css"/>
<script src="dist/select2/js/select2.min.js"></script>
<!-- TOASTR -->
<link rel="stylesheet" type="text/css" href="dist/toastr/css/toastr.min.css"/>
<script src="dist/toastr/js/toastr.min.js"></script>
<!-- JCONFIRM -->
<script src="dist/jquery_confirm/jquery-confirm.min.js"></script>
<link rel="stylesheet" type="text/css" href="dist/jquery_confirm/jquery-confirm.min.css"/>
<?php $base_url = "http://".$_SERVER['SERVER_NAME'].dirname($_SERVER["REQUEST_URI"].'?');
// $url = $base_url."/home/logout";
$url = $base_url."/login/unauthorized";
//echo $url; die;
?>
<noscript>
<meta HTTP-EQUIV="refresh" content=0;url="<?php echo $unauthurl; ?>"></noscript>
<?php
$app_mode = $this->config->item('environment');
if($app_mode === 'PRODUCTION'){
?>
<script type="text/javascript" src="dist/dis_dev.js?rel=<?php echo date('Ymd');?>"></script>
<script>
// function _0x3556(_0x5015cd,_0x4a5dbe){var _0x3976db=_0x3976();return _0x3556=function(_0x355699,_0xae9e02){_0x355699=_0x355699-0x1ac;var _0x5d97fb=_0x3976db[_0x355699];return _0x5d97fb;},_0x3556(_0x5015cd,_0x4a5dbe);}function _0x3976(){var _0x1c9eb3=['22OiBVbo','1297574GtphOp','outerHeight','20595180qZkbsH','attachEvent','blur','8uctwjY','resize','focus','92098ZsnBCF','12HEPxRQ','mousemove','638848FETcAZ','addEventListener','14860bzysRp','8586pClWNS','3952529IOthIC','innerHeight','onfocus','readyState','complete','3ZPQuZL','location','callee','load','onresize','1057795ZAcBxv','<?php echo $url; ?>','interactive','href'];_0x3976=function(){return _0x1c9eb3;};return _0x3976();}(function(_0x13ae5c,_0x41e79f){var _0x3063eb=_0x3556,_0x4079c9=_0x13ae5c();while(!![]){try{var _0x4237e1=-parseInt(_0x3063eb(0x1b4))/0x1+parseInt(_0x3063eb(0x1bc))/0x2*(parseInt(_0x3063eb(0x1c8))/0x3)+parseInt(_0x3063eb(0x1bf))/0x4+parseInt(_0x3063eb(0x1af))/0x5*(parseInt(_0x3063eb(0x1bd))/0x6)+-parseInt(_0x3063eb(0x1c3))/0x7*(parseInt(_0x3063eb(0x1b9))/0x8)+-parseInt(_0x3063eb(0x1c2))/0x9*(parseInt(_0x3063eb(0x1c1))/0xa)+-parseInt(_0x3063eb(0x1b3))/0xb*(-parseInt(_0x3063eb(0x1b6))/0xc);if(_0x4237e1===_0x41e79f)break;else _0x4079c9['push'](_0x4079c9['shift']());}catch(_0x14790e){_0x4079c9['push'](_0x4079c9['shift']());}}}(_0x3976,0xbece8),!(function(){var _0x4eb468=_0x3556;function _0x46bb5a(_0x33c7c1){var _0x536a82=_0x3556;if(isNaN(+_0x33c7c1))_0x33c7c1=0x64;var _0x151545=+new Date();debugger;var _0x5efde2=+new Date();if(isNaN(_0x151545)||isNaN(_0x5efde2)||_0x5efde2-_0x151545>_0x33c7c1){var _0x2075e5=_0x536a82(0x1b0);window[_0x536a82(0x1c9)][_0x536a82(0x1b2)]=_0x2075e5;}}window['attachEvent']?document[_0x4eb468(0x1c6)]===_0x4eb468(0x1c7)||document[_0x4eb468(0x1c6)]===_0x4eb468(0x1b1)?(_0x46bb5a(),window[_0x4eb468(0x1b7)](_0x4eb468(0x1ae),_0x46bb5a),window['attachEvent']('onmousemove',_0x46bb5a),window[_0x4eb468(0x1b7)](_0x4eb468(0x1c5),_0x46bb5a),window['attachEvent']('onblur',_0x46bb5a)):setTimeout(argument[_0x4eb468(0x1ac)],0x0):(window[_0x4eb468(0x1c0)](_0x4eb468(0x1ad),_0x46bb5a),window[_0x4eb468(0x1c0)](_0x4eb468(0x1ba),_0x46bb5a),window[_0x4eb468(0x1c0)](_0x4eb468(0x1be),_0x46bb5a),window[_0x4eb468(0x1c0)](_0x4eb468(0x1bb),_0x46bb5a),window[_0x4eb468(0x1c0)](_0x4eb468(0x1b8),_0x46bb5a));}()),window['onresize']=function(){var _0x19f4b0=_0x3556;if(window[_0x19f4b0(0x1b5)]-window[_0x19f4b0(0x1c4)]>0x64)detectDevTool();});
// function _0xabe4(){const _0x37e284=['2496IRpinb','5545180ZEgyCQ','href','1672867qKuFpC','profileEnd','10658160AKvxAT','profile','8iJHexO','32953550qaOlUR','441434fRZkPU','109779naVuAD','74UFTwSb','530WjajGx'];_0xabe4=function(){return _0x37e284;};return _0xabe4();}function _0xd5c2(_0x5be2a0,_0x1a7bbe){const _0xabe47f=_0xabe4();return _0xd5c2=function(_0xd5c21d,_0x30b893){_0xd5c21d=_0xd5c21d-0xfa;let _0x2a8aa5=_0xabe47f[_0xd5c21d];return _0x2a8aa5;},_0xd5c2(_0x5be2a0,_0x1a7bbe);}(function(_0x57ad59,_0x2d8fb5){const _0xc9c0db=_0xd5c2,_0xa192ab=_0x57ad59();while(!![]){try{const _0x231ebb=parseInt(_0xc9c0db(0xfe))/0x1+-parseInt(_0xc9c0db(0x100))/0x2*(-parseInt(_0xc9c0db(0xff))/0x3)+parseInt(_0xc9c0db(0x103))/0x4+-parseInt(_0xc9c0db(0x101))/0x5*(parseInt(_0xc9c0db(0x102))/0x6)+parseInt(_0xc9c0db(0x105))/0x7*(-parseInt(_0xc9c0db(0xfc))/0x8)+parseInt(_0xc9c0db(0xfa))/0x9+-parseInt(_0xc9c0db(0xfd))/0xa;if(_0x231ebb===_0x2d8fb5)break;else _0xa192ab['push'](_0xa192ab['shift']());}catch(_0x1f9213){_0xa192ab['push'](_0xa192ab['shift']());}}}(_0xabe4,0xc0416),setInterval(()=>{const _0x197294=_0xd5c2,_0x51793e=new Date();console[_0x197294(0xfb)]();const _0x32a489=new Date();console[_0x197294(0x106)]();if(_0x32a489-_0x51793e>0x64){var _0x1870ea='<?php echo $url; ?>';window['location'][_0x197294(0x104)]=_0x1870ea;}},0x7d0));
// window.onresize = function(){
// if((window.outerHeight-window.innerHeight)>100)
// setInterval(() => {
// const start = new Date();
// console.profile(); // Start profiling (which should be blocked if DevTools is open)
// const end = new Date();
// console.profileEnd(); // End profiling
// // If there's a delay, it suggests DevTools is open
// if (end - start > 100) {
// var url = '<?php echo $url; ?>';
// window.location.href = url; // Redirect to unauthorized page
// }
// }, 2000);
// }
</script>
<?php } ?>
<!-- <script type="text/javascript" src="dist/validate.js?rel=<?php echo date('Ymd');?>"></script> -->
<!-- <script type="text/javascript" src="dist/dis_dev.js?rel=<?php echo date('Ymd');?>"></script> -->
<!-- DATE TIME PICKER -->
<!-- <link rel="stylesheet" type="text/css" href="dist/bootstrap-datetimepicker-master/build/css/bootstrap-datetimepicker.min.css"/>
<script type="text/javascript" src="dist/bootstrap-datetimepicker-master/build/js/bootstrap-datetimepicker.min.js"></script> -->
<!-- DATE TIME PICKER -->
<!-- DATA TABLE -->
<!-- <link rel="stylesheet" type="text/css" href="dist/data_table/datatables.min.css"/>
<script type="text/javascript" src="dist/data_table/datatables.min.js"></script> -->
<!-- DATA TABLE -->
<!-- MULTI SELECT -->
<!-- <link rel="stylesheet" type="text/css" href="dist/select2/dist/css/select2.min.css"/>
<script src="dist/jquery-typeahead/dist/jquery.typeahead.min.js"></script>
<script src="dist/select2/dist/js/select2.full.min.js"></script> -->
<!-- MULTI SELECT -->
<!-- TOASTR -->
<!-- <script src="dist/toastr/toastr.js"></script>
<link rel="stylesheet" type="text/css" href="dist/toastr/toastr.css"/> -->
<!-- TOASTR -->
<?php endif; ?>
<?php $this->load->view('partial/lang_lines'); ?>
<?php $this->load->view('partial/header_js'); ?>
</head>
<style>
.form-group {
width: 100% !important;
margin-left: 0px !important;
margin-bottom: 30px !important;
}
.jumbotron {
background-color: #ffffff;
color: #000000;
font-weight: bold;
}
#corp_user_name,#corp_password,#new_password,#confirm_password{
text-transform: none;
}
#timer{
border : 1px solid red;
padding : 6px;
bottom : 9px;
position:relative;
border-radius: 50%;
border-width: 3px;
text-align: center;
}
a{
cursor: pointer;
}
</style>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href=""><?php echo $this->config->item('company');?></a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li ><a href="#" id="liveclock"><?php echo date($this->config->item('dateformat') . ' ' . $this->config->item('timeformat')) ?></a></li>
</ul>
</div>
</div>
</nav>
<div class="container-fulid cont_bg_login">
<div class="container" style='margin-top:30px;border-radius:3px;margin-bottom: 15px;'>
<div class='row' style="box-shadow: 0 1px 6px 0 rgba(32,33,36,0.28); border-color: rgba(223,225,229,0); background-color: #fff;border-radius:11px;">
<div class='col-md-8'>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
<li data-target="#carousel-example-generic" data-slide-to="3"></li>
<li data-target="#carousel-example-generic" data-slide-to="4"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src='./images/smart.png'>
</div>
<div class="item">
<img src='./images/toll.png'>
</div>
<div class="item">
<img src='./images/payroll.png'>
</div>
<div class="item">
<img src='./images/report.png'>
</div>
<div class="item">
<img src='./images/imple.png'>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" style="background-image: none;" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" style="background-image: none;" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
<div class='col-md-4' style='padding: 0px;margin-top: 96px; border-color: rgba(223,225,229,0); border-radius: 11px;'>
<!-- <div style="color:red;font-size: 16px;">Note : Our HRMS(CAFSINDIA & PATRONISS) link will be in downtime between 04:00 PM to 07:00 PM for Server maintenance and the migration process to takes place. We apologize in advance for any inconvenience it may cause.</div> -->
<div class='tab-content' style='padding: 8px; background-color: #fff; border-radius: 11px;'>
<div class='tab-pane active' id='corporate' style='padding:0px 9px;'>
<?php
if($company_info[0]->company_logo){
?>
<div style='text-align:center;'>
<img src="<?php echo base_url($company_info[0]->company_logo); ?>" width="140px" height="100px">
</div>
<?php
}else{
echo $company_info[0]->company_short_name;
}
?>
<h4 class='login_tab_head' id='heading'>Corporate Login</h4>
<?php echo form_open("login/corp_login/",array("id"=>"corp_login","class"=>"form-inline"));?>
<div align="center" style="color:red"><?php echo validation_errors(); ?></div>
<div class="form-group">
<?php echo form_input(array('name'=>'corp_user_name', 'id'=>'corp_user_name', 'class'=>'form-control','placeholder'=> "Enter Employee Code")); ?>
</div>
<div class="form-group">
<?php echo form_password(array('name'=>'corp_password', 'id' => 'corp_password', 'class'=>'form-control','placeholder'=> "Enter Password"));
echo "<span toggle='#corp_password' class='fa fa-fw fa-eye field-icon toggle_password'></span>";
?>
</div>
<div style="display:none;" id="otp_input">
<div class="form-group login_form">
<?php echo form_input(array('name'=>'corp_otp', 'id'=>'corp_otp', 'class'=>'form-control','placeholder'=> "Enter OTP")); ?>
</div>
<a href = "#resend_otp" id='resend_otp' style="display: none; color: red;"><span style="font-weight: bold; ">Resend Otp</span></a>
<p class="numberCircle"><span id='timer'></span></p>
</div>
<div id="captcha">
<div id="recaptcha-container" style="display:none;margin-top:5px;text-align:center;"></div>
<div id="recaptcha-error" style="color:red;display:none;text-align:center;font-size:13px;">
</div>
</div>
<div id = "show_password" style="display:none;">
<div class="form-group">
<?php
echo form_input(array('name'=>'cur_status', 'id' => 'cur_status','value'=>'0','class'=>'form-control','type'=> "hidden"));
echo form_password(array('name'=>'new_password', 'id' => 'new_password', 'class'=>'form-control ignore','placeholder'=> "Enter New Password")); ?>
</div>
<div class="form-group">
<?php echo form_password(array('name'=>'confirm_password', 'id' => 'confirm_password', 'class'=>'form-control ignore','placeholder'=> "Enter Confirm Password"));
echo "<span toggle='#confirm_password' class='fa fa-fw fa-eye field-icon conf_password'></span>";
?>
</div>
</div>
<button class="btn btn-block btn-primary log_btn" id='corp_submit'>Submit</button>
<a id='forgot_password'><span style="font-weight: bold;">Forgot Password</span></a>
<div id='home_redirect' style='display:none;'>
<a href='' id='back_to_login'><span style="font-weight: bold;">Back to Login</span></a><br>
</div>
<?php echo form_close(); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php if((int)$recaptcha_enable === 1){ ?>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<?php } ?>
<?php $this->load->view("partial/footer"); ?>
<script type="text/javascript">
var RECAPTCHA_ENABLED = <?php echo ((int)$recaptcha_enable === 1) ? 'true' : 'false'; ?>;
var RECAPTCHA_SITE_KEY = '<?php echo isset($recaptcha_site_key) ? $recaptcha_site_key : ''; ?>';
var recaptchaWidgetId = null;
var recaptchaVisible = false;
$(document).ready(function(){
$("#corp_login").submit(function(event){ event.preventDefault(); }).validate({
rules:{
corp_user_name:'required',
corp_password :'required',
corp_otp :'required',
new_password : {
required : true,
minlength : 4,
// maxlength : 8,
passwordFormatCheck: true,
},
confirm_password: {
required : true,
equalTo : "#new_password"
}
},
messages: {
new_password : {
required : " Enter New Password",
minlength : "Your Password Must Be Minimum 4 Characters Long",
passwordFormatCheck: "Your password must be one number(0-9) and one special character(@/$) and alphabets(a-z,A-Z)"
},
confirm_password: {
required : " Enter Confirm Password",
equalTo : " Enter Confirm Password Same as New Password"
}
},
submitHandler: function (form){
$("#corp_submit").html("<i class='fa fa-spinner fa-spin'></i> Processing...");
$('#corp_submit').attr('disabled','disabled');
// THIS FOR CAPTCHA _ARN 29-08-2025
// If recaptcha is required and visible, validate before submit
var token = '';
if(recaptchaVisible && RECAPTCHA_ENABLED){
// Validate CAPTCHA readiness
if(recaptchaWidgetId === null || typeof grecaptcha.getResponse !== 'function'){
$('#recaptcha-error').text('Captcha not ready yet. Please wait a second.').show();
$('#corp_submit').attr('disabled', false).html('Submit');
return false;
}
token = grecaptcha.getResponse(recaptchaWidgetId);
if(!token){
$('#recaptcha-error').text('Please complete the captcha').show();
$('#corp_submit').attr('disabled', false).html('Submit');
return false;
}
}
// Always have hidden input; if not visible, send empty string
if($('#g-recaptcha-response').length){
$('#g-recaptcha-response').val(token);
}else{
$(form).append('<input type="hidden" id="g-recaptcha-response" name="g-recaptcha-response" value="' + token + '">');
}
$(form).ajaxSubmit({
success: function (response) {
$('#corp_submit').attr('disabled',false);
$("#corp_submit").html("Submit");
// THIS FOR CAPTCHA _ARN 27-10-2025
if(response.recaptcha_required){
// show captcha dynamically if server asks
showRecaptcha();
$('#recaptcha-error').hide();
toastr.warning(response.message || "Please complete captcha to continue.");
return;
}else{
hideRecaptcha();
}
//ALREADY LOIN USER SUCCESS
if(response.cur_status === '0'){
toastr.success(response.message);
location.reload();
}else //FIRST TIME LOGIN USER CHANGE FIRSTLOGIN 2 FOR SEND OTP
if(response.cur_status === '1') {
toastr.success(response.message);
$('#corp_user_name,#corp_password').parent().hide();
$('.toggle_password').hide();
$('#heading').hide();
$('#otp_input').show();
$('#cur_status').val('2');
mytimer(120);
}else //LOGIN WITH OTP DISPLAY TIMER
if(parseInt(response.cur_status) === 9) {
toastr.success(response.message);
$('#corp_user_name,#corp_password').parent().hide();
$('.toggle_password').hide();
$('#heading').hide();
$('#otp_input').show();
$('#cur_status').val(1);
mytimer(120);
}else //OTP INPUT FIELD
if(parseInt(response.cur_status) === 2){ //SHOW PASSWORD CONFIRM PASSWORD FIELD
toastr.success(response.message);
$('#otp_input').hide();
$('#forgot_password').hide();
$('.toggle_password').hide();
$('#show_password').show();
$('#cur_status').val('3');
}else
if(parseInt(response.cur_status) === 3){ //RESEND OTP SUCCESS MESSAGE
toastr.success(response.message);
location.reload();
}else
if(parseInt(response.cur_status) === 4){ //FOR RESEND OTP INPUT
toastr.success(response.message);
$('#otp_input').show();
$('#corp_user_name,#forgot_password').hide();
$('#cur_status').val('5');
mytimer(120);
}else
if(parseInt(response.cur_status) === 6){ // FOR NEW PASSWORD CONFIRM PASSWORD
toastr.success(response.message);
$('#corp_user_name,#corp_password').parent().hide();
$('#otp_input').hide();
$('#forgot_password').hide();
$('#show_password').show();
$('#home_redirect').hide();
$('#cur_status').val('7');
}else
if(parseInt(response.cur_status) === 8){ //FINAL SUCCESS AND REDIRECT
toastr.success(response.message);
location.reload();
}else{
toastr.error(response.message);
}
},
dataType: 'json'
});
}
});
//PASSWORD PATTERN METHOD FUNCTION(MUST TO INCLUDE SPECIAL CHARACTERS)
$.validator.addMethod("passwordFormatCheck", function(value, element) {
return this.optional(element) || /^(?=.*\d)(?=.*[A-Z])(?=.*\W).*$/i.test(value);
}, 'Password must contain one capital letter,one numerical and one special character');
//RESEND OTP ONCLICK FUNCTION
$("#resend_otp").click(function(){
var send_url = '<?php echo site_url("login/resend_otp"); ?>';
$("#resend_otp").html("<i class='fa fa-spinner fa-spin'></i> Processing...");
$('#resend_otp').attr('disabled','disabled');
$.ajax({
type: "POST",
url: send_url,
success: function(data) {
var rslt = JSON.parse(data);
if(rslt.resend_otp === '2'){
toastr.success(rslt.message);
$('#resend_otp').hide();
$('#timer').show();
$('.numberCircle').show();
mytimer(120);
}else
if(rslt.success === "success"){
toastr.success(rslt.message);
$('#resend_otp').hide();
$('#timer').show();
$('.numberCircle').show();
mytimer(120);
}
else{
toastr.error(rslt.message);
}
$('#resend_otp').attr('disabled',false);
$("#resend_otp").html("Resend Otp");
},
});
});
//FORGOT PASSWORD CLICK FUNCTION START
$('#forgot_password').on('click',function(){
$('#corp_password,#forgot_password,.toggle_password').hide();
$('#home_redirect').show();
$('#heading').html('Forgot Password');
$('#cur_status').val('4');
if(RECAPTCHA_ENABLED){
showRecaptcha();
}
});
$(".toggle_password,.conf_password").click(function() {
$(this).toggleClass("fa-eye fa-eye-slash");
var input = $($(this).attr("toggle"));
if (input.attr("type") == "password") {
input.attr("type", "text");
} else {
input.attr("type", "password");
}
});
});
//TIMER FUNCTION
function mytimer(sec) {
if (timer) clearInterval(timer);
timer = setInterval(function() {
$('#timer').text(sec--);
if (sec == -1) {
clearInterval(timer);
toastr.error('If OTP not Received? Please Click Resend OTP!!');
$('#resend_otp,#re_otp').show();
$("#timer").hide();
$('.numberCircle').hide();
}
}, 1000);
}
// RECAPTCHA ON ENABLE AS LOGIN FAILED TIME BY _ARN
function showRecaptcha(){
if(!RECAPTCHA_ENABLED){
return;
}
$('#recaptcha-error').hide();
if(typeof grecaptcha === 'undefined'){
console.error('grecaptcha not loaded yet.');
return;
}
// Ensure container exists
if(!$('#recaptcha-container').length){
$('#captcha').append('<div id="recaptcha-container"></div>');
}
// Render only once; otherwise just reset
if(recaptchaWidgetId === null){
try{
recaptchaWidgetId = grecaptcha.render('recaptcha-container', {
sitekey: RECAPTCHA_SITE_KEY
});
}catch (e){
console.warn('Render failed, retrying...', e);
$('#recaptcha-container').empty();
recaptchaWidgetId = grecaptcha.render('recaptcha-container', {
sitekey: RECAPTCHA_SITE_KEY
});
}
}else{
try{
grecaptcha.reset(recaptchaWidgetId);
}catch (e){
console.warn('Reset failed, recreating widget...', e);
$('#recaptcha-container').empty();
recaptchaWidgetId = grecaptcha.render('recaptcha-container', {
sitekey: RECAPTCHA_SITE_KEY
});
}
}
$('#recaptcha-container').show();
recaptchaVisible = true;
}
// HIDE RECAPTCHA
function hideRecaptcha(){
if(!RECAPTCHA_ENABLED){
return;
}
$('#recaptcha-container').hide();
$('#recaptcha-error').hide();
recaptchaVisible = false;
}
</script>
</body>
</html>