{"id":30794,"date":"2025-08-07T13:22:09","date_gmt":"2025-08-07T06:22:09","guid":{"rendered":"https:\/\/www.hikmat.co.id\/?page_id=30794"},"modified":"2025-08-07T16:48:07","modified_gmt":"2025-08-07T09:48:07","slug":"barcode-validator","status":"publish","type":"page","link":"https:\/\/www.hikmat.co.id\/en\/barcode-validator\/","title":{"rendered":"Barcode Validator"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"30794\" class=\"elementor elementor-30794\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-d93e556 e-con-full e-flex e-con e-parent\" data-id=\"d93e556\" data-element_type=\"container\" data-e-type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t<div class=\"elementor-element elementor-element-269e73e elementor-widget elementor-widget-html\" data-id=\"269e73e\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<script src=\"https:\/\/unpkg.com\/html5-qrcode\"><\/script>\r\n\r\n<div style=\"text-align:center; margin-top: 40px;\">\r\n  <div id=\"scanner\" style=\"width: 300px; margin: 0 auto; display: none;\"><\/div>\r\n  <button id=\"start-scan\" style=\"padding: 10px 20px;\">Scan Barcode<\/button>\r\n  <div id=\"validation-result\" style=\"margin-top: 20px; font-size: 20px; font-weight: bold;\"><\/div>\r\n<\/div>\r\n\r\n<style>\r\n    #start-scan{\r\n        border-color: black;\r\n        border-radius: 0px;\r\n        color: black;\r\n    }\r\n    \r\n    #start-scan:hover{\r\n        background-color: black;\r\n        border-color: black;\r\n        border-radius: 0px;\r\n        color: white;\r\n    }\r\n    \r\n    .button-scan-again{\r\n        border-color: black;\r\n        border-radius: 0px;\r\n        color: black;\r\n    }\r\n    \r\n    .button-scan-again:hover{\r\n        background-color: black;\r\n        border-color: black;\r\n        border-radius: 0px;\r\n        color: white;\r\n    }\r\n<\/style>\r\n\r\n<script>\r\ndocument.addEventListener(\"DOMContentLoaded\", function () {\r\n  const scanBtn = document.getElementById(\"start-scan\");\r\n  const scannerDiv = document.getElementById(\"scanner\");\r\n  const resultDiv = document.getElementById(\"validation-result\");\r\n\r\n  let scanner;\r\n  let hasScanned = false;\r\n  let scanTimeout;\r\n\r\n  scanBtn.addEventListener(\"click\", function () {\r\n    scanBtn.style.display = \"none\";\r\n    scannerDiv.style.display = \"block\";\r\n\r\n    setTimeout(() => {\r\n      scanner = new Html5Qrcode(\"scanner\");\r\n\r\n      scanner.start(\r\n        { facingMode: \"environment\" },\r\n        {\r\n          fps: 10,\r\n          qrbox: 250\r\n        },\r\n        (decodedText, decodedResult) => {\r\n          if (hasScanned) return;\r\n          hasScanned = true;\r\n\r\n          if (scanTimeout) clearTimeout(scanTimeout);\r\n          scanTimeout = setTimeout(() => {\r\n            scanner.stop().then(() => {\r\n              scanner.clear();\r\n              scannerDiv.style.display = \"none\";\r\n              validateBarcode(decodedText);\r\n            });\r\n          }, 300);\r\n        },\r\n        (errorMessage) => {\r\n          \/\/ scanning error tidak ditampilkan\r\n        }\r\n      ).catch(err => {\r\n        resultDiv.innerHTML = `<span style=\"color:red;\">\u26a0\ufe0f Gagal mengakses kamera<\/span>`;\r\n      });\r\n\r\n    }, 300);\r\n  });\r\n\r\n  function validateBarcode(code) {\r\n    fetch(`\/wp-json\/hikmat\/v1\/validate-barcode?code=${code}`)\r\n      .then(res => res.json())\r\n      .then(data => {\r\n        let html = \"\";\r\n        if (data.valid) {\r\n          html = `\r\n            <span style=\"color:green;\">\u2705 VALID<\/span><br>\r\n            Invitation : <strong>${code}<\/strong><br><br>\r\n            Selamat datang<br>\r\n            <strong>${data.name}<\/strong><br><br>\r\n            <button class=\"button-scan-again\" onclick=\"window.location.reload()\">Scan Lagi<\/button>\r\n          `;\r\n        } else {\r\n          const reason = data.reason === \"Sudah digunakan\" ? \"\u274c SUDAH DIGUNAKAN\" : \"\u274c TIDAK VALID\";\r\n          html = `\r\n            <span style=\"color:red;\">${reason}<\/span><br>\r\n            Invitation : <strong>${code}<\/strong><br><br>\r\n            <button class=\"button-scan-again\" onclick=\"window.location.reload()\">Scan Lagi<\/button>\r\n          `;\r\n        }\r\n        resultDiv.innerHTML = html;\r\n      })\r\n      .catch(() => {\r\n        resultDiv.innerHTML = `\r\n          <span style=\"color:red;\">\u26a0\ufe0f Gagal validasi<\/span><br><br>\r\n          <button class=\"button-scan-again\" onclick=\"window.location.reload()\">Scan Lagi<\/button>\r\n        `;\r\n      });\r\n  }\r\n});\r\n<\/script>\r\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Scan Barcode<\/p>\n","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-30794","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Barcode Validator | HIKMAT\u00ae Luxury Modest Fashion<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hikmat.co.id\/en\/barcode-validator\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Barcode Validator | HIKMAT\u00ae Luxury Modest Fashion\" \/>\n<meta property=\"og:description\" content=\"Scan Barcode\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hikmat.co.id\/en\/barcode-validator\/\" \/>\n<meta property=\"og:site_name\" content=\"HIKMAT\u00ae Luxury Modest Fashion\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/web.facebook.com\/hikmatfashionofficial\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-07T09:48:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.hikmat.co.id\/wp-content\/uploads\/2025\/01\/Thumbnail-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\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:\\\/\\\/www.hikmat.co.id\\\/en\\\/barcode-validator\\\/\",\"url\":\"https:\\\/\\\/www.hikmat.co.id\\\/en\\\/barcode-validator\\\/\",\"name\":\"Barcode Validator | HIKMAT\u00ae Luxury Modest Fashion\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hikmat.co.id\\\/en\\\/#website\"},\"datePublished\":\"2025-08-07T06:22:09+00:00\",\"dateModified\":\"2025-08-07T09:48:07+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hikmat.co.id\\\/en\\\/barcode-validator\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hikmat.co.id\\\/en\\\/barcode-validator\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hikmat.co.id\\\/en\\\/barcode-validator\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hikmat.co.id\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Barcode Validator\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hikmat.co.id\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/www.hikmat.co.id\\\/en\\\/\",\"name\":\"HIKMAT\",\"description\":\"Classy with Modesty\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hikmat.co.id\\\/en\\\/#organization\"},\"alternateName\":\"Hikmat\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hikmat.co.id\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hikmat.co.id\\\/en\\\/#organization\",\"name\":\"PT Hikmat Moda Indonesia\",\"alternateName\":\"HIKMAT\",\"url\":\"https:\\\/\\\/www.hikmat.co.id\\\/en\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hikmat.co.id\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hikmat.co.id\\\/wp-content\\\/uploads\\\/2024\\\/05\\\/Logo-Hikmat.webp\",\"contentUrl\":\"https:\\\/\\\/www.hikmat.co.id\\\/wp-content\\\/uploads\\\/2024\\\/05\\\/Logo-Hikmat.webp\",\"width\":1430,\"height\":1449,\"caption\":\"PT Hikmat Moda Indonesia\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hikmat.co.id\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/web.facebook.com\\\/hikmatfashionofficial\",\"https:\\\/\\\/www.instagram.com\\\/hikmatfashion\",\"https:\\\/\\\/www.tiktok.com\\\/@hikmat.fashion\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Barcode Validator | HIKMAT\u00ae Luxury Modest Fashion","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hikmat.co.id\/en\/barcode-validator\/","og_locale":"en_US","og_type":"article","og_title":"Barcode Validator | HIKMAT\u00ae Luxury Modest Fashion","og_description":"Scan Barcode","og_url":"https:\/\/www.hikmat.co.id\/en\/barcode-validator\/","og_site_name":"HIKMAT\u00ae Luxury Modest Fashion","article_publisher":"https:\/\/web.facebook.com\/hikmatfashionofficial","article_modified_time":"2025-08-07T09:48:07+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/www.hikmat.co.id\/wp-content\/uploads\/2025\/01\/Thumbnail-1.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.hikmat.co.id\/en\/barcode-validator\/","url":"https:\/\/www.hikmat.co.id\/en\/barcode-validator\/","name":"Barcode Validator | HIKMAT\u00ae Luxury Modest Fashion","isPartOf":{"@id":"https:\/\/www.hikmat.co.id\/en\/#website"},"datePublished":"2025-08-07T06:22:09+00:00","dateModified":"2025-08-07T09:48:07+00:00","breadcrumb":{"@id":"https:\/\/www.hikmat.co.id\/en\/barcode-validator\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hikmat.co.id\/en\/barcode-validator\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.hikmat.co.id\/en\/barcode-validator\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hikmat.co.id\/en\/"},{"@type":"ListItem","position":2,"name":"Barcode Validator"}]},{"@type":"WebSite","@id":"https:\/\/www.hikmat.co.id\/en\/#website","url":"https:\/\/www.hikmat.co.id\/en\/","name":"HIKMAT","description":"Classy with Modesty","publisher":{"@id":"https:\/\/www.hikmat.co.id\/en\/#organization"},"alternateName":"Hikmat","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hikmat.co.id\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hikmat.co.id\/en\/#organization","name":"PT Hikmat Moda Indonesia","alternateName":"HIKMAT","url":"https:\/\/www.hikmat.co.id\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hikmat.co.id\/en\/#\/schema\/logo\/image\/","url":"https:\/\/www.hikmat.co.id\/wp-content\/uploads\/2024\/05\/Logo-Hikmat.webp","contentUrl":"https:\/\/www.hikmat.co.id\/wp-content\/uploads\/2024\/05\/Logo-Hikmat.webp","width":1430,"height":1449,"caption":"PT Hikmat Moda Indonesia"},"image":{"@id":"https:\/\/www.hikmat.co.id\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/web.facebook.com\/hikmatfashionofficial","https:\/\/www.instagram.com\/hikmatfashion","https:\/\/www.tiktok.com\/@hikmat.fashion"]}]}},"_links":{"self":[{"href":"https:\/\/www.hikmat.co.id\/en\/wp-json\/wp\/v2\/pages\/30794","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hikmat.co.id\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.hikmat.co.id\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.hikmat.co.id\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hikmat.co.id\/en\/wp-json\/wp\/v2\/comments?post=30794"}],"version-history":[{"count":0,"href":"https:\/\/www.hikmat.co.id\/en\/wp-json\/wp\/v2\/pages\/30794\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hikmat.co.id\/en\/wp-json\/wp\/v2\/media?parent=30794"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}