{"id":1756,"date":"2025-11-04T14:24:40","date_gmt":"2025-11-04T11:24:40","guid":{"rendered":"https:\/\/urfaeo.kolaysoft.com.tr\/?page_id=1756"},"modified":"2025-11-28T13:46:13","modified_gmt":"2025-11-28T10:46:13","slug":"nobet-karti-bastir","status":"publish","type":"page","link":"https:\/\/sanliurfaeo.birodam.org.tr\/index.php\/nobet-karti-bastir\/","title":{"rendered":"N\u00f6bet Kart\u0131 Bast\u0131r"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"1756\" class=\"elementor elementor-1756\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-f4bac94 e-flex e-con-boxed wpr-particle-no wpr-jarallax-no wpr-parallax-no wpr-sticky-section-no wpr-equal-height-no e-con e-parent\" data-id=\"f4bac94\" 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-8308824 elementor-widget elementor-widget-text-editor\" data-id=\"8308824\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t\n\t<form id=\"eczane-pdf-form\" style=\"margin-bottom: 1em;\">\n\t\t<label for=\"bolge\">B\u00f6lge:<\/label>\n\t\t<select id=\"bolge\">\n\t\t\t<option value=\"akcakale\">AK\u00c7AKALE<\/option><option value=\"birecik\">B\u0130REC\u0130K<\/option><option value=\"bozova\">BOZOVA<\/option><option value=\"ceylanpinar\">CEYLANPINAR<\/option><option value=\"halfeti\">HALFET\u0130<\/option><option value=\"harran\">HARRAN<\/option><option value=\"hilvan\">H\u0130LVAN<\/option><option value=\"sanliurfa-merkez\">\u015eANLIURFA MERKEZ<\/option><option value=\"siverek\">S\u0130VEREK<\/option><option value=\"suruc\">SURU\u00c7<\/option><option value=\"viransehir\">V\u0130RAN\u015eEH\u0130R<\/option>\t\t<\/select>\n\n        <label for=\"tarih-baslangic\">Tarih:<\/label>\n        <input type=\"date\" id=\"tarih-baslangic\" value=\"2026-04-17\" \/>\n\n        <button type=\"button\" id=\"generate-pdf\">PDF \u0130ndir<\/button>\n        <button type=\"button\" id=\"show-pdf\">PDF G\u00f6ster<\/button>\n    <\/form>\n\n    <!-- PDF Modal -->\n    <div id=\"pdfModal\" class=\"pdf-modal\" style=\"\n        display:none;\n        position:fixed;\n        top:0; left:0; right:0; bottom:0;\n        background:rgba(0,0,0,0.7);\n        z-index:9999;\n        justify-content:center;\n        align-items:center;\n    \">\n        <div style=\"width:80%; height:90%; background:white; position:relative; border-radius:8px; overflow:hidden;\">\n            <button onclick=\"closePdfModal()\"\n                style=\"position:absolute; top:10px; right:10px; z-index:9999;\n                padding:6px 12px; background:#cc0000; color:white; border:none;\n                cursor:pointer; border-radius:4px;\">\n                Kapat\n            <\/button>\n\n            <iframe id=\"pdfFrame\" style=\"width:100%; height:100%; border:none;\"><\/iframe>\n        <\/div>\n    <\/div>\n\n    <script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/pdfmake\/0.2.7\/pdfmake.min.js\"><\/script>\n        <script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/pdfmake\/0.2.7\/vfs_fonts.js\"><\/script>\n\n        <script>\n        \/\/ Modal Fonksiyonlar\u0131\n        function openPdfModal(blobUrl) {\n                document.getElementById('pdfFrame').src = blobUrl;\n                document.getElementById('pdfModal').style.display = 'flex';\n        }\n\n        function closePdfModal() {\n                document.getElementById('pdfModal').style.display = 'none';\n                document.getElementById('pdfFrame').src = \"\";\n        }\n\n        \/\/ PDF olu\u015fturma mant\u0131\u011f\u0131n\u0131 tek fonksiyonda toplad\u0131k\n\t\tasync function createPdfDefinition() {\n\t\n\t\t\tconst bolge = document.getElementById('bolge').value;\n\t\t\tconst bolgeAd = document.getElementById('bolge').options[document.getElementById('bolge').selectedIndex].textContent;\n\t\t\tconst baslangicInput = document.getElementById('tarih-baslangic').value;\n\n\t\t\tif (!baslangicInput) {\n\t\t\t  alert(\"Ge\u00e7erli bir tarih girin.\");\n\t\t\t  return null;\n\t\t\t}\n\n\t\t\tconst baslangicDate = new Date(baslangicInput);\n\t\t\tconst bitisDate = baslangicDate;\n\n\t\t\tconst baslangic = baslangicDate.toISOString().split('T')[0];\n\t\t\tconst bitis = bitisDate.toISOString().split('T')[0];\n\n\t\t\tconst username = \"nobet_karti\";\n\t\t\tconst password = \"N2KS S3Qi b53z MH9k xkGj ecQG\";\n\n\t\t\tconst res = await fetch(`\/wp-json\/eczaneler\/v1\/listele-aralik?bolge=${bolge}&baslangic=${baslangic}&bitis=${bitis}`, {\n\t\t\t  headers: {\n\t\t\t\t\t'Authorization': 'Basic ' + btoa(username + ':' + password),\n\t\t\t\t\t'Content-Type': 'application\/json',\n\t\t\t  }\n\t\t\t});\n\n\t\t\tconst data = await res.json();\n\n\t\t\tif (!Array.isArray(data) || data.length === 0) {\n\t\t\t  alert(\"Girdi\u011finiz tarih aral\u0131\u011f\u0131nda bir n\u00f6bet kart\u0131 mevcut de\u011fildir.\");\n\t\t\t  return null;\n\t\t\t}\n\n\t\t\tconst grouped = {};\n\t\t\tdata.forEach(item => {\n\t\t\t  if (!grouped[item.tarih]) grouped[item.tarih] = [];\n\t\t\t  grouped[item.tarih].push(item);\n\t\t\t});\n\n\t\t\tconst sortedDates = Object.keys(grouped).sort((a, b) => parseInt(a) - parseInt(b));\n\n\t\t\tconst content = [];\n\n\t\t\tsortedDates.forEach(timestampStr => {\n\t\t\t  const eczaneler = grouped[timestampStr];\n\t\t\t  const tarihObj = new Date(parseInt(timestampStr, 10) * 1000);\n\t\t\t  const gunAdi = tarihObj.toLocaleDateString('tr-TR', { weekday: 'long' });\n\t\t\t  const formattedTarih = tarihObj.toLocaleDateString('tr-TR', { day: 'numeric', month: 'long', year: 'numeric' });\n\n\t\t\t  content.push(\n\t\t\t\t\t{ text: bolgeAd.toUpperCase(), style: 'header', alignment: 'center', margin: [0, 10, 0, 5] },\n\t\t\t\t\t{ text: `${formattedTarih} ${gunAdi} N\u00d6BET\u00c7\u0130 ECZANELER`, style: 'subheader', alignment: 'center', margin: [0, 0, 0, 10] }\n\t\t\t  );\n\n\t\t\t  const tableBody = [\n\t\t\t\t  [\n\t\t\t\t\t  { text: 'Eczane Ad\u0131', alignment: 'center' },\n\t\t\t\t\t  { text: 'Adres', alignment: 'center' },\n\t\t\t\t\t  { text: 'Telefon', alignment: 'center' },\n\t\t\t\t\t  { text: 'Konum QR', alignment: 'center' }\n\t\t\t\t  ]\n\t\t\t  ];\n\t\t\t  eczaneler.forEach(e => {\n\t\t\t\tconst mapsLink = e.haritaLinki || 'https:\/\/www.google.com\/maps';\n\t\t\t\ttableBody.push([\n\t\t\t\t  { stack: [{ text: e.title, alignment: 'center' }], margin: [0,5,0,5] },\n\t\t\t\t  { stack: [{ text: e.adres, alignment: 'center', fontSize:10 }], margin: [0,5,0,5] },\n\t\t\t\t  { stack: [{ text: e.telefon, alignment: 'center' }], margin: [0,5,0,5] },\n\t\t\t\t  { qr: mapsLink, fit: 60, alignment: 'center', margin: [0,5,0,5] }\n\t\t\t\t]);\n\t\t\t  });\n\n\t\t\t  content.push({\n\t\t\t\t\ttable: { widths: [120, '*', 100, 90], body: tableBody },\n\t\t\t\t\tlayout: 'lightHorizontalLines',\n\t\t\t\t\tmargin: [0, 0, 0, 15],\n\t\t\t\t\theights: function(row) { return 75; } \/\/ her sat\u0131r 75px y\u00fcksek \u2192 dikey ortalama\n\t\t\t  });\n\n\t\t\t  content.push(\n\t\t\t\t\t{ text: '* NOT : Yukar\u0131da ismi olan eczanelerimiz; yar\u0131n sabah saat 08:30\\'a kadar n\u00f6bet\u00e7ilerdir.', style: 'note', alignment: 'center', margin: [0,5,0,5] },\n\t\t\t\t\t{ text: 'TEB 27. B\u00d6LGE \u015eANLIURFA ECZACI ODASI', style: 'note', alignment: 'center', margin: [0,0,0,20] }\n\t\t\t  );\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t  definition: {\n\t\t\t\t     pageSize: 'A4',\n                     pageOrientation: 'portrait',\n                     pageMargins: [40, 20, 40, 20],\n\n\t\t\t\t\tcontent: content,\n\t\t\t\t\tstyles: {\n\t\t\t\t\t  header: { fontSize: 16, bold: true },\n\t\t\t\t\t  subheader: { fontSize: 10 },\n\t\t\t\t\t  note: { fontSize: 9, italics: true }\n\t\t\t\t\t}\n\t\t\t  },\n\t\t\t  fileName: `nobetci-eczaneler-${bolge}-${baslangic}_to_${bitis}.pdf`\n\t\t\t};\n\t\t}\n\n        \/\/ PDF \u0130ndir\n        document.getElementById('generate-pdf').addEventListener('click', async function () {\n                const pdf = await createPdfDefinition();\n                if (!pdf) return;\n                pdfMake.createPdf(pdf.definition).download(pdf.fileName);\n        });\n\n        \/\/ PDF Modalda G\u00f6ster\n        document.getElementById('show-pdf').addEventListener('click', async function () {\n                const pdf = await createPdfDefinition();\n\t\t\t\n                if (!pdf) return;\n\n                pdfMake.createPdf(pdf.definition).getBlob(function (blob) {\n                        const blobUrl = URL.createObjectURL(blob);\n                        openPdfModal(blobUrl);\n                });\n        });\n\n        <\/script>\n\n        \t\t\t\t\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-900a169 e-flex e-con-boxed wpr-particle-no wpr-jarallax-no wpr-parallax-no wpr-sticky-section-no wpr-equal-height-no e-con e-parent\" data-id=\"900a169\" 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-446c703 elementor-widget elementor-widget-spacer\" data-id=\"446c703\" data-element_type=\"widget\" data-widget_type=\"spacer.default\">\n\t\t\t\t\t\t\t<div class=\"elementor-spacer\">\n\t\t\t<div class=\"elementor-spacer-inner\"><\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"","protected":false},"author":5,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"elementor_canvas","meta":{"footnotes":""},"class_list":["post-1756","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>N\u00f6bet Kart\u0131 Bast\u0131r - \u015eanl\u0131urfa Eczac\u0131 Odas\u0131<\/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:\/\/sanliurfaeo.birodam.org.tr\/index.php\/nobet-karti-bastir\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"N\u00f6bet Kart\u0131 Bast\u0131r - \u015eanl\u0131urfa Eczac\u0131 Odas\u0131\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sanliurfaeo.birodam.org.tr\/index.php\/nobet-karti-bastir\/\" \/>\n<meta property=\"og:site_name\" content=\"\u015eanl\u0131urfa Eczac\u0131 Odas\u0131\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-28T10:46:13+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/sanliurfaeo.birodam.org.tr\\\/index.php\\\/nobet-karti-bastir\\\/\",\"url\":\"https:\\\/\\\/sanliurfaeo.birodam.org.tr\\\/index.php\\\/nobet-karti-bastir\\\/\",\"name\":\"N\u00f6bet Kart\u0131 Bast\u0131r - \u015eanl\u0131urfa Eczac\u0131 Odas\u0131\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sanliurfaeo.birodam.org.tr\\\/#website\"},\"datePublished\":\"2025-11-04T11:24:40+00:00\",\"dateModified\":\"2025-11-28T10:46:13+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/sanliurfaeo.birodam.org.tr\\\/index.php\\\/nobet-karti-bastir\\\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/sanliurfaeo.birodam.org.tr\\\/index.php\\\/nobet-karti-bastir\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/sanliurfaeo.birodam.org.tr\\\/index.php\\\/nobet-karti-bastir\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Anasayfa\",\"item\":\"https:\\\/\\\/sanliurfaeo.birodam.org.tr\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"N\u00f6bet Kart\u0131 Bast\u0131r\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/sanliurfaeo.birodam.org.tr\\\/#website\",\"url\":\"https:\\\/\\\/sanliurfaeo.birodam.org.tr\\\/\",\"name\":\"\u015eanl\u0131urfa Eczac\u0131 Odas\u0131\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/sanliurfaeo.birodam.org.tr\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/sanliurfaeo.birodam.org.tr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"tr\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/sanliurfaeo.birodam.org.tr\\\/#organization\",\"name\":\"\u015eanl\u0131urfa Eczac\u0131 Odas\u0131\",\"url\":\"https:\\\/\\\/sanliurfaeo.birodam.org.tr\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\\\/\\\/sanliurfaeo.birodam.org.tr\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/sanliurfaeo.birodam.org.tr\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/22022021211638-19929-73208.png\",\"contentUrl\":\"https:\\\/\\\/sanliurfaeo.birodam.org.tr\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/22022021211638-19929-73208.png\",\"width\":635,\"height\":635,\"caption\":\"\u015eanl\u0131urfa Eczac\u0131 Odas\u0131\"},\"image\":{\"@id\":\"https:\\\/\\\/sanliurfaeo.birodam.org.tr\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"N\u00f6bet Kart\u0131 Bast\u0131r - \u015eanl\u0131urfa Eczac\u0131 Odas\u0131","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:\/\/sanliurfaeo.birodam.org.tr\/index.php\/nobet-karti-bastir\/","og_locale":"tr_TR","og_type":"article","og_title":"N\u00f6bet Kart\u0131 Bast\u0131r - \u015eanl\u0131urfa Eczac\u0131 Odas\u0131","og_url":"https:\/\/sanliurfaeo.birodam.org.tr\/index.php\/nobet-karti-bastir\/","og_site_name":"\u015eanl\u0131urfa Eczac\u0131 Odas\u0131","article_modified_time":"2025-11-28T10:46:13+00:00","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/sanliurfaeo.birodam.org.tr\/index.php\/nobet-karti-bastir\/","url":"https:\/\/sanliurfaeo.birodam.org.tr\/index.php\/nobet-karti-bastir\/","name":"N\u00f6bet Kart\u0131 Bast\u0131r - \u015eanl\u0131urfa Eczac\u0131 Odas\u0131","isPartOf":{"@id":"https:\/\/sanliurfaeo.birodam.org.tr\/#website"},"datePublished":"2025-11-04T11:24:40+00:00","dateModified":"2025-11-28T10:46:13+00:00","breadcrumb":{"@id":"https:\/\/sanliurfaeo.birodam.org.tr\/index.php\/nobet-karti-bastir\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sanliurfaeo.birodam.org.tr\/index.php\/nobet-karti-bastir\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/sanliurfaeo.birodam.org.tr\/index.php\/nobet-karti-bastir\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Anasayfa","item":"https:\/\/sanliurfaeo.birodam.org.tr\/"},{"@type":"ListItem","position":2,"name":"N\u00f6bet Kart\u0131 Bast\u0131r"}]},{"@type":"WebSite","@id":"https:\/\/sanliurfaeo.birodam.org.tr\/#website","url":"https:\/\/sanliurfaeo.birodam.org.tr\/","name":"\u015eanl\u0131urfa Eczac\u0131 Odas\u0131","description":"","publisher":{"@id":"https:\/\/sanliurfaeo.birodam.org.tr\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sanliurfaeo.birodam.org.tr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"tr"},{"@type":"Organization","@id":"https:\/\/sanliurfaeo.birodam.org.tr\/#organization","name":"\u015eanl\u0131urfa Eczac\u0131 Odas\u0131","url":"https:\/\/sanliurfaeo.birodam.org.tr\/","logo":{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/sanliurfaeo.birodam.org.tr\/#\/schema\/logo\/image\/","url":"https:\/\/sanliurfaeo.birodam.org.tr\/wp-content\/uploads\/2025\/09\/22022021211638-19929-73208.png","contentUrl":"https:\/\/sanliurfaeo.birodam.org.tr\/wp-content\/uploads\/2025\/09\/22022021211638-19929-73208.png","width":635,"height":635,"caption":"\u015eanl\u0131urfa Eczac\u0131 Odas\u0131"},"image":{"@id":"https:\/\/sanliurfaeo.birodam.org.tr\/#\/schema\/logo\/image\/"}}]}},"acf":[],"_links":{"self":[{"href":"https:\/\/sanliurfaeo.birodam.org.tr\/index.php\/wp-json\/wp\/v2\/pages\/1756","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sanliurfaeo.birodam.org.tr\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sanliurfaeo.birodam.org.tr\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sanliurfaeo.birodam.org.tr\/index.php\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/sanliurfaeo.birodam.org.tr\/index.php\/wp-json\/wp\/v2\/comments?post=1756"}],"version-history":[{"count":71,"href":"https:\/\/sanliurfaeo.birodam.org.tr\/index.php\/wp-json\/wp\/v2\/pages\/1756\/revisions"}],"predecessor-version":[{"id":4816,"href":"https:\/\/sanliurfaeo.birodam.org.tr\/index.php\/wp-json\/wp\/v2\/pages\/1756\/revisions\/4816"}],"wp:attachment":[{"href":"https:\/\/sanliurfaeo.birodam.org.tr\/index.php\/wp-json\/wp\/v2\/media?parent=1756"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}