{"id":3731,"date":"2025-11-16T01:49:03","date_gmt":"2025-11-16T01:49:03","guid":{"rendered":"https:\/\/white-hy.com\/?page_id=3731"},"modified":"2025-11-16T01:50:02","modified_gmt":"2025-11-16T01:50:02","slug":"coils-2","status":"publish","type":"page","link":"https:\/\/white-hy.com\/en\/coils-2\/","title":{"rendered":"Coils"},"content":{"rendered":"<div data-elementor-type=\"wp-page\" data-elementor-id=\"3731\" class=\"elementor elementor-3731\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-aa52cec e-flex e-con-boxed e-con e-parent\" data-id=\"aa52cec\" 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-3280e6e elementor-widget elementor-widget-heading\" data-id=\"3280e6e\" 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<h1 class=\"elementor-heading-title elementor-size-default\">Coils<\/h1>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-cd4dd6a elementor-widget elementor-widget-html\" data-id=\"cd4dd6a\" 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<div style=\"text-align:center; margin:20px;\">\r\n  <button onclick=\"sendQuotation3()\" \r\n          style=\"padding:10px 20px; background:#28a745; color:white; border:none; border-radius:6px; font-size:14px; cursor:pointer;\">\r\n    \u2714 \u0625\u0631\u0633\u0627\u0644 \u0639\u0631\u0636 \u0633\u0639\u0631 \u0644\u0644\u0645\u0646\u062a\u062c\u0627\u062a \u0627\u0644\u0645\u062e\u062a\u0627\u0631\u0629\r\n  <\/button>\r\n<\/div>\r\n\r\n<div id=\"products3\" style=\"text-align:center;\"><\/div>\r\n\r\n<!-- \u2705 \u0632\u0631 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0637\u0644\u0628 \u0627\u0644\u062c\u0645\u0627\u0639\u064a (\u0627\u0644\u0623\u0633\u0641\u0644) -->\r\n<div style=\"text-align:center; margin:20px;\">\r\n  <button onclick=\"sendQuotation3()\" \r\n          style=\"padding:10px 20px; background:#007bff; color:white; border:none; border-radius:6px; font-size:14px; cursor:pointer;\">\r\n    \ud83d\udce9 \u0625\u0631\u0633\u0627\u0644 \u0639\u0631\u0636 \u0633\u0639\u0631 \u0644\u0644\u0645\u0646\u062a\u062c\u0627\u062a \u0627\u0644\u0645\u062e\u062a\u0627\u0631\u0629\r\n  <\/button>\r\n<\/div>\r\n\r\n<script>\r\nfunction sendQuotation3() {\r\n  const checkboxes = document.querySelectorAll(\".product3-check:checked\");\r\n  if (checkboxes.length === 0) {\r\n    alert(\"\u0645\u0646 \u0641\u0636\u0644\u0643 \u0627\u062e\u062a\u0631 \u0645\u0646\u062a\u062c \u0648\u0627\u062d\u062f \u0639\u0644\u0649 \u0627\u0644\u0623\u0642\u0644 \u0644\u0625\u0631\u0633\u0627\u0644 \u0639\u0631\u0636 \u0627\u0644\u0633\u0639\u0631.\");\r\n    return;\r\n  }\r\n\r\n  let selectedProducts = [];\r\n  checkboxes.forEach(cb => selectedProducts.push(cb.value));\r\n\r\n  const subject = \"\u0637\u0644\u0628 \u0639\u0631\u0636 \u0633\u0639\u0631\";\r\n  const body = \"\u0645\u0631\u062d\u0628\u0627\u060c\\n\\n\u0623\u0631\u063a\u0628 \u0641\u064a \u0637\u0644\u0628 \u0639\u0631\u0636 \u0633\u0639\u0631 \u0644\u0644\u0645\u0646\u062a\u062c\u0627\u062a \u0627\u0644\u062a\u0627\u0644\u064a\u0629:\\n\\n\" + selectedProducts.join(\"\\n\") + \"\\n\\n\u0634\u0643\u0631\u0627.\";\r\n  \r\n  window.location.href = `mailto:info@white-hy.com?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}`;\r\n}\r\n\r\n(async () => {\r\n  const SHEET_ID = '1FNMpPYGzc7D6m4lPQR22vaf8awXksfVohJ_62RAt6-w';\r\n  const SHEET_NAME = 'Sheet3'; \/\/ \u2705 \u0634\u064a\u062a 3\r\n  const SHEET_URL = `https:\/\/docs.google.com\/spreadsheets\/d\/${SHEET_ID}\/gviz\/tq?sheet=${encodeURIComponent(SHEET_NAME)}&tqx=out:json`;\r\n\r\n  const container = document.getElementById('products3');\r\n  container.innerHTML = \"\u062c\u0627\u0631\u064a \u062c\u0644\u0628 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a...\";\r\n\r\n  try {\r\n    const res = await fetch(SHEET_URL);\r\n    const text = await res.text();\r\n    const json = JSON.parse(text.substr(47).slice(0, -2));\r\n\r\n    container.innerHTML = \"\"; \r\n\r\n    json.table.rows.forEach((row, index) => {\r\n      const catalog  = row.c[1]?.v || '';   \/\/ Catalog\r\n      const brand    = row.c[2]?.v || '';   \/\/ Brand\r\n      const code     = row.c[3]?.v || '';   \/\/ Product Code\r\n      const diameter = row.c[4]?.v || '';   \/\/ Internal Diameter\r\n      const type     = row.c[5]?.v || '';   \/\/ DC\/AC\r\n      const voltage  = row.c[6]?.v || '';   \/\/ Voltage\r\n      const imageURL = row.c[7]?.v || '';   \/\/ Image\r\n\r\n      if (!brand && !code) return; \r\n\r\n      function fixDriveURL(url) {\r\n        if (url && url.includes(\"drive.google.com\")) {\r\n          const fileIdMatch = url.match(\/[-\\w]{25,}\/);\r\n          if (fileIdMatch) {\r\n            return `https:\/\/drive.google.com\/uc?export=view&id=${fileIdMatch[0]}`;\r\n          }\r\n        }\r\n        return url;\r\n      }\r\n      const finalImageURL = fixDriveURL(imageURL);\r\n\r\n      const productLabel = `${brand} - ${code}`;\r\n      const checkboxId = `chk3-${index}`;\r\n\r\n      container.innerHTML += `\r\n        <div style=\"\r\n          border:1px solid #ccc;\r\n          padding:8px;\r\n          margin:10px;\r\n          border-radius:8px;\r\n          display:inline-block;\r\n          width:260px;\r\n          vertical-align:top;\r\n          background:#fff;\r\n          text-align:left;\r\n          font-family:Arial, sans-serif;\r\n          box-shadow:0 2px 6px rgba(0,0,0,0.1);\r\n          font-size:12px;\r\n        \">\r\n          <div style=\"margin-bottom:6px;\">\r\n            <input id=\"${checkboxId}\" type=\"checkbox\" class=\"product3-check\" value=\"${productLabel}\">\r\n            <label for=\"${checkboxId}\" style=\"font-size:12px; color:#007bff; font-weight:bold; cursor:pointer;\">\u0627\u062e\u062a\u0631 \u0627\u0644\u0645\u0646\u062a\u062c<\/label>\r\n          <\/div>\r\n\r\n          <img decoding=\"async\" src=\"${finalImageURL || ''}\" alt=\"${brand}\" \r\n               style=\"width:100%;height:140px;object-fit:contain;border-bottom:1px solid #ddd;padding-bottom:4px;${finalImageURL ? '' : 'display:none;'}\">\r\n\r\n          <h3 style=\"font-size:14px;margin:6px 0;font-weight:bold;color:#333;\">Brand: ${brand}<\/h3>\r\n          <p style=\"margin:0;color:#555;font-size:12px;\">Product Code: ${code}<\/p>\r\n          <p style=\"margin:0;color:#555;font-size:12px;\">Internal Diameter: ${diameter}<\/p>\r\n          <p style=\"margin:0;color:#555;font-size:12px;\">Type: ${type}<\/p>\r\n          <p style=\"margin:0;color:#555;font-size:12px;\">Voltage: ${voltage}<\/p>\r\n\r\n          ${catalog ? `\r\n            <div style=\"text-align:center; margin-top:8px;\">\r\n              <a href=\"${catalog}\" target=\"_blank\" \r\n                 style=\"display:inline-block;padding:6px 12px;background:#007bff;color:#fff;\r\n                        font-size:12px;font-weight:bold;border-radius:6px;text-decoration:none;\">\r\n                 \u0639\u0631\u0636 \u0627\u0644\u0643\u062a\u0627\u0644\u0648\u062c\r\n              <\/a>\r\n            <\/div>` : ''}\r\n        <\/div>\r\n      `;\r\n    });\r\n\r\n    if (!container.innerHTML.trim()) {\r\n      container.innerHTML = \"\u0644\u0627 \u064a\u0648\u062c\u062f \u0645\u0646\u062a\u062c\u0627\u062a \u0644\u0639\u0631\u0636\u0647\u0627.\";\r\n    }\r\n  } catch (err) {\r\n    container.innerHTML = `\u062e\u0637\u0623: ${err.message}`;\r\n  }\r\n})();\r\n<\/script>\r\n\r\n\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>&#8230;<\/p>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-3731","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/white-hy.com\/en\/wp-json\/wp\/v2\/pages\/3731","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/white-hy.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/white-hy.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/white-hy.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/white-hy.com\/en\/wp-json\/wp\/v2\/comments?post=3731"}],"version-history":[{"count":4,"href":"https:\/\/white-hy.com\/en\/wp-json\/wp\/v2\/pages\/3731\/revisions"}],"predecessor-version":[{"id":3736,"href":"https:\/\/white-hy.com\/en\/wp-json\/wp\/v2\/pages\/3731\/revisions\/3736"}],"wp:attachment":[{"href":"https:\/\/white-hy.com\/en\/wp-json\/wp\/v2\/media?parent=3731"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}