Init Git Prod Mars 2026

This commit is contained in:
Oleg Barykin committed 2026-03-05 10:25:39 +01:00
commit d81efe93b1
362 files changed
+86627

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
<?php
declare(strict_types=1);
header('Content-Type: application/json');
// Mets ta clé directement ici pour tester
$API_KEY = 'cee5df47-3c1a-4885-a5df-473c1aa885e2';
$siret = preg_replace('/\D/', '', $_GET['siret'] ?? '');
if (strlen($siret) !== 14) {
echo json_encode(['exists' => false, 'http' => 0, 'why' => 'bad_length']);
exit;
}
$url = "https://api.insee.fr/api-sirene/3.11/siret/$siret";
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ["X-INSEE-Api-Key-Integration: $API_KEY", "Accept: application/json"],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
]);
curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo json_encode(['exists' => ($code === 200), 'http' => $code]);
+4229
View File
File diff suppressed because it is too large. Load diff
+61
View File
@@ -0,0 +1,61 @@
(function(){
const ENDPOINT = '/public/contact_admin.php';
function openContactModal(lang){
const url = ENDPOINT + '?modal=1' + (lang ? '&lang='+encodeURIComponent(lang) : '');
fetch(url, { headers: { 'X-Requested-With': 'XMLHttpRequest' } })
.then(r => r.text())
.then(html => {
// On insère TOUT le HTML renvoyé (overlay + <style>)
const wrap = document.createElement('div');
wrap.innerHTML = html;
while (wrap.firstChild) document.body.appendChild(wrap.firstChild);
})
.catch(() => alert('Erreur de chargement du formulaire'));
}
// Intercepte les clics sur le lien (classe ou data-attr)
document.addEventListener('click', function(e){
const a = e.target.closest('a.contact-admin-link, [data-contact-admin]');
if (!a) return;
// si l'utilisateur ouvre au clavier/milieu => laisse le comportement natif
if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || a.target === '_blank') return;
e.preventDefault();
openContactModal(a.getAttribute('data-lang') || '');
});
// Intercepte l’envoi du formulaire dans la popup
document.addEventListener('submit', function(e){
const form = e.target.closest('#contact-admin-form');
if (!form) return;
e.preventDefault();
const btn = form.querySelector('.caf-btn');
const fb = form.querySelector('.caf-feedback');
const lblSend = btn?.getAttribute('data-label-send') || 'Envoyer';
const lblSending = btn?.getAttribute('data-label-sending') || 'Envoi...';
if (btn) { btn.disabled = true; btn.textContent = lblSending; }
const fd = new FormData(form);
fetch(ENDPOINT, { method:'POST', headers:{'X-Requested-With':'XMLHttpRequest'}, body: fd })
.then(r => r.json())
.then(j => {
fb.textContent = j.msg || '';
fb.style.color = j.ok ? 'green' : 'crimson';
if (j.ok) {
form.reset();
setTimeout(() => document.querySelector('.caf-overlay')?.remove(), 1200);
}
})
.catch(() => { fb.textContent = 'Network error'; fb.style.color = 'crimson'; })
.finally(() => { if (btn) { btn.disabled = false; btn.textContent = lblSend; } });
});
// Fermer la popup (clic sur fond ou bouton ×)
document.addEventListener('click', function(e){
if (e.target.classList?.contains('caf-overlay') || e.target.classList?.contains('caf-close')) {
document.querySelector('.caf-overlay')?.remove();
}
});
})();
+1
View File
@@ -0,0 +1 @@
#cc-main{background:transparent;color:var(--cc-primary-color);font-family:var(--cc-font-family);font-size:16px;font-weight:400;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:1.15;position:relative;text-rendering:optimizeLegibility;-webkit-text-size-adjust:100%;position:fixed;z-index:var(--cc-z-index)}#cc-main :after,#cc-main :before,#cc-main a,#cc-main button,#cc-main div,#cc-main h2,#cc-main input,#cc-main p,#cc-main span{all:unset;box-sizing:border-box}#cc-main .pm__badge,#cc-main button{all:initial;box-sizing:border-box;color:unset;visibility:unset}#cc-main .pm__badge,#cc-main a,#cc-main button,#cc-main input{-webkit-appearance:none;appearance:none;cursor:pointer;font-family:inherit;font-size:100%;line-height:normal;margin:0;outline:revert;outline-offset:2px;overflow:hidden}#cc-main table,#cc-main tbody,#cc-main td,#cc-main th,#cc-main thead,#cc-main tr{all:revert;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit}:root{--cc-font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--cc-modal-border-radius:.5rem;--cc-btn-border-radius:.4rem;--cc-modal-transition-duration:.25s;--cc-link-color:var(--cc-btn-primary-bg);--cc-modal-margin:1rem;--cc-z-index:2147483647;--cc-bg:#fff;--cc-primary-color:#2c2f31;--cc-secondary-color:#5e6266;--cc-btn-primary-bg:#30363c;--cc-btn-primary-color:#fff;--cc-btn-primary-border-color:var(--cc-btn-primary-bg);--cc-btn-primary-hover-bg:#000;--cc-btn-primary-hover-color:#fff;--cc-btn-primary-hover-border-color:var(--cc-btn-primary-hover-bg);--cc-btn-secondary-bg:#eaeff2;--cc-btn-secondary-color:var(--cc-primary-color);--cc-btn-secondary-border-color:var(--cc-btn-secondary-bg);--cc-btn-secondary-hover-bg:#d4dae0;--cc-btn-secondary-hover-color:#000;--cc-btn-secondary-hover-border-color:#d4dae0;--cc-separator-border-color:#f0f4f7;--cc-toggle-on-bg:var(--cc-btn-primary-bg);--cc-toggle-off-bg:#667481;--cc-toggle-on-knob-bg:#fff;--cc-toggle-off-knob-bg:var(--cc-toggle-on-knob-bg);--cc-toggle-enabled-icon-color:var(--cc-bg);--cc-toggle-disabled-icon-color:var(--cc-bg);--cc-toggle-readonly-bg:#d5dee2;--cc-toggle-readonly-knob-bg:#fff;--cc-toggle-readonly-knob-icon-color:var(--cc-toggle-readonly-bg);--cc-section-category-border:var(--cc-cookie-category-block-bg);--cc-cookie-category-block-bg:#f0f4f7;--cc-cookie-category-block-border:#f0f4f7;--cc-cookie-category-block-hover-bg:#e9eff4;--cc-cookie-category-block-hover-border:#e9eff4;--cc-cookie-category-expanded-block-bg:transparent;--cc-cookie-category-expanded-block-hover-bg:#dee4e9;--cc-overlay-bg:rgba(0,0,0,.65);--cc-webkit-scrollbar-bg:var(--cc-section-category-border);--cc-webkit-scrollbar-hover-bg:var(--cc-btn-primary-hover-bg);--cc-footer-bg:var(--cc-btn-secondary-bg);--cc-footer-color:var(--cc-secondary-color);--cc-footer-border-color:#e4eaed;--cc-pm-toggle-border-radius:4em}#cc-main.cc--rtl{direction:rtl}#cc-main .cm__title,#cc-main a,#cc-main b,#cc-main em,#cc-main strong{font-weight:600}#cc-main button>span{pointer-events:none}#cc-main .cc__link,#cc-main a{background-image:linear-gradient(currentColor,currentColor);background-position:0 100%;background-repeat:no-repeat;background-size:0 1px;font-weight:600;position:relative;transition:background-size .25s,color .25s ease}#cc-main .cc__link:hover,#cc-main a:hover{background-size:100% 1px;color:var(--cc-primary-color)}#cc-main .cc__link{color:var(--cc-link-color)}#cc-main .cm__desc,#cc-main .pm__body{overscroll-behavior:auto contain;scrollbar-width:thin}@media screen and (min-width:640px){#cc-main ::-webkit-scrollbar,#cc-main ::-webkit-scrollbar-thumb,#cc-main ::-webkit-scrollbar-track{all:revert}#cc-main ::-webkit-scrollbar-thumb{-webkit-background-clip:padding-box;background-clip:padding-box;background:var(--cc-toggle-readonly-bg);border:.25rem solid var(--cc-bg);border-radius:1rem}#cc-main ::-webkit-scrollbar-thumb:hover{background:var(--cc-toggle-off-bg)}#cc-main ::-webkit-scrollbar{background:transparent;width:12px}}html.disable--interaction.show--consent,html.disable--interaction.show--consent body{height:auto!important;overflow:hidden!important}@media (prefers-reduced-motion){#cc-main{--cc-modal-transition-duration:0s}}.cc--darkmode{--cc-bg:#161a1c;--cc-primary-color:#ebf3f6;--cc-secondary-color:#aebbc5;--cc-btn-primary-bg:#c2d0e0;--cc-btn-primary-color:var(--cc-bg);--cc-btn-primary-border-color:var(--cc-btn-primary-bg);--cc-btn-primary-hover-bg:#98a7b6;--cc-btn-primary-hover-color:#000;--cc-btn-primary-hover-border-color:var(--cc-btn-primary-hover-bg);--cc-btn-secondary-bg:#242c31;--cc-btn-secondary-color:var(--cc-primary-color);--cc-btn-secondary-border-color:var(--cc-btn-secondary-bg);--cc-btn-secondary-hover-bg:#353d43;--cc-btn-secondary-hover-color:#fff;--cc-btn-secondary-hover-border-color:var(--cc-btn-secondary-hover-bg);--cc-separator-border-color:#222a30;--cc-toggle-on-bg:var(--cc-btn-primary-bg);--cc-toggle-off-bg:#525f6Line truncated
+7
View File
@@ -0,0 +1,7 @@
/*!
* CookieConsent 3.0.1
* https://github.com/orestbida/cookieconsent
* Author Orest Bida
* Released under the MIT License
*/
var e,t;e=this,t=function(e){'use strict';const t='opt-in',o='opt-out',n='show--consent',s='show--preferences',a='disable--interaction',c='data-category',r='div',i='button',l='aria-hidden',d='btn-group',f='click',_='data-role',u='consentModal',p='preferencesModal';class g{constructor(){this.t={mode:t,revision:0,autoShow:!0,lazyHtmlGeneration:!0,autoClearCookies:!0,manageScriptTags:!0,hideFromBots:!0,cookie:{name:'cc_cookie',expiresAfterDays:182,domain:'',path:'/',sameSite:'Lax'}},this.o={i:{},l:'',_:{},u:{},p:{},m:[],v:!1,h:null,C:null,S:null,M:'',T:!0,D:!1,k:!1,A:!1,N:!1,H:[],V:!1,j:!0,I:[],L:!1,F:'',P:!1,O:[],R:[],B:[],G:[],J:!1,U:!1,$:!1,q:[],K:[],W:[],X:{},Y:{},Z:{},ee:{},te:{},oe:[]},this.ne={se:{},ae:{}},this.ce={},this.re={ie:'cc:onFirstConsent',le:'cc:onConsent',de:'cc:onChange',fe:'cc:onModalShow',_e:'cc:onModalHide',ue:'cc:onModalReady'}}}const m=new g,b=(e,t)=>e.indexOf(t),v=(e,t)=>-1!==b(e,t),y=e=>Array.isArray(e),h=e=>'string'==typeof e,C=e=>!!e&&'object'==typeof e&&!y(e),w=e=>'function'==typeof e,S=e=>Object.keys(e),x=e=>Array.from(new Set(e)),M=()=>document.activeElement,T=e=>e.preventDefault(),D=(e,t)=>e.querySelectorAll(t),k=e=>e.dispatchEvent(new Event('change')),E=e=>{const t=document.createElement(e);return e===i&&(t.type=e),t},A=(e,t,o)=>e.setAttribute(t,o),N=(e,t,o)=>{e.removeAttribute(o?'data-'+t:t)},H=(e,t,o)=>e.getAttribute(o?'data-'+t:t),V=(e,t)=>e.appendChild(t),j=(e,t)=>e.classList.add(t),I=(e,t)=>j(e,'cm__'+t),L=(e,t)=>j(e,'pm__'+t),F=(e,t)=>e.classList.remove(t),P=e=>{if('object'!=typeof e)return e;if(e instanceof Date)return new Date(e.getTime());let t=Array.isArray(e)?[]:{};for(let o in e){let n=e[o];t[o]=P(n)}return t},O=()=>{const e={},{O:t,X:o,Y:n}=m.o;for(const s of t)e[s]=J(n[s],S(o[s]));return e},R=(e,t)=>dispatchEvent(new CustomEvent(e,{detail:t})),B=(e,t,o,n)=>{e.addEventListener(t,o),n&&m.o.m.push({pe:e,ge:t,me:o})},G=()=>{const e=m.t.cookie.expiresAfterDays;return w(e)?e(m.o.F):e},J=(e,t)=>{const o=e||[],n=t||[];return o.filter((e=>!v(n,e))).concat(n.filter((e=>!v(o,e))))},U=e=>{m.o.R=x(e),m.o.F=(()=>{let e='custom';const{R:t,O:o,B:n}=m.o,s=t.length;return s===o.length?e='all':s===n.length&&(e='necessary'),e})()},$=(e,t,o,n)=>{const s='accept-',{show:a,showPreferences:c,hide:r,hidePreferences:i,acceptCategory:l}=t,d=e||document,_=e=>D(d,`[data-cc="${e}"]`),u=(e,t)=>{T(e),l(t),i(),r()},p=_('show-preferencesModal'),g=_('show-consentModal'),b=_(s+'all'),v=_(s+'necessary'),y=_(s+'custom'),h=m.t.lazyHtmlGeneration;for(const e of p)A(e,'aria-haspopup','dialog'),B(e,f,(e=>{T(e),c()})),h&&(B(e,'mouseenter',(e=>{T(e),m.o.N||o(t,n)}),!0),B(e,'focus',(()=>{m.o.N||o(t,n)})));for(let e of g)A(e,'aria-haspopup','dialog'),B(e,f,(e=>{T(e),a(!0)}),!0);for(let e of b)B(e,f,(e=>{u(e,'all')}),!0);for(let e of y)B(e,f,(e=>{u(e)}),!0);for(let e of v)B(e,f,(e=>{u(e,[])}),!0)},z=(e,t)=>{e&&(t&&(e.tabIndex=-1),e.focus(),t&&e.removeAttribute('tabindex'))},q=(e,t)=>{const o=n=>{n.target.removeEventListener('transitionend',o),'opacity'===n.propertyName&&'1'===getComputedStyle(e).opacity&&z((e=>1===e?m.ne.be:m.ne.ve)(t))};B(e,'transitionend',o)};let K;const Q=e=>{clearTimeout(K),e?j(m.ne.ye,a):K=setTimeout((()=>{F(m.ne.ye,a)}),500)},W=['M 19.5 4.5 L 4.5 19.5 M 4.5 4.501 L 19.5 19.5','M 3.572 13.406 L 8.281 18.115 L 20.428 5.885','M 21.999 6.94 L 11.639 17.18 L 2.001 6.82 '],X=(e=0,t=1.5)=>`<svg viewBox="0 0 24 24" stroke-width="${t}"><path d="${W[e]}"/></svg>`,Y=e=>{const t=m.ne,o=m.o;(e=>{const n=e===t.he,s=o.i.disablePageInteraction?t.ye:n?t.Ce:t.ye;B(s,'keydown',(t=>{if('Tab'!==t.key||!(n?o.k&&!o.A:o.A))return;const s=M(),a=n?o.q:o.K;0!==a.length&&(t.shiftKey?s!==a[0]&&e.contains(s)||(T(t),z(a[1])):s!==a[1]&&e.contains(s)||(T(t),z(a[0])))}),!0)})(e)},Z=['[href]',i,'input','details','[tabindex]'].map((e=>e+':not([tabindex="-1"])')).join(','),ee=e=>{const{o:t,ne:o}=m,n=(e,t)=>{const o=D(e,Z);t[0]=o[0],t[1]=o[o.length-1]};1===e&&t.D&&n(o.he,t.q),2===e&&t.N&&n(o.we,t.K)},te=(e,t,o)=>{const{de:n,le:s,ie:a,_e:c,ue:r,fe:i}=m.ce,l=m.re;if(t){const n={modalName:t};return e===l.fe?w(i)&&i(n):e===l._e?w(c)&&c(n):(n.modal=o,w(r)&&r(n)),R(e,n)}const d={cookie:m.o.p};e===l.ie?w(a)&&a(P(d)):e===l.le?w(s)&&s(P(d)):(d.changedCategories=m.o.I,d.changedServices=m.o.ee,w(n)&&n(P(d))),R(e,P(d))},oe=(e,t)=>{try{return e()}catch(e){return!t&&console.warn('CookieConsent:',e),!1}},ne=e=>{const{Y:t,ee:o,O:n,X:s,oe:a,p:r,I:i}=m.o;for(const e of n){const n=o[e]||t[e]||[];for(const o of n){const n=s[e][o];if(!n)continue;const{onAccept:a,onReject:c}=n;!n.Se&&v(t[e],o)?(n.Se=!0,w(a)&&a()):n.Se&&!v(t[e],o)&&(n.Se=!1,w(c)&&c())}}if(!m.t.manageScriptTags)return;const l=a,d=e||r.categories||[],f=(e,n)=>{if(n>=e.length)return;const s=a[n];if(s.xe)return f(e,n+1);const r=s.Me,l=s.Te,_=s.De,u=v(d,l),p=!!_&&v(t[l],_);if(!_&&!s.ke&&u||!_&&s.ke&&!u&&v(i,l)||_&&!s.ke&&p||_&&s.ke&&!p&&v(o[l]||[],_)){s.xe=!0;const t=H(r,'type',!0);N(r,'type',!!t),N(r,c);let o=H(r,'src',!0);o&&N(r,'src',!0);const a=E('script');a.textContent=r.innerHTMLine truncated
+162
View File
@@ -0,0 +1,162 @@
const $ = (s) => document.querySelector(s);
const debounce = (fn, d = 250) => {
let t;
return (...a) => {
clearTimeout(t);
t = setTimeout(() => fn(...a), d);
};
};
async function fetchSuggest(field, q) {
const url = `/?ajax=suggest&field=${encodeURIComponent(field)}&q=${encodeURIComponent(q)}`;
const res = await fetch(url, {
headers: { "X-Requested-With": "XMLHttpRequest" },
});
if (!res.ok) return [];
return res.json();
}
function bindSuggest(inputEl, listEl, field) {
const render = (items) => {
listEl.innerHTML = items.map((v) => `<li role="option">${v}</li>`).join("");
listEl.hidden = items.length === 0;
};
inputEl.addEventListener(
"input",
debounce(async (e) => {
const q = e.target.value.trim();
if (!q) {
listEl.hidden = true;
listEl.innerHTML = "";
return;
}
const items = await fetchSuggest(field, q);
render(items);
}, 200),
);
listEl.addEventListener("click", (e) => {
if (e.target.tagName === "LI") {
inputEl.value = e.target.textContent;
listEl.hidden = true;
}
});
document.addEventListener("click", (e) => {
if (!listEl.contains(e.target) && e.target !== inputEl) {
listEl.hidden = true;
}
});
}
bindSuggest($("#specialite"), $("#sg-specialite"), "specialite");
bindSuggest($("#ville"), $("#sg-ville"), "ville");
$("#submitBtn")?.addEventListener("click", () => {
const sp = $("#specialite")?.value?.trim() || "";
const vi = $("#ville")?.value?.trim() || "";
const url = `result_search.php?specialite=${encodeURIComponent(sp)}&ville=${encodeURIComponent(vi)}`;
window.location.href = url;
});
document.querySelectorAll(".searchbar input").forEach((i) => {
i.addEventListener("keydown", (e) => {
if (e.key === "Enter") {
e.preventDefault();
$("#submitBtn")?.click();
}
});
});
if ("serviceWorker" in navigator) {
window.addEventListener("load", () => {
navigator.serviceWorker
.register("/sw.js", { scope: "/" })
.catch(console.error);
});
}
(() => {
const btn = document.getElementById("pwaInstallBtn");
const iosHint = document.getElementById("pwaIosHint");
const iosClose = document.getElementById("pwaIosClose");
let deferredPrompt = null;
function isInstalled() {
const mm =
window.matchMedia &&
window.matchMedia("(display-mode: standalone)").matches;
const iosStandalone = !!window.navigator.standalone;
return mm || iosStandalone;
}
function isMobile() {
return window.matchMedia && window.matchMedia("(max-width: 991px)").matches;
}
function isIos() {
return /iphone|ipad|ipod/i.test(navigator.userAgent);
}
function isSafari() {
const ua = navigator.userAgent.toLowerCase();
return (
ua.includes("safari") &&
!ua.includes("crios") &&
!ua.includes("fxios") &&
!ua.includes("edgios")
);
}
function hideAll() {
if (btn) btn.classList.add("d-none");
if (iosHint) iosHint.classList.add("d-none");
}
function showBtn() {
if (!btn) return;
btn.classList.remove("d-none");
}
window.addEventListener("beforeinstallprompt", (e) => {
if (!isMobile() || isInstalled()) return;
e.preventDefault();
deferredPrompt = e;
showBtn();
});
btn?.addEventListener("click", async () => {
if (isInstalled()) return hideAll();
if (deferredPrompt) {
deferredPrompt.prompt();
await deferredPrompt.userChoice.catch(() => {});
deferredPrompt = null;
hideAll();
return;
}
if (isIos() && isSafari()) {
iosHint?.classList.remove("d-none");
return;
}
});
iosClose?.addEventListener("click", () => {
iosHint?.classList.add("d-none");
localStorage.setItem("pwa_ios_hint_seen", Date.now().toString());
});
window.addEventListener("appinstalled", () => hideAll());
document.addEventListener("DOMContentLoaded", () => {
if (!isMobile() || isInstalled()) return hideAll();
const seen = Number(localStorage.getItem("pwa_ios_hint_seen") || "0");
const days7 = 7 * 24 * 60 * 60 * 1000;
if (isIos() && isSafari()) {
if (!seen || Date.now() - seen > days7) showBtn();
}
});
})();
+6
View File
@@ -0,0 +1,6 @@
/*!
FullCalendar Standard Bundle v6.1.19
Docs & License: https://fullcalendar.io/docs/initialize-globals
(c) 2024 Adam Shaw
*/
var FullCalendar=function(e){"use strict";var t,n,r,i,s,o,a,l,c,d={},u=[],h=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function f(e,t){for(var n in t)e[n]=t[n];return e}function g(e){var t=e.parentNode;t&&t.removeChild(e)}function p(e,n,r){var i,s,o,a={};for(o in n)"key"==o?i=n[o]:"ref"==o?s=n[o]:a[o]=n[o];if(arguments.length>2&&(a.children=arguments.length>3?t.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return m(e,a,i,s,null)}function m(e,t,i,s,o){var a={type:e,props:t,key:i,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++r:o};return null==o&&null!=n.vnode&&n.vnode(a),a}function v(){return{current:null}}function y(e){return e.children}function b(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||h.test(t)?n:n+"px"}function E(e,t,n,r,i){var s;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||b(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||b(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])s=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=n,n?r||e.addEventListener(t,s?A:S,s):e.removeEventListener(t,s?A:S,s);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&-1==t.indexOf("-")?e.removeAttribute(t):e.setAttribute(t,n))}}function S(e){s=!0;try{return this.l[e.type+!1](n.event?n.event(e):e)}finally{s=!1}}function A(e){s=!0;try{return this.l[e.type+!0](n.event?n.event(e):e)}finally{s=!1}}function D(e,t){this.props=e,this.context=t}function w(e,t){if(null==t)return e.__?w(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?w(e):null}function C(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return C(e)}}function R(e){s?setTimeout(e):l(e)}function x(e){(!e.__d&&(e.__d=!0)&&o.push(e)&&!_.__r++||a!==n.debounceRendering)&&((a=n.debounceRendering)||R)(_)}function _(){var e,t,n,r,i,s,a,l;for(o.sort((function(e,t){return e.__v.__b-t.__v.__b}));e=o.shift();)e.__d&&(t=o.length,r=void 0,i=void 0,a=(s=(n=e).__v).__e,(l=n.__P)&&(r=[],(i=f({},s)).__v=s.__v+1,N(l,s,i,n.__n,void 0!==l.ownerSVGElement,null!=s.__h?[a]:null,r,null==a?w(s):a,s.__h),P(r,s),s.__e!=a&&C(s)),o.length>t&&o.sort((function(e,t){return e.__v.__b-t.__v.__b})));_.__r=0}function T(e,t,n,r,i,s,o,a,l,c){var h,f,g,p,v,b,E,S=r&&r.__k||u,A=S.length;for(n.__k=[],h=0;h<t.length;h++)if(null!=(p=n.__k[h]=null==(p=t[h])||"boolean"==typeof p?null:"string"==typeof p||"number"==typeof p||"bigint"==typeof p?m(null,p,null,null,p):Array.isArray(p)?m(y,{children:p},null,null,null):p.__b>0?m(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):p)){if(p.__=n,p.__b=n.__b+1,null===(g=S[h])||g&&p.key==g.key&&p.type===g.type)S[h]=void 0;else for(f=0;f<A;f++){if((g=S[f])&&p.key==g.key&&p.type===g.type){S[f]=void 0;break}g=null}N(e,p,g=g||d,i,s,o,a,l,c),v=p.__e,(f=p.ref)&&g.ref!=f&&(E||(E=[]),g.ref&&E.push(g.ref,null,p),E.push(f,p.__c||v,p)),null!=v?(null==b&&(b=v),"function"==typeof p.type&&p.__k===g.__k?p.__d=l=k(p,l,e):l=I(e,p,g,S,v,l),"function"==typeof n.type&&(n.__d=l)):l&&g.__e==l&&l.parentNode!=e&&(l=w(g))}for(n.__e=b,h=A;h--;)null!=S[h]&&("function"==typeof n.type&&null!=S[h].__e&&S[h].__e==n.__d&&(n.__d=O(r).nextSibling),j(S[h],S[h]));if(E)for(h=0;h<E.length;h++)B(E[h],E[++h],E[++h])}function k(e,t,n){for(var r,i=e.__k,s=0;i&&s<i.length;s++)(r=i[s])&&(r.__=e,t="function"==typeof r.type?k(r,t,n):I(n,r,r,i,r.__e,t));return t}function M(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){M(e,t)})):t.push(e)),t}function I(e,t,n,r,i,s){var o,a,l;if(void 0!==t.__d)o=t.__d,t.__d=void 0;else if(null==n||i!=s||null==i.parentNode)e:if(null==s||s.parentNode!==e)e.appendChild(i),o=null;else{for(a=s,l=0;(a=a.nextSibling)&&l<r.length;l+=1)if(a==i)break e;e.insertBefore(i,s),o=s}return void 0!==o?o:i.nextSibling}function O(e){var t,n,r;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=O(n)))return r;return null}function N(e,t,r,i,s,o,a,l,c){var d,u,h,g,p,m,v,b,E,S,A,w,C,R,x,_=t.type;if(void 0!==t.constructor)return null;null!=r.__h&&(c=r.__h,l=t.__e=r.__e,t.__h=null,o=[l]),(d=n.__b)&&d(t);try{e:if("function"==typeof _){if(b=t.props,E=(d=_.contextType)&&i[d.__c],S=d?E?E.props.value:d.__:i,r.__c?v=(u=t.__c=r.__c).__=u.__E:("prototype"in _&&_.prototype.render?t.__c=u=new _(b,S):(t.__c=u=new D(b,S),u.constructor=_,u.render=z),E&&E.sub(u),u.proLine truncated
+90
View File
@@ -0,0 +1,90 @@
<?php
// tools/generer_code.php — compatible endroid/qr-code v4 et v5
declare(strict_types=1);
require __DIR__ . '/../vendor/autoload.php';
use Endroid\QrCode\QrCode;
use Endroid\QrCode\Writer\PngWriter;
use Endroid\QrCode\Writer\SvgWriter;
$url = 'https://uslugi.fr';
$pngSize = 1600; // px
$margin = 20; // px
$publicDir = __DIR__ . '/../public/uploads/img';
$basename = 'qr_uslugi';
if (!filter_var($url, FILTER_VALIDATE_URL)) {
http_response_code(400);
exit("❌ URL invalide\n");
}
if (!is_dir($publicDir) && !mkdir($publicDir, 0775, true)) {
http_response_code(500);
exit("❌ Impossible de créer le dossier: {$publicDir}\n");
}
// Instanciation commune
$qr = new QrCode($url);
// ---------- Compatibilité v4 / v5 ----------
/**
* v5.x :
* - Encoding via new Encoding('UTF-8')
* - ECC via new ErrorCorrectionLevelHigh()
* - RoundBlockSizeMode via new RoundBlockSizeModeMargin()
*
* v4.x :
* - Encoding via string 'UTF-8'
* - ECC via new ErrorCorrectionLevel(ErrorCorrectionLevel::HIGH)
* - Pas de RoundBlockSizeModeMargin (on ignore)
*/
$qr->setSize($pngSize);
$qr->setMargin($margin);
// Encoding
if (class_exists(\Endroid\QrCode\Encoding\Encoding::class)) {
// v5
$qr->setEncoding(new \Endroid\QrCode\Encoding\Encoding('UTF-8'));
} else {
// v4
if (method_exists($qr, 'setEncoding')) {
$qr->setEncoding('UTF-8');
}
}
// Error correction
if (class_exists(\Endroid\QrCode\ErrorCorrectionLevel\ErrorCorrectionLevelHigh::class)) {
// v5
$qr->setErrorCorrectionLevel(new \Endroid\QrCode\ErrorCorrectionLevel\ErrorCorrectionLevelHigh());
} elseif (class_exists(\Endroid\QrCode\ErrorCorrectionLevel\ErrorCorrectionLevel::class)) {
// v4
$qr->setErrorCorrectionLevel(
new \Endroid\QrCode\ErrorCorrectionLevel\ErrorCorrectionLevel(
\Endroid\QrCode\ErrorCorrectionLevel\ErrorCorrectionLevel::HIGH
)
);
}
// Round blocks (v5 uniquement)
if (
method_exists($qr, 'setRoundBlockSizeMode') &&
class_exists(\Endroid\QrCode\RoundBlockSizeMode\RoundBlockSizeModeMargin::class)
) {
$qr->setRoundBlockSizeMode(new \Endroid\QrCode\RoundBlockSizeMode\RoundBlockSizeModeMargin());
}
// Écriture PNG / SVG
$pngWriter = new PngWriter();
$svgWriter = new SvgWriter();
$png = $pngWriter->write($qr);
$svg = $svgWriter->write($qr);
// Sauvegarde
$pngPath = $publicDir . '/' . $basename . '.png';
$svgPath = $publicDir . '/' . $basename . '.svg';
$png->saveToFile($pngPath);
$svg->saveToFile($svgPath);
echo "✅ QR codes générés :\n";
echo "PNG : " . realpath($pngPath) . "\n";
echo "SVG : " . realpath($svgPath) . "\n";
+2553
View File
File diff suppressed because it is too large. Load diff
+81
View File
@@ -0,0 +1,81 @@
document.addEventListener("DOMContentLoaded", function () {
const emailInput = document.getElementById("email");
const erreurEmail = document.getElementById("email-erreur");
const form = document.getElementById("form-inscription");
let emailEstValide = true;
// Vérif e-mail AJAX
emailInput.addEventListener("input", function () {
const email = emailInput.value;
if (!email.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/)) {
erreurEmail.style.display = "none";
emailEstValide = false;
return;
}
fetch("verifier_email.php", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: "email=" + encodeURIComponent(email)
})
.then(response => response.text())
.then(data => {
if (data === "existe") {
erreurEmail.style.display = "block";
emailEstValide = false;
} else {
erreurEmail.style.display = "none";
emailEstValide = true;
}
});
});
// Blocage formulaire si e-mail invalide
form.addEventListener("submit", function (e) {
if (!emailEstValide) {
e.preventDefault();
alert(EMAIL_TAKEN); // vient de PHP
}
});
// ---- Jauge mot de passe ----
const passwordInput = document.getElementById("mot_de_passe");
const segments = document.querySelectorAll(".strength-fill");
const niveauText = document.getElementById("niveau-securite");
passwordInput.addEventListener("input", function () {
const val = passwordInput.value;
segments.forEach(seg => seg.style.backgroundColor = '#ccc');
niveauText.textContent = T.rule;
niveauText.style.color = '#666';
const longOk = val.length >= 8;
const lettre = /[A-Za-z]/.test(val);
const chiffre = /\d/.test(val);
const maj = /[A-Z]/.test(val);
const special = /[^A-Za-z0-9]/.test(val);
let force = 0;
if (longOk && lettre && chiffre) force++;
if (maj) force++;
if (special) force++;
if (force === 1) {
segments[0].style.backgroundColor = 'red';
niveauText.textContent = T.weak;
niveauText.style.color = 'red';
} else if (force === 2) {
segments[0].style.backgroundColor = 'orange';
segments[1].style.backgroundColor = 'orange';
niveauText.textContent = T.medium;
niveauText.style.color = 'orange';
} else if (force >= 3) {
segments.forEach(seg => seg.style.backgroundColor = 'green');
niveauText.textContent = T.strong;
niveauText.style.color = 'green';
}
});
});