{"id":13573,"date":"2024-11-11T07:38:10","date_gmt":"2024-11-11T07:38:10","guid":{"rendered":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/?page_id=13573"},"modified":"2025-05-22T04:47:57","modified_gmt":"2025-05-22T04:47:57","slug":"set-announcement","status":"publish","type":"page","link":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/en\/set-announcement\/","title":{"rendered":"SET Announcement"},"content":{"rendered":"<div data-elementor-type=\"wp-page\" data-elementor-id=\"13573\" class=\"elementor elementor-13573\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-a25dbc9 e-flex e-con-boxed parallax_section_no qode_elementor_container_no e-con e-parent\" data-id=\"a25dbc9\" data-element_type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-16e0b2f elementor-widget elementor-widget-heading\" data-id=\"16e0b2f\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">SET Announcement\n<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-d74ad5b e-flex e-con-boxed parallax_section_no qode_elementor_container_no e-con e-parent\" data-id=\"d74ad5b\" data-element_type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-217913f elementor-widget elementor-widget-html\" data-id=\"217913f\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t      <style>\n      #table-newsset{\n          border-bottom: none;\n      }\n    <\/style> \n    <div class=\"news-section\">\n \n        <div class=\"news-item\" id=\"table-newsset\">\n            \n        <\/div>\n        \n    <\/div>\n    \n    <div id=\"pagination-controls\" ><\/div>\n\n<\/div>\n    \t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-135e581 elementor-widget elementor-widget-shortcode\" data-id=\"135e581\" data-element_type=\"widget\" data-widget_type=\"shortcode.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-shortcode\"> <script>\r\n    const baseURL = \"https:\/\/www.irplus.in.th\/api\/SetAnnounce?share=LDC&lang=\";\r\n    const headers = {\r\n        \"Authorization\": \"f0d32684a89fb255fa8bc51b3df9d5f7f1bccf2a19e190fbd39988aa67c06ef6\"\r\n    };\r\n\r\n    const pathname = window.location.pathname;\r\n    const extractedLang = pathname.split('\/')[1];\r\n    const lang = (extractedLang === \"en\") ? \"en\" : \"th\";\r\n\r\n    let parsedData = [];\r\n    let currentPage = 1;\r\n    const itemsPerPage = 10;\r\n\r\n    function fetchData(language) {\r\n        const url = `${baseURL}${language}`;\r\n        fetch(url, { method: \"GET\", headers: headers })\r\n            .then(response => {\r\n                if (!response.ok) throw new Error('Network response was not ok ' + response.statusText);\r\n                return response.json();\r\n            })\r\n            .then(data => {\r\n                if (data.status === \"success\") {\r\n                    parsedData = JSON.parse(data.data);\r\n                    populateTable(parsedData, language);\r\n                    updatePagination();\r\n                } else {\r\n                    document.querySelector(\"#table-newsset\").innerHTML = \"<div class='no-data'>\u0e44\u0e21\u0e48\u0e21\u0e35\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e35\u0e48\u0e08\u0e30\u0e41\u0e2a\u0e14\u0e07<\/div>\";\r\n                }\r\n            })\r\n            .catch(error => {\r\n                console.error('Fetch error:', error);\r\n                document.querySelector(\"#table-newsset\").innerHTML = `<div class='error-message'>Error: ${error.message}<\/div>`;\r\n            });\r\n    }\r\n\r\n    function populateTable(data, language) {\r\n        const container = document.querySelector(\"#table-newsset\");\r\n        container.innerHTML = \"\";\r\n\r\n        const start = (currentPage - 1) * itemsPerPage;\r\n        const end = start + itemsPerPage;\r\n        const paginatedData = data.slice(start, end);\r\n\r\n        paginatedData.forEach(item => {\r\n            const timestamp = formatDate(item.timestamp, language);\r\n            const title = item.title;\r\n\r\n            const path = item.link;\r\n            const queryString = path.split('?')[1];\r\n            const formattedString = queryString.replace(\/y=|m=|id=\/g, '').replace(\/&\/g, '\/');\r\n            const parts = formattedString.split('\/');\r\n            const year = parts[0];\r\n            const month = parts[1];\r\n            const decodedValue = parts[2];\r\n            const reEncodedValue = btoa(decodedValue);\r\n            const getlang = language === 'en' ? 'E' : 'T';\r\n            const newFormattedString = `${year}\/${month}\/${decodedValue}\/${getlang}`;\r\n\r\n            const newsItemHTML = `\r\n                <div class=\"news-item\">\r\n                    <div class=\"news-date\">\r\n                        <i class=\"fa-regular fa-calendar\"><\/i>\r\n                        <span class=\"news-date-detail\">${timestamp}<\/span>\r\n                    <\/div>\r\n                    <div class=\"news-content\">\r\n                        <a href=\"..\/news-set-announcement\/${newFormattedString}\" target=\"_blank\"><p>${title}<\/p><\/a>\r\n                    <\/div>\r\n                <\/div>\r\n            `;\r\n            container.insertAdjacentHTML('beforeend', newsItemHTML);\r\n        });\r\n    }\r\n\r\n    function formatDate(timestamp, language) {\r\n        const date = new Date(timestamp);\r\n        const options = { day: 'numeric', month: 'short', year: 'numeric' };\r\n        if (language === \"th\") {\r\n            const buddhistYear = date.getFullYear() + 543;\r\n            return date.toLocaleDateString('th-TH', options).replace(date.getFullYear(), buddhistYear);\r\n        }\r\n        return date.toLocaleDateString('en-US', options);\r\n    }\r\n\r\n    function updatePagination() {\r\n        const totalPages = Math.ceil(parsedData.length \/ itemsPerPage);\r\n        const container = document.getElementById(\"pagination-controls\");\r\n        container.innerHTML = \"\";\r\n\r\n        const createButton = (label, page, disabled = false) => {\r\n            const btn = document.createElement(\"button\");\r\n            btn.textContent = label;\r\n            btn.style.margin = \"2px\";\r\n            btn.style.padding = \"4px 8px\";\r\n            if (disabled) btn.disabled = true;\r\n            btn.addEventListener(\"click\", () => {\r\n                currentPage = page;\r\n                populateTable(parsedData, lang);\r\n                updatePagination();\r\n            });\r\n            return btn;\r\n        };\r\n\r\n        \/\/ \u00ab Button\r\n        container.appendChild(createButton(\"\u00ab\", currentPage - 1, currentPage === 1));\r\n\r\n        \/\/ Page Numbers\r\n        let maxVisibleButtons = 5;\r\n        let startPage = Math.max(1, currentPage - Math.floor(maxVisibleButtons \/ 2));\r\n        let endPage = Math.min(totalPages, startPage + maxVisibleButtons - 1);\r\n\r\n        if (endPage - startPage < maxVisibleButtons - 1) {\r\n            startPage = Math.max(1, endPage - maxVisibleButtons + 1);\r\n        }\r\n\r\n        if (startPage > 1) {\r\n            container.appendChild(createButton(\"1\", 1, currentPage === 1));\r\n            if (startPage > 2) {\r\n                const dots = document.createElement(\"span\");\r\n                dots.textContent = \"\u2026\";\r\n                dots.style.margin = \"2px\";\r\n                container.appendChild(dots);\r\n            }\r\n        }\r\n\r\n        for (let i = startPage; i <= endPage; i++) {\r\n            const isCurrent = i === currentPage;\r\n            const btn = createButton(i, i, isCurrent);\r\n            if (isCurrent) btn.disabled = true;\r\n            container.appendChild(btn);\r\n        }\r\n\r\n        if (endPage < totalPages) {\r\n            if (endPage < totalPages - 1) {\r\n                const dots = document.createElement(\"span\");\r\n                dots.textContent = \"\u2026\";\r\n                dots.style.margin = \"2px\";\r\n                container.appendChild(dots);\r\n            }\r\n            container.appendChild(createButton(totalPages, totalPages, currentPage === totalPages));\r\n        }\r\n\r\n        \/\/ \u00bb Button\r\n        container.appendChild(createButton(\"\u00bb\", currentPage + 1, currentPage === totalPages));\r\n    }\r\n\r\n    \/\/ Fetch data on load\r\n    fetchData(lang);\r\n<\/script>\r\n<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>SET Announcement<\/p>","protected":false},"author":3,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-13573","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u0e02\u0e48\u0e32\u0e27\u0e1b\u0e23\u0e30\u0e01\u0e32\u0e28\u0e08\u0e32\u0e01\u0e15\u0e25\u0e32\u0e14\u0e2b\u0e25\u0e31\u0e01\u0e17\u0e23\u0e31\u0e1e\u0e22\u0e4c - LDC Dental PCL<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u0e02\u0e48\u0e32\u0e27\u0e1b\u0e23\u0e30\u0e01\u0e32\u0e28\u0e08\u0e32\u0e01\u0e15\u0e25\u0e32\u0e14\u0e2b\u0e25\u0e31\u0e01\u0e17\u0e23\u0e31\u0e1e\u0e22\u0e4c - LDC Dental PCL\" \/>\n<meta property=\"og:description\" content=\"\u0e02\u0e48\u0e32\u0e27\u0e1b\u0e23\u0e30\u0e01\u0e32\u0e28\u0e08\u0e32\u0e01\u0e15\u0e25\u0e32\u0e14\u0e2b\u0e25\u0e31\u0e01\u0e17\u0e23\u0e31\u0e1e\u0e22\u0e4c\" \/>\n<meta property=\"og:url\" content=\"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/en\/set-announcement\/\" \/>\n<meta property=\"og:site_name\" content=\"LDC Dental PCL\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/LDCDental\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-22T04:47:57+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@LDC_Dental\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/set-announcement\/\",\"url\":\"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/set-announcement\/\",\"name\":\"\u0e02\u0e48\u0e32\u0e27\u0e1b\u0e23\u0e30\u0e01\u0e32\u0e28\u0e08\u0e32\u0e01\u0e15\u0e25\u0e32\u0e14\u0e2b\u0e25\u0e31\u0e01\u0e17\u0e23\u0e31\u0e1e\u0e22\u0e4c - LDC Dental PCL\",\"isPartOf\":{\"@id\":\"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/#website\"},\"datePublished\":\"2024-11-11T07:38:10+00:00\",\"dateModified\":\"2025-05-22T04:47:57+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/set-announcement\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/set-announcement\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/set-announcement\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u0e02\u0e48\u0e32\u0e27\u0e1b\u0e23\u0e30\u0e01\u0e32\u0e28\u0e08\u0e32\u0e01\u0e15\u0e25\u0e32\u0e14\u0e2b\u0e25\u0e31\u0e01\u0e17\u0e23\u0e31\u0e1e\u0e22\u0e4c\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/#website\",\"url\":\"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/\",\"name\":\"My WordPress\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/#organization\",\"name\":\"My WordPress\",\"url\":\"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/wp-content\/uploads\/2025\/04\/logo-LDC-02.webp\",\"contentUrl\":\"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/wp-content\/uploads\/2025\/04\/logo-LDC-02.webp\",\"width\":150,\"height\":39,\"caption\":\"My WordPress\"},\"image\":{\"@id\":\"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/LDCDental\",\"https:\/\/x.com\/LDC_Dental\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u0e02\u0e48\u0e32\u0e27\u0e1b\u0e23\u0e30\u0e01\u0e32\u0e28\u0e08\u0e32\u0e01\u0e15\u0e25\u0e32\u0e14\u0e2b\u0e25\u0e31\u0e01\u0e17\u0e23\u0e31\u0e1e\u0e22\u0e4c - LDC Dental PCL","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"\u0e02\u0e48\u0e32\u0e27\u0e1b\u0e23\u0e30\u0e01\u0e32\u0e28\u0e08\u0e32\u0e01\u0e15\u0e25\u0e32\u0e14\u0e2b\u0e25\u0e31\u0e01\u0e17\u0e23\u0e31\u0e1e\u0e22\u0e4c - LDC Dental PCL","og_description":"\u0e02\u0e48\u0e32\u0e27\u0e1b\u0e23\u0e30\u0e01\u0e32\u0e28\u0e08\u0e32\u0e01\u0e15\u0e25\u0e32\u0e14\u0e2b\u0e25\u0e31\u0e01\u0e17\u0e23\u0e31\u0e1e\u0e22\u0e4c","og_url":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/en\/set-announcement\/","og_site_name":"LDC Dental PCL","article_publisher":"https:\/\/www.facebook.com\/LDCDental","article_modified_time":"2025-05-22T04:47:57+00:00","twitter_card":"summary_large_image","twitter_site":"@LDC_Dental","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/set-announcement\/","url":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/set-announcement\/","name":"\u0e02\u0e48\u0e32\u0e27\u0e1b\u0e23\u0e30\u0e01\u0e32\u0e28\u0e08\u0e32\u0e01\u0e15\u0e25\u0e32\u0e14\u0e2b\u0e25\u0e31\u0e01\u0e17\u0e23\u0e31\u0e1e\u0e22\u0e4c - LDC Dental PCL","isPartOf":{"@id":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/#website"},"datePublished":"2024-11-11T07:38:10+00:00","dateModified":"2025-05-22T04:47:57+00:00","breadcrumb":{"@id":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/set-announcement\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/set-announcement\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/set-announcement\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/"},{"@type":"ListItem","position":2,"name":"\u0e02\u0e48\u0e32\u0e27\u0e1b\u0e23\u0e30\u0e01\u0e32\u0e28\u0e08\u0e32\u0e01\u0e15\u0e25\u0e32\u0e14\u0e2b\u0e25\u0e31\u0e01\u0e17\u0e23\u0e31\u0e1e\u0e22\u0e4c"}]},{"@type":"WebSite","@id":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/#website","url":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/","name":"My WordPress","description":"","publisher":{"@id":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/#organization","name":"My WordPress","url":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/#\/schema\/logo\/image\/","url":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/wp-content\/uploads\/2025\/04\/logo-LDC-02.webp","contentUrl":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/wp-content\/uploads\/2025\/04\/logo-LDC-02.webp","width":150,"height":39,"caption":"My WordPress"},"image":{"@id":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/LDCDental","https:\/\/x.com\/LDC_Dental"]}]}},"_links":{"self":[{"href":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/en\/wp-json\/wp\/v2\/pages\/13573","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/en\/wp-json\/wp\/v2\/comments?post=13573"}],"version-history":[{"count":94,"href":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/en\/wp-json\/wp\/v2\/pages\/13573\/revisions"}],"predecessor-version":[{"id":21232,"href":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/en\/wp-json\/wp\/v2\/pages\/13573\/revisions\/21232"}],"wp:attachment":[{"href":"https:\/\/aliceblue-flamingo-311157-clone.irpluscontent.com\/en\/wp-json\/wp\/v2\/media?parent=13573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}