{"id":1313,"date":"2026-01-06T11:19:09","date_gmt":"2026-01-06T06:19:09","guid":{"rendered":"https:\/\/chess.zti.kz\/en\/?page_id=1313"},"modified":"2026-01-06T11:59:53","modified_gmt":"2026-01-06T06:59:53","slug":"abonement","status":"publish","type":"page","link":"https:\/\/chess.zti.kz\/en\/abonement\/","title":{"rendered":"\u0410\u0431\u043e\u043d\u0435\u043c\u0435\u043d\u0442"},"content":{"rendered":"    <div class=\"cyber-abonement-form\">\r\n        <div id=\"step1\">\r\n            <h3>\u0410\u0431\u043e\u043d\u0435\u043c\u0435\u043d\u0442 \u043d\u0430 30 \u0434\u043d\u0435\u0439 5000 \u0442\u0433.<\/h3>\r\n            <form id=\"user-data-form\">\r\n                <p>\r\n                    <label for=\"fio\">\u0424\u0418\u041e (\u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e):<\/label>\r\n                    <input type=\"text\" id=\"fio\" name=\"fio\" value=\"\" required \/>\r\n                <\/p>\r\n                <p>\r\n                    <label for=\"iin\">\u0418\u0418\u041d (12 \u0446\u0438\u0444\u0440):<\/label>\r\n                    <input type=\"text\" id=\"iin\" name=\"iin\" value=\"\" required pattern=\"[0-9]{12}\" maxlength=\"12\"  \/>\r\n                <\/p>\r\n                <p>\r\n                    <label for=\"email\">Email:<\/label>\r\n                    <input type=\"email\" id=\"email\" name=\"email\" value=\"\" required  \/>\r\n                <\/p>\r\n                <p>\r\n                    <button class=\"button_blue\" type=\"submit\" id=\"pay-btn\">\u041f\u0440\u0438\u043e\u0431\u0440\u0435\u0441\u0442\u0438<\/button>\r\n                <\/p>\r\n            <\/form>\r\n        <\/div>\r\n\r\n        <div id=\"step2\" style=\"display:none; margin-top: 20px; text-align:center;\">\r\n            <h3>\u041e\u043f\u043b\u0430\u0442\u0438\u0442\u0435 \u043f\u043e QR-\u043a\u043e\u0434\u0443<\/h3>\r\n            <p><strong>\u0418\u043d\u0441\u0442\u0438\u0442\u0443\u0442 \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439<\/strong><\/p>\r\n            <p><strong>\u041d\u043e\u043c\u0435\u0440 \u0437\u0430\u044f\u0432\u043a\u0438:<\/strong> <span id=\"display-iin\"><\/span><\/p>\r\n            <p><strong>\u0421\u0443\u043c\u043c\u0430:<\/strong> 5 000 \u0442\u0433<\/p>\r\n            <p><strong>\u0410\u0431\u043e\u043d\u0435\u043c\u0435\u043d\u0442 \u0434\u043e:<\/strong> <span id=\"display-end-date\"><\/span><\/p>\r\n            <p>\r\n                <img decoding=\"async\" src=\"https:\/\/chess.zti.kz\/wp-content\/plugins\/user-tariff\/kaspi_qr.jpg\" alt=\"Kaspi QR\" style=\"max-width:200px; margin:15px 0;\" \/>\r\n            <\/p>\r\n            <p>\r\n                <button class=\"button_blue\" type=\"button\" id=\"check-payment-btn\" style=\"width: 250px;\">\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/button>\r\n            <\/p>\r\n            <div id=\"payment-status\" style=\"margin-top:15px; min-height:24px;\"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n\r\n    <script>\r\n        document.addEventListener('DOMContentLoaded', function() {\r\n            const step1 = document.getElementById('step1');\r\n            const step2 = document.getElementById('step2');\r\n            const checkBtn = document.getElementById('check-payment-btn');\r\n            let currentIIN = '';\r\n\r\n            document.getElementById('user-data-form').addEventListener('submit', function(e) {\r\n                e.preventDefault();\r\n\r\n                const fio = document.getElementById('fio').value.trim();\r\n                const iin = document.getElementById('iin').value.trim();\r\n                const email = document.getElementById('email').value.trim();\r\n\r\n                if (!\/^[0-9]{12}$\/.test(iin)) {\r\n                    alert('\u0418\u0418\u041d \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0440\u043e\u0432\u043d\u043e 12 \u0446\u0438\u0444\u0440.');\r\n                    return;\r\n                }\r\n\r\n                fetch('https:\/\/chess.zti.kz\/wp-admin\/admin-ajax.php', {\r\n                    method: 'POST',\r\n                    headers: { 'Content-Type': 'application\/x-www-form-urlencoded' },\r\n                    body: `action=cyber_save_pending&fio=${encodeURIComponent(fio)}&iin=${encodeURIComponent(iin)}&email=${encodeURIComponent(email)}`\r\n                })\r\n                    .then(r => r.json())\r\n                    .then(data => {\r\n                        if (data.success) {\r\n                            currentIIN = data.data.iin;\r\n                            document.getElementById('display-iin').textContent = data.data.iin;\r\n                            document.getElementById('display-end-date').textContent = data.data.end_date;\r\n                            step1.style.display = 'none';\r\n                            step2.style.display = 'block';\r\n                        } else {\r\n                            alert('\u041e\u0448\u0438\u0431\u043a\u0430: ' + (data.data?.message || '\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435'));\r\n                        }\r\n                    })\r\n                    .catch(() => {\r\n                        alert('\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c.');\r\n                    });\r\n            });\r\n\r\n            checkBtn.addEventListener('click', function() {\r\n                const statusDiv = document.getElementById('payment-status');\r\n                statusDiv.innerHTML = '\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043e\u043f\u043b\u0430\u0442\u044b ...';\r\n\r\n                fetch('https:\/\/chess.zti.kz\/wp-admin\/admin-ajax.php', {\r\n                    method: 'POST',\r\n                    headers: { 'Content-Type': 'application\/x-www-form-urlencoded' },\r\n                    body: 'action=cyber_manual_email_check'\r\n                })\r\n                    .then(r => r.json())\r\n                    .then(() => {\r\n                        return fetch('https:\/\/chess.zti.kz\/wp-admin\/admin-ajax.php?action=cyber_check_status&iin=' + currentIIN);\r\n                    })\r\n                    .then(r => r.json())\r\n                    .then(res => {\r\n                        if (res.success && res.data.status === 'approved') {\r\n                            statusDiv.innerHTML = '<span style=\"color:green;\">\u2705 \u041e\u043f\u043b\u0430\u0442\u0430 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0430!<\/span>';\r\n                            setTimeout(() => {\r\n                                if (res.data.redirect_url) {\r\n                                    window.location.href = res.data.redirect_url;\r\n                                } else {\r\n                                    window.location.href = 'https:\/\/chess.zti.kz\/en\/';\r\n                                }\r\n                            }, 2000);\r\n                        } else if (res.data?.status === 'rejected' || res.data?.status === 'expired') {\r\n                            statusDiv.innerHTML = '<span style=\"color:red;\">\u274c ' + res.data.message + '<\/span>';\r\n                        } else {\r\n                            statusDiv.innerHTML = '<span style=\"color:orange;\">\u23f3 \u041e\u043f\u043b\u0430\u0442\u0430 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430. \u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u0447\u0435\u0440\u0435\u0437 \u043c\u0438\u043d\u0443\u0442\u0443 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430.<\/span>';\r\n                        }\r\n                    })\r\n                    .catch(() => {\r\n                        statusDiv.innerHTML = '<span style=\"color:red;\">\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438.<\/span>';\r\n                    });\r\n            });\r\n        });\r\n    <\/script>\r\n    \n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"footnotes":""},"class_list":["post-1313","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/chess.zti.kz\/en\/wp-json\/wp\/v2\/pages\/1313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chess.zti.kz\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/chess.zti.kz\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/chess.zti.kz\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chess.zti.kz\/en\/wp-json\/wp\/v2\/comments?post=1313"}],"version-history":[{"count":5,"href":"https:\/\/chess.zti.kz\/en\/wp-json\/wp\/v2\/pages\/1313\/revisions"}],"predecessor-version":[{"id":1319,"href":"https:\/\/chess.zti.kz\/en\/wp-json\/wp\/v2\/pages\/1313\/revisions\/1319"}],"wp:attachment":[{"href":"https:\/\/chess.zti.kz\/en\/wp-json\/wp\/v2\/media?parent=1313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}