{"id":33345,"date":"2025-04-16T16:04:14","date_gmt":"2025-04-16T09:04:14","guid":{"rendered":"https:\/\/steam.ictu.edu.vn\/2025\/?page_id=33345"},"modified":"2025-04-16T16:04:26","modified_gmt":"2025-04-16T09:04:26","slug":"nop-san-pham-du-thi","status":"publish","type":"page","link":"https:\/\/steam.ictu.edu.vn\/2025\/nop-san-pham-du-thi\/","title":{"rendered":"N\u1ed9p s\u1ea3n ph\u1ea9m d\u1ef1 thi"},"content":{"rendered":"\n    <div class=\"ovic-form ovic-submit-entry-form\">\n                    <h2 class=\"timeout-title text-center\">\n                \u0110\u00e3 h\u1ebft h\u1ea1n \u0111\u0103ng k\u00fd l\u00fac<strong class=\"text-danger\">23:59:59 ng\u00e0y 30\/06\/2025<\/strong>, vui l\u00f2ng ch\u1edd k\u1ebft qu\u1ea3.            <\/h2>\n            <\/div>\n    <script src=\"https:\/\/www.google.com\/recaptcha\/api.js?render=6Le4fRkrAAAAAG28YooXr2MPtVqhN5BihPDTk3Os\"><\/script>\n    <script>\n        (function ($) {\n            'use strict';\n\n            let attends = [];\n            let currentAttend = null;\n\n            document.addEventListener('DOMContentLoaded', function () {\n                const form = document.getElementById('attendance-form');\n                const loginForm = document.getElementById('login-submit-entry-form');\n\n                if (form) {\n                    form.addEventListener('submit', function (e) {\n                        e.preventDefault();\n\n                        form.classList.add('loading')\n\n                        form.submit();\n\n                        \/\/ grecaptcha.ready(function () {\n                        \/\/    grecaptcha.execute('\/\/', {action: 'submit'}).then(function (token) {\n                        \/\/        document.getElementById('g-recaptcha-response').value = token;\n                        \/\/        form.submit();\n                        \/\/    });\n                        \/\/ });\n                    });\n                }\n\n                if (loginForm) {\n                    loginForm.addEventListener('submit', function (e) {\n                        e.preventDefault();\n\n                        loginForm.classList.add('loading')\n\n                        loginForm.submit();\n\n                        \/\/ grecaptcha.ready(function () {\n                        \/\/    grecaptcha.execute('\/\/', {action: 'submit'}).then(function (token) {\n                        \/\/        document.getElementById('g-recaptcha-response').value = token;\n                        \/\/        loginForm.submit();\n                        \/\/    });\n                        \/\/ });\n                    });\n                }\n            });\n\n            document.addEventListener('click', function (e) {\n                if (e.target.closest('.ovic-form .message .overlay')) {\n                    const btn = e.target.closest('.overlay');\n                    const wrap = btn.closest('.message');\n\n                    wrap.classList.add('hidden');\n                    wrap.remove();\n                }\n\n                if (e.target.closest('.ovic-form .message .close')) {\n                    const btn = e.target.closest('.close');\n                    const wrap = btn.closest('.message');\n\n                    wrap.classList.add('hidden');\n                    wrap.remove();\n                }\n            });\n\n            document.addEventListener('DOMContentLoaded', function () {\n                const competitionSelect = document.getElementById('attend_competition');\n                const productCategorySelect = document.getElementById('product_category');\n                const productCategoryItem = document.querySelector('.product-category-item');\n\n                function toggleCompetitionField() {\n                    const competitionVal = competitionSelect.value;\n                    const form = document.getElementById('submit-entry-form');\n                    const attend_id = document.getElementById('attend_id');\n                    const competitionSlug = $(competitionSelect).find(':selected').attr('data-slug');\n\n                    \/\/ if (competitionSlug == 'cuoc-thi-1') {\n                    \/\/     competitionSelect.value = ''\n                    \/\/     toggleCompetitionField()\n                    \/\/     createAlert('Cu\u1ed9c thi n\u00e0y \u0111\u00e3 h\u1ebft h\u1ea1n n\u1ed9p.')\n                    \/\/     return false\n                    \/\/ }\n\n                    if (competitionVal != '') {\n                        currentAttend = competitionVal\n                        const attend = attends[competitionVal];\n\n                        const provincial = document.querySelector('.attend-provincial .form-control');\n                        const school = document.querySelector('.attend-school .form-control');\n                        const attendClass = document.querySelector('.class-name .form-control');\n                        const fullName = document.querySelector('.full-name .form-control');\n                        const phone = document.querySelector('.phone .form-control');\n                        const email = document.querySelector('.email .form-control');\n                        const instructor = document.querySelector('.instructor .form-control');\n                        const instructorPhone = document.querySelector('.instructor-phone .form-control');\n                        const teamNameWrap = document.querySelector('.team-name');\n                        const teamName = teamNameWrap.querySelector('.team-name .form-control');\n                        const membersWrap = document.querySelector('.members');\n                        const members = membersWrap.querySelector('.members .form-control');\n\n                        const productName = document.getElementById('product_name');\n                        const productCategory = document.querySelector('.product-category');\n                        const productImage = document.getElementById('product_image');\n                        const productImageUrl = document.querySelector('.product-image .form-file-image');\n                        const productDesc = document.getElementById('product_desc');\n                        const productFile = document.getElementById('product_file');\n                        const productFileName = document.querySelector('.product-file .form-file-btn');\n                        const productAudio = document.getElementById('product_audio');\n                        const productAudioName = document.querySelector('.product-audio .form-file-btn');\n\n                        provincial.value = attend['attend_provincial'];\n                        school.value = attend['attend_school'];\n                        attendClass.value = attend['class_name'];\n                        fullName.value = attend['full_name'];\n                        phone.value = attend['phone'];\n                        email.value = attend['email'];\n                        instructor.value = attend['instructor'];\n                        instructorPhone.value = attend['instructor_phone'];\n                        if (attend['team_solo'] === 'solo') {\n                            teamNameWrap.classList.add('hidden');\n                            membersWrap.classList.add('hidden');\n                        } else {\n                            teamNameWrap.classList.remove('hidden');\n                            teamName.value = attend['team_name'];\n                            membersWrap.classList.remove('hidden');\n                            let membersVal = '';\n                            if (attend['members'].length !== 0) {\n                                for (const member of attend['members']) {\n                                    membersVal += '<span class=\"member\"><span class=\"name\">' + member['name'] + '<\/span><span class=\"phone\">' + member['phone'] + '<\/span><\/span>';\n                                }\n                            }\n                            members.innerHTML = membersVal;\n                        }\n\n                        form.classList.remove('hidden-inputs');\n\n                        productName.value = attend['product_name'];\n                        if (attend['attend_competition'] === 'cuoc-thi-3') {\n                            productCategory.classList.remove('hidden');\n                            productCategoryItem.classList.remove('hidden');\n                        } else {\n                            productCategory.classList.add('hidden');\n                            productCategoryItem.classList.add('hidden');\n                        }\n                        if (attend['product_category'] !== '') {\n                            productCategorySelect.value = attend['product_category'];\n                            toggleProductCategoryField();\n                        } else {\n                            productCategorySelect.selectedIndex = 0;\n                            toggleProductCategoryField();\n                        }\n                        if (attend['product_category_item_arr'].length !== 0) {\n                            for (const product_category_item of attend['product_category_item_arr']) {\n                                const categoryItem = document.getElementById(product_category_item);\n                                if (categoryItem) {\n                                    categoryItem.checked = true;\n                                }\n                            }\n                        } else {\n                            for (const product_category_item of document.querySelectorAll('input[name=\"product_category_item[]\"]')) {\n                                if (product_category_item) {\n                                    product_category_item.checked = false;\n                                }\n                            }\n                        }\n                        if (attend['product_image_url'] !== '') {\n                            productImageUrl.src = attend['product_image_url'];\n                        } else {\n                            productImageUrl.src = 'https:\/\/steam.ictu.edu.vn\/2025\/wp-content\/themes\/ittech\/assets\/images\/placeholder.png';\n                        }\n                        productDesc.innerHTML = attend['product_desc'];\n                        if (attend['product_file'] !== '') {\n                            productFileName.innerHTML = attend['product_file'];\n                        } else {\n                            productFileName.innerHTML = '...';\n                        }\n                        if (attend['product_audio'] !== '') {\n                            productAudioName.innerHTML = attend['product_audio'];\n                        } else {\n                            productAudioName.innerHTML = '...';\n                        }\n\n                        attend_id.value = competitionVal;\n                        console.log(attend);\n                        if (parseInt(attend['submitted']) === 1 && competitionSlug != 'cuoc-thi-1') {\n                            document.querySelector('.submit-entry-form').classList.add('submitted');\n                            document.querySelector('.attend-competition-wrap .submitted').classList.remove('hidden');\n                            productName.readOnly = true;\n                            document.getElementById('product_category').disabled = true;\n                            \/\/ document.querySelectorAll('.product-category-item input').forEach(function(checkbox) {\n                            \/\/     checkbox.onclick = function() {\n                            \/\/         return false;\n                            \/\/     };\n                            \/\/ });\n                            productImage.classList.add('hidden');\n                            productDesc.readOnly = true;\n                            productFile.classList.add('hidden');\n                            productAudio.classList.add('hidden');\n                            document.querySelector('.group-submit .form-image-wrap .form-file-name').classList.add('hidden');\n                            document.querySelector('.group-submit .field-text').classList.add('hidden');\n                            document.querySelector('.group-submit .form-submit').classList.add('hidden');\n                        } else {\n                            document.querySelector('.submit-entry-form').classList.remove('submitted');\n                            document.querySelector('.attend-competition-wrap .submitted').classList.add('hidden');\n                            productName.readOnly = false;\n                            document.getElementById('product_category').disabled = false;\n                            \/\/ productCategoryItem.readOnly = false;\n                            productImage.classList.remove('hidden');\n                            productDesc.readOnly = false;\n                            productFile.classList.remove('hidden');\n                            productAudio.classList.remove('hidden');\n                            document.querySelector('.group-submit .form-image-wrap .form-file-name').classList.remove('hidden');\n                            document.querySelector('.group-submit .field-text').classList.remove('hidden');\n                            document.querySelector('.group-submit .form-submit').classList.remove('hidden');\n                        }\n                    } else {\n                        form.classList.add('hidden-inputs');\n                    }\n                }\n\n                if (competitionSelect) {\n                    competitionSelect.addEventListener('change', toggleCompetitionField);\n                }\n\n                function toggleProductCategoryField() {\n                    const productCategoryVal = productCategorySelect.value;\n\n                    if (productCategoryVal === 'multimedia') {\n                        productCategoryItem.innerHTML = '' +\n                            '<span><input type=\"checkbox\" id=\"multimedia-1\" name=\"product_category_item[]\" value=\"multimedia-1\"><label for=\"multimedia-1\">Tranh \u1ea3nh<\/label><\/span>' +\n                            '<span><input type=\"checkbox\" id=\"multimedia-2\" name=\"product_category_item[]\" value=\"multimedia-2\"><label for=\"multimedia-2\">Poster<\/label><\/span>' +\n                            '<span><input type=\"checkbox\" id=\"multimedia-3\" name=\"product_category_item[]\" value=\"multimedia-3\"><label for=\"multimedia-3\">Video clip<\/label><\/span>' +\n                            '<span><input type=\"checkbox\" id=\"multimedia-4\" name=\"product_category_item[]\" value=\"multimedia-4\"><label for=\"multimedia-4\">Truy\u1ec7n tranh<\/label><\/span>' +\n                            '<span><input type=\"checkbox\" id=\"multimedia-5\" name=\"product_category_item[]\" value=\"multimedia-5\"><label for=\"multimedia-5\">Th\u01a1 s\u1ed1<\/label><\/span>' +\n                            '<span><input type=\"checkbox\" id=\"multimedia-6\" name=\"product_category_item[]\" value=\"multimedia-6\"><label for=\"multimedia-6\">\u00c2m nh\u1ea1c AI<\/label><\/span>'\n                        ;\n                    } else {\n                        productCategoryItem.innerHTML = '' +\n                            '<span><input type=\"checkbox\" id=\"software-1\" name=\"product_category_item[]\" value=\"software-1\"><label for=\"software-1\">Chatbot du l\u1ecbch<\/label><\/span>' +\n                            '<span><input type=\"checkbox\" id=\"software-2\" name=\"product_category_item[]\" value=\"software-2\"><label for=\"software-2\">H\u01b0\u1edbng d\u1eabn vi\u00ean \u1ea3o<\/label><\/span>' +\n                            '<span><input type=\"checkbox\" id=\"software-3\" name=\"product_category_item[]\" value=\"software-3\"><label for=\"software-3\">Tr\u00f2 ch\u01a1i t\u01b0\u01a1ng t\u00e1c<\/label><\/span>'\n                        ;\n                    }\n                }\n\n                if (competitionSelect) {\n                    toggleProductCategoryField();\n                    productCategorySelect.addEventListener('change', toggleProductCategoryField);\n                }\n            });\n\n            document.querySelectorAll('.form-file-wrap').forEach(container => {\n                const input = container.querySelector('.form-file');\n                const formFileName = container.querySelector('.form-file-name');\n\n                input.addEventListener('change', function () {\n                    const name = this.getAttribute('id')\n                    const file = this.files[0]\n                    const maxSize = 200 * 1024 * 1024\n\n                    if (name === 'product_image') {\n                        if (!['image\/jpeg', 'image\/png'].includes(file.type)) {\n                            $(container).find('.form-file').val('')\n                            createAlert('H\u00ecnh \u1ea3nh \u0111\u1ea1i di\u1ec7n: Ch\u1ec9 ch\u1ea5p nh\u1eadn c\u00e1c file c\u00f3 \u0111\u1ecbnh d\u1ea1ng *.jpg, *.png.')\n                        } else {\n                            const img = new Image();\n                            const objectUrl = URL.createObjectURL(file);\n                            img.onload = function () {\n                                if (!['image\/jpeg', 'image\/png'].includes(file.type)) {\n                                    $(container).find('.form-file').val('')\n                                    createAlert('H\u00ecnh \u1ea3nh \u0111\u1ea1i di\u1ec7n: Ch\u1ec9 ch\u1ea5p nh\u1eadn c\u00e1c file c\u00f3 \u0111\u1ecbnh d\u1ea1ng *.jpg, *.png.')\n                                } else {\n                                    $(container).find('.form-file-image').attr('src', objectUrl)\n                                    formFileName.textContent = file ? file.name : \"Ch\u1ecdn file m\u1edbi\";\n                                }\n                                URL.revokeObjectURL(objectUrl);\n                            };\n\n                            img.src = objectUrl;\n                        }\n                    }\n\n                    if (name === 'product_file') {\n                        if (isValidExtension(file, ['.zip', '.rar']) && file.size < maxSize) {\n                            formFileName.textContent = file ? file.name : \"Ch\u1ecdn file m\u1edbi\";\n                            uploadFile('product_file', file, container)\n                        } else {\n                            formFileName.textContent = \"Ch\u1ecdn file m\u1edbi\";\n                            $(container).find('.form-file').val('')\n                            createAlert('File s\u1ea3n ph\u1ea9m: Ch\u1ec9 ch\u1ea5p nh\u1eadn c\u00e1c file c\u00f3 \u0111\u1ecbnh d\u1ea1ng *.zip, *.rar dung l\u01b0\u1ee3ng d\u01b0\u1edbi 200Mb.')\n                        }\n                    }\n\n                    if (name === 'product_audio') {\n                        if (isValidExtension(file, ['.pdf', '.ppt', '.pptx', '.zip', '.rar']) && file.size < maxSize) {\n                            formFileName.textContent = file ? file.name : \"Ch\u1ecdn file m\u1edbi\";\n                            uploadFile('product_audio', file, container)\n                        } else {\n                            formFileName.textContent = \"Ch\u1ecdn file m\u1edbi\";\n                            $(container).find('.form-file').val('')\n                            createAlert('File thuy\u1ebft minh m\u00f4 t\u1ea3 s\u1ea3n ph\u1ea9m v\u00e0 file thuy\u1ebft tr\u00ecnh: Ch\u1ec9 ch\u1ea5p nh\u1eadn c\u00e1c file c\u00f3 \u0111\u1ecbnh d\u1ea1ng *.pdf, *.ppt, *.pptx, *.zip, *.rar dung l\u01b0\u1ee3ng d\u01b0\u1edbi 200Mb.')\n                        }\n                    }\n                });\n            });\n\n            document.getElementById('submit-entry-form').addEventListener('submit', function (e) {\n                const button = e.submitter;\n                const action = button.value;\n                const descValue = $(this).find('[name=product_desc]').val();\n                const descLength = descValue.split(' ').length;\n\n                if (descLength <= 100 || descLength > 300) {\n                    createAlert(`M\u00f4 t\u1ea3 ng\u1eafn v\u1ec1 s\u1ea3n ph\u1ea9m b\u1ea1n \u0111\u00e3 nh\u1eadp ${descLength} t\u1eeb, y\u00eau c\u1ea7u trong kho\u1ea3ng 100 - 300 t\u1eeb.`);\n                    e.preventDefault();\n                    return false\n                }\n\n                if (currentAttend && attends[currentAttend]) {\n                    \/\/ if (!attends[currentAttend].product_image) {\n                    \/\/     if (document.getElementById('product_image').files.length === 0) {\n                    \/\/         createAlert('Y\u00eau c\u1ea7u nh\u1eadp h\u00ecnh \u1ea3nh \u0111\u1ea1i di\u1ec7n.')\n                    \/\/         e.preventDefault();\n                    \/\/         return false\n                    \/\/     }\n                    \/\/ }\n                    if (!attends[currentAttend].product_file || !attends[currentAttend].product_audio) {\n                        if (!$(this).find('[name=product_file]').val() || !$(this).find('[name=product_audio]').val()) {\n                            createAlert('Y\u00eau c\u1ea7u nh\u1eadp \u0111\u1ee7 th\u00f4ng tin \u0111\u01b0\u1ee3c y\u00eau c\u1ea7u.')\n                            e.preventDefault();\n                            return false\n                        }\n                    }\n                }\n\n                if (action === 'save') {\n                    if (!confirm('B\u1ea1n c\u00f3 ch\u1eafc ch\u1eafn x\u00e1c nh\u1eadn n\u1ed9p s\u1ea3n ph\u1ea9m d\u1ef1 thi, sau khi n\u1ed9p s\u1ebd kh\u00f4ng th\u1ec3 ch\u1ec9nh s\u1eeda?')) {\n                        e.preventDefault();\n                        return false\n                    }\n                }\n\n                $(this).addClass('loading')\n            })\n\n            function uploadFile(name, file, container) {\n                const xhr = new XMLHttpRequest();\n                const formData = new FormData();\n                const el = $(container).closest('.form-field');\n\n                $(el).find('.statusText').removeClass('text-success text-danger')\n                $(el).find('.progressBar').removeClass('success')\n                $(el).find('.progressBar').attr('value', 0)\n                $(el).find('.upload-progress').removeClass('d-none')\n                $('.submit-entry-form [name=submit_action]').prop('disabled', true)\n\n                formData.append('upload_file', file);\n                formData.append('value', $(el).find(`[name=${name}]`).val());\n\n                xhr.open('POST', 'https:\/\/steam.ictu.edu.vn\/2025\/wp-admin\/admin-ajax.php?action=ovic_ajax_upload_file&nonce=ff2941ac44', true);\n\n                xhr.upload.addEventListener('progress', function (e) {\n                    if (e.lengthComputable) {\n                        const percent = Math.round((e.loaded \/ e.total) * 100);\n                        $(el).find('.progressBar').attr('value', percent)\n                        $(el).find('.statusText').html(`${percent}%`);\n                    }\n                });\n\n                xhr.onload = function () {\n                    $(el).find('.statusText').addClass('text-danger')\n                    $('.submit-entry-form [name=submit_action]').prop('disabled', false)\n\n                    if (xhr.status === 200) {\n                        try {\n                            const response = JSON.parse(xhr.responseText);\n                            if (response.success) {\n                                $(el).find('.statusText').removeClass('text-danger')\n                                $(el).find('.statusText').addClass('text-success')\n                                $(el).find('.statusText').html('T\u1ea3i l\u00ean th\u00e0nh c\u00f4ng!');\n                                $(el).find(`[name=${name}]`).val(response.data).trigger('change');\n                                $(el).find('.progressBar').addClass('success')\n                            } else {\n                                $(el).find('.statusText').html('L\u1ed7i: ' + response.message);\n                            }\n                        } catch (e) {\n                            $(el).find('.statusText').html('Ph\u1ea3n h\u1ed3i kh\u00f4ng h\u1ee3p l\u1ec7.');\n                        }\n                    } else {\n                        $(el).find('.statusText').html('L\u1ed7i khi t\u1ea3i l\u00ean!');\n                    }\n                };\n\n                xhr.onerror = function () {\n                    $(el).find('.statusText').addClass('text-danger')\n                    $(el).find('.statusText').html('L\u1ed7i k\u1ebft n\u1ed1i.');\n                };\n\n                xhr.send(formData);\n            }\n\n            function isValidExtension(file, allowedExtensions) {\n                const fileName = file.name.toLowerCase();\n                return allowedExtensions.some(ext => fileName.endsWith(ext));\n            }\n\n            function createAlert(message, type = 'link-danger') {\n                $('.ovic-submit-entry-form').append(\n                    `<p class=\"message message-popup ${type}\"><a href=\"javascript:void(0)\" class=\"overlay\"><\/a><span class=\"text\">${message}<a href=\"javascript:void(0)\" class=\"close\"><\/a><\/span><\/p>`\n                )\n            }\n\n        })(jQuery);\n    <\/script>\n\n    \n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1864,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-33345","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/steam.ictu.edu.vn\/2025\/wp-json\/wp\/v2\/pages\/33345","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/steam.ictu.edu.vn\/2025\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/steam.ictu.edu.vn\/2025\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/steam.ictu.edu.vn\/2025\/wp-json\/wp\/v2\/users\/1864"}],"replies":[{"embeddable":true,"href":"https:\/\/steam.ictu.edu.vn\/2025\/wp-json\/wp\/v2\/comments?post=33345"}],"version-history":[{"count":2,"href":"https:\/\/steam.ictu.edu.vn\/2025\/wp-json\/wp\/v2\/pages\/33345\/revisions"}],"predecessor-version":[{"id":33347,"href":"https:\/\/steam.ictu.edu.vn\/2025\/wp-json\/wp\/v2\/pages\/33345\/revisions\/33347"}],"wp:attachment":[{"href":"https:\/\/steam.ictu.edu.vn\/2025\/wp-json\/wp\/v2\/media?parent=33345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}