{"id":678687,"date":"2025-04-30T09:58:01","date_gmt":"2025-04-30T01:58:01","guid":{"rendered":"https:\/\/www.carlorino.net\/my\/?page_id=678687"},"modified":"2025-04-30T10:00:05","modified_gmt":"2025-04-30T02:00:05","slug":"validation","status":"publish","type":"page","link":"https:\/\/www.carlorino.net\/my\/validation\/","title":{"rendered":"Verification"},"content":{"rendered":"                \n\n        <div class=\"row\">\n\n            <div class=\"u-column2 col-lg-4 col-12\"><\/div>\n\n            <div class=\"u-column2 col-lg-4 col-12\">\n\n                <div class=\"panda-verification-options\">\n\n                    <form>                \n\n                        <div id=\"notification\"><\/div>\n\n                        <input type=\"text\" class=\"full-width\" name=\"verification_code\" id=\"verification_code\" placeholder=\"Verification Code\" hidden>\n\n                        <input type=\"hidden\" id='method'>\n\n                        <div id=\"timer\" class=\"text-center\"><\/div>\n\n                        <button id='verify' class=\"verify-button\" hidden>Verify<\/button>\n\n                        <div style=\"display: flex; width: 100%;\">\n\n                            \n                                <button id='emailbtn' class=\"email-button btn-block\">Email<\/button>\n\n                            \n                            \n\n                        <\/div>\n\n                        <button id='cancel' class=\"cancel-button\">Cancel<\/button>\n\n                    <\/form>\n\n                <\/div>\n\n            <\/div>\n\n            <div class=\"u-column2 col-lg-4 col-12\"><\/div>\n\n        <\/div>\n\n\n\n        <script>\n\n            \n\n            jQuery(document).ready(function ($) {\n\n\n\n                $('#smsbtn , #emailbtn').on('click', function() {\n\n                    event.preventDefault();\n\n\n\n                    startTimer(180);\n\n                    \n\n                    verify_method = $(this).attr('id');\n\n                    \n\n                    if (verify_method == 'smsbtn') {\n\n                        method = 'Mobile';\n\n                    } else {\n\n                        method = 'Email';\n\n                    }\n\n                    \n\n                    $('#method').val(method);\n\n\n\n                    getVerifyCode(method)\n\n                });\n\n\n\n                $('#verify').on('click', function() {\n\n                    event.preventDefault();\n\n\n\n                    if( $('#verification_code').val() == '') {\n\n                        alert('Verification code is required.');\n\n                    } else {                        \n\n                        registerCustomer();\n\n                    }\n\n\n\n                    \n\n                });\n\n    \n\n                function getVerifyCode(method) {\n\n                    $.ajax({\n\n                        type: 'GET',\n\n                        url: 'https:\/\/www.carlorino.net\/my\/wp-content\/plugins\/panda-crm\/panda-crm-verification.php?sign_data=wb9fu7NgDK7XZcLJMeADV9amg9yON2%2Fx8D2WIXoZLMG%2BK%2BSWr5COd6cqGdTGsutOJHWAcYwvnpi4eRnHPzCyV5G5H2%2BTYUlXyBvrdTwTMJa%2FY%2FW%2BUUi1XclYOmDRpHM9qQVw%2BGIwqYqUqkEx9NDyhg%3D%3D&verify_by=' + method,\n\n                        success: function (response) {                        \n\n                            if (response.success) {   \n\n                                $('#notification').text('Successfully send verification code'); \n\n                            } else {\n\n                                $('#notification').text(response.data.message);\n\n                            }\n\n                        },\n\n                        error: function (xhr, status, error) {\n\n                            return false;\n\n                        }\n\n                    });\n\n                }\n\n\n\n                function startTimer(duration) {\n\n\n\n                    var timerElement = $('#timer');\n\n                    var timer = duration, minutes, seconds;\n\n\n\n                    var intervalId = setInterval(function () {\n\n                        minutes = parseInt(timer \/ 60, 10);\n\n                        seconds = parseInt(timer % 60, 10);\n\n\n\n                        minutes = minutes < 10 ? '0' + minutes : minutes;\n\n                        seconds = seconds < 10 ? '0' + seconds : seconds;\n\n\n\n                        timerElement.text(minutes + ':' + seconds);\n\n\n\n                        $('#smsbtn').attr('hidden', true);\n\n                        $('#emailbtn').attr('hidden', true);                \n\n                        $('#verify').removeAttr('hidden');\n\n                        $('#verification_code').removeAttr('hidden');\n\n\n\n                        if (--timer < 0) {\n\n                            clearInterval(intervalId); \/\/ Clear the interval when the timer reaches zero                         \n\n                            \/\/ Add logic to handle timer expiration if needed\n\n                            timerElement.text('');\n\n                            \/\/ Display your button here\n\n                            $('#smsbtn').removeAttr('hidden');\n\n                            $('#emailbtn').removeAttr('hidden');\n\n                            $('#verify').attr('hidden', true);\n\n                            $('#verification_code').attr('hidden', true);       \n\n                            \n\n                            $('#notification').text('Verification code expired. Please request new verification code.');\n\n                        }\n\n                    }, 1000); \/\/ Update the timer every 1000 milliseconds (1 second)\n\n                }\n\n\n\n                function registerCustomer() {\n\n\n\n                    $.ajax({\n\n                        type: 'POST',\n\n                        url: 'https:\/\/www.carlorino.net\/my\/wp-content\/plugins\/panda-crm\/panda-crm-register.php?sign_data=wb9fu7NgDK7XZcLJMeADV9amg9yON2%2Fx8D2WIXoZLMG%2BK%2BSWr5COd6cqGdTGsutOJHWAcYwvnpi4eRnHPzCyV5G5H2%2BTYUlXyBvrdTwTMJa%2FY%2FW%2BUUi1XclYOmDRpHM9qQVw%2BGIwqYqUqkEx9NDyhg%3D%3D',\n\n                        data: {\n\n                            verification_code: $('#verification_code').val(),\n\n                            verifyby: $('#method').val()\n\n                        }, \n\n                        beforeSend: function() {\n\n                            $('#verify').prop('disabled', true).html('Loading...');\n\n                        },\n\n                        complete: function() {\n\n                            $('#verify').prop('disabled', false).html('Verify');\n\n                        },\n\n                        success: function (response) {\n\n                            if (response.success) {\n\n                                var storeUrl = 'https:\/\/www.carlorino.net\/my'; \/\/ Assumes this JavaScript is within a .php file\n\n                                \/\/ Concatenate with the desired path\n\n                                var accountUrl = storeUrl + '\/my-account';\n\n                                \/\/ Redirect to the dynamic URL after successful login\n\n                                window.location.href = accountUrl;\n\n                            } else {\n\n                                $('#notification').text(response.data.message);\n\n                            }                        \n\n                        },\n\n                        error: function (xhr, status, error) {\n\n                            return false;\n\n                        }\n\n                    });\n\n\n\n                }\n\n            });\n\n            \n\n        <\/script>\n\n        \n","protected":false},"excerpt":{"rendered":"Verify Email Cancel","protected":false},"author":64650,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"class_list":["post-678687","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.carlorino.net\/my\/wp-json\/wp\/v2\/pages\/678687","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.carlorino.net\/my\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.carlorino.net\/my\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.carlorino.net\/my\/wp-json\/wp\/v2\/users\/64650"}],"replies":[{"embeddable":true,"href":"https:\/\/www.carlorino.net\/my\/wp-json\/wp\/v2\/comments?post=678687"}],"version-history":[{"count":0,"href":"https:\/\/www.carlorino.net\/my\/wp-json\/wp\/v2\/pages\/678687\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.carlorino.net\/my\/wp-json\/wp\/v2\/media?parent=678687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}