{"id":2424,"date":"2026-07-05T15:21:45","date_gmt":"2026-07-05T15:21:45","guid":{"rendered":"https:\/\/srivijayagames.rmutsv.ac.th\/17\/certificate\/"},"modified":"2026-07-05T15:24:47","modified_gmt":"2026-07-05T15:24:47","slug":"certificate","status":"publish","type":"page","link":"https:\/\/srivijayagames.rmutsv.ac.th\/17\/certificate\/","title":{"rendered":"\u0e1e\u0e34\u0e21\u0e1e\u0e4c\u0e40\u0e01\u0e35\u0e22\u0e23\u0e15\u0e34\u0e1a\u0e31\u0e15\u0e23"},"content":{"rendered":"\r\n<div class=\"wp-block-group alignwide\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">    <div id=\"ruts-certificate-container\" style=\"max-width: 600px; margin: 0 auto; padding: 20px; font-family: 'Prompt', sans-serif;\">\r\n        <!-- Login Form -->\r\n        <div id=\"ruts-cert-login-form\">\r\n            <h3 style=\"text-align: center; color: #ff6600;\">\u0e14\u0e32\u0e27\u0e19\u0e4c\u0e42\u0e2b\u0e25\u0e14\u0e40\u0e01\u0e35\u0e22\u0e23\u0e15\u0e34\u0e1a\u0e31\u0e15\u0e23\u0e19\u0e31\u0e01\u0e01\u0e35\u0e2c\u0e32<\/h3>\r\n            <p style=\"text-align: center; font-size: 14px; color: #666;\">\u0e01\u0e23\u0e38\u0e13\u0e32\u0e40\u0e02\u0e49\u0e32\u0e2a\u0e39\u0e48\u0e23\u0e30\u0e1a\u0e1a\u0e14\u0e49\u0e27\u0e22 e-Passport \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e14\u0e32\u0e27\u0e19\u0e4c\u0e42\u0e2b\u0e25\u0e14\u0e40\u0e01\u0e35\u0e22\u0e23\u0e15\u0e34\u0e1a\u0e31\u0e15\u0e23<br\/>(\u0e1e\u0e34\u0e21\u0e1e\u0e4c <b>s<\/b> \u0e19\u0e33\u0e2b\u0e19\u0e49\u0e32\u0e23\u0e2b\u0e31\u0e2a\u0e19\u0e31\u0e01\u0e28\u0e36\u0e01\u0e29\u0e32 \u0e40\u0e0a\u0e48\u0e19 s367403400093)<\/p>\r\n            <div style=\"margin-bottom: 15px;\">\r\n                <label style=\"display: block; font-weight: bold; margin-bottom: 5px;\">Username (e-Passport)<\/label>\r\n                <input type=\"text\" id=\"ruts_cert_user\" style=\"width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 16px;\" placeholder=\"s36XXXXXXXXX\" \/>\r\n            <\/div>\r\n            <div style=\"margin-bottom: 15px;\">\r\n                <label style=\"display: block; font-weight: bold; margin-bottom: 5px;\">Password<\/label>\r\n                <input type=\"password\" id=\"ruts_cert_pass\" style=\"width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 16px;\" \/>\r\n            <\/div>\r\n            <div id=\"ruts_cert_msg\" style=\"color: red; margin-bottom: 15px; display: none; text-align: center; background: #ffe6e6; padding: 10px; border-radius: 4px;\"><\/div>\r\n            <button id=\"ruts_cert_btn\" style=\"width: 100%; padding: 12px; background: #ff6600; color: #fff; border: none; border-radius: 4px; font-size: 16px; font-weight: bold; cursor: pointer;\">\u0e40\u0e02\u0e49\u0e32\u0e2a\u0e39\u0e48\u0e23\u0e30\u0e1a\u0e1a<\/button>\r\n        <\/div>\r\n\r\n        <!-- Dashboard -->\r\n        <div id=\"ruts-cert-dashboard\" style=\"display: none;\">\r\n            <div style=\"text-align: right; margin-bottom: 10px;\">\r\n                <button id=\"ruts_cert_logout\" style=\"padding: 5px 15px; background: #666; color: #fff; border: none; border-radius: 4px; cursor: pointer;\">\u0e2d\u0e2d\u0e01\u0e08\u0e32\u0e01\u0e23\u0e30\u0e1a\u0e1a<\/button>\r\n            <\/div>\r\n            <div style=\"background: #f9f9f9; padding: 20px; border-radius: 8px; border-left: 4px solid #ff6600; margin-bottom: 20px;\">\r\n                <h4 style=\"margin-top: 0;\">\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e19\u0e31\u0e01\u0e01\u0e35\u0e2c\u0e32<\/h4>\r\n                <p style=\"margin: 5px 0;\"><strong>\u0e0a\u0e37\u0e48\u0e2d-\u0e2a\u0e01\u0e38\u0e25:<\/strong> <span id=\"ruts_player_name\"><\/span><\/p>\r\n                <p style=\"margin: 5px 0;\"><strong>\u0e04\u0e13\u0e30\/\u0e2b\u0e19\u0e48\u0e27\u0e22\u0e07\u0e32\u0e19:<\/strong> <span id=\"ruts_player_faculty\"><\/span><\/p>\r\n            <\/div>\r\n            \r\n            <h4 style=\"border-bottom: 2px solid #ff6600; padding-bottom: 5px;\">\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e40\u0e01\u0e35\u0e22\u0e23\u0e15\u0e34\u0e1a\u0e31\u0e15\u0e23\u0e02\u0e2d\u0e07\u0e04\u0e38\u0e13<\/h4>\r\n            <div id=\"ruts_cert_list\"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n\r\n    <script>\r\n    jQuery(document).ready(function($) {\r\n        $('#ruts_cert_btn').on('click', function() {\r\n            var user = $('#ruts_cert_user').val().trim();\r\n            var pass = $('#ruts_cert_pass').val().trim();\r\n            \r\n            if(!user || !pass) {\r\n                $('#ruts_cert_msg').text('\u0e01\u0e23\u0e38\u0e13\u0e32\u0e01\u0e23\u0e2d\u0e01 Username \u0e41\u0e25\u0e30 Password \u0e43\u0e2b\u0e49\u0e04\u0e23\u0e1a\u0e16\u0e49\u0e27\u0e19').show();\r\n                return;\r\n            }\r\n            \r\n            var btn = $(this);\r\n            btn.text('\u0e01\u0e33\u0e25\u0e31\u0e07\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a...').prop('disabled', true);\r\n            $('#ruts_cert_msg').hide();\r\n            \r\n            $.ajax({\r\n                url: 'https:\/\/srivijayagames.rmutsv.ac.th\/system-17\/wp_api\/api_login.php',\r\n                type: 'POST',\r\n                data: {\r\n                    username: user,\r\n                    password: pass\r\n                },\r\n                dataType: 'json',\r\n                success: function(res) {\r\n                    btn.text('\u0e40\u0e02\u0e49\u0e32\u0e2a\u0e39\u0e48\u0e23\u0e30\u0e1a\u0e1a').prop('disabled', false);\r\n                    if(res.status === 'success') {\r\n                        \/\/ Populate dashboard\r\n                        var p = res.player;\r\n                        $('#ruts_player_name').text(p.title_name + p.first_name + ' ' + p.last_name);\r\n                        $('#ruts_player_faculty').text(p.fac_name);\r\n                        \r\n                        var html = '';\r\n                        var stdId = p.std_id;\r\n                        var hash = res.secure_hash;\r\n                        \r\n                        \/\/ Join certificate\r\n                        var joinUrl = 'https:\/\/srivijayagames.rmutsv.ac.th\/system-17\/wp_api\/cert_join.php?std_id=' + stdId + '&hash=' + hash;\r\n                        html += '<div style=\"padding: 15px; border: 1px solid #eee; margin-bottom: 10px; border-radius: 4px; display: flex; justify-content: space-between; align-items: center; background: #fff;\">';\r\n                        html += '<span><strong>\u0e40\u0e01\u0e35\u0e22\u0e23\u0e15\u0e34\u0e1a\u0e31\u0e15\u0e23\u0e40\u0e02\u0e49\u0e32\u0e23\u0e48\u0e27\u0e21\u0e01\u0e32\u0e23\u0e41\u0e02\u0e48\u0e07\u0e02\u0e31\u0e19<\/strong><\/span>';\r\n                        html += '<a href=\"'+joinUrl+'\" target=\"_blank\" style=\"padding: 8px 15px; background: #007bff; color: #fff; text-decoration: none; border-radius: 4px; font-size: 14px; white-space: nowrap;\">\u0e1e\u0e34\u0e21\u0e1e\u0e4c (PDF)<\/a>';\r\n                        html += '<\/div>';\r\n                        \r\n                        \/\/ Medal certificates\r\n                        if(res.medals && res.medals.length > 0) {\r\n                            $.each(res.medals, function(i, m) {\r\n                                var sportName = m.sub_name + ' ' + m.sub_type + ' ' + m.sub_sex;\r\n                                var medalName = '';\r\n                                if(m.coin == '1') medalName = '\u0e40\u0e2b\u0e23\u0e35\u0e22\u0e0d\u0e17\u0e2d\u0e07';\r\n                                else if(m.coin == '2') medalName = '\u0e40\u0e2b\u0e23\u0e35\u0e22\u0e0d\u0e40\u0e07\u0e34\u0e19';\r\n                                else if(m.coin == '3') medalName = '\u0e40\u0e2b\u0e23\u0e35\u0e22\u0e0d\u0e17\u0e2d\u0e07\u0e41\u0e14\u0e07';\r\n                                \r\n                                var sportUrl = 'https:\/\/srivijayagames.rmutsv.ac.th\/system-17\/wp_api\/cert_sport.php?std_id=' + stdId + '&coin=' + m.coin + '&sub_id=' + m.sub_id + '&hash=' + hash;\r\n                                html += '<div style=\"padding: 15px; border: 1px solid #eee; margin-bottom: 10px; border-radius: 4px; display: flex; justify-content: space-between; align-items: center; background: #fff;\">';\r\n                                html += '<span><strong>\u0e40\u0e01\u0e35\u0e22\u0e23\u0e15\u0e34\u0e1a\u0e31\u0e15\u0e23\u0e0a\u0e19\u0e30\u0e40\u0e25\u0e34\u0e28 ' + medalName + '<\/strong><br\/><small style=\"color: #666;\">' + sportName + '<\/small><\/span>';\r\n                                html += '<a href=\"'+sportUrl+'\" target=\"_blank\" style=\"padding: 8px 15px; background: #28a745; color: #fff; text-decoration: none; border-radius: 4px; font-size: 14px; white-space: nowrap;\">\u0e1e\u0e34\u0e21\u0e1e\u0e4c (PDF)<\/a>';\r\n                                html += '<\/div>';\r\n                            });\r\n                        }\r\n                        \r\n                        $('#ruts_cert_list').html(html);\r\n                        \r\n                        \/\/ Switch views\r\n                        $('#ruts-cert-login-form').hide();\r\n                        $('#ruts-cert-dashboard').fadeIn();\r\n                        \r\n                        \/\/ Clear password\r\n                        $('#ruts_cert_pass').val('');\r\n                    } else {\r\n                        $('#ruts_cert_msg').text(res.message).show();\r\n                    }\r\n                },\r\n                error: function() {\r\n                    btn.text('\u0e40\u0e02\u0e49\u0e32\u0e2a\u0e39\u0e48\u0e23\u0e30\u0e1a\u0e1a').prop('disabled', false);\r\n                    $('#ruts_cert_msg').text('\u0e44\u0e21\u0e48\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e40\u0e0a\u0e37\u0e48\u0e2d\u0e21\u0e15\u0e48\u0e2d\u0e40\u0e0b\u0e34\u0e23\u0e4c\u0e1f\u0e40\u0e27\u0e2d\u0e23\u0e4c\u0e44\u0e14\u0e49').show();\r\n                }\r\n            });\r\n        });\r\n        \r\n        $('#ruts_cert_logout').on('click', function() {\r\n            $('#ruts_cert_list').empty();\r\n            $('#ruts_cert_user').val('');\r\n            $('#ruts_cert_pass').val('');\r\n            $('#ruts_cert_msg').hide();\r\n            $('#ruts-cert-dashboard').hide();\r\n            $('#ruts-cert-login-form').fadeIn();\r\n        });\r\n        \r\n        \/\/ Enter key to login\r\n        $('#ruts_cert_pass').on('keypress', function(e) {\r\n            if(e.which === 13) {\r\n                $('#ruts_cert_btn').click();\r\n            }\r\n        });\r\n    });\r\n    <\/script>\r\n    \n<\/div><\/div>\r\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":{"_acf_changed":false,"footnotes":""},"class_list":["post-2424","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/srivijayagames.rmutsv.ac.th\/17\/wp-json\/wp\/v2\/pages\/2424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/srivijayagames.rmutsv.ac.th\/17\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/srivijayagames.rmutsv.ac.th\/17\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/srivijayagames.rmutsv.ac.th\/17\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/srivijayagames.rmutsv.ac.th\/17\/wp-json\/wp\/v2\/comments?post=2424"}],"version-history":[{"count":1,"href":"https:\/\/srivijayagames.rmutsv.ac.th\/17\/wp-json\/wp\/v2\/pages\/2424\/revisions"}],"predecessor-version":[{"id":2667,"href":"https:\/\/srivijayagames.rmutsv.ac.th\/17\/wp-json\/wp\/v2\/pages\/2424\/revisions\/2667"}],"wp:attachment":[{"href":"https:\/\/srivijayagames.rmutsv.ac.th\/17\/wp-json\/wp\/v2\/media?parent=2424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}