{"id":40,"date":"2026-03-02T19:22:01","date_gmt":"2026-03-02T19:22:01","guid":{"rendered":"https:\/\/www.giefrancilin.fr\/?page_id=40"},"modified":"2026-03-02T19:41:03","modified_gmt":"2026-03-02T19:41:03","slug":"emargement-francilin-formation","status":"publish","type":"page","link":"https:\/\/www.giefrancilin.fr\/index.php\/emargement-francilin-formation\/","title":{"rendered":"emargement-francilin-formation"},"content":{"rendered":"\n<div style=\"display:flex; justify-content:center; margin:20px 0;\">\n  <div id=\"sas-container\" style=\"width:100%; max-width:900px; min-height:600px; background:#fff; border-radius:12px; box-shadow:0 4px 20px rgba(0,0,0,0.1); overflow:hidden;\">\n    <p style=\"text-align:center; padding:20px; font-family:sans-serif;\">V\u00e9rification en cours\u2026<\/p>\n  <\/div>\n<\/div>\n\n<script>\n(function(){\n  function qp(name){ return new URLSearchParams(window.location.search).get(name) || ''; }\n  const idpro = qp('IDPRO');\n  const idcours = qp('IDCOURS');\n  const debugPage = qp('DEBUG') === '1';\n  const ctn = document.getElementById('sas-container');\n\n  if(!idpro || !idcours){\n    ctn.innerHTML = \"<p style='color:red;text-align:center;'>\u274c Param\u00e8tres manquants (IDPRO \/ IDCOURS)<\/p>\";\n    return;\n  }\n\n  const ctrl = new AbortController();\n  const timer = setTimeout(() => ctrl.abort(), 12000);\n\n  \/\/ IMPORTANT : wp est sous index.php\n  const apiUrl = \"\/index.php\/wp-json\/sas\/v1\/check?IDPRO=\" + encodeURIComponent(idpro)\n               + \"&IDCOURS=\" + encodeURIComponent(idcours)\n               + (debugPage ? \"&DEBUG=1\" : \"\");\n\n  ctn.innerHTML = \"<p style='text-align:center; padding:20px; font-family:sans-serif;'>V\u00e9rification en cours\u2026<\/p>\";\n\n  fetch(apiUrl, {\n    signal: ctrl.signal,\n    credentials: \"same-origin\",\n    headers: { \"Accept\": \"application\/json\" }\n  })\n  .then(async (r) => {\n    clearTimeout(timer);\n    if (!r.ok) {\n      const txt = await r.text().catch(() => \"\");\n      throw new Error(\"HTTP \" + r.status + (txt ? \" \u2014 \" + txt : \"\"));\n    }\n    const ct = r.headers.get(\"Content-Type\") || \"\";\n    if (ct.includes(\"application\/json\")) return r.json();\n    const txt = await r.text();\n    throw new Error(\"R\u00e9ponse non JSON : \" + (txt || \"(vide)\"));\n  })\n  .then((data) => {\n    if (data && data.redirect) {\n      const time = data.time || \"ON\";\n      ctn.innerHTML = \"\";\n\n      const iframe = document.createElement(\"iframe\");\n      iframe.src = data.redirect + \"&TIME=\" + encodeURIComponent(time);\n      iframe.id = \"fillout-iframe\";\n      iframe.style.width = \"100%\";\n      iframe.style.minHeight = \"600px\";\n      iframe.style.border = \"0\";\n      iframe.style.overflow = \"hidden\";\n      ctn.appendChild(iframe);\n\n      window.addEventListener(\"message\", function(event){\n        if(event.data && event.data.type === \"embed-height\"){\n          const iframeEl = document.getElementById(\"fillout-iframe\");\n          if(iframeEl && event.data.height){\n            iframeEl.style.height = event.data.height + \"px\";\n          }\n        }\n      });\n\n    } else if (data && data.error){\n      ctn.innerHTML = \"<p style='color:red;text-align:center;'>\u274c Erreur: \" + (data.error || \"Ind\u00e9termin\u00e9e\") + \"<\/p>\";\n    } else {\n      ctn.innerHTML = \"<p style='color:red;text-align:center;'>\u274c R\u00e9ponse inattendue<\/p>\";\n      console.error(\"R\u00e9ponse inattendue:\", data);\n    }\n  })\n  .catch((e) => {\n    ctn.innerHTML = \"<div style='padding:16px; font-family:sans-serif;'>\"\n                  + \"<p style='color:red; text-align:center;'>\u274c Erreur: \" + (e && e.message ? e.message : e) + \"<\/p>\"\n                  + (debugPage ? \"<p style='font-size:12px; text-align:center;'>URL API: \" + apiUrl + \"<\/p>\" : \"\")\n                  + \"<\/div>\";\n    console.error(\"SAS fetch error:\", e);\n    clearTimeout(timer);\n  });\n})();\n<\/script>\n\n","protected":false},"excerpt":{"rendered":"<p>V\u00e9rification en cours\u2026 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-40","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.giefrancilin.fr\/index.php\/wp-json\/wp\/v2\/pages\/40","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.giefrancilin.fr\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.giefrancilin.fr\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.giefrancilin.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.giefrancilin.fr\/index.php\/wp-json\/wp\/v2\/comments?post=40"}],"version-history":[{"count":2,"href":"https:\/\/www.giefrancilin.fr\/index.php\/wp-json\/wp\/v2\/pages\/40\/revisions"}],"predecessor-version":[{"id":43,"href":"https:\/\/www.giefrancilin.fr\/index.php\/wp-json\/wp\/v2\/pages\/40\/revisions\/43"}],"wp:attachment":[{"href":"https:\/\/www.giefrancilin.fr\/index.php\/wp-json\/wp\/v2\/media?parent=40"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}