{"id":3771,"date":"2025-11-16T01:59:35","date_gmt":"2025-11-16T01:59:35","guid":{"rendered":"https:\/\/white-hy.com\/?page_id=3771"},"modified":"2025-11-16T02:01:10","modified_gmt":"2025-11-16T02:01:10","slug":"schwing-2","status":"publish","type":"page","link":"https:\/\/white-hy.com\/en\/schwing-2\/","title":{"rendered":"SCHWING"},"content":{"rendered":"<div data-elementor-type=\"wp-page\" data-elementor-id=\"3771\" class=\"elementor elementor-3771\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-03cff3b e-flex e-con-boxed e-con e-parent\" data-id=\"03cff3b\" 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-9b8d1d0 elementor-widget elementor-widget-heading\" data-id=\"9b8d1d0\" 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\">SCHWING<\/h1>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-40fec7b elementor-widget elementor-widget-html\" data-id=\"40fec7b\" 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<!-- \u2705 \u0632\u0631 \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 (\u0623\u0639\u0644\u0649) -->\r\n<div style=\"text-align:center; margin:15px;\">\r\n  <button onclick=\"sendQuotation()\" \r\n          style=\"padding:10px 20px; background:#28a745; color:#fff; font-size:14px; font-weight:bold; border:none; border-radius:8px; cursor:pointer;\">\r\n    \ud83d\udcb0 \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=\"products\" style=\"text-align:center;\"><\/div>\r\n\r\n<script>\r\nfunction sendQuotation() {\r\n  const checkboxes = document.querySelectorAll(\".product-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  const selected = Array.from(checkboxes).map(cb => cb.value);\r\n  const subject = \"\u0637\u0644\u0628 \u0639\u0631\u0636 \u0633\u0639\u0631 - \u0645\u0646\u062a\u062c\u0627\u062a \u0645\u062e\u062a\u0627\u0631\u0629\";\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\" + selected.join(\"\\n\") + \"\\n\\n\u0634\u0643\u0631\u0627.\";\r\n  window.location.href = `mailto:info@white-hy.com?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}`;\r\n}\r\n\r\n\/\/ \u2705 \u0645\u064f\u062d\u0644\u0651\u0644 \u0622\u0645\u0646 \u0644\u0631\u062f\u0651 gviz \u0645\u0646 Google Sheets (\u0628\u062f\u064a\u0644 \u0639\u0646 substr(47))\r\nfunction parseGViz(text) {\r\n  const start = text.indexOf('{');\r\n  const end = text.lastIndexOf('}');\r\n  if (start === -1 || end === -1) throw new Error('\u062a\u0646\u0633\u064a\u0642 Google Sheets \u063a\u064a\u0631 \u0645\u062a\u0648\u0642\u0639');\r\n  return JSON.parse(text.slice(start, end + 1));\r\n}\r\n\r\n\/\/ \u2705 \u0625\u0635\u0644\u0627\u062d \u0631\u0648\u0627\u0628\u0637 Google Drive (\u0644\u0648 \u0648\u064f\u062c\u062f\u062a)\r\nfunction fixDriveURL(url) {\r\n  if (url && url.includes(\"drive.google.com\")) {\r\n    const fileIdMatch = url.match(\/[-\\w]{25,}\/);\r\n    if (fileIdMatch) return `https:\/\/drive.google.com\/uc?export=view&id=${fileIdMatch[0]}`;\r\n  }\r\n  return url;\r\n}\r\n\r\n(async () => {\r\n  const SHEET_ID = '1FNMpPYGzc7D6m4lPQR22vaf8awXksfVohJ_62RAt6-w';\r\n  const SHEET_NAME = 'Sheet10'; \/\/ \u2705 \u0634\u064a\u062a 10: NO. | EN | AR | Image\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('products');\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 = parseGViz(text);\r\n\r\n    container.innerHTML = \"\";\r\n\r\n    (json.table.rows || []).forEach((row, idx) => {\r\n      if (!row || !row.c) return;\r\n\r\n      const enName   = row.c[1]?.v || '';   \/\/ EN\r\n      const arName   = row.c[2]?.v || '';   \/\/ AR\r\n      const imageURL = row.c[3]?.v || '';   \/\/ Image\r\n\r\n      \/\/ \u062a\u062e\u0637\u064a \u0635\u0641 \u064a\u062d\u062a\u0645\u0644 \u0623\u0646\u0647 \u0639\u0646\u0627\u0648\u064a\u0646\r\n      if ((enName || '').toLowerCase() === 'en' && (arName || '').toLowerCase() === 'ar') return;\r\n      if (!enName && !arName) return;\r\n\r\n      const finalImageURL = fixDriveURL(imageURL);\r\n      const productLabel  = `${enName}${arName ? ' (' + arName + ')' : ''}`.replace(\/\"\/g, '\\\"');\r\n      const checkboxId    = `prod-${idx}`;\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:240px;\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=\"product-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=\"${enName}\" \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;\">${enName}<\/h3>\r\n          <p style=\"margin:0 0 6px;color:#555;font-size:12px; text-align:right;\">${arName}<\/p>\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\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-3771","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/white-hy.com\/en\/wp-json\/wp\/v2\/pages\/3771","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=3771"}],"version-history":[{"count":4,"href":"https:\/\/white-hy.com\/en\/wp-json\/wp\/v2\/pages\/3771\/revisions"}],"predecessor-version":[{"id":3781,"href":"https:\/\/white-hy.com\/en\/wp-json\/wp\/v2\/pages\/3771\/revisions\/3781"}],"wp:attachment":[{"href":"https:\/\/white-hy.com\/en\/wp-json\/wp\/v2\/media?parent=3771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}