<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
/* @HoneybeeWeb/pages/views/verify_otp_honeybee.html.twig */
class __TwigTemplate_383f7475fd96007d22794646385264b8216861de6a9619b406f19218aa93ee94 extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
];
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@HoneybeeWeb/pages/views/verify_otp_honeybee.html.twig"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@HoneybeeWeb/pages/views/verify_otp_honeybee.html.twig"));
// line 2
yield from $this->loadTemplate("@Application/inc/central_header.html.twig", "@HoneybeeWeb/pages/views/verify_otp_honeybee.html.twig", 2)->unwrap()->yield($context);
// line 3
yield "
<style>
.email-input{
position: relative;
}
.otp_in{ }
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* Firefox */
input[type=number] {
-moz-appearance: textfield;
}
</style>
";
// line 25
yield "<section class=\"verification-code-page section\">
<div class=\"container d-flex justify-content-center align-items-center\">
<div class=\"card text-center login-inputs\">
<h2 class=\"section-title\">We've sent you a code to your email address </h2>
<p style=\"margin: 0; text-align: center; color: #eb9f9f;\">";
// line 29
(((0 === CoreExtension::compare((isset($context["message"]) || array_key_exists("message", $context) ? $context["message"] : (function () { throw new RuntimeError('Variable "message" does not exist.', 29, $this->source); })()), ""))) ? (yield "") : (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["message"]) || array_key_exists("message", $context) ? $context["message"] : (function () { throw new RuntimeError('Variable "message" does not exist.', 29, $this->source); })()), "html", null, true)));
yield "</p>
<p>Please check your email and enter the code from there.</p>
";
// line 32
yield " <form action=\"\" id=\"relevantForm\" method=\"post\">
<div class=\"email-input d-flex justify-content-center \" id=\"code-input\">
";
// line 35
yield " <input type=\"number\" id=\"otp_in_1\" name=\"otp_in_1\" placeholder=\"\" maxlength=\"1\" data-prev-id=\"_NONE_\" data-next-id=\"2\" class=\"code-box mx-1 otp_in otp_in_1\" required>
";
// line 37
yield " <input type=\"number\" id=\"otp_in_2\" name=\"otp_in_2\" placeholder=\"\" maxlength=\"1\" data-prev-id=\"1\" data-next-id=\"3\" class=\"code-box mx-1 otp_in otp_in_2\" required>
";
// line 39
yield " <input type=\"number\" id=\"otp_in_3\" name=\"otp_in_3\" placeholder=\"\" maxlength=\"1\" data-prev-id=\"2\" data-next-id=\"4\" class=\"code-box mx-1 otp_in otp_in_3\" required>
";
// line 41
yield " <input type=\"number\" id=\"otp_in_4\" name=\"otp_in_4\" placeholder=\"\" maxlength=\"1\" data-prev-id=\"3\" data-next-id=\"_NONE_\" class=\"code-box mx-1 otp_in otp_in_4\" required>
<input type=\"hidden\" id=\"otp\" name=\"otp\" placeholder=\"otp\" maxlength=\"4\" class=\"input_field\" required>
<div class=\"eye-onoff d-none\">
<i class=\"fas fa-times small_error_icon email\"></i>
</div>
";
// line 48
yield " <p class=\"small_error_text email\"></p>
</div>
<h6 class='mt-5' style=\"margin: 10px 0 10px;color: #615A5A;font-size:12px;text-align: center;\"><span id=\"otpExpireTextPrefix\">The OTP will expire</span> <span style=\"\" id=\"otpExpireText\"
class=\"time convert_to_moment_time\" data-moment-ts-format=\"_today_or_date_\"
data-moment-ts=\"";
// line 55
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["otpExpireTs"]) || array_key_exists("otpExpireTs", $context) ? $context["otpExpireTs"] : (function () { throw new RuntimeError('Variable "otpExpireTs" does not exist.', 55, $this->source); })()), "html", null, true);
yield "\"></span> <a class=\"resend_otp_button\" style=\"display: inline-block;\" href=\"#\"> Resend OTP</a>
</h6>
<button type=\"submit\" class=\"honeybtn rel_form_submit mt-4\">Confirm</button>
</form>
<p class=\"mt-3\"><small>Not you? </small><a href=\"";
// line 61
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("central_landing");
yield "\" >Login with another account?</a></p>
</div>
</div>
</section>
";
// line 66
yield from $this->loadTemplate("@HoneybeeWeb/footer/central_footer.html.twig", "@HoneybeeWeb/pages/views/verify_otp_honeybee.html.twig", 66)->unwrap()->yield($context);
// line 67
yield "
";
// line 69
yield "<script type=\"text/javascript\" src=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\HttpFoundationExtension']->generateAbsoluteUrl($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("dashboard")), "html", null, true);
yield "js/onscan.min.js\"></script>
";
// line 71
yield "
<script>
var fbt='';
var cndDwnInterval='';
\$(document).ready(function () {
function ConvertToMomentTimeOtpExpire(elem) {
elem=elem||\$('#otpExpireText');
var moment_time = moment.unix(\$(elem).attr('data-moment-ts'));
// console.log(\$(elem).attr('data-moment-ts'));
\$('#otpExpireTextPrefix').text('This OTP will Expire');
var format = \$(elem).attr('data-moment-ts-format');
var toReplaceStr = '';
if (\$(elem).attr('data-moment-ts') <= 0) {
clearInterval(cndDwnInterval);
toReplaceStr = ''
}
else {
if (format == '_today_or_date_') {
// toReplaceStr = moment_time.fromNow()
if (moment() > moment_time) {
// alert('here')
\$('#otpExpireTextPrefix').text('The OTP has Expired');
toReplaceStr = ''
clearInterval(cndDwnInterval);
}
else {
toReplaceStr = moment_time.fromNow()
}
}
else {
toReplaceStr = moment_time.format(format)
}
}
\$(elem).text(toReplaceStr)
}
function resendOtp(options){
options=options||{
";
// line 112
yield " userId:";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((CoreExtension::getAttribute($this->env, $this->source, ($context["session"] ?? null), CoreExtension::getAttribute($this->env, $this->source, (isset($context["UserConstants"]) || array_key_exists("UserConstants", $context) ? $context["UserConstants"] : (function () { throw new RuntimeError('Variable "UserConstants" does not exist.', 112, $this->source); })()), "USER_ID", [], "any", false, false, false, 112), [], "array", true, true, false, 112)) ? (CoreExtension::getAttribute($this->env, $this->source, (isset($context["session"]) || array_key_exists("session", $context) ? $context["session"] : (function () { throw new RuntimeError('Variable "session" does not exist.', 112, $this->source); })()), CoreExtension::getAttribute($this->env, $this->source, (isset($context["UserConstants"]) || array_key_exists("UserConstants", $context) ? $context["UserConstants"] : (function () { throw new RuntimeError('Variable "UserConstants" does not exist.', 112, $this->source); })()), "USER_ID", [], "any", false, false, false, 112), [], "array", false, false, false, 112)) : (((array_key_exists("userId", $context)) ? ((isset($context["userId"]) || array_key_exists("userId", $context) ? $context["userId"] : (function () { throw new RuntimeError('Variable "userId" does not exist.', 112, $this->source); })())) : ("0")))), "html", null, true);
yield ",
userType:";
// line 113
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((CoreExtension::getAttribute($this->env, $this->source, ($context["session"] ?? null), CoreExtension::getAttribute($this->env, $this->source, (isset($context["UserConstants"]) || array_key_exists("UserConstants", $context) ? $context["UserConstants"] : (function () { throw new RuntimeError('Variable "UserConstants" does not exist.', 113, $this->source); })()), "USER_TYPE", [], "any", false, false, false, 113), [], "array", true, true, false, 113)) ? (CoreExtension::getAttribute($this->env, $this->source, (isset($context["session"]) || array_key_exists("session", $context) ? $context["session"] : (function () { throw new RuntimeError('Variable "session" does not exist.', 113, $this->source); })()), CoreExtension::getAttribute($this->env, $this->source, (isset($context["UserConstants"]) || array_key_exists("UserConstants", $context) ? $context["UserConstants"] : (function () { throw new RuntimeError('Variable "UserConstants" does not exist.', 113, $this->source); })()), "USER_TYPE", [], "any", false, false, false, 113), [], "array", false, false, false, 113)) : (((array_key_exists("userType", $context)) ? ((isset($context["userType"]) || array_key_exists("userType", $context) ? $context["userType"] : (function () { throw new RuntimeError('Variable "userType" does not exist.', 113, $this->source); })())) : ("0")))), "html", null, true);
yield ",
userCategory:'";
// line 114
((array_key_exists("userCategory", $context)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["userCategory"]) || array_key_exists("userCategory", $context) ? $context["userCategory"] : (function () { throw new RuntimeError('Variable "userCategory" does not exist.', 114, $this->source); })()), "html", null, true)) : (yield "_BUDDYBEE_USER_"));
yield "',
otpActionId:'";
// line 115
((array_key_exists("otpActionId", $context)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["otpActionId"]) || array_key_exists("otpActionId", $context) ? $context["otpActionId"] : (function () { throw new RuntimeError('Variable "otpActionId" does not exist.', 115, $this->source); })()), "html", null, true)) : (yield 1));
yield "',
otpExpireSecond:180,
email:'";
// line 117
((array_key_exists("email", $context)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["email"]) || array_key_exists("email", $context) ? $context["email"] : (function () { throw new RuntimeError('Variable "email" does not exist.', 117, $this->source); })()), "html", null, true)) : (yield "_NONE_"));
yield "',
}
\$.post('";
// line 121
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("send_otp_ajax");
yield "', options)
.done(function (data) {
// // console.log(data);
if (data.success == true) {
\$('#otpExpireText').attr('data-moment-ts',data.otpExpireTs);
reset_otp()
clearInterval(cndDwnInterval);
cndDwnInterval = setInterval(ConvertToMomentTimeOtpExpire, 1000);
} else {
// \$('#barcode_selector_cont').waitMe('hide');
}
})
.fail(function () {
// \$('#barcode_selector_cont').waitMe('hide');
});
}
// cndDwnInterval = setInterval(ConvertToMomentTimeOtpExpire(\$('#otpExpireText')), 1000);
function paste_otp(curr_number){
\$('.otp_in_1').val(Math.floor(curr_number/1000));curr_number=curr_number%1000;
\$('.otp_in_2').val(Math.floor(curr_number/100));curr_number=curr_number%100;
\$('.otp_in_3').val(Math.floor(curr_number/10));curr_number=curr_number%10;
\$('.otp_in_4').val(Math.floor(curr_number/1));curr_number=curr_number%1;
update_otp_field()
}
function reset_otp(){
\$('.otp_in_1').val('').focus();
\$('.otp_in_2').val('');
\$('.otp_in_3').val('');
\$('.otp_in_4').val('');
}
function update_otp_field(){
\$('#otp').val(
1000*(\$('.otp_in_1').val())+
100*(\$('.otp_in_2').val())+
10*(\$('.otp_in_3').val())+
1*(\$('.otp_in_4').val())
)
check_doc_and_submit(0); //check only not submit
}
// \$('.otp_in').keydown(function(event){
//// alert('keydown')
// alert(\$(this).val())
//SS
//
//
//
// })
// \$('.otp_in').keydown(function(event){
//// alert('blur')
//// alert(\$(this).val())
// if(1*\$(this).val()>=1000) {
// alert(\$(this).val())
// paste_otp(1 * \$(this).val())
//
// }
//
//
//
//
// })
\$('.otp_in_1').keydown(function(event){
// \$('#enter_otp_title').text(
// '_'+\$(this).val()+'_'
// )
if(\$(this).val().length>=4)
paste_otp(\$(this).val())
})
// document.addEventListener('onautocomplete', function(e) {
// e.target.hasAttribute('autocompleted'); // true or false
//// alert(event.target.value)
// paste_otp(event.target.value)
//// e.preventDefault(); // prevent autocomplete
// // do you stuff...
// })
\$('.otp_in').keyup(function(event){
var prev_data_id=\$(this).data('prevId')
var next_data_id=\$(this).data('nextId')
// alert(event.keyCode)
if ( event.which == 13 ) {
event.preventDefault();
}
else if ( event.which == 8 ) {
event.preventDefault();
\$(this).val('');
if(prev_data_id!='_NONE_')
\$('.otp_in_'+prev_data_id).focus();
// \$('.otp_in_'+prev_data_id).val('').focus();
}
else if ( event.which == 39 ) {
event.preventDefault();
if (next_data_id != '_NONE_') {
\$('.otp_in_' + next_data_id).focus();
}
}
else if ( event.which == 37 ) {
event.preventDefault();
if(prev_data_id!='_NONE_')
\$('.otp_in_'+prev_data_id).focus();
}
else
{
if(event.key >=0 && event.key<=9 ) {
// alert(event.which)
// alert(event.key)
// alert(String.fromCharCode(event.which))
// \$(this).val(String.fromCharCode(event.which));
\$(this).val(event.key);
if (next_data_id != '_NONE_') {
\$('.otp_in_' + next_data_id).focus();
}
}
// alert(\$(this).val())
// alert(isNaN(\$(this).val()))
if( isNaN(\$(this).val()))
\$(this).val('');
}
update_otp_field()
})
function attach_onscan() {
// alert('pika')
onScan.attachTo(document, {
singleScanQty: 1,
minLength:4,
suffixKeyCodes: [13], // enter-key expected at the end of a scan
reactToPaste: true, // Compatibility to built-in scanners in paste-mode (as opposed to keyboard-mode)
onScan: function (sCode, iQty) { // Alternative to document.addEventListener('scan')
// // console.log('Scanned: ' + iQty + 'x ' + sCode);
//
// var foundIds = [];
//
//// // console.log('PIKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA');
// // console.log(sCode);
// lastScanCrossMatched = 1;
if (!isNaN(sCode)) {
paste_otp(sCode)
}
//// dynamic_product_selector.focus();
// // console.log(dynamic_product_selector.currentResults.items);
//// dynamic_product_selector.setValue(dynamic_product_selector.currentResults.items[0].id);
// if(dynamic_product_selector.currentResults.items.length>=1) {
//// alert(dynamic_product_selector.currentResults.items.length+','+dynamic_product_selector.currentResults.items[0].id)
// dynamic_product_selector.setValue(dynamic_product_selector.currentResults.items[0].id);
// //// console.log(this.currentResults.items.length);
//
// dynamic_product_selector.focus();
// }
},
// onKeyDetect: function(iKeyCode){ // output all potentially relevant key events - great for debugging!
// // console.log('Pressed: ' + iKeyCode);
// }
});
}
function detach_onscan() {
onScan.detachFrom(document);
}
// \$('#deliveryInfoModal').on('hidden.bs.modal', function (e) {
// attach_onscan();
// })
// \$('#deliveryInfoModal').on('shown.bs.modal', function (e) {
// detach_onscan();
// })
attach_onscan();
\$('.otp_in_'+1).focus();
\$('.resend_otp_button').click(function(e){
e.preventDefault();
";
// line 324
yield " resendOtp();
})
\$('.login-inputs input').focus(function () {
// if()
// \$('.login-inputs input').removeClass('error_class');
\$(this).removeClass('error_class');
})
\$('.login-inputs input').change(function () {
// if()
// \$('.login-inputs input').removeClass('error_class');
if(\$(this).hasClass('checkIfExists'))
{
check_field_validity(\$(this).attr('data-field-type'))
}
check_doc_and_submit(0); //check only not submit
})
function check_field_validity(fieldType)
{
fieldType = fieldType || 'email';
\$('.small_error_text.' + fieldType).text('')
\$('.small_error_text.' + fieldType).hide()
\$('.small_error_icon.' + fieldType).removeClass('success').removeClass('error');
\$('.small_error_icon.' + fieldType).removeClass('fa-check').removeClass('fa-times');
\$('.small_error_icon.' + fieldType).addClass('fa-spinner');
\$('.small_error_icon.' + fieldType).show()
// \$.post( \"example.php\", function() {
// alert( \"success\" );
// })
// .done(function() {
// alert( \"second success\" );
// })
// .fail(function() {
// alert( \"error\" );
// })
// .always(function() {
// alert( \"finished\" );
// });
//";
// line 369
yield " //";
// line 370
yield " //";
// line 371
yield " //";
// line 372
yield "
//";
// line 375
yield "
if(fieldType=='password')
{
// if(\$('#password2').val()=='')
// return;
if(\$('#password').val()!==\$('#password2').val())
// if(0)
{
\$('.small_error_text.' + fieldType).text('Passwords do not Match')
\$('.small_error_text.' + fieldType).show()
\$('.small_error_icon.' + fieldType).removeClass('fa-spinner').removeClass('success');
\$('.small_error_icon.' + fieldType).addClass('fa-times').addClass('error');
\$('.small_error_icon.' + fieldType).show()
}
else {
\$('.small_error_text.' + fieldType).text('')
\$('.small_error_text.' + fieldType).hide()
\$('.small_error_icon.' + fieldType).removeClass('fa-spinner').removeClass('error');
\$('.small_error_icon.' + fieldType).addClass('fa-check').addClass('success');
\$('.small_error_icon.' + fieldType).show()
}
return;
}
\$.post('";
// line 411
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("check_if_email_exists_already");
yield "', {
fieldType: fieldType,
fieldValue: \$('.input_field.' + fieldType).val(),
signUpUserType: ";
// line 414
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["userType"]) || array_key_exists("userType", $context) ? $context["userType"] : (function () { throw new RuntimeError('Variable "userType" does not exist.', 414, $this->source); })()), "html", null, true);
yield ",
})
.done(function (data) {
//sales.clearItemTable()
fieldType=data.fieldType;
if (data.alreadyExists != true) {
\$('.small_error_text.' + fieldType).text('Couldnot find your email')
\$('.small_error_text.' + fieldType).show()
\$('.small_error_icon.' + fieldType).removeClass('fa-spinner').removeClass('success');
\$('.small_error_icon.' + fieldType).addClass('fa-times').addClass('error');
\$('.small_error_icon.' + fieldType).show()
}
else {
\$('.small_error_text.' + fieldType).text('')
\$('.small_error_text.' + fieldType).hide()
\$('.small_error_icon.' + fieldType).removeClass('fa-spinner').removeClass('error');
\$('.small_error_icon.' + fieldType).addClass('fa-check').addClass('success');
\$('.small_error_icon.' + fieldType).show()
}
}
);
}
function check_doc_and_submit(submitFlag) {
var checkFailed = 0;
submitFlag=submitFlag||0
///check if any checking needed here
\$('.login-inputs input').each(function(ind,elem){
if(\$(this).prop('required')){
if(\$(this).val()=='' )
checkFailed=1;
// console.log(\"REQ\");
} else {
// console.log(\"NREQ\");
}
});
\$('.small_error_text').each(function(ind,elem)
{
if(\$(elem).text()!='')
checkFailed=1;
})
\$('.small_error_text').each(function(ind,elem)
{
if(\$(elem).text()!='')
checkFailed=1;
})
if(checkFailed==0)
\$('.rel_form_submit').addClass('ready');
else
{
\$('.rel_form_submit').removeClass('ready');
}
if (checkFailed == 0 && submitFlag==1) {
\$('.rel_form_submit').removeClass('ready');
\$('.rel_form_submit').hide();
\$('#relevantForm').submit();
}
}
//For save action
\$('input[type=\"submit\"], button[type=\"submit\"], .rel_form_submit').click(function (event) {
event.preventDefault();
check_doc_and_submit(1);
})
\$('.convert_to_moment_time').each(function (ind, elem) {
ConvertToMomentTimeOtpExpire(elem);
});
cndDwnInterval = setInterval(ConvertToMomentTimeOtpExpire, 1000);
check_doc_and_submit(0)
})
</script>
";
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
return; yield '';
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName()
{
return "@HoneybeeWeb/pages/views/verify_otp_honeybee.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable()
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo()
{
return array ( 509 => 414, 503 => 411, 465 => 375, 461 => 372, 459 => 371, 457 => 370, 455 => 369, 409 => 324, 204 => 121, 197 => 117, 192 => 115, 188 => 114, 184 => 113, 179 => 112, 137 => 71, 132 => 69, 129 => 67, 127 => 66, 119 => 61, 110 => 55, 101 => 48, 93 => 41, 90 => 39, 87 => 37, 84 => 35, 80 => 32, 75 => 29, 69 => 25, 46 => 3, 44 => 2,);
}
public function getSourceContext()
{
return new Source("{# {% include '@Application/inc/buddybee_new_header.html.twig' %} #}
{% include '@Application/inc/central_header.html.twig' %}
<style>
.email-input{
position: relative;
}
.otp_in{ }
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* Firefox */
input[type=number] {
-moz-appearance: textfield;
}
</style>
{# honeybee otp verrify form section #}
<section class=\"verification-code-page section\">
<div class=\"container d-flex justify-content-center align-items-center\">
<div class=\"card text-center login-inputs\">
<h2 class=\"section-title\">We've sent you a code to your email address </h2>
<p style=\"margin: 0; text-align: center; color: #eb9f9f;\">{{ message==''?'':message }}</p>
<p>Please check your email and enter the code from there.</p>
{# form #}
<form action=\"\" id=\"relevantForm\" method=\"post\">
<div class=\"email-input d-flex justify-content-center \" id=\"code-input\">
{# otp digit 1 #}
<input type=\"number\" id=\"otp_in_1\" name=\"otp_in_1\" placeholder=\"\" maxlength=\"1\" data-prev-id=\"_NONE_\" data-next-id=\"2\" class=\"code-box mx-1 otp_in otp_in_1\" required>
{# otp digit 2 #}
<input type=\"number\" id=\"otp_in_2\" name=\"otp_in_2\" placeholder=\"\" maxlength=\"1\" data-prev-id=\"1\" data-next-id=\"3\" class=\"code-box mx-1 otp_in otp_in_2\" required>
{# otp digit 3 #}
<input type=\"number\" id=\"otp_in_3\" name=\"otp_in_3\" placeholder=\"\" maxlength=\"1\" data-prev-id=\"2\" data-next-id=\"4\" class=\"code-box mx-1 otp_in otp_in_3\" required>
{# otp digit 4 #}
<input type=\"number\" id=\"otp_in_4\" name=\"otp_in_4\" placeholder=\"\" maxlength=\"1\" data-prev-id=\"3\" data-next-id=\"_NONE_\" class=\"code-box mx-1 otp_in otp_in_4\" required>
<input type=\"hidden\" id=\"otp\" name=\"otp\" placeholder=\"otp\" maxlength=\"4\" class=\"input_field\" required>
<div class=\"eye-onoff d-none\">
<i class=\"fas fa-times small_error_icon email\"></i>
</div>
{# error message #}
<p class=\"small_error_text email\"></p>
</div>
<h6 class='mt-5' style=\"margin: 10px 0 10px;color: #615A5A;font-size:12px;text-align: center;\"><span id=\"otpExpireTextPrefix\">The OTP will expire</span> <span style=\"\" id=\"otpExpireText\"
class=\"time convert_to_moment_time\" data-moment-ts-format=\"_today_or_date_\"
data-moment-ts=\"{{ otpExpireTs }}\"></span> <a class=\"resend_otp_button\" style=\"display: inline-block;\" href=\"#\"> Resend OTP</a>
</h6>
<button type=\"submit\" class=\"honeybtn rel_form_submit mt-4\">Confirm</button>
</form>
<p class=\"mt-3\"><small>Not you? </small><a href=\"{{ url('central_landing') }}\" >Login with another account?</a></p>
</div>
</div>
</section>
{% include '@HoneybeeWeb/footer/central_footer.html.twig' %}
{# {% include '@Application/footer/buddybee_new_footer.html.twig' %} #}
<script type=\"text/javascript\" src=\"{{ absolute_url(path('dashboard')) }}js/onscan.min.js\"></script>
{#<script type=\"text/javascript\" src=\"{{ absolute_url(path('dashboard')) }}buddybee_assets/js/detect_autofill.js\"></script>#}
<script>
var fbt='';
var cndDwnInterval='';
\$(document).ready(function () {
function ConvertToMomentTimeOtpExpire(elem) {
elem=elem||\$('#otpExpireText');
var moment_time = moment.unix(\$(elem).attr('data-moment-ts'));
// console.log(\$(elem).attr('data-moment-ts'));
\$('#otpExpireTextPrefix').text('This OTP will Expire');
var format = \$(elem).attr('data-moment-ts-format');
var toReplaceStr = '';
if (\$(elem).attr('data-moment-ts') <= 0) {
clearInterval(cndDwnInterval);
toReplaceStr = ''
}
else {
if (format == '_today_or_date_') {
// toReplaceStr = moment_time.fromNow()
if (moment() > moment_time) {
// alert('here')
\$('#otpExpireTextPrefix').text('The OTP has Expired');
toReplaceStr = ''
clearInterval(cndDwnInterval);
}
else {
toReplaceStr = moment_time.fromNow()
}
}
else {
toReplaceStr = moment_time.format(format)
}
}
\$(elem).text(toReplaceStr)
}
function resendOtp(options){
options=options||{
{#userId:{{ session[UserConstants.USER_ID] is defined?session[UserConstants.USER_ID]:'0' }},#}
userId:{{ session[UserConstants.USER_ID] is defined?session[UserConstants.USER_ID]:(userId is defined?userId:'0') }},
userType:{{ session[UserConstants.USER_TYPE] is defined?session[UserConstants.USER_TYPE]:(userType is defined?userType:'0') }},
userCategory:'{{ userCategory is defined?userCategory:'_BUDDYBEE_USER_' }}',
otpActionId:'{{ otpActionId is defined?otpActionId:1 }}',
otpExpireSecond:180,
email:'{{ email is defined?email:'_NONE_' }}',
}
\$.post('{{ url('send_otp_ajax') }}', options)
.done(function (data) {
// // console.log(data);
if (data.success == true) {
\$('#otpExpireText').attr('data-moment-ts',data.otpExpireTs);
reset_otp()
clearInterval(cndDwnInterval);
cndDwnInterval = setInterval(ConvertToMomentTimeOtpExpire, 1000);
} else {
// \$('#barcode_selector_cont').waitMe('hide');
}
})
.fail(function () {
// \$('#barcode_selector_cont').waitMe('hide');
});
}
// cndDwnInterval = setInterval(ConvertToMomentTimeOtpExpire(\$('#otpExpireText')), 1000);
function paste_otp(curr_number){
\$('.otp_in_1').val(Math.floor(curr_number/1000));curr_number=curr_number%1000;
\$('.otp_in_2').val(Math.floor(curr_number/100));curr_number=curr_number%100;
\$('.otp_in_3').val(Math.floor(curr_number/10));curr_number=curr_number%10;
\$('.otp_in_4').val(Math.floor(curr_number/1));curr_number=curr_number%1;
update_otp_field()
}
function reset_otp(){
\$('.otp_in_1').val('').focus();
\$('.otp_in_2').val('');
\$('.otp_in_3').val('');
\$('.otp_in_4').val('');
}
function update_otp_field(){
\$('#otp').val(
1000*(\$('.otp_in_1').val())+
100*(\$('.otp_in_2').val())+
10*(\$('.otp_in_3').val())+
1*(\$('.otp_in_4').val())
)
check_doc_and_submit(0); //check only not submit
}
// \$('.otp_in').keydown(function(event){
//// alert('keydown')
// alert(\$(this).val())
//SS
//
//
//
// })
// \$('.otp_in').keydown(function(event){
//// alert('blur')
//// alert(\$(this).val())
// if(1*\$(this).val()>=1000) {
// alert(\$(this).val())
// paste_otp(1 * \$(this).val())
//
// }
//
//
//
//
// })
\$('.otp_in_1').keydown(function(event){
// \$('#enter_otp_title').text(
// '_'+\$(this).val()+'_'
// )
if(\$(this).val().length>=4)
paste_otp(\$(this).val())
})
// document.addEventListener('onautocomplete', function(e) {
// e.target.hasAttribute('autocompleted'); // true or false
//// alert(event.target.value)
// paste_otp(event.target.value)
//// e.preventDefault(); // prevent autocomplete
// // do you stuff...
// })
\$('.otp_in').keyup(function(event){
var prev_data_id=\$(this).data('prevId')
var next_data_id=\$(this).data('nextId')
// alert(event.keyCode)
if ( event.which == 13 ) {
event.preventDefault();
}
else if ( event.which == 8 ) {
event.preventDefault();
\$(this).val('');
if(prev_data_id!='_NONE_')
\$('.otp_in_'+prev_data_id).focus();
// \$('.otp_in_'+prev_data_id).val('').focus();
}
else if ( event.which == 39 ) {
event.preventDefault();
if (next_data_id != '_NONE_') {
\$('.otp_in_' + next_data_id).focus();
}
}
else if ( event.which == 37 ) {
event.preventDefault();
if(prev_data_id!='_NONE_')
\$('.otp_in_'+prev_data_id).focus();
}
else
{
if(event.key >=0 && event.key<=9 ) {
// alert(event.which)
// alert(event.key)
// alert(String.fromCharCode(event.which))
// \$(this).val(String.fromCharCode(event.which));
\$(this).val(event.key);
if (next_data_id != '_NONE_') {
\$('.otp_in_' + next_data_id).focus();
}
}
// alert(\$(this).val())
// alert(isNaN(\$(this).val()))
if( isNaN(\$(this).val()))
\$(this).val('');
}
update_otp_field()
})
function attach_onscan() {
// alert('pika')
onScan.attachTo(document, {
singleScanQty: 1,
minLength:4,
suffixKeyCodes: [13], // enter-key expected at the end of a scan
reactToPaste: true, // Compatibility to built-in scanners in paste-mode (as opposed to keyboard-mode)
onScan: function (sCode, iQty) { // Alternative to document.addEventListener('scan')
// // console.log('Scanned: ' + iQty + 'x ' + sCode);
//
// var foundIds = [];
//
//// // console.log('PIKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA');
// // console.log(sCode);
// lastScanCrossMatched = 1;
if (!isNaN(sCode)) {
paste_otp(sCode)
}
//// dynamic_product_selector.focus();
// // console.log(dynamic_product_selector.currentResults.items);
//// dynamic_product_selector.setValue(dynamic_product_selector.currentResults.items[0].id);
// if(dynamic_product_selector.currentResults.items.length>=1) {
//// alert(dynamic_product_selector.currentResults.items.length+','+dynamic_product_selector.currentResults.items[0].id)
// dynamic_product_selector.setValue(dynamic_product_selector.currentResults.items[0].id);
// //// console.log(this.currentResults.items.length);
//
// dynamic_product_selector.focus();
// }
},
// onKeyDetect: function(iKeyCode){ // output all potentially relevant key events - great for debugging!
// // console.log('Pressed: ' + iKeyCode);
// }
});
}
function detach_onscan() {
onScan.detachFrom(document);
}
// \$('#deliveryInfoModal').on('hidden.bs.modal', function (e) {
// attach_onscan();
// })
// \$('#deliveryInfoModal').on('shown.bs.modal', function (e) {
// detach_onscan();
// })
attach_onscan();
\$('.otp_in_'+1).focus();
\$('.resend_otp_button').click(function(e){
e.preventDefault();
{# console.log(\"resend clicked\") #}
resendOtp();
})
\$('.login-inputs input').focus(function () {
// if()
// \$('.login-inputs input').removeClass('error_class');
\$(this).removeClass('error_class');
})
\$('.login-inputs input').change(function () {
// if()
// \$('.login-inputs input').removeClass('error_class');
if(\$(this).hasClass('checkIfExists'))
{
check_field_validity(\$(this).attr('data-field-type'))
}
check_doc_and_submit(0); //check only not submit
})
function check_field_validity(fieldType)
{
fieldType = fieldType || 'email';
\$('.small_error_text.' + fieldType).text('')
\$('.small_error_text.' + fieldType).hide()
\$('.small_error_icon.' + fieldType).removeClass('success').removeClass('error');
\$('.small_error_icon.' + fieldType).removeClass('fa-check').removeClass('fa-times');
\$('.small_error_icon.' + fieldType).addClass('fa-spinner');
\$('.small_error_icon.' + fieldType).show()
// \$.post( \"example.php\", function() {
// alert( \"success\" );
// })
// .done(function() {
// alert( \"second success\" );
// })
// .fail(function() {
// alert( \"error\" );
// })
// .always(function() {
// alert( \"finished\" );
// });
//{#// console.log({#}
//{# fieldType: fieldType,#}
//{#fieldValue: \$('.input_field.' + fieldType).val(),#}
//{#signUpUserType: {{ signUpUserType }},#}
//{#}) #}
if(fieldType=='password')
{
// if(\$('#password2').val()=='')
// return;
if(\$('#password').val()!==\$('#password2').val())
// if(0)
{
\$('.small_error_text.' + fieldType).text('Passwords do not Match')
\$('.small_error_text.' + fieldType).show()
\$('.small_error_icon.' + fieldType).removeClass('fa-spinner').removeClass('success');
\$('.small_error_icon.' + fieldType).addClass('fa-times').addClass('error');
\$('.small_error_icon.' + fieldType).show()
}
else {
\$('.small_error_text.' + fieldType).text('')
\$('.small_error_text.' + fieldType).hide()
\$('.small_error_icon.' + fieldType).removeClass('fa-spinner').removeClass('error');
\$('.small_error_icon.' + fieldType).addClass('fa-check').addClass('success');
\$('.small_error_icon.' + fieldType).show()
}
return;
}
\$.post('{{ url('check_if_email_exists_already') }}', {
fieldType: fieldType,
fieldValue: \$('.input_field.' + fieldType).val(),
signUpUserType: {{ userType }},
})
.done(function (data) {
//sales.clearItemTable()
fieldType=data.fieldType;
if (data.alreadyExists != true) {
\$('.small_error_text.' + fieldType).text('Couldnot find your email')
\$('.small_error_text.' + fieldType).show()
\$('.small_error_icon.' + fieldType).removeClass('fa-spinner').removeClass('success');
\$('.small_error_icon.' + fieldType).addClass('fa-times').addClass('error');
\$('.small_error_icon.' + fieldType).show()
}
else {
\$('.small_error_text.' + fieldType).text('')
\$('.small_error_text.' + fieldType).hide()
\$('.small_error_icon.' + fieldType).removeClass('fa-spinner').removeClass('error');
\$('.small_error_icon.' + fieldType).addClass('fa-check').addClass('success');
\$('.small_error_icon.' + fieldType).show()
}
}
);
}
function check_doc_and_submit(submitFlag) {
var checkFailed = 0;
submitFlag=submitFlag||0
///check if any checking needed here
\$('.login-inputs input').each(function(ind,elem){
if(\$(this).prop('required')){
if(\$(this).val()=='' )
checkFailed=1;
// console.log(\"REQ\");
} else {
// console.log(\"NREQ\");
}
});
\$('.small_error_text').each(function(ind,elem)
{
if(\$(elem).text()!='')
checkFailed=1;
})
\$('.small_error_text').each(function(ind,elem)
{
if(\$(elem).text()!='')
checkFailed=1;
})
if(checkFailed==0)
\$('.rel_form_submit').addClass('ready');
else
{
\$('.rel_form_submit').removeClass('ready');
}
if (checkFailed == 0 && submitFlag==1) {
\$('.rel_form_submit').removeClass('ready');
\$('.rel_form_submit').hide();
\$('#relevantForm').submit();
}
}
//For save action
\$('input[type=\"submit\"], button[type=\"submit\"], .rel_form_submit').click(function (event) {
event.preventDefault();
check_doc_and_submit(1);
})
\$('.convert_to_moment_time').each(function (ind, elem) {
ConvertToMomentTimeOtpExpire(elem);
});
cndDwnInterval = setInterval(ConvertToMomentTimeOtpExpire, 1000);
check_doc_and_submit(0)
})
</script>
", "@HoneybeeWeb/pages/views/verify_otp_honeybee.html.twig", "/home/u405565514/domains/ourhoneybee.eu/public_html/honeybee_main/src/ApplicationBundle/Modules/HoneybeeWeb/Resources/views/pages/views/verify_otp_honeybee.html.twig");
}
}