diff --git a/src/components/AteliersCatalogue.css b/src/components/AteliersCatalogue.css new file mode 100644 index 0000000..220aef3 --- /dev/null +++ b/src/components/AteliersCatalogue.css @@ -0,0 +1,710 @@ +:root { + --mysy-blue: #104277; + --mysy-blue-2: #0f56bd; + --mysy-blue-3: #eaf2ff; + --text: #071943; + --muted: #63708c; + --border: #dbe4f2; + --soft-border: #edf2fa; + --bg: #f3f6fc; + --card: #ffffff; + --green: #11985a; + --green-bg: #e9fbf2; + --red: #c8203a; + --red-bg: #ffedf1; + --shadow: 0 14px 40px rgba(16, 66, 119, 0.1); + --shadow-soft: 0 8px 22px rgba(16, 66, 119, 0.08); +} + +* { + box-sizing: border-box; +} + +body { + margin: 0; + font-family: "DM Sans", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; + background: var(--bg); + color: var(--text); +} + +button, +input { + font: inherit; +} + +button { + cursor: pointer; +} + +.catalogue-page { + min-height: 100vh; + padding-bottom: 56px; +} + +.topbar { + height: 72px; + display: flex; + align-items: center; + gap: 32px; + padding: 0 56px; + background: rgba(255, 255, 255, 0.92); + border-bottom: 1px solid var(--soft-border); + position: sticky; + top: 0; + z-index: 20; + backdrop-filter: blur(14px); +} + +.brand { + font-size: 28px; + font-weight: 900; + letter-spacing: -1px; + color: var(--mysy-blue); + white-space: nowrap; +} + +.brand span { + font-weight: 700; +} + +.nav-links { + display: flex; + align-items: stretch; + gap: 8px; + height: 100%; + flex: 1; + justify-content: center; +} + +.nav-link { + display: flex; + align-items: center; + gap: 8px; + padding: 0 14px; + color: #697590; + text-decoration: none; + border-bottom: 3px solid transparent; + font-size: 14px; + font-weight: 700; +} + +.nav-link--active { + color: var(--mysy-blue-2); + border-color: var(--mysy-blue-2); +} + +.user-actions { + display: flex; + align-items: center; + gap: 14px; +} + +.notification-btn, +.avatar-btn { + border: 0; + background: transparent; +} + +.notification-btn { + position: relative; + width: 42px; + height: 42px; + display: grid; + place-items: center; + color: #31405f; +} + +.notification-btn span { + position: absolute; + top: 7px; + right: 5px; + background: #e43145; + color: #fff; + min-width: 17px; + height: 17px; + border-radius: 999px; + display: grid; + place-items: center; + font-size: 10px; + font-weight: 800; +} + +.avatar-btn { + display: inline-flex; + align-items: center; + gap: 7px; + background: var(--mysy-blue); + color: #fff; + padding: 10px 12px; + border-radius: 999px; + font-weight: 800; +} + +.hero-section, +.search-panel, +.results-info, +.formation-list { + width: min(1320px, calc(100% - 64px)); + margin-left: auto; + margin-right: auto; +} + +.hero-section { + display: flex; + justify-content: space-between; + align-items: flex-start; + gap: 24px; + padding: 42px 0 22px; +} + +.hero-section h1 { + margin: 0; + font-size: clamp(34px, 4vw, 46px); + letter-spacing: -1.4px; + line-height: 1.05; +} + +.hero-section p { + margin: 10px 0 0; + color: var(--muted); + font-size: 16px; +} + +.segment-tabs { + display: flex; + padding: 5px; + border: 1px solid var(--border); + border-radius: 999px; + background: #fff; + min-width: 360px; + box-shadow: var(--shadow-soft); +} + +.segment-tabs button { + flex: 1; + border: 0; + background: transparent; + color: var(--mysy-blue); + padding: 14px 26px; + border-radius: 999px; + font-weight: 800; +} + +.segment-tabs button.active { + background: linear-gradient(135deg, var(--mysy-blue), #0d56c4); + color: #fff; + box-shadow: 0 10px 22px rgba(15, 86, 196, 0.22); +} + +.search-panel { + background: #fff; + border: 1px solid var(--border); + border-radius: 18px; + padding: 20px; + box-shadow: var(--shadow); +} + +.search-row { + display: grid; + grid-template-columns: 1fr 180px; + gap: 18px; +} + +.search-input { + display: flex; + align-items: center; + gap: 12px; + height: 62px; + border: 1px solid #c8d7eb; + border-radius: 12px; + padding: 0 18px; + color: #71809b; + background: #fff; +} + +.search-input input { + border: 0; + outline: 0; + flex: 1; + color: var(--text); + font-size: 15px; +} + +.sort-btn { + display: grid; + grid-template-columns: 1fr auto; + align-items: center; + text-align: left; + gap: 2px 12px; + height: 62px; + border: 1px solid #c8d7eb; + background: #fff; + border-radius: 12px; + padding: 0 16px; + color: var(--text); +} + +.sort-btn span { + font-size: 12px; + color: var(--muted); +} + +.sort-btn svg { + grid-row: 1 / span 2; + grid-column: 2; +} + +.filter-row { + display: flex; + align-items: center; + justify-content: space-between; + gap: 18px; + margin-top: 20px; +} + +.filter-chips { + display: flex; + flex-wrap: wrap; + gap: 12px; +} + +.filter-chip { + display: inline-flex; + align-items: center; + gap: 8px; + height: 44px; + padding: 0 16px; + border: 1px solid var(--border); + border-radius: 10px; + color: var(--mysy-blue-2); + background: linear-gradient(180deg, #fff, #f8fbff); + font-weight: 800; + font-size: 14px; +} + +.filter-chip:hover { + border-color: #aac3e8; + box-shadow: 0 7px 16px rgba(16, 66, 119, 0.08); +} + +.reset-btn, +.program-btn { + border: 0; + background: transparent; + color: var(--mysy-blue-2); + font-weight: 800; +} + +.results-info { + margin-top: 22px; + color: var(--muted); + font-size: 15px; +} + +.results-info strong { + color: var(--text); +} + +.formation-list { + display: grid; + gap: 22px; + margin-top: 16px; +} + +.formation-card { + background: var(--card); + border: 1px solid var(--border); + border-radius: 18px; + box-shadow: var(--shadow-soft); + overflow: hidden; +} + +.formation-card__main { + display: grid; + grid-template-columns: 320px 1fr 250px; + gap: 28px; + padding: 22px; +} + +.formation-card__image-wrap { + position: relative; + min-height: 190px; +} + +.formation-card__image { + display: block; + width: 100%; + height: 190px; + object-fit: cover; + border-radius: 14px; +} + +.favorite-btn { + position: absolute; + top: 12px; + right: 12px; + width: 38px; + height: 38px; + border: 1px solid rgba(255, 255, 255, 0.8); + border-radius: 12px; + display: grid; + place-items: center; + background: rgba(255, 255, 255, 0.86); + color: #78859d; + backdrop-filter: blur(8px); +} + +.favorite-btn:hover { + color: #e43145; +} + +.formation-card__content { + display: grid; + grid-template-columns: 54px 1fr; + gap: 18px; + align-items: flex-start; + padding-top: 8px; +} + +.formation-icon { + width: 54px; + height: 54px; + display: grid; + place-items: center; + border-radius: 18px; + color: var(--mysy-blue-2); + background: var(--mysy-blue-3); +} + +.formation-icon--green { + color: #0f8b53; + background: #e9fbf2; +} + +.formation-icon--purple { + color: #7457e7; + background: #f1edff; +} + +.formation-copy h2 { + margin: 0 0 12px; + color: var(--mysy-blue); + font-size: 28px; + line-height: 1.15; + letter-spacing: -0.7px; +} + +.formation-copy p { + max-width: 700px; + margin: 0; + color: #475572; + line-height: 1.55; +} + +.rating-line { + display: flex; + align-items: center; + gap: 10px; + margin-top: 16px; + font-weight: 800; + color: #3e4b65; + font-size: 14px; +} + +.rating-stars { + display: inline-flex; + gap: 2px; + color: #f6ad19; +} + +.formation-card__meta { + padding-top: 6px; +} + +.badges { + display: flex; + align-items: center; + gap: 8px; + flex-wrap: wrap; + margin-bottom: 22px; +} + +.badge { + display: inline-flex; + align-items: center; + border-radius: 999px; + padding: 8px 12px; + font-size: 12px; + font-weight: 900; +} + +.badge--danger { + color: var(--red); + background: var(--red-bg); +} + +.badge--success { + color: var(--green); + background: var(--green-bg); +} + +.badge--soft { + color: var(--mysy-blue-2); + background: var(--mysy-blue-3); +} + +.meta-list { + display: grid; + gap: 16px; +} + +.meta-item { + display: grid; + grid-template-columns: 24px 1fr; + gap: 12px; + align-items: flex-start; + color: #53617d; +} + +.meta-item span, +.workshop-cell span { + display: block; + color: var(--muted); + font-size: 12px; + font-weight: 600; +} + +.meta-item strong, +.workshop-cell strong { + display: block; + margin-top: 2px; + color: var(--text); + font-size: 14px; + line-height: 1.25; +} + +.meta-item .price { + color: var(--mysy-blue-2); + font-size: 19px; + font-weight: 900; +} + +.meta-item .price-free { + color: var(--green); + font-size: 19px; + font-weight: 900; +} + +.workshops { + border-top: 1px solid var(--soft-border); + padding: 0 18px 18px; +} + +.workshops__header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 20px; + padding: 18px 0 12px; +} + +.workshops__header > div { + display: flex; + align-items: center; + gap: 10px; + color: var(--mysy-blue); + font-size: 18px; +} + +.workshops__header span { + min-width: 28px; + height: 26px; + padding: 0 9px; + border-radius: 999px; + display: inline-grid; + place-items: center; + background: var(--mysy-blue-3); + color: var(--mysy-blue-2); + font-weight: 900; + font-size: 13px; +} + +.program-btn { + display: inline-flex; + align-items: center; + gap: 4px; +} + +.workshops__list { + border: 1px solid var(--border); + border-radius: 14px; + overflow: hidden; + background: #fff; +} + +.workshop-row { + display: grid; + grid-template-columns: 1.5fr 1.5fr 1.2fr 1.15fr 1.15fr 144px; + align-items: center; + gap: 16px; + min-height: 72px; + padding: 10px 14px; +} + +.workshop-row + .workshop-row { + border-top: 1px solid var(--soft-border); +} + +.workshop-row:hover { + background: #f8fbff; +} + +.workshop-cell { + min-width: 0; + display: grid; + grid-template-columns: 24px 1fr; + align-items: center; + gap: 10px; + color: var(--mysy-blue-2); +} + +.workshop-code { + display: block; + padding-left: 6px; +} + +.workshop-code strong { + color: var(--mysy-blue); +} + +.workshop-places span { + color: var(--green); +} + +.details-btn { + border: 0; + background: linear-gradient(135deg, var(--mysy-blue), #0d56c4); + color: #fff; + height: 42px; + border-radius: 9px; + font-weight: 900; + box-shadow: 0 9px 18px rgba(16, 66, 119, 0.18); +} + +.details-btn:hover { + filter: brightness(1.04); + transform: translateY(-1px); +} + +@media (max-width: 1120px) { + .topbar { + padding: 0 24px; + } + + .nav-links { + display: none; + } + + .formation-card__main { + grid-template-columns: 240px 1fr; + } + + .formation-card__meta { + grid-column: 1 / -1; + display: flex; + justify-content: space-between; + gap: 22px; + } + + .meta-list { + grid-template-columns: repeat(3, 1fr); + flex: 1; + } + + .workshop-row { + grid-template-columns: 1.2fr 1.4fr 1fr 1fr; + } + + .workshop-row .workshop-cell:nth-of-type(5), + .details-btn { + grid-column: span 2; + } +} + +@media (max-width: 760px) { + .hero-section, + .search-panel, + .results-info, + .formation-list { + width: min(100% - 28px, 1320px); + } + + .topbar { + height: auto; + min-height: 68px; + } + + .hero-section { + flex-direction: column; + padding-top: 26px; + } + + .segment-tabs { + width: 100%; + min-width: 0; + } + + .search-row { + grid-template-columns: 1fr; + } + + .filter-row { + align-items: flex-start; + flex-direction: column; + } + + .formation-card__main { + grid-template-columns: 1fr; + gap: 20px; + } + + .formation-card__image { + height: 220px; + } + + .formation-card__content { + grid-template-columns: 1fr; + } + + .formation-card__meta { + display: block; + } + + .meta-list { + grid-template-columns: 1fr; + } + + .formation-copy h2 { + font-size: 24px; + } + + .workshops__header { + align-items: flex-start; + flex-direction: column; + } + + .workshop-row { + grid-template-columns: 1fr; + gap: 12px; + padding: 16px; + } + + .workshop-row .workshop-cell:nth-of-type(5), + .details-btn { + grid-column: auto; + } + + .details-btn { + width: 100%; + } +} diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index 80bf0c3..1b9c1df 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -32,6 +32,7 @@ import moment from "moment"; import 'moment/locale/fr'; import { useCookies } from "react-cookie"; import InputAdornment from '@mui/material/InputAdornment'; +import { FcOrgUnit } from "react-icons/fc"; import { AiFillCloseCircle } from "react-icons/ai"; import Box from '@mui/material/Box'; import { Typography, LinearProgress } from '@mui/material'; @@ -3730,6 +3731,75 @@ const DisplayPartnerSession = (props) => { + const [New_Get_Conflit_On_Inscription_result, setNew_Get_Conflit_On_Inscription_result] = useState([]); + + const [Get_Conflit_On_Inscription_api, setGet_Conflit_On_Inscription_api] = useState(); + const [Get_Conflit_On_Inscription_message, setGet_Conflit_On_Inscription_message] = useState(); + const [Get_Conflit_On_Inscription_result, setGet_Conflit_On_Inscription_result] = useState([]); + function Get_Conflit_On_Inscription() { + var form = new FormData(); + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + + + //console.log("### form = ", form); + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Inscription_Conflit/"; + + setLoading(true); + axios.post(myurl, form).then(res => { + //console.log(" In Get_Conflit_On_Inscription res.data.status = " + res.data.status); + // console.log(" In Get_Conflit_On_Inscription res.data.message r_class = " + res.data.message); + + setLoading(false); + if (String(res.data.status) === String("true")) { + setGet_Conflit_On_Inscription_api("true"); + setGet_Conflit_On_Inscription_message(res.data.message); + + var new_data2 = []; + const new_data = res.data.message.map((x) => { + new_data2.push(x) + + }); + + if (new_data2.length > 0) + setNew_Get_Conflit_On_Inscription_result(new_data2); + else + setNew_Get_Conflit_On_Inscription_result([]) + + setDialog_List_Conflit_Inscription(true); + + + + + + } + else { + setGet_Conflit_On_Inscription_api("false"); + setGet_Conflit_On_Inscription_message(res.data.message); + + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); + } + + }).catch((error) => { + setLoading(false); + + console.warn('Get_Conflit_On_Inscription : Not good man :( Get_Conflit_On_Inscription = ' + error); + setGet_Conflit_On_Inscription_api("false"); + setdisplay_alert_mysy("1"); + setalert_message(" Impossible de récuperer la liste des conflits "); + setalert_type("error"); + }) + + + } + + + + useEffect(() => { Get_List_Mode_Financement(); @@ -16540,6 +16610,15 @@ const DisplayPartnerSession = (props) => { }; + + + const [Dialog_List_Conflit_Inscription, setDialog_List_Conflit_Inscription] = useState(false); + + const Close_Dialog_List_Conflit_Inscription = () => { + // clean_order_detail_fields(); + setDialog_List_Conflit_Inscription(false); + }; + return (
@@ -16559,6 +16638,302 @@ const DisplayPartnerSession = (props) => { {/*** FIN Affichage des messages d'alerte*/} + {/********** Dialog pour Conflit_Inscription */} + null} + PaperProps={{ + className: classes.paper, + style: { + overflowY: "unset", + position: "absolute", + top: "15rem", + margin: "2px", + }, + }} + hideBackdrop={true} + disableScrollLock + classes={{ + paper: classes.dialog, + }} + PaperComponent={PaperComponent} + aria-labelledby="draggable-dialog-title" + > + + Conflits d’inscription + + + + {New_Get_Conflit_On_Inscription_result && + New_Get_Conflit_On_Inscription_result.length > 0 && ( +
+
+
+
+ + +
+ {New_Get_Conflit_On_Inscription_result.map((conflit) => ( +
+
+
+
+ {String(JSON.parse(conflit).apprenant_nom)}{" "} {String(JSON.parse(conflit).apprenant_prenom)} + +
+ + + + +
+ + +
+ +
+ {JSON.parse(conflit).sessions_en_conflit && + JSON.parse(conflit).sessions_en_conflit.map((session, sessionIndex) => ( +
+
+
+ {String(session.code_session || "Session")} +
+ +
+ Session {sessionIndex + 1} +
+
+ +
+
+ Du{" "} + + {String(session.date_debut || "-")} + {" "} + au{" "} + + {String(session.date_fin || "-")} + +
+ + + + {session.code_session && ( +
+ Code : + + {String(session.code_session)} + +
+ )} +
+
+ ))} +
+
+ ))} +
+
+
+
+
+ )} + + {New_Get_Conflit_On_Inscription_result && + New_Get_Conflit_On_Inscription_result.length <= 0 && ( +
+
+
+
+
+ ✓ +
+ +
+ Aucun conflit détecté +
+ +
+ Les inscriptions contrôlées ne présentent aucun chevauchement de sessions. +
+
+
+
+
+ )} +
+ + + + + + +
+ {/********** FIN Dialog pour Conflit_Inscription */} + + + {/* Dialog pour gerer les Distanciel_Orga */} {
} -
+ {/*** On masque le pavé ci-dessous pour eviter confusions d'affichage */} + + {String(acces_right_data_edit_mode) !== "1" &&
@@ -14242,7 +14244,7 @@ const Employes = (props) => { >Annuler
-
+
}
  diff --git a/src/components/Groupe_Apprenant.js b/src/components/Groupe_Apprenant.js index 9735f98..ac8e885 100644 --- a/src/components/Groupe_Apprenant.js +++ b/src/components/Groupe_Apprenant.js @@ -1705,6 +1705,15 @@ const Groupe_Apprenant = (props) => { setp_detail_type_groupe_code(""); } + + if (mylocal_groupe.groupe_inscription_type_id) { + setp_detail_type_groupe_id(mylocal_groupe.groupe_inscription_type_id); + } else { + setp_detail_type_groupe_id(""); + } + + + if (mylocal_groupe.session_id) { setp_detail_session_id(mylocal_groupe.session_id); } else { diff --git a/src/components/Jmj_Theme/Session_Partner_Catalog_Special_Partner.js b/src/components/Jmj_Theme/Session_Partner_Catalog_Special_Partner.js new file mode 100644 index 0000000..f8dfb0f --- /dev/null +++ b/src/components/Jmj_Theme/Session_Partner_Catalog_Special_Partner.js @@ -0,0 +1,503 @@ +import React, { useState, useEffect } from "react"; + +import { useHistory } from "react-router-dom"; + +import { useCookies } from "react-cookie"; +import { confirmAlert } from 'react-confirm-alert'; +import Fotter_Catalog_Pub from "../Fotter_Catalog_Pub"; +import img_met_program from "../../mysy_img/met_programmation.jpg"; + +import img_met_graphisme from "../../mysy_img/metier_graphisme.jpg"; + +import img_met_autre from "../../mysy_img/met_autre.jpg"; +import img_met_digital from "../../mysy_img/met_digital.jpg"; +import img_met_management from "../../mysy_img/met_management.jpg"; + +import img_met_dev_perso from "../../mysy_img/metier_dev_perso.jpg"; +import img_met_rh from "../../mysy_img/met_rh.jpg"; + +import img_met_bureautic from "../../mysy_img/met_burautic.jpg"; +import img_met_vente from "../../mysy_img/met_vente.jpg"; +import axios from "axios"; +//import { Rating } from 'react-simple-star-rating' +import Rating from '@mui/material/Rating'; +import parse from 'html-react-parser' +import { CiLocationOn } from "react-icons/ci"; + +const Session_Partner_Catalog_Special_Partner = (props) => { + const [userconnected, setuserconnected] = useState("0"); + const [partnerconnected, setpartnerconnected] = useState("0"); + const [cookie, setCookie, removeCookie] = useCookies(['tokenmysych']); + const [cookie_part, setCookie_part, removeCookie_part] = useCookies(['tokenmysypart']); + const history = useHistory(); + const [myfilter, setmyfilter] = useState(props.formation.price); + + const [profileimg, setprofileimg] = useState(props.formation.price); + + + // Gestion des Cookies + const stored_partner = cookie_part.tokenmysypart; + const stored_user = cookie.tokenmysych; + + function test(val) { + + if (userconnected === "0" && partnerconnected === "0") { + confirmAlert({ + title: 'Activer votre session ?', + message: 'Merci de vous connecter pour acceder au detail de cette formation', + buttons: [ + { + label: 'Oui', + onClick: () => { history.push("/mysy-training-login/training/" + props.formation.internal_url) } + }, + { + label: 'Non', + onClick: () => { return } + + } + ], + closeOnEscape: false, + closeOnClickOutside: false, + keyCodeForClose: [8, 32], + willUnmount: () => { }, + afterClose: () => { }, + onClickOutside: () => { }, + onKeypress: () => { }, + onKeypressEscape: () => { }, + }); + } else { + window.open( + "/Display-Detail-formation/" + props.formation.internal_url, + '_blank' + ); + } + + + } + + const [myclassimage, setmyclassimage] = useState(); + const [isclassimage, setisclassimage] = useState("False"); + const [userimgclassprofil, setuserimgclassprofil] = useState(""); + + const [class_img_stored_in_bdd, setclass_img_stored_in_bdd] = useState(""); + + function getClassImage_no_token() { + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/getRecodedClassImage_no_token/"; + + var form = new FormData(); + + form.append("type", "partner"); + form.append("related_collection", "myclass"); + form.append("related_collection_recid", props.formation._id); + form.append("class_external_code", props.formation.external_code); + + axios.post(myurl, form).then(res => { + + // console.log(" getClassImage_no_token : In test res.data.status = ", res.data.status); + if (String(res.data.status) === "true") { + + + //console.log(" getClassImage_no_token: res.data.message.img = ", res.data.message); + + if (res.data.message.img.length > 0) { + setisclassimage("True"); + } + else { + setisclassimage("False"); + } + setisclassimage(res.data.message.img); + var ch_img = "data:image/png;base64," + res.data.message.img; + setclass_img_stored_in_bdd(ch_img); + // console.log(" getClassImage_no_token: setclass_img_stored_in_bdd = ", setclass_img_stored_in_bdd); + + } + else { + // console.log(" In Erreur res.data.status = " + res.data.status); + //console.log(" In Erreur res.data.message = " + res.data.message); + setisclassimage("False"); + setuserimgclassprofil(); + setclass_img_stored_in_bdd(); + } + }).catch((error) => { + + console.warn('getClassImage ee: Not good man :( getClassImage = '); + setisclassimage("False"); + setuserimgclassprofil(""); + setclass_img_stored_in_bdd(""); + }) + + } + + + /* Cette variable accompagne la gestion des images par defaut. + idée : si la valeur de "DetailTraining.metier" != "management, digital, office, rh, vente, dev_perso" + alors l'utilisateur à créer une formation avec un metier qui n'est pas geré, donc on met une image par defaut + */ + const [ismetiermanaged, setismetiermanaged] = useState(); + const liste_metier = ["management", "digital", "office", "rh", "vente", "dev_perso"]; + + useEffect(() => { + setmyfilter(props.myfil); + + // console.log(" #### useEffect props.formation = ", props.formation); + + + if (typeof (stored_user) === "undefined" || String(stored_user) === '') { + setuserconnected("0"); + } else { + setuserconnected("1"); + } + + if (typeof (stored_partner) === "undefined" || String(stored_partner) === '') { + setpartnerconnected("0"); + } else { + setpartnerconnected("1"); + } + + getClassImage_no_token(); + GetCurrentClass_trainingsession(); + + GetCurrentClass_trainingsession_cities(); + + // Verifier si le metier est geré + if (props.formation.metier) { + if (!liste_metier.includes(props.formation.metier)) { + setismetiermanaged("0"); // j'ai une valeur dans metier, mais qui n'est pas geré + } + } + else { + setismetiermanaged("0"); + } + + if (props.formation.img_url && String(props.formation.img_url).length > 0) { + setismetiermanaged("1"); + } + + }, []); + + + const [GetCurrentClass_api, setGetCurrentClass_api] = useState(); + const [GetCurrentClass_message, setGetCurrentClass_message] = useState(); + const [GetCurrentClass_result, setGetCurrentClass_result] = useState(); + function GetCurrentClass_trainingsession(event) { + + var form = new FormData(); + + form.append("class_internal_url", props.formation.internal_url); + + form.append("token", stored_partner); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetActiveSessionFormation_List/"; + + axios.post(myurl, form).then(res => { + + if (res.data.status != "false") { + //console.log(" In GetCurrentClass_trainingsession res.data.status = " + res.data.status); + //console.log(" In GetCurrentClass_trainingsession res.data.message r_class = " + res.data.message); + setGetCurrentClass_api("true"); + setGetCurrentClass_result(res.data.message); + } + else { + setGetCurrentClass_api("false"); + setGetCurrentClass_message(res.data.message); + } + + }).catch((error) => { + console.warn('Not good man :( GetCurrentClass_trainingsession = ', error); + setGetCurrentClass_api("false"); + //setmyApimyApiMessage("") + }) + } + + + const [GetCurrentClass_trainingsession_cities_api, setGetCurrentClass_trainingsession_cities_api] = useState(); + const [GetCurrentClass_trainingsession_cities_message, setGetCurrentClass_trainingsession_cities_message] = useState(); + const [GetCurrentClass_trainingsession_cities_result, setGetCurrentClass_trainingsession_cities_result] = useState([]); + function GetCurrentClass_trainingsession_cities(event) { + + var form = new FormData(); + + form.append("class_internal_url", props.formation.internal_url); + + form.append("token", stored_partner); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetActiveSession_Cities_And_Distance_Formation_List/"; + + axios.post(myurl, form).then(res => { + + if (res.data.status != "false") { + //console.log(" In GetCurrentClass_trainingsession_cities res.data.status = " + res.data.status); + //console.log(" In GetCurrentClass_trainingsession_cities res.data.message r_class = " + res.data.message); + setGetCurrentClass_trainingsession_cities_api("true"); + setGetCurrentClass_trainingsession_cities_result(res.data.message); + } + else { + setGetCurrentClass_trainingsession_cities_api("false"); + setGetCurrentClass_trainingsession_cities_message(res.data.message); + } + + }).catch((error) => { + console.warn('Not good man :( GetCurrentClass_trainingsession_cities = ', error); + setGetCurrentClass_trainingsession_cities_api("false"); + //setmyApimyApiMessage("") + }) + } + + const styles = { + list: { + display: 'flex', + flexDirection: 'column', + gap: '32px', + width: '100%', + }, + row: { + display: 'flex', + flexDirection: 'row', + gap: '24px', + width: '100%', + }, + card: { + flexGrow: 1, + backgroundColor: '#fff', + borderRadius: '8px', + overflow: 'hidden', + display: 'flex', + flexDirection: 'column', + }, + image: { + maxWidth: '100%', + height: '200px', + overflow: 'hidden', + margin: "auto", + + }, + content: { + padding: '16px', + }, + header: { + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', + }, + eligibility: { + backgroundColor: '#e2e9fb', + padding: '4px 8px', + borderRadius: '4px', + fontSize: '12px', + fontWeight: 'bold', + }, + title: { + fontSize: '14px', + fontWeight: 'bold', + margin: '8px 0', + }, + price: { + fontSize: '14px', + fontWeight: 'bold', + color: '#000', + }, + description: { + fontSize: '12px', + color: '#666', + margin: '8px 0', + height: "40px", + overflow: "hidden", + }, + details: { + display: 'flex', + justifyContent: 'space-between', + marginTop: '16px', + }, + button: { + backgroundColor: '#007bff', + color: '#fff', + padding: '8px 16px', + border: 'none', + borderRadius: '4px', + cursor: 'pointer', + }, + buttonOutline: { + backgroundColor: '#fff', + color: '#007bff', + padding: '8px 16px', + border: '1px solid #007bff', + borderRadius: '4px', + cursor: 'pointer', + }, + }; + + return ( + +
+ NB SESSION = {props.formation.tab_session.length} + + {props.formation.tab_session && props.formation.tab_session.map((val) => ( + +
+ CODE SESSION = {val.code_session} +
+ +
 
+ + {props.formation.cpf && String(props.formation.cpf) === String("1") &&
+ {"OUI CPF"} +
+ } + {props.formation.cpf && String(props.formation.cpf) !== String("1") &&
+ {"NON CPF"} +
+ } + {!props.formation.cpf && String(props.formation.cpf) !== String("1") &&
+ {"NON CPF"} +
} + +
+ + + {class_img_stored_in_bdd && String(class_img_stored_in_bdd).length > 50 && + Formation + } + + {(!class_img_stored_in_bdd || String(class_img_stored_in_bdd).length < 50) && + (!props.formation.img_url || String(props.formation.img_url).length <= 10) && + String(ismetiermanaged) !== "0" && String(ismetiermanaged) !== "1" && + +
+ + {(!props.formation.img_url || String(props.formation.img_url).length <= 0) && + props.formation.metier && String(props.formation.metier).toLocaleLowerCase() === String("it") && + String(isclassimage) === "False" && informatique} + + {(!props.formation.img_url || String(props.formation.img_url).length <= 0) && + props.formation.metier && String(props.formation.metier).toLocaleLowerCase() === String("graphisme") && + String(isclassimage) === "False" && graphisme} + + {(!props.formation.img_url || String(props.formation.img_url).length <= 0) && + props.formation.metier && String(props.formation.metier).toLocaleLowerCase() === String("management") && + String(isclassimage) === "False" && management} + + {(!props.formation.img_url || String(props.formation.img_url).length <= 0) && + props.formation.metier && String(props.formation.metier).toLocaleLowerCase() === String("digital") && + String(isclassimage) === "False" && digital} + + {(!props.formation.img_url || String(props.formation.img_url).length <= 0) && + props.formation.metier && String(props.formation.metier).toLocaleLowerCase() === String("office") && + String(isclassimage) === "False" && office} + + {!props.formation.img_url || String(props.formation.img_url).length <= 0 && + props.formation.metier && String(props.formation.metier).toLocaleLowerCase() === String("rh") && + String(isclassimage) === "False" && ressources humaines} + + {!props.formation.img_url || String(props.formation.img_url).length <= 0 && + props.formation.metier && String(props.formation.metier).toLocaleLowerCase() === String("vente") && + String(isclassimage) === "False" && vente} + + {!props.formation.img_url || String(props.formation.img_url).length <= 0 && + props.formation.metier && String(props.formation.metier).toLocaleLowerCase() === String("dev_perso") && + String(isclassimage) === "False" && developpement personnel} + + {String(isclassimage) === "True" && developpement personnel} + + +
+ } + + {(!class_img_stored_in_bdd || String(class_img_stored_in_bdd).length < 50) && String(ismetiermanaged) === "0" && String(userimgclassprofil).length > 100 && +
+ autre + {/*props.formation.institut_formation &&
Dispensé par :
+ {String(props.formation.institut_formation)}
*/} +
} + + {(!class_img_stored_in_bdd || String(class_img_stored_in_bdd).length < 50) && String(ismetiermanaged) === "0" && String(userimgclassprofil).length <= 100 && +
+ autre + {/*props.formation.institut_formation &&
Dispensé par :
+ {String(props.formation.institut_formation)}
*/} +
} + + {(!class_img_stored_in_bdd || String(class_img_stored_in_bdd).length < 50) && String(ismetiermanaged) === "1" && +
+ autre + {/*props.formation.institut_formation &&
Dispensé par :
+ {String(props.formation.institut_formation)}
*/} +
} + + +
+
+
+ {props.formation.note && String(props.formation.note).length === 1 && + parseInt(String(props.formation.note)) <= 5 && + + } +
+ +

{String(parse(String(props.formation.title).replace(/(<([^>]+)>)/ig, ''))).substring(0, 50)}

+ {props.formation.discounted_price && props.formation.business_prices &&

{props.formation.discounted_price} € + {parseFloat(String(props.formation.partnaire_tva)) > 0 && <> HT  } + {parseFloat(String(props.formation.partnaire_tva)) <= 0 && <> TTC  } + +

} + + {props.formation.business_prices && props.formation.business_prices.length <= 0 && props.formation.inscription_direct !== "1" + + &&

+ + {parseFloat(String(props.formation.price)) <= 0 && <> Gratuit } + {parseFloat(String(props.formation.price)) > 0 && <> {props.formation.price} € } + + {parseFloat(String(props.formation.partnaire_tva)) > 0 && parseFloat(String(props.formation.price)) > 0 && <> HT  } + {parseFloat(String(props.formation.partnaire_tva)) <= 0 && parseFloat(String(props.formation.price)) > 0 && <> TTC  } +

} + + {props.formation.business_prices && props.formation.business_prices.length > 0 && props.formation.inscription_direct !== "1" && +

+ +

{props.formation.business_prices[0].discounted_price}€ + {parseFloat(String(props.formation.partnaire_tva)) > 0 && <> HT  } + {parseFloat(String(props.formation.partnaire_tva)) <= 0 && <> TTC  } + + {props.formation.price} € + {parseFloat(String(props.formation.partnaire_tva)) > 0 && <> HT  } + {parseFloat(String(props.formation.partnaire_tva)) <= 0 && <> TTC  } + + + ({props.formation.business_prices[0].discount} %)

+

} + +

{String(parse(String(props.formation.description).replace(/(<([^>]+)>)/ig, ''))).substring(0, 80)}...

+
+ +
+
+ + +
+
+ ))} + +
+ + ) +} + + +export default Session_Partner_Catalog_Special_Partner; \ No newline at end of file diff --git a/src/components/Module_Atelier_Catalogue.js b/src/components/Module_Atelier_Catalogue.js new file mode 100644 index 0000000..911cf1c --- /dev/null +++ b/src/components/Module_Atelier_Catalogue.js @@ -0,0 +1,720 @@ +import React, { useMemo, useState, useEffect } from "react"; +import Dialog from '@mui/material/Dialog'; +import DialogActions from '@mui/material/DialogActions'; +import DialogContent from '@mui/material/DialogContent'; +import DialogContentText from '@mui/material/DialogContentText'; +import DialogTitle from '@mui/material/DialogTitle'; +import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif"; +import { Fab } from "@material-ui/core"; +import Module_Alert_Confirmation from "./Module_Alert_Confirmation"; +import Autocomplete from '@mui/material/Autocomplete'; +import TextField from '@mui/material/TextField'; +import Button from '@mui/material/Button'; +import axios from "axios"; +import { + Bell, + BookOpen, + Building2, + CalendarDays, + ChevronDown, + ChevronRight, + Clock3, + Heart, + Home, + Laptop, + MapPin, + Monitor, + Search, + SlidersHorizontal, + Sparkles, + Star, + Tag, + UsersRound, +} from "lucide-react"; +import "./AteliersCatalogue.css"; + +import CancelPresentationIcon from '@mui/icons-material/CancelPresentation'; +import { makeStyles } from "@material-ui/core/styles"; +import Paper from '@material-ui/core/Paper'; +import Draggable from 'react-draggable'; +import { IconButton } from '@material-ui/core'; + +function PaperComponent(props) { + return ( + + + + ); +} + +const useStyles = makeStyles((theme) => ({ + + dialog: { + position: 'absolute', + // left: 10, + top: 400 + }, + + paper: { + overflowY: 'unset', + }, + customizedButton: { + position: 'absolute', + left: '98%', + top: '-3%', + backgroundColor: 'lightgray', + color: 'gray', + }, +})); + +const formations = [ + { + _id: "f1", + title: "Poser des règles et des limites aux enfants accueillis", + description: + "Le fonctionnement émotionnel du petit et ses besoins en sécurité pour se développer. Apprenez à poser un cadre bienveillant et sécurisant adapté à chaque enfant.", + image: + "https://images.unsplash.com/photo-1516321497487-e288fb19713f?auto=format&fit=crop&w=900&q=80", + rating: "4,6", + reviews: 128, + price: "270 € HT", + duration: "7 heures", + audience: "Professionnels de la petite enfance", + badge: "Non CPF", + badgeType: "danger", + highlight: "Populaire", + icon: , + iconTone: "blue", + ateliers: [ + { + code: "ADF_20260421_A", + date: "21 avril 2026", + time: "9h00 – 17h00", + mode: "Présentiel", + city: "Lyon", + zip: "69003", + places: 6, + cta: "Voir les détails", + }, + { + code: "ADF_20260512_D", + date: "12 mai 2026", + time: "9h00 – 17h00", + mode: "Distanciel", + city: "En ligne", + zip: "", + places: 10, + cta: "Voir les détails", + }, + { + code: "ADF_20260616_H", + date: "16 juin 2026", + time: "9h00 – 17h00", + mode: "Hybride", + city: "Paris", + zip: "75011", + places: 7, + cta: "S’inscrire", + }, + ], + }, + { + _id: "f2", + title: "Accueillir un enfant en situation de handicap", + description: + "Comprendre les différents types de handicap et leurs impacts au quotidien. Adapter l’accueil et les pratiques pour favoriser l’inclusion et le bien-être.", + image: + "https://images.unsplash.com/photo-1544776193-352d25ca82cd?auto=format&fit=crop&w=900&q=80", + rating: "4,8", + reviews: 92, + price: "Gratuit", + duration: "7 heures", + audience: "Professionnels de la petite enfance", + badge: "CPF", + badgeType: "success", + highlight: "Nouveau", + icon: , + iconTone: "green", + ateliers: [ + { + code: "ADF_20260505_P", + date: "5 mai 2026", + time: "9h00 – 17h00", + mode: "Présentiel", + city: "Marseille", + zip: "13002", + places: 8, + cta: "Voir les détails", + }, + { + code: "ADF_20260602_D", + date: "2 juin 2026", + time: "9h00 – 17h00", + mode: "Distanciel", + city: "En ligne", + zip: "", + places: 12, + cta: "S’inscrire", + }, + ], + }, + { + _id: "f3", + title: "Développer le langage chez le jeune enfant", + description: + "Stimuler le langage oral et accompagner les premières acquisitions à travers des jeux, des histoires et des interactions adaptées.", + image: + "https://images.unsplash.com/photo-1503676260728-1c00da094a0b?auto=format&fit=crop&w=900&q=80", + rating: "4,5", + reviews: 76, + price: "210 € HT", + duration: "7 heures", + audience: "Professionnels de la petite enfance", + badge: "CPF", + badgeType: "success", + highlight: "Populaire", + icon: , + iconTone: "purple", + ateliers: [ + { + code: "ADF_20260428_L", + date: "28 avril 2026", + time: "9h00 – 17h00", + mode: "Présentiel", + city: "Lille", + zip: "59000", + places: 9, + cta: "Voir les détails", + }, + { + code: "ADF_20260519_D", + date: "19 mai 2026", + time: "9h00 – 17h00", + mode: "Distanciel", + city: "En ligne", + zip: "", + places: 15, + cta: "Voir les détails", + }, + { + code: "ADF_20260609_H", + date: "9 juin 2026", + time: "9h00 – 17h00", + mode: "Hybride", + city: "Toulouse", + zip: "31000", + places: 6, + cta: "S’inscrire", + }, + ], + }, +]; + +const filters = [ + { label: "Tous les filtres", icon: }, + { label: "Présentiel", icon: }, + { label: "Distanciel", icon: }, + { label: "Hybride", icon: }, + { label: "CPF", icon: }, + { label: "Gratuit", icon: }, + { label: "Payant", icon: }, +]; + +function Stars() { + return ( +
+ {[1, 2, 3, 4, 5].map((item) => ( + + ))} +
+ ); +} + +function ModeIcon({ mode }) { + if (mode === "Distanciel") return ; + if (mode === "Hybride") return ; + return ; +} + +function FormationCard_orig({ formation }) { + return ( +
+
+
+ + +
+ +
+ + +
+

{formation.title}

+

{formation.description}

+ + +
+
+ + +
+ +
+
+
+ Ateliers disponibles + {formation.ateliers.length} +
+ +
+ +
+ {formation.ateliers.map((atelier) => ( +
+
+ {atelier.code} + Code session +
+ +
+ +
+ {atelier.date} + {atelier.time} +
+
+ +
+ +
+ {atelier.mode} + Mode +
+
+ +
+ +
+ {atelier.city} + {atelier.zip || "Classe virtuelle"} +
+
+ +
+ +
+ {atelier.places} places + disponibles +
+
+ + +
+ ))} +
+
+
+ ); +} + + +export default function Module_Atelier_Catalogue(props) { + const [activeTab, setActiveTab] = useState("formations"); + + const classes = useStyles(); + + + const totalAteliers = useMemo( + () => formations.reduce((acc, formation) => acc + formation.ateliers.length, 0), + [] + ); + + function FormationCard({ formation }) { + return ( +
+
+
+ + +
+ +
+ + +
+

{formation.title}

+

{formation.description}

+ + +
+
+ + +
+ + {formation && formation.external_code &&
external_code = {formation.external_code}
} + + + {formation && formation.tab_session &&
+
+
+ Ateliers disponibles + {formation.tab_session.length} +
+ +
+ +
+ {formation.tab_session.map((atelier) => ( +
+
+ {atelier.code_session} + Code +
+ +
+ +
+ {atelier.date_debut} + {formation.duration} +
+
+ +
+ +
+ {atelier.mode_animation === "0" && Présentiel} + {atelier.mode_animation === "1" && Distanciel} + {atelier.mode_animation === "2" && Hybride} + Mode +
+
+ +
+ +
+ {atelier.ville} + {atelier.mode_animation === "1" && En ligne} + {atelier.mode_animation !== "1" && atelier.ville && {atelier.ville}} +
+
+ +
+ +
+ {atelier.nb_participant} places + disponibles +
+
+ + +
+ ))} +
+
} +
+ ); + } + + + useEffect(() => { + // console.log(" ### props.formations = ", props.formations) + + }, []) + + const [Dialog_add_inscription_message, setDialog_add_inscription_message] = React.useState(false); + const [Dialog_add_inscription_open, setDialog_add_inscription_open] = React.useState(false); + function Dialog_add_inscription_handle_change_participant_session(message) { + setDialog_add_inscription_message(message); + setDialog_add_inscription_open(true); + } + + + const Dialog_add_inscription_handleClose_buton = () => { + setDialog_add_inscription_open(false); + init_inscrit_info(); + }; + + + const [selected_session_id, setselected_session_id] = useState(""); + const [selected_session_code, setselected_session_code] = useState(""); + const [inscrit_nom, setinscrit_nom] = useState(""); + const [inscrit_prenom, setinscrit_prenom] = useState(""); + const [inscrit_telephone, setinscrit_telephone] = useState(""); + const [inscrit_email, setinscrit_email] = useState(""); + + function init_inscrit_info() { + setselected_session_id(""); + setselected_session_code(""); + setinscrit_nom(""); + setinscrit_prenom(""); + setinscrit_telephone(""); + setinscrit_email(""); + } + + + return ( +
+ + {/*** Dialog pour reinscrire un apprenant à une session */} + null} + + PaperProps={{ + className: classes.paper, // Apply the paper style + style: { + overflowY: 'unset', + position: 'absolute', + top: '10rem', + margin: "2px", + }, + }} + hideBackdrop={true} + disableScrollLock + classes={{ + paper: classes.dialog + }} + + PaperComponent={PaperComponent} + aria-labelledby="draggable-dialog-title" + > + + Inscription Atelier : {selected_session_code} - {selected_session_id} + + + + + + + + + +
  + +
+
+ + + + + + + +
+
+ +
+
+ +
+
+ +
+ + +
+ + + {/*** Fin Dialog pour reinscrire un apprenant à une session */} + + + + +
+
+
+ mySY +
+ + + +
+ + +
+
+ +
+
+

Nos ateliers

+

Trouvez la formation qui vous correspond et inscrivez-vous à l’atelier de votre choix.

+
+ +
+ + +
+
+ +
+
+ + + +
+ +
+
+ {filters.map((filter) => ( + + ))} +
+ + +
+
+ +
+ {props.formations.length} formations · {totalAteliers} ateliers ouverts +
+ +
+ {props.formations.map((formation) => ( + <> + + {formation.external_code && } + + + + + + ))} +
+
+ +
+ ); +} + + +const local_css = ` +.formation-copy h2 { + text-align: justify; + font-family: DM Sans; +} + +.formation-copy p { + text-align: justify; +} + +`; \ No newline at end of file diff --git a/src/components/Module_Atelier_Catalogue_ORIG.js b/src/components/Module_Atelier_Catalogue_ORIG.js new file mode 100644 index 0000000..f4da44c --- /dev/null +++ b/src/components/Module_Atelier_Catalogue_ORIG.js @@ -0,0 +1,428 @@ +import React, { useMemo, useState, useEffect } from "react"; +import { + Bell, + BookOpen, + Building2, + CalendarDays, + ChevronDown, + ChevronRight, + Clock3, + Heart, + Home, + Laptop, + MapPin, + Monitor, + Search, + SlidersHorizontal, + Sparkles, + Star, + Tag, + UsersRound, +} from "lucide-react"; +import "./AteliersCatalogue.css"; + +const formations = [ + { + _id: "f1", + title: "Poser des règles et des limites aux enfants accueillis", + description: + "Le fonctionnement émotionnel du petit et ses besoins en sécurité pour se développer. Apprenez à poser un cadre bienveillant et sécurisant adapté à chaque enfant.", + image: + "https://images.unsplash.com/photo-1516321497487-e288fb19713f?auto=format&fit=crop&w=900&q=80", + rating: "4,6", + reviews: 128, + price: "270 € HT", + duration: "7 heures", + audience: "Professionnels de la petite enfance", + badge: "Non CPF", + badgeType: "danger", + highlight: "Populaire", + icon: , + iconTone: "blue", + ateliers: [ + { + code: "ADF_20260421_A", + date: "21 avril 2026", + time: "9h00 – 17h00", + mode: "Présentiel", + city: "Lyon", + zip: "69003", + places: 6, + cta: "Voir les détails", + }, + { + code: "ADF_20260512_D", + date: "12 mai 2026", + time: "9h00 – 17h00", + mode: "Distanciel", + city: "En ligne", + zip: "", + places: 10, + cta: "Voir les détails", + }, + { + code: "ADF_20260616_H", + date: "16 juin 2026", + time: "9h00 – 17h00", + mode: "Hybride", + city: "Paris", + zip: "75011", + places: 7, + cta: "S’inscrire", + }, + ], + }, + { + _id: "f2", + title: "Accueillir un enfant en situation de handicap", + description: + "Comprendre les différents types de handicap et leurs impacts au quotidien. Adapter l’accueil et les pratiques pour favoriser l’inclusion et le bien-être.", + image: + "https://images.unsplash.com/photo-1544776193-352d25ca82cd?auto=format&fit=crop&w=900&q=80", + rating: "4,8", + reviews: 92, + price: "Gratuit", + duration: "7 heures", + audience: "Professionnels de la petite enfance", + badge: "CPF", + badgeType: "success", + highlight: "Nouveau", + icon: , + iconTone: "green", + ateliers: [ + { + code: "ADF_20260505_P", + date: "5 mai 2026", + time: "9h00 – 17h00", + mode: "Présentiel", + city: "Marseille", + zip: "13002", + places: 8, + cta: "Voir les détails", + }, + { + code: "ADF_20260602_D", + date: "2 juin 2026", + time: "9h00 – 17h00", + mode: "Distanciel", + city: "En ligne", + zip: "", + places: 12, + cta: "S’inscrire", + }, + ], + }, + { + _id: "f3", + title: "Développer le langage chez le jeune enfant", + description: + "Stimuler le langage oral et accompagner les premières acquisitions à travers des jeux, des histoires et des interactions adaptées.", + image: + "https://images.unsplash.com/photo-1503676260728-1c00da094a0b?auto=format&fit=crop&w=900&q=80", + rating: "4,5", + reviews: 76, + price: "210 € HT", + duration: "7 heures", + audience: "Professionnels de la petite enfance", + badge: "CPF", + badgeType: "success", + highlight: "Populaire", + icon: , + iconTone: "purple", + ateliers: [ + { + code: "ADF_20260428_L", + date: "28 avril 2026", + time: "9h00 – 17h00", + mode: "Présentiel", + city: "Lille", + zip: "59000", + places: 9, + cta: "Voir les détails", + }, + { + code: "ADF_20260519_D", + date: "19 mai 2026", + time: "9h00 – 17h00", + mode: "Distanciel", + city: "En ligne", + zip: "", + places: 15, + cta: "Voir les détails", + }, + { + code: "ADF_20260609_H", + date: "9 juin 2026", + time: "9h00 – 17h00", + mode: "Hybride", + city: "Toulouse", + zip: "31000", + places: 6, + cta: "S’inscrire", + }, + ], + }, +]; + +const filters = [ + { label: "Tous les filtres", icon: }, + { label: "Présentiel", icon: }, + { label: "Distanciel", icon: }, + { label: "Hybride", icon: }, + { label: "CPF", icon: }, + { label: "Gratuit", icon: }, + { label: "Payant", icon: }, +]; + +function Stars() { + return ( +
+ {[1, 2, 3, 4, 5].map((item) => ( + + ))} +
+ ); +} + +function ModeIcon({ mode }) { + if (mode === "Distanciel") return ; + if (mode === "Hybride") return ; + return ; +} + +function FormationCard({ formation }) { + return ( +
+
+
+ + +
+ +
+
+ {formation.icon} +
+ +
+

{formation.title}

+

{formation.description}

+ +
+ + {formation.rating} ({formation.reviews} avis) +
+
+
+ + +
+ +
+
+
+ Ateliers disponibles + {formation.ateliers.length} +
+ +
+ +
+ {formation.ateliers.map((atelier) => ( +
+
+ {atelier.code} + Code session +
+ +
+ +
+ {atelier.date} + {atelier.time} +
+
+ +
+ +
+ {atelier.mode} + Mode +
+
+ +
+ +
+ {atelier.city} + {atelier.zip || "Classe virtuelle"} +
+
+ +
+ +
+ {atelier.places} places + disponibles +
+
+ + +
+ ))} +
+
+
+ ); +} + +export default function Module_Atelier_Catalogue_ORIG(props) { + const [activeTab, setActiveTab] = useState("formations"); + + const totalAteliers = useMemo( + () => formations.reduce((acc, formation) => acc + formation.ateliers.length, 0), + [] + ); + + useEffect(() => { + console.log(" ### props.formations = ", props.formations) + + }, []) + + + return ( +
+
+
+
+ mySY +
+ + + +
+ + +
+
+ +
+
+

Nos ateliers

+

Trouvez la formation qui vous correspond et inscrivez-vous à l’atelier de votre choix.

+
+ +
+ + +
+
+ +
+
+ + + +
+ +
+
+ {filters.map((filter) => ( + + ))} +
+ + +
+
+ +
+ {formations.length} formations · {totalAteliers} ateliers ouverts +
+ +
+ {formations.map((formation) => ( + + ))} +
+
+ +
+ ); +} diff --git a/src/components/Module_Session_Planification.js b/src/components/Module_Session_Planification.js index d55f245..e5eee25 100644 --- a/src/components/Module_Session_Planification.js +++ b/src/components/Module_Session_Planification.js @@ -1196,6 +1196,7 @@ const Module_Session_Planification = (props) => { setAdd_One_Sequence_Session_Ressource_result(res.data.message); Getall_List_Sequence_Ressource(selected_sequence_id); + Getall_Sequence_Of_Session(selected_session_id); setDialog_seq_ressource_1_selected_type_ressource(""); setDialog_seq_ressource_1_selected_ressource_id(""); @@ -1275,7 +1276,7 @@ const Module_Session_Planification = (props) => { setAdd_One_Ressource_Fom_Dialog_Sequence_result(res.data.message); Getall_List_Sequence_Ressource(selected_sequence_id); - + Getall_Sequence_Of_Session(selected_session_id); setDialog_seq_ressource_1_selected_type_ressource(""); setDialog_seq_ressource_1_selected_ressource_id(""); setDialog_seq_ressource_1_selected_ressource_poste(""); @@ -1668,7 +1669,7 @@ const Module_Session_Planification = (props) => { setAdd_One_Sequence_Session_Ressource_Mass_result(res.data.message); Getall_List_Sequence_Ressource(selected_sequence_id); - + Getall_Sequence_Of_Session(selected_session_id); setDialog_seq_ressource_1_selected_type_ressource(""); setDialog_seq_ressource_1_selected_ressource_id(""); setDialog_seq_ressource_1_selected_ressource_poste(""); @@ -1824,7 +1825,7 @@ const Module_Session_Planification = (props) => { local_session_color = "#3573CB" } - // console.log(" ## PROMO local_session_color = ", local_session_color) + // console.log(" ## PROMO local_session_color = ", local_session_color) //--- var node = { "_id": local_id, @@ -2831,6 +2832,8 @@ const Module_Session_Planification = (props) => { setGet_Ressource_Avabilities_avability_check(""); setcheck_ressource_avabilities(""); setDialog_seq_ressource_1_open(false); + + }; const handleEventClick = (arg) => { @@ -7275,7 +7278,7 @@ const Module_Session_Planification = (props) => { setp_detail_sequence_ue_id(value._id); Get_List_Given_UE_Planif_lines(value._id); setp_detail_sequence_title(Distinct_UE_New_Getall_Session_List_UE_result.filter((data) => (data)._id === String(value._id))[0].label); - // console.log(" domaine_competence_id = ", value.domaine_competence_id); + // console.log(" domaine_competence_id = ", value.domaine_competence_id); setp_detail_sequence_domaine_competence_id(value.domaine_competence_id); } else { setp_detail_sequence_ue_id(""); @@ -7341,32 +7344,32 @@ const Module_Session_Planification = (props) => {
Groupe apprenants - {New_Getall_Partner_Groupe_Inscrit_result && New_Getall_Partner_Groupe_Inscrit_result.length > 0 && - 0 && + (data)._id === String(p_detail_sequence_groupe_apprenant_id))[0].label} - options={New_Getall_Partner_Groupe_Inscrit_result} + fullWidth + // value={New_Getall_Partner_Groupe_Inscrit_result.filter((data) => (data)._id === String(p_detail_sequence_groupe_apprenant_id))[0].label} + options={New_Getall_Partner_Groupe_Inscrit_result} - multiple - onChange={(event, newValue) => { - setval_grp_apprenant([ - ...fixedVal_grp_apprenant, - ...newValue.filter((i) => fixedVal_grp_apprenant.indexOf(i) === -1), - ]); + multiple + onChange={(event, newValue) => { + setval_grp_apprenant([ + ...fixedVal_grp_apprenant, + ...newValue.filter((i) => fixedVal_grp_apprenant.indexOf(i) === -1), + ]); - }} - value={val_grp_apprenant} + }} + value={val_grp_apprenant} - renderInput={(params) => - } - />} + renderInput={(params) => + } + />}
@@ -7628,8 +7631,8 @@ const Module_Session_Planification = (props) => {
)} - - + + } @@ -8005,14 +8008,14 @@ const Module_Session_Planification = (props) => { {display_view && String(display_view) === "planning" && Getall_Sequence_Of_Session_result_planning_view &&
-   +  
{ @@ -1041,16 +1044,11 @@ const Mon_Catalogue_Public = (props) => { whosisconnected(); if (categorie) { - //console.log(" ### categorie = ", categorie); setmymetier(categorie); } else { setmymetier(); } - //document.getElementById("_1234").checked = true; - - - }, [initAllfiter, categorie]); @@ -1319,7 +1317,7 @@ const Mon_Catalogue_Public = (props) => { form.append("user_state", state); form.append("subdomain", window.location.host.split(".")[0]); - + var myurl = "" if (displayAllClasses == true) { myurl = process.env.REACT_APP_API_URL + "myclass/api/get_all_class_Given_partner_owner_recid_No_Login/"; @@ -1333,7 +1331,7 @@ const Mon_Catalogue_Public = (props) => { axios.post(myurl, form).then(res => { if (String(res.data.status) != String("false")) { //console.log(" In test res.data.status = " + res.data.status); - // console.log(" In test res.data.message = " + res.data.message); + // console.log(" In test res.data.message = " + res.data.message); setmyApiResponse("True"); setResult(res.data.message) @@ -1397,7 +1395,7 @@ const Mon_Catalogue_Public = (props) => { if (typeof (NewSearchText) === "undefined" || String(NewSearchText) === '') { crit_SearchText = ""; - myurl = process.env.REACT_APP_API_URL + "myclass/api/get_all_class_Given_partner_owner_recid_No_Login/"; + myurl = process.env.REACT_APP_API_URL + "myclass/api/get_all_class_Given_partner_owner_recid_No_Login_With_Valide_Session/"; form.append("subdomain", window.location.host.split(".")[0]); //console.log(" ######### laaaaaaaaaaaaa subdomain = ", window.location.host.split(".")[0]) @@ -1475,11 +1473,11 @@ const Mon_Catalogue_Public = (props) => { } - //alert("myurl = " + myurl); + // alert("myurl = " + myurl); axios.post(myurl, form).then(res => { if (String(res.data.status) != String("false")) { //console.log(" In test res.data.status = " + res.data.status); - //console.log(" In DisplayXfirstClas res.data.message = " + res.data.message); + // console.log(" In DisplayXfirstClas res.data.message = " + res.data.message); setmyApiResponse("True"); setResult(res.data.message) @@ -2528,11 +2526,11 @@ const Mon_Catalogue_Public = (props) => { domain = url.split('://')[1]; } - // console.log(" ### local_url_subdomain = ", local_url_subdomain); + // console.log(" ### local_url_subdomain = ", local_url_subdomain); const subdomain = domain.split('.')[0]; - // console.log(" ### subdomain = ", subdomain); + // console.log(" ### subdomain = ", subdomain); var form = new FormData(); @@ -2543,8 +2541,8 @@ const Mon_Catalogue_Public = (props) => { axios.post(myurl, form).then(res => { if (String(res.data.status) === "true") { - // console.log(" In Get_Subdomain_Partner_Data res.data.status = " + res.data.status); - // console.log(" In Get_Subdomain_Partner_Data res.data.message r_class = " + res.data.message); + // console.log(" In Get_Subdomain_Partner_Data res.data.status = " + res.data.status); + // console.log(" In Get_Subdomain_Partner_Data res.data.message r_class = " + res.data.message); setGet_Subdomain_Partner_Data_api("true"); setGet_Subdomain_Partner_Data_result(res.data.message); @@ -2723,7 +2721,7 @@ const Mon_Catalogue_Public = (props) => { if (JSON.parse(x).affiche_contact) catalog_pub_affiche_contact = JSON.parse(x).affiche_contact; - // console.log(" ### setmy_theme_code = ", theme_code); + // console.log(" ### setmy_theme_code = ", theme_code); //--- @@ -2789,7 +2787,7 @@ const Mon_Catalogue_Public = (props) => { "affiche_contact": catalog_pub_affiche_contact, }; - // console.log(" --- node = ", node); + // console.log(" --- node = ", node); new_data2.push(node); }); @@ -2834,6 +2832,8 @@ const Mon_Catalogue_Public = (props) => { } + const [display_formation_session, setdisplay_formation_session] = useState("formation"); + return ( @@ -2876,7 +2876,7 @@ const Mon_Catalogue_Public = (props) => {  
- +
@@ -2952,7 +2952,7 @@ const Mon_Catalogue_Public = (props) => {
} - + {String(New_Get_Subdomain_Partner_Data_result[0].affiche_contact) === "1" &&
Contact
@@ -2973,7 +2973,7 @@ const Mon_Catalogue_Public = (props) => {
-
+
Nos Formations & Tutoriels
{showelement === "true" &&
@@ -4823,7 +4823,24 @@ const Mon_Catalogue_Public = (props) => {
-

Nos Formations

+

Nos Formations

+ +
+ + + + + + +
{
-
+ {display_formation_session !== "session" &&
@@ -4925,7 +4942,65 @@ const Mon_Catalogue_Public = (props) => { ))}
-
+
} + + {display_formation_session === "session22" &&
+ +
+ + {result && myApiResponse == "True" && fin == 0 && !newresult && + result.slice(0, PageSize).map((formation) => ( +
+
+ +
+ +
+ + ))} + + {result && myApiResponse == "True" && fin == 0 && newresult && + newresult.slice(0, PageSize).map((formation) => ( +
+ +
+ + ))} + + + + {result && myApiResponse === "True" && fin === 1 && !newresult + && currentTableData2 + && currentTableData2.map((formation) => ( +
+ +
+ + ))} + + {result && myApiResponse === "True" && fin === 1 && newresult + && currentTableData2 + && currentTableData2.map((formation) => ( +
+ + +
+ + ))} + +
+
} + + {display_formation_session === "session" &&
+ + +
}
diff --git a/src/components/Mon_Catalogue_Public_ORIG_040726.js b/src/components/Mon_Catalogue_Public_ORIG_040726.js new file mode 100644 index 0000000..a7d0586 --- /dev/null +++ b/src/components/Mon_Catalogue_Public_ORIG_040726.js @@ -0,0 +1,4946 @@ +import React, { useRef, useState, useMemo, useEffect } from "react"; +import { useForm } from "react-hook-form"; +import axios from "axios"; +import Formation_Partner_Catalog from "./Formation_Partner_Catalog"; +import { FaSearch, FaRegArrowAltCircleDown, FaRegArrowAltCircleUp } from 'react-icons/fa'; + +import { IoAppsSharp, IoListSharp } from "react-icons/io5"; +import Formation_Grid_2Col from "./Formation_Grid_2Col"; +import Pagination from "./TestPagination"; + +import { useHistory } from "react-router-dom"; +import { getCookie, removeCookie } from 'react-use-cookie'; +import { Helmet } from "react-helmet"; + +import AideRecherche from "./AideRecherche" +import { useParams } from 'react-router-dom' +import Fotter_Catalog_Pub from "./Fotter_Catalog_Pub"; + +import img_header_jmg from "../mysy_img2/img_jmj_modif.jpg" +import Formation_Partner_Catalog_Special_JMJFormation from "./Jmj_Theme/Formation_Partner_Catalog_Special_JMJFormation"; +import "./Jmj_Theme/jmj_formation.css"; + +import { confirmAlert } from 'react-confirm-alert'; // Import +import { useCookies } from "react-cookie"; +import InputRange from 'react-input-range'; +import 'react-input-range/lib/css/index.css'; +import tick_ko from "../mysy_img/tick_KO.png"; +import img_header from "../mysy_img2/img_header.png" +import { TbArrowsDownUp } from "react-icons/tb"; +import { CiCircleRemove, CiCircleMinus } from "react-icons/ci"; +let PageSize = 10; +const Mon_Catalogue_Public_ORIG_040726 = (props) => { + + + const { type, categorie } = useParams(); + const { NewSearchText } = useParams(); + const [v11, setv11] = useState(""); + const [userconnected, setuserconnected] = useState("0"); + const [TrainingSupport, setTrainingSupport] = useState(""); + const [TrainingType, setTrainingType] = useState(""); + const [TrainingCertif, setTrainingCertif] = useState(""); + const [TrainingCPF, setTrainingCPF] = useState(""); + const [TrainingLang, setTrainingLang] = useState(""); + const [TrainingPrice, setTrainingPrice] = useState(""); + const [SearchText, setSearchText] = useState(""); + const [SearchcitiesText, setSearchcitiesText] = useState(""); + const [result, setResult] = useState(""); + const [myApiResponse, setmyApiResponse] = useState("false"); + const [displayAllClasses, setdisplayAllClasses] = useState("0"); + const [showelement, setshowelement] = useState("init"); + const [country_code, setcountry_code] = useState("FR"); + const [country_name, setcountry_name] = useState("France"); + const [city, setcity] = useState("Paris"); + const [postal, setpostal] = useState("75001"); + const [latitude, setlatitude] = useState("48.861000061035156"); + const [longitude, setlongitude] = useState("2.3380000591278076"); + const [IPv4, setIPv4] = useState("172.71.122.128"); + const [state, setstate] = useState("France"); + const [userIp, setuserIp] = useState("172.71.122.128"); + const [currentPage, setCurrentPage] = useState(1); + const [currentPage2, setCurrentPage2] = useState(1); + const [fin, setfin] = useState(0); + const [ismobilephone, setismobilephone] = useState(); + const [TrainingDistanciel, setTrainingDistanciel] = useState(); + const textInput = useRef(null); + const scrollDiv = useRef(null); + + const [url_subdomain, seturl_subdomain] = useState(window.location.host.split(".")[0]); + + + const [textplaceholder, settextplaceholder] = useState(""); + const [empltysearch, setempltysearch] = useState("1"); + const [empltycitiessearch, setempltycitiessearch] = useState("1"); + + const [filtredistance, setfiltredistance] = useState("0"); + const continent = ['oui', 'non']; + const [selectedcontinent, setselectedcontinent] = useState(""); + const [newresult, setnewresult] = useState(); + const stored_user = getCookie('tokenmysych'); + const history = useHistory(); + const [besoinaiderecherche, setbesoinaiderecherche] = useState(""); + const [istrier, setistrier] = useState(); + const [selectmetier, setselectmetier] = useState(); + const [initAllfiter, setinitAllfiter] = useState(); + const testDivRef = useRef(null); + const [partcookie, setpartCookie, removepartCookie] = useCookies(['tokenmysypart']); + const inputEl = useRef(null); + + + + + const url = process.env.REACT_APP_API_URL + "myclass/api/add_user_account/"; + const { + register, + formState: { errors }, + handleSubmit, + watch, + } = useForm(); + const pwd = useRef({}); + pwd.current = watch("pwd", ""); + + + + const onSubmit = async (data) => { + + searchFunction(); + }; + + const [Trainingdistance, setTrainingdistance] = useState(0); + const handleInput = (e) => { + setTrainingdistance(e.target.value); + } + + const [Trainingduration, setTrainingduration] = useState(0); + const handleInputDuration = (e) => { + setTrainingduration(e.target.value); + } + + + function showdisplayfilter(event) { + + if (showelement == "true") { + setshowelement("false"); + document.getElementById('block_partner').style.top = "5200px" + document.getElementById('pieddepage_v2').style.top = "5800px" + } + else if (showelement == "false") { + setshowelement("true"); + document.getElementById('block_partner').style.top = "6300px" + document.getElementById('pieddepage_v2').style.top = "6800px" + } + + + } + + function clearsearchtext(event) { + setSearchText(""); + setResult([]); + document.getElementById("SearchText").value = ""; + setempltysearch("1") + setbesoinaiderecherche(""); + settext(""); + DisplayXfirstClas(); + } + + const [suggestion2, setsuggestion2] = useState([]); + const [suggestioncities, setsuggestioncities] = useState([]); + + function SearchTextHandle(event) { + setempltysearch("0"); + setSearchText(event.target.value); + + var val = String(event.target.value).toLocaleLowerCase(); + let matches = []; + // 13/01 : A faire absolument. j'ai bloqué car bug d'affichage (pas au bon endroit) + + if (String(val).length > 2) { + matches = suggestedwords.filter(usr => { + //alert(JSON.parse(usr).name ); + const regex = new RegExp(`${val}`, "gi"); + return JSON.parse(usr).name.match(regex); + } + + ) + + } + + //console.log("matches = " + matches); + setsuggestion2(matches); + settext(event.target.value); + } + + function SearchcitiesHandle(event) { + setempltycitiessearch("0"); + setSearchcitiesText(event.target.value); + + var val = String(event.target.value).toLocaleLowerCase().trimStart(); + const regex = new RegExp(`^${val}`, "gi"); + + let matches = []; + + if (String(val).length > 2) { + matches = suggestedcities.filter(usr => { + return JSON.parse(usr).ville.match(regex); + }) + } + + //console.log("matches = " + matches); + setsuggestioncities(matches); + setcities(event.target.value); + + } + + + const [v1, setv1] = useState(); + const [v2, setv2] = useState(); + + + function TrainingSupportHandle(event) { + setsupportchecked("1"); + var toto = ""; + var filtre1 = ""; + var filtre2 = ""; + var filtre3 = ""; + + var crit_TrainingSupport = ""; + var crit_TrainingSupport22 = ""; + + + if (document.getElementById("supoort_list_derou")) { + crit_TrainingSupport = document.getElementById("supoort_list_derou").value; + + //console.log("crit_TrainingSupport = ", crit_TrainingSupport); + + if (crit_TrainingSupport.length > 0) { + filtre1 = result.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport); + setv11(filtre1); + } + else if (crit_TrainingSupport.length <= 0) { + /* l'utilisateur a choisi d'annuler le filter */ + annulefiltresupportchecked(); + return; + //filtre1 = result; + //setv11(filtre1); + } + } + + /* + + + + if (document.querySelector('input[name="TrainingSupport"]:checked')) { + crit_TrainingSupport = document.querySelector('input[name="TrainingSupport"]:checked').value; + if (crit_TrainingSupport.length > 0) { + filtre1 = result.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport); + setv11(filtre1); + } + else if (crit_TrainingSupport.length <= 0 || String(crit_TrainingSupport) === String("NA")) { + filtre1 = result; + setv11(filtre1); + } + + } + */ + + + var crit_TrainingCertif = ""; + if (document.querySelector('input[name="TrainingCertif"]:checked')) { + crit_TrainingCertif = document.querySelector('input[name="TrainingCertif"]:checked').value; + if (crit_TrainingCertif.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingCertif); + + } + + // recuperation du filtre du type (cours, tuto, etc) + var crit_TrainingType = ""; + if (document.querySelector('input[name="TrainingType"]:checked')) { + crit_TrainingType = document.querySelector('input[name="TrainingType"]:checked').value; + if (crit_TrainingType.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).type === crit_TrainingType); + + } + + // recuperation du filtre de la distance + var crit_Trainingdistance = ""; + if (document.querySelector('input[name="TrainingPresentiel"]:checked')) { + crit_Trainingdistance = document.querySelector('input[name="TrainingPresentiel"]:checked').value; + if (crit_Trainingdistance.length > 0) { + // filtre presentiel = 1 + if (String(crit_Trainingdistance) === String("1")) { + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.distantiel === "1"); + setv11(filtre1); + + } + else if (String(crit_Trainingdistance) === String("0")) { + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.presentiel === "1"); + setv11(filtre1); + } + } + } + // Recup du filtre de prix + var crit_TrainingPrice = range_price.min + ":" + range_price.max; + + if (range_price.min && range_price.max) { + filtre1 = filtre1.filter((maformation) => Number(JSON.parse(maformation).price) >= Number(range_price.min) && + Number(JSON.parse(maformation).price) <= Number(range_price.max) + ); + + setv11(filtre1); + } + + + setnewresult(filtre1); + + //alert("crit_TrainingCertif = " + crit_TrainingCertif + " ET crit_TrainingSupport = " + crit_TrainingSupport + " ET crit_TrainingType = " + crit_TrainingType); + //console.log("############################ filtre1 = " + filtre1); + setCurrentPage2(1); + //console.log(" ????????????????????????????filtre2 = "+filtre2); + + } + + + + function TrainingCertifHandle(event) { + + var ele = document.querySelector('input[name="TrainingCertif"]:checked').value + + var toto = ""; + var filtre1 = ""; + var filtre2 = ""; + var filtre3 = ""; + + setcertifchecked(""); + var crit_TrainingCertif = ""; + if (document.querySelector('input[name="TrainingCertif"]:checked')) { + setcertifchecked("1"); + crit_TrainingCertif = document.querySelector('input[name="TrainingCertif"]:checked').value + if (crit_TrainingCertif.length > 0) { + //alert(" laa = " + crit_TrainingCertif); + //console.log(result) + filtre1 = result.filter((maformation) => String(JSON.parse(maformation).certif) === String(crit_TrainingCertif)); + setv11(filtre1); + } + + } else { + + filtre1 = result; + setv11(filtre1); + } + + /* + // recuperation du filtre du support + var crit_TrainingSupport = ""; + if (document.querySelector('input[name="TrainingSupport"]:checked')) { + crit_TrainingSupport = document.querySelector('input[name="TrainingSupport"]:checked').value + if (crit_TrainingSupport.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport); + + } + */ + // recuperation du filtre du support + var crit_TrainingSupport = ""; + if (document.getElementById("supoort_list_derou")) { + crit_TrainingSupport = document.getElementById("supoort_list_derou").value; + if (crit_TrainingSupport.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport); + + } + + + // recuperation du filtre du CPF + var crit_TrainingCPF = ""; + if (document.querySelector('input[name="TrainingCPF"]:checked')) { + crit_TrainingCPF = document.querySelector('input[name="TrainingCPF"]:checked').value + if (crit_TrainingCPF.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).cpf === crit_TrainingCPF); + + } + + + // recuperation du filtre du type + var crit_TrainingType = ""; + if (document.querySelector('input[name="TrainingType"]:checked')) { + crit_TrainingType = document.querySelector('input[name="TrainingType"]:checked').value + if (crit_TrainingType.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingType); + + } + + // recuperation du filtre de la distance + var crit_Trainingdistance = ""; + if (document.querySelector('input[name="TrainingPresentiel"]:checked')) { + crit_Trainingdistance = document.querySelector('input[name="TrainingPresentiel"]:checked').value + if (crit_Trainingdistance.length > 0) { + // filtre presentiel = 1 + if (String(crit_Trainingdistance) === String("1")) { + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.distantiel === "1"); + setv11(filtre1); + + } + else if (String(crit_Trainingdistance) === String("0")) { + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.presentiel === "1"); + setv11(filtre1); + } + } + + } + + // Recup du filtre de prix + var crit_TrainingPrice = range_price.min + ":" + range_price.max; + + if (range_price.min && range_price.max) { + filtre1 = filtre1.filter((maformation) => Number(JSON.parse(maformation).price) >= Number(range_price.min) && + Number(JSON.parse(maformation).price) <= Number(range_price.max) + ); + + setv11(filtre1); + } + + + setnewresult(filtre1); + //alert("crit_TrainingCertif = " + crit_TrainingCertif + " ET crit_TrainingSupport = " + crit_TrainingSupport + " ET crit_TrainingType = " + crit_TrainingType); + //console.log("############################ filtre1 = " + filtre1); + setCurrentPage2(1); + //console.log(" ????????????????????????????filtre2 = "+filtre2); + + + return; + } + + + + // Pour le CPF + const [cpfchecked, setcpfchecked] = useState(); + function TrainingCPFHandle(event) { + + var ele = document.querySelector('input[name="TrainingCPF"]:checked').value + var myelement; + + if (document.getElementById('rech_middlebox')) { + myelement = document.getElementById('rech_middlebox'); + } + + + var toto = ""; + var filtre1 = ""; + var filtre2 = ""; + var filtre3 = ""; + + setcpfchecked(""); + var crit_TrainingCPF = ""; + if (document.querySelector('input[name="TrainingCPF"]:checked')) { + setcpfchecked("1"); + crit_TrainingCPF = document.querySelector('input[name="TrainingCPF"]:checked').value + if (crit_TrainingCPF.length > 0) { + //alert(" crit_TrainingCPF = " + crit_TrainingCPF); + + filtre1 = result.filter((maformation) => String(JSON.parse(maformation).cpf) === String(crit_TrainingCPF)); + setv11(filtre1); + //console.log(" #### ",filtre1); + } + + } else { + + filtre1 = result; + setv11(filtre1); + } + + // recuperation du filtre du certificat + var crit_TrainingCertif = ""; + if (document.querySelector('input[name="TrainingCertif"]:checked')) { + crit_TrainingCertif = document.querySelector('input[name="TrainingCertif"]:checked').value + if (crit_TrainingCertif.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingCertif); + + } + + + // recuperation du filtre du support + var crit_TrainingSupport = ""; + if (document.getElementById("supoort_list_derou")) { + crit_TrainingSupport = document.getElementById("supoort_list_derou").value; + if (crit_TrainingSupport.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport); + + } + + + // recuperation du filtre du type + var crit_TrainingType = ""; + if (document.querySelector('input[name="TrainingType"]:checked')) { + crit_TrainingType = document.querySelector('input[name="TrainingType"]:checked').value + if (crit_TrainingType.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingType); + + } + + // recuperation du filtre de la distance + var crit_Trainingdistance = ""; + if (document.querySelector('input[name="TrainingPresentiel"]:checked')) { + crit_Trainingdistance = document.querySelector('input[name="TrainingPresentiel"]:checked').value + if (crit_Trainingdistance.length > 0) { + // filtre presentiel = 1 + if (String(crit_Trainingdistance) === String("1")) { + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.distantiel === "1"); + setv11(filtre1); + + } + else if (String(crit_Trainingdistance) === String("0")) { + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.presentiel === "1"); + setv11(filtre1); + } + } + + + + } + + // Recup du filtre de prix + var crit_TrainingPrice = range_price.min + ":" + range_price.max; + + if (range_price.min && range_price.max) { + filtre1 = filtre1.filter((maformation) => Number(JSON.parse(maformation).price) >= Number(range_price.min) && + Number(JSON.parse(maformation).price) <= Number(range_price.max) + ); + + setv11(filtre1); + } + + + setnewresult(filtre1); + //alert("crit_TrainingCertif = " + crit_TrainingCertif + " ET crit_TrainingSupport = " + crit_TrainingSupport + " ET crit_TrainingType = " + crit_TrainingType); + //console.log("############################ filtre1 = " + filtre1); + setCurrentPage2(1); + //console.log(" ????????????????????????????filtre2 = "+filtre2); + if (myelement) { + myelement.scrollIntoView({ behavior: 'smooth' }); + } + + return; + } + + + // END PR CPF + function TrainingTypeHandle(event) { + + settypechecked("1"); + var toto = ""; + var filtre1 = ""; + var filtre2 = ""; + var filtre3 = ""; + + var myelement; + + if (document.getElementById('rech_middlebox')) { + myelement = document.getElementById('rech_middlebox'); + } + + var crit_TrainingPrice = ""; + + var crit_TrainingType = ""; + if (document.querySelector('input[name="TrainingType"]:checked')) { + crit_TrainingType = document.querySelector('input[name="TrainingType"]:checked').value + if (crit_TrainingType.length > 0) { + filtre1 = result.filter((maformation) => JSON.parse(maformation).type === crit_TrainingType); + setv11(filtre1); + } + + } else { + + filtre1 = result; + setv11(filtre1); + } + + // recuperation du filtre du support + var crit_TrainingSupport = ""; + if (document.getElementById("supoort_list_derou")) { + crit_TrainingSupport = document.getElementById("supoort_list_derou").value; + if (crit_TrainingSupport.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport); + + } + + + // recuperation du filtre du CPF + var crit_TrainingCPF = ""; + if (document.querySelector('input[name="TrainingCPF"]:checked')) { + crit_TrainingCPF = document.querySelector('input[name="TrainingCPF"]:checked').value + if (crit_TrainingCPF.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).cpf === crit_TrainingCPF); + + } + + // recuperation du filtre du certificat + var crit_TrainingCertif = ""; + if (document.querySelector('input[name="TrainingCertif"]:checked')) { + crit_TrainingCertif = document.querySelector('input[name="TrainingCertif"]:checked').value + if (crit_TrainingCertif.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingCertif); + + } + + // recuperation du filtre de la distance + var crit_Trainingdistance = ""; + if (document.querySelector('input[name="TrainingPresentiel"]:checked')) { + crit_Trainingdistance = document.querySelector('input[name="TrainingPresentiel"]:checked').value + if (crit_Trainingdistance.length > 0) { + // filtre presentiel = 1 + if (String(crit_Trainingdistance) === String("1")) { + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.distantiel === "1"); + setv11(filtre1); + + } + else if (String(crit_Trainingdistance) === String("0")) { + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.presentiel === "1"); + setv11(filtre1); + } + } + + } + + // Recup du filtre de prix + var crit_TrainingPrice = range_price.min + ":" + range_price.max; + + if (range_price.min && range_price.max) { + filtre1 = filtre1.filter((maformation) => Number(JSON.parse(maformation).price) >= Number(range_price.min) && + Number(JSON.parse(maformation).price) <= Number(range_price.max) + ); + + setv11(filtre1); + } + + + setnewresult(filtre1); + //alert("crit_TrainingCertif = " + crit_TrainingCertif + " ET crit_TrainingSupport = " + crit_TrainingSupport + " ET crit_TrainingType = " + crit_TrainingType); + //console.log("############################ filtre1 = " + filtre1); + setCurrentPage2(1); + //console.log(" ????????????????????????????filtre2 = "+filtre2); + + if (myelement) { + // 👇 Will scroll smoothly to the top of the next section + myelement.scrollIntoView({ behavior: 'smooth' }); + + } + + + return; + + + + + + } + + + function TrainingLangHandle(event) { + setTrainingLang(event.target.value); + alert("newresult newresultnewresultnewresult = " + newresult); + } + + + function TrainingPriceHandle(event) { + + + var crit_TrainingPrice = range_price.min + ":" + range_price.max; + + setTrainingPrice(event.target.value); + var toto = ""; + var filtre1 = ""; + + + var crit_TrainingPrice = range_price.min + ":" + range_price.max; + + var myprices = crit_TrainingPrice.split(':'); + if (range_price.min && range_price.max) { + filtre1 = result.filter((maformation) => Number(JSON.parse(maformation).price) >= Number(range_price.min) && + Number(JSON.parse(maformation).price) <= Number(range_price.max) + ); + //console.log(" PRICEEEEEEEEEEEEEEEE = "+filtre1); + setv11(filtre1); + } + else { + //alert(" Annulation du filtre prix"); + filtre1 = result; + setv11(filtre1); + } + + + + // Recuperation des autres filtres. + // recuperation du filtre du support + var crit_TrainingSupport = ""; + if (document.getElementById("supoort_list_derou")) { + crit_TrainingSupport = document.getElementById("supoort_list_derou").value; + if (crit_TrainingSupport.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport); + } + + // recuperation du filtre du CPF + var crit_TrainingCPF = ""; + if (document.querySelector('input[name="TrainingCPF"]:checked')) { + crit_TrainingCPF = document.querySelector('input[name="TrainingCPF"]:checked').value + if (crit_TrainingCPF.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).cpf === crit_TrainingCPF); + + } + + + // recuperation du filtre du certification + var crit_TrainingCertif = ""; + if (document.querySelector('input[name="TrainingCertif"]:checked')) { + crit_TrainingCertif = document.querySelector('input[name="TrainingCertif"]:checked').value; + if (crit_TrainingCertif.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingCertif); + } + + // recuperation du filtre du type (cours, tuto, etc) + var crit_TrainingType = ""; + if (document.querySelector('input[name="TrainingType"]:checked')) { + crit_TrainingType = document.querySelector('input[name="TrainingType"]:checked').value; + if (crit_TrainingType.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).type === crit_TrainingType); + } + + // recuperation du filtre de la distance + var crit_Trainingdistance = ""; + if (document.querySelector('input[name="TrainingPresentiel"]:checked')) { + crit_Trainingdistance = document.querySelector('input[name="TrainingPresentiel"]:checked').value; + if (crit_Trainingdistance.length > 0) { + // filtre presentiel = 1 + if (String(crit_Trainingdistance) === String("1")) { + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.distantiel === "1"); + setv11(filtre1); + + } + else if (String(crit_Trainingdistance) === String("0")) { + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.presentiel === "1"); + setv11(filtre1); + } + } + + } + + + setnewresult(filtre1); + setCurrentPage2(1); + + } + + + // Traitement du filtre presentiel / distantiel + function TrainingDistancielHandle(event) { + + + isonsite(); + setlieuchecked("1"); + var toto = ""; + var filtre1 = ""; + var filtre0 = []; + var filtre01 = []; + var my_ville = ""; + var my_cp = ""; + + if (document.getElementById("ville")) { + my_ville = crit_TrainingSupport = document.getElementById("ville").value; + my_ville = my_ville.trim(); + + } + + if (document.getElementById("zip_code")) { + my_cp = crit_TrainingSupport = document.getElementById("zip_code").value; + my_cp = my_cp.trim(); + + } + + var crit_Trainingdistance = ""; + // Recuperation du filtre principale modifié dans ce event (distance) + if (document.querySelector('input[name="TrainingPresentiel"]:checked')) { + crit_Trainingdistance = document.querySelector('input[name="TrainingPresentiel"]:checked').value; + //alert("crit_Trainingdistance = " + crit_Trainingdistance); + if (crit_Trainingdistance.length > 0) { + // filtre presentiel = 1 + + if (String(crit_Trainingdistance) === String("1")) { + + filtre1 = result.filter((maformation) => JSON.parse(maformation).presentiel.distantiel === "1"); + setv11(filtre1); + + } + else if (String(crit_Trainingdistance) === String("0")) { + filtre1 = result.filter((maformation) => JSON.parse(maformation).presentiel.presentiel === "1"); + + // Traitement du nom de la ville + if (my_ville.length > 3) { + + var filtre2 = filtre1.map(obj => { + + if (JSON.parse(obj).datelieu) { + + var tmp = JSON.parse(obj).datelieu.length + var i = 0; + while (i < tmp) { + //console.log(JSON.parse(obj).datelieu[i]); + //console.log(" ville =" + JSON.parse(obj).datelieu[i].ville) + if (JSON.parse(obj).datelieu[i].ville === my_ville) { + return obj + } + i++; + } + } + + }); + + var filtre3 = filtre2.filter(function (element) { + return element !== undefined; + }); + + + filtre1 = filtre3; + } + + // Traitement du zip code + if (my_cp.length > 2) { + + var filtre2 = filtre1.map(obj => { + + if (JSON.parse(obj).datelieu) { + + var tmp = JSON.parse(obj).datelieu.length + var i = 0; + while (i < tmp) { + //console.log(JSON.parse(obj).datelieu[i]); + //console.log(" ville =" + JSON.parse(obj).datelieu[i].ville) + if (JSON.parse(obj).datelieu[i].code_postal.startsWith(my_cp)) { + return obj + } + i++; + } + } + + }); + + var filtre3 = filtre2.filter(function (element) { + return element !== undefined; + }); + + + filtre1 = filtre3; + } + + setv11(filtre1); + + + } + else if (String(crit_Trainingdistance) === String("NA")) { + + filtre1 = result; + setv11(filtre1); + } + } + else if (crit_Trainingdistance.length <= 0) { + + filtre1 = result; + setv11(filtre1); + } + } + + + /* Recuperation des autres filtres */ + // recuperation du filtre du support + var crit_TrainingSupport = ""; + if (document.getElementById("supoort_list_derou")) { + crit_TrainingSupport = document.getElementById("supoort_list_derou").value; + if (crit_TrainingSupport.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport); + } + + // recuperation du filtre du certification + var crit_TrainingCertif = ""; + if (document.querySelector('input[name="TrainingCertif"]:checked')) { + crit_TrainingCertif = document.querySelector('input[name="TrainingCertif"]:checked').value; + if (crit_TrainingCertif.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingCertif); + } + + // recuperation du filtre du CPF + var crit_TrainingCPF = ""; + if (document.querySelector('input[name="TrainingCPF"]:checked')) { + crit_TrainingCPF = document.querySelector('input[name="TrainingCPF"]:checked').value + if (crit_TrainingCPF.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).cpf === crit_TrainingCPF); + + } + + + // recuperation du filtre du type (cours, tuto, etc) + var crit_TrainingType = ""; + if (document.querySelector('input[name="TrainingType"]:checked')) { + crit_TrainingType = document.querySelector('input[name="TrainingType"]:checked').value; + if (crit_TrainingType.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).type === crit_TrainingType); + } + + // Recup du filtre de prix + var crit_TrainingPrice = range_price.min + ":" + range_price.max; + + if (range_price.min && range_price.max) { + filtre1 = filtre1.filter((maformation) => Number(JSON.parse(maformation).price) >= Number(range_price.min) && + Number(JSON.parse(maformation).price) <= Number(range_price.max) + ); + + setv11(filtre1); + } + + + setnewresult(filtre1); + setCurrentPage2(1); + } + + + + function displayAllClassesHandle(event) { + setdisplayAllClasses(event.target.checked); + if (event.target.checked == true) + document.getElementById("SearchText").disabled = true; + else + document.getElementById("SearchText").disabled = false; + } + + + const [suggestedwords, setsuggestedwords] = useState([]); + const [texte, settext] = useState(""); + + const [cities, setcities] = useState(""); + + const [suggestedcities, setsuggestedcities] = useState([]); + + + + useEffect(() => { + + var ip = ""; + + Get_Subdomain_Partner_Data(window.location.host); + + + async function fetchData() { + + + let windowWidth = window.innerWidth; + + if (showelement === "init") { + + if (windowWidth < 601) { + setismobilephone(true); + setshowelement("false"); + settextplaceholder("Plus de 10 000 formations (gratuites, payantes...)"); + + } else if (windowWidth >= 601) { + setismobilephone(false); + setshowelement("true"); + //settextplaceholder("Ex : graphiste ...sur plus de 10 000 formations (gratuites, payantes,..)"); + settextplaceholder("Recherche par Titre, Description, Contenu video ... sur plus de 10 000 formations (gratuites, payantes,..)"); + } + } + + DisplayXfirstClas(result.data); + } + + + fetchData(); + + async function loadDomainMetier() { + + var form = new FormData(); + + fetch( + process.env.REACT_APP_API_URL + "myclass/api/get_List_domaine_metier/", + { + method: 'POST', + + } + ).then((response) => response.json()) + .then((result) => { + //console.log('### loadDomainMetier Success:', result['message']); + setdomaine_metier(result['message']); + var tab = []; + + result.message.map(obj => { + + if (JSON.parse(obj).label) { + + + var month = {}; + month.label = JSON.parse(obj).label; + month.value = JSON.parse(obj).value; + month.domaine = JSON.parse(obj).domaine; + tab.push({ ...month }); + } + }); + + + setdomaine_v11(tab); + setdomaine_v11_orig(tab); + setdomaine_metier(tab); + setdomaine_metier_orig(tab); + + + }) + .catch((error) => { + console.error('Error:', error); + }); + + } + loadDomainMetier(); + + + async function loadDomain() { + + var form = new FormData(); + + fetch( + process.env.REACT_APP_API_URL + "myclass/api/get_List_domaine_formation/", + { + method: 'POST', + + } + ).then((response) => response.json()) + .then((result) => { + //console.log('### loadDomainMetier Success:', result['message']); + setdomaine_metier(result['message']); + + }) + .catch((error) => { + console.error('loadDomain :', error); + + }); + + } + + loadDomain(); + + const listener = event => { + if (event.code === "Enter" || event.code === "NumpadEnter") { + event.preventDefault(); + searchFunction(); + } + }; + document.addEventListener("keydown", listener); + + + if (typeof (stored_user) === "undefined" || String(stored_user) === '') { + setuserconnected("0"); + } else { + setuserconnected("1"); + } + + + setinitAllfiter(); + + whosisconnected(); + + if (categorie) { + setmymetier(categorie); + } else { + setmymetier(); + } + + }, [initAllfiter, categorie]); + + + // Cette fonction reinitialise les filtres + function InitAllfilters() { + //document.getElementById("TrainingCertif").selectedv = 0; + const $select = document.querySelector('#TrainingCertif'); + $select.value = '' + + const $select2 = document.querySelector('#TrainingSupport'); + $select2.value = '' + + const $select3 = document.querySelector('#TrainingType'); + $select3.value = '' + + const $select4 = document.querySelector('#TrainingPresentiel'); + $select4.value = 'NA' + + const $select5 = document.querySelector('#TrainingPrice'); + $select5.value = 'NA' + + + + } + + function DisplayClassByDomainFilter() { + var tab_domaine = list_domaine.split(";") + //console.log("tab_domaine = ", tab_domaine) + + if (tab_domaine.length <= 0) { + setdomaine_v11(domaine_v11_orig); + DisplayXfirstClas(); + return; + } + + + + } + + const handleChangeMetier = (event) => { + + var local_list_metier = "" + + + for (let i = 0; i < event.length; i++) { + const label = event[i].label; + const value = event[i].value; + + local_list_metier += value + ";" + + } + + //console.log(" ### local_list_metier = ",local_list_metier); + setlist_metier(local_list_metier); + //TrainingMetierHandle(); + + // Verification si on a une valeur + if (event.length > 0 && local_list_metier.trim().length > 0) { + getClassByMetier(local_list_metier); + } else { + DisplayClassByDomainFilter(); + } + + } + + + + const [domaine_metier, setdomaine_metier] = useState([]); + const [domaine_metier_orig, setdomaine_metier_orig] = useState([]); + + const [domaine_formation, setdomaine_formation] = useState([]); + + const [domaine_v11, setdomaine_v11] = useState(""); + const [domaine_v11_orig, setdomaine_v11_orig] = useState(""); + + const [list_domaine, setlist_domaine] = useState(""); + const [list_metier, setlist_metier] = useState(""); + + const handleChangeDomaine = (event) => { + + + if (event.length <= 0) { + setdomaine_v11(domaine_v11_orig); + DisplayXfirstClas(); + return; + } + //console.log(domaine_metier); + //console.log(" taille =" + event.length); + //console.log(domaine_v11_orig); + + var tt = domaine_v11_orig; + var dump = []; + var local_list_domaine = "" + + + for (let i = 0; i < event.length; i++) { + const label = event[i].label; + const value = event[i].value; + + local_list_domaine += value + ";" + + tt = domaine_v11_orig.filter((maformation) => maformation.domaine === String(value)); + //console.log(" TT = ", tt); + + for (let i2 = 0; i2 < tt.length; i2++) { + //console.log(" push de ", tt[i2]) + dump.push(tt[i2]); + } + + setlist_domaine(local_list_domaine); + setdomaine_v11(dump); + } + + getClassByDomaine(local_list_domaine); + + + + } + + + + const currentTableData2 = useMemo(() => { + if (newresult) { + const firstPageIndex = (currentPage2 - 1) * PageSize; + const lastPageIndex = firstPageIndex + PageSize; + setfin(1); + return newresult.slice(firstPageIndex, lastPageIndex); + } + + + if (result) { + const firstPageIndex = (currentPage2 - 1) * PageSize; + const lastPageIndex = firstPageIndex + PageSize; + setfin(1); + return result.slice(firstPageIndex, lastPageIndex); + } + else { + return []; + setfin(0); + } + }, [currentPage2]); + + function searchFunction(e) { + // Nettoyage du resultat precedent. + setResult([]); + + var crit_TrainingSupport = ""; + var crit_TrainingType = ""; + var crit_TrainingCertif = ""; + var crit_TrainingLang = ""; + var crit_TrainingPresentiel = ""; + var crit_TrainingPrice = ""; + var crit_TrainingDuration = ""; + var my_ville = ""; + + var my_cp = ""; + + var my_domaine = ""; + + + + if (document.getElementById("searchdomain")) + my_domaine = document.getElementById("searchdomain").value; + + + + //Get Criterias + var crit_SearchText = document.getElementById("SearchText").value; + + if (document.getElementById("TrainingSupport")) + crit_TrainingSupport = document.getElementById("TrainingSupport").value; + + if (document.getElementById("TrainingType")) + crit_TrainingType = document.getElementById("TrainingType").value; + + if (document.getElementById("TrainingCertif")) + crit_TrainingCertif = document.getElementById("TrainingCertif").value; + if (crit_TrainingCertif.length == 0) + crit_TrainingCertif = "NA"; + + + if (document.getElementById("TrainingLang")) + crit_TrainingLang = document.getElementById("TrainingLang").value; + + if (document.getElementById("TrainingPresentiel")) + crit_TrainingPresentiel = document.getElementById("TrainingPresentiel").value; + + if (document.getElementById("TrainingPrice")) + crit_TrainingPrice = document.getElementById("TrainingPrice").value; + + if (document.getElementById("duration")) + crit_TrainingDuration = document.getElementById("duration").value; + + + if (document.getElementById("ville")) { + my_ville = crit_TrainingSupport = document.getElementById("ville").value; + + } + + if (document.getElementById("zip_code")) { + my_cp = crit_TrainingSupport = document.getElementById("zip_code").value; + + } + + + var crit_Trainingdistance = Trainingdistance; + + //console.log(" my_domaine = ", my_domaine); + + /*console.log('SearchText = ' + crit_SearchText + ' - TrainingSupport = ' + crit_TrainingSupport + + ' - TrainingType = ' + crit_TrainingType + ' - TrainingCertif ' + crit_TrainingCertif + + " Langue = " + crit_TrainingLang + " TrainingPrice = " + crit_TrainingPrice + + " - Distance = " + crit_Trainingdistance + " -- Presentiel :" + crit_TrainingPresentiel + + " - Duration = " + crit_TrainingDuration + " - stored_user_cookie = " + stored_user);*/ + + + var form = new FormData(); + form.append("search_text", crit_SearchText); + + + var my_local_user_connect; + var my_local_part_connect; + if (typeof (stored_user) === "undefined" || String(stored_user) === '') { + my_local_user_connect = 0; + } else { + my_local_user_connect = 1; + } + + if (typeof (stored_part) === "undefined" || String(stored_part) === '') { + my_local_part_connect = 0; + } else { + my_local_part_connect = 1; + } + + + + if (String(my_local_user_connect) === "1") { + form.append("token", stored_user); + form.append("connection_type", "user"); + } + else if (String(my_local_part_connect) === "1") { + form.append("token", stored_part); + form.append("connection_type", "partner"); + } + else { + form.append("token", ""); + form.append("connection_type", ""); + } + form.append("certif", crit_TrainingCertif); + form.append("support", crit_TrainingSupport); + form.append("type", crit_TrainingType); + form.append("lang", crit_TrainingLang); + form.append("price", crit_TrainingPrice); + form.append("distance", crit_Trainingdistance); + form.append("duration", crit_TrainingDuration); + + + // Ajout des info IP user + form.append("user_ip", IPv4); + form.append("user_country_code", country_code); + form.append("user_country_name", country_name); + form.append("user_city", city); + form.append("user_postal", postal); + form.append("user_latitude", latitude); + form.append("user_longitude", longitude); + form.append("user_state", state); + form.append("subdomain", window.location.host.split(".")[0]); + + + var myurl = "" + if (displayAllClasses == true) { + myurl = process.env.REACT_APP_API_URL + "myclass/api/get_all_class_Given_partner_owner_recid_No_Login/"; + } + else { + myurl = process.env.REACT_APP_API_URL + "myclass/api/recherche_text_simple_for_partner_catalog/"; + + } + + // alert("myurl = " + myurl); + axios.post(myurl, form).then(res => { + if (String(res.data.status) != String("false")) { + //console.log(" In test res.data.status = " + res.data.status); + // console.log(" In test res.data.message = " + res.data.message); + setmyApiResponse("True"); + setResult(res.data.message) + + //Verification si le resutlat est vide + if (res.data.message.length <= 0) { + setbesoinaiderecherche("1"); + } + /*if (scrollDiv.current) { + scrollDiv.current.scrollIntoView({ behavior: "smooth" }); + }*/ + + var myelement; + + if (document.getElementById('rech_middlebox')) { + myelement = document.getElementById('rech_middlebox'); + } + + if (myelement) { + myelement.scrollIntoView({ behavior: 'smooth' }); + } + + } + + else { + //console.log(" In test res.data.status = " + res.data.status); + //console.log(" In test res.data.message = " + res.data.message); + setmyApiResponse("False"); + //setmyApimyApiMessage("") + //textInput.current.focus(); + } + + + }).catch((error) => { + // console.warn('Not good man :( mysearchtext = '); + setmyApiResponse("False"); + //setmyApimyApiMessage("") + }) + + // window.scrollTo(0, 600); + + + + + } + + // Cette fonction affiche les X premieres formations + function DisplayXfirstClas(ip) { + + // Nettoyage du resultat precedent. + setResult([]); + + + + //Get Criterias + var crit_SearchText = ""; + var myurl = ""; + + var form = new FormData(); + form.append("search_text", crit_SearchText); + + + if (typeof (NewSearchText) === "undefined" || String(NewSearchText) === '') { + crit_SearchText = ""; + myurl = process.env.REACT_APP_API_URL + "myclass/api/get_all_class_Given_partner_owner_recid_No_Login/"; + form.append("subdomain", window.location.host.split(".")[0]); + + //console.log(" ######### laaaaaaaaaaaaa subdomain = ", window.location.host.split(".")[0]) + + + } else { + crit_SearchText = NewSearchText; + myurl = process.env.REACT_APP_API_URL + "myclass/api/recherche_text_simple_for_partner_catalog/"; + + } + + + var my_local_user_connect; + var my_local_part_connect; + + if (typeof (stored_user) === "undefined" || String(stored_user) === '') { + my_local_user_connect = 0; + } else { + my_local_user_connect = 1; + } + + if (typeof (stored_part) === "undefined" || String(stored_part) === '') { + my_local_part_connect = 0; + } else { + my_local_part_connect = 1; + } + + if (String(my_local_user_connect) === "1") { + form.append("token", stored_user); + form.append("connection_type", "user"); + } + else if (String(my_local_part_connect) === "1") { + form.append("token", stored_part); + form.append("connection_type", "partner"); + } + else { + form.append("token", ""); + form.append("connection_type", ""); + } + + form.append("certif", ""); + form.append("support", ""); + form.append("type", ""); + form.append("lang", ""); + form.append("price", ""); + form.append("distance", ""); + form.append("duration", ""); + form.append("cpf", ""); + + + + // Ajout des info IP user + if (ip) { + //console.log(" ### with IP"); + form.append("user_ip", ip.IPv4); + form.append("user_country_code", ip.country_code); + form.append("user_country_name", ip.country_name); + form.append("user_city", ip.city); + form.append("user_postal", ip.postal); + form.append("user_latitude", ip.latitude); + form.append("user_longitude", ip.longitude); + form.append("user_state", ip.state); + } + else { + //console.log(" ### with OUT IP"); + form.append("user_ip", IPv4); + form.append("user_country_code", country_code); + form.append("user_country_name", country_name); + form.append("user_city", city); + form.append("user_postal", postal); + form.append("user_latitude", latitude); + form.append("user_longitude", longitude); + form.append("user_state", state); + // alert(" rrtt "); + } + + + //alert("myurl = " + myurl); + axios.post(myurl, form).then(res => { + if (String(res.data.status) != String("false")) { + //console.log(" In test res.data.status = " + res.data.status); + //console.log(" In DisplayXfirstClas res.data.message = " + res.data.message); + + setmyApiResponse("True"); + setResult(res.data.message) + // textInput.current.focus(); + setbesoinaiderecherche(""); + + } + else { + //console.log(" In test res.data.status = " + res.data.status); + //console.log(" In test res.data.message = " + res.data.message); + setmyApiResponse("False"); + //setmyApimyApiMessage("") + //textInput.current.focus(); + } + + + }).catch((error) => { + // console.warn('Not good man :( mysearchtext = '); + setmyApiResponse("False"); + //setmyApimyApiMessage("") + }) + + + } + + const [trier_par, settrier_par] = useState("1"); + + function trier(e) { + + setistrier(); + var trierpar = "" + if (document.getElementById("trierpar")) + trierpar = document.getElementById("trierpar").value; + + if (String(trierpar) === String("duration")) { + setCurrentPage2(1); + setCurrentPage(1); + + if (typeof (newresult) === "undefined" || String(newresult) === '') { + + //console.log(" AVANT TRIE : [0].duration = " + JSON.parse(result[0]).duration + " - [1].duration = " + JSON.parse(result[1]).duration) + result.sort(function (a, b) { + if (trier_par === "1") + return JSON.parse(a).duration - JSON.parse(b).duration; + else + return JSON.parse(b).duration - JSON.parse(a).duration; + }); + + //console.log("APRES TRIE : [0].duration = " + JSON.parse(result[0]).duration + " - [1].duration = " + JSON.parse(result[1]).duration) + + setistrier("1"); + } + else if (typeof (newresult) !== "undefined" || newresult.length > 0) { + newresult.sort(function (a, b) { + if (trier_par === "1") + return JSON.parse(a).duration - JSON.parse(b).duration; + else + return JSON.parse(b).duration - JSON.parse(a).duration; + }); + } + } + + else if (String(trierpar) === String("price")) { + setCurrentPage2(1); + + if (typeof (newresult) === "undefined" || String(newresult) === '') { + //console.log(" AVANT TRIE : [0].price = " + JSON.parse(result[0]).price + " - [1].price = " + JSON.parse(result[1]).price); + result.sort(function (a, b) { + + if (trier_par === "1") + return JSON.parse(a).price - JSON.parse(b).price; + else + return JSON.parse(b).price - JSON.parse(a).price; + }); + //console.log("APRES TRIE : [0].price = " + JSON.parse(result[0]).price + " - [1].price = " + JSON.parse(result[1]).price); + setistrier("2"); + } + else if (typeof (newresult) !== "undefined" || newresult.length > 0) { + newresult.sort(function (a, b) { + if (trier_par === "1") + return JSON.parse(a).price - JSON.parse(b).price; + else + return JSON.parse(b).price - JSON.parse(a).price; + }); + } + } + + else if (String(trierpar) === String("note")) { + setCurrentPage2(1); + + if (typeof (newresult) === "undefined" || String(newresult) === '') { + //console.log(" AVANT TRIE : [0].price = " + JSON.parse(result[0]).price + " - [1].price = " + JSON.parse(result[1]).price); + result.sort(function (a, b) { + if (trier_par === "1") + return JSON.parse(b).note - JSON.parse(a).note; + else + return JSON.parse(a).note - JSON.parse(b).note; + }); + //console.log("APRES TRIE : [0].price = " + JSON.parse(result[0]).price + " - [1].price = " + JSON.parse(result[1]).price); + setistrier("2"); + } + else if (typeof (newresult) !== "undefined" || newresult.length > 0) { + newresult.sort(function (a, b) { + if (trier_par === "1") + return JSON.parse(b).note - JSON.parse(a).note; + else + return JSON.parse(a).note - JSON.parse(b).note; + }); + } + } + + if (trier_par === "1") + settrier_par("-1"); + else + settrier_par("1"); + + } + + + function getClassByMetier_categorie(mycate) { + + var mymetier = mycate; + + + // Nettoyage du resultat precedent. + setResult([]); + var myurl = process.env.REACT_APP_API_URL + "myclass/api/get_class_by_metier/"; + + /*if (mymetier === "tout") { + //alert(" tout et sortir"); + setinitAllfiter("1"); + return; + + }*/ + + var form = new FormData(); + form.append("metier", mymetier); + form.append("token", ""); + + + //alert("myurl = "+myurl); + axios.post(myurl, form).then(res => { + if (String(res.data.status) != String("false")) { + + setmyApiResponse("True"); + setResult(res.data.message) + //textInput.current.focus(); + setbesoinaiderecherche(""); + setnewresult(""); + //console.log(" In getClassByMetier res.data.status = " + res.data.status); + //console.log(" In getClassByMetier res.data.message = " + res.data.message); + //setnewresult(res.data.message); + setCurrentPage2(1); + if (scrollDiv.current) { + scrollDiv.current.scrollIntoView({ behavior: "smooth" }); + } + + // reinitialisation de tous les filtre + + //setmyApimyApiMessage("OK") + //console.log("taille = "+res.data.message.length); + } + else { + //console.log(" In getClassByMetier res.data.status = " + res.data.status); + //console.log(" In getClassByMetier res.data.message = " + res.data.message); + setmyApiResponse("False"); + //setmyApimyApiMessage("") + //textInput.current.focus(); + } + + + }).catch((error) => { + console.warn(' getClassByMetier : Not good man :( mysearchtext = '); + setmyApiResponse("False"); + //setmyApimyApiMessage("") + }) + + } + + + function getClassByDomaine(List_Domaine) { + + // Nettoyage du resultat precedent. + setResult([]); + var myurl = process.env.REACT_APP_API_URL + "myclass/api/get_class_by_domaine/"; + + /*if (mymetier === "tout") { + //alert(" tout et sortir"); + setinitAllfiter("1"); + return; + + }*/ + + var form = new FormData(); + form.append("domaine", List_Domaine); + form.append("token", ""); + + + //alert("myurl = "+myurl); + axios.post(myurl, form).then(res => { + if (String(res.data.status) != String("false")) { + + setmyApiResponse("True"); + setResult(res.data.message) + //textInput.current.focus(); + setbesoinaiderecherche(""); + setnewresult(""); + //console.log(" In getClassByDomaine res.data.status = " + res.data.status); + //console.log(" In getClassByDomaine res.data.message = " + res.data.message); + //setnewresult(res.data.message); + setCurrentPage2(1); + if (scrollDiv.current) { + scrollDiv.current.scrollIntoView({ behavior: "smooth" }); + } + + // reinitialisation de tous les filtre + + //setmyApimyApiMessage("OK") + //console.log("taille = "+res.data.message.length); + } + else { + //console.log(" In getClassByMetier res.data.status = " + res.data.status); + //console.log(" In getClassByMetier res.data.message = " + res.data.message); + setmyApiResponse("False"); + //setmyApimyApiMessage("") + //textInput.current.focus(); + } + + + }).catch((error) => { + console.warn(' getClassByMetier : Not good man :( mysearchtext = '); + setmyApiResponse("False"); + //setmyApimyApiMessage("") + }) + + } + + function ReinitFilters() { + // Reinitialisation des filtre + annulefiltrecertif(); + annulefiltresupportchecked(); + annulefiltretypechecked(); + annulefiltrelieuchecked(); + annulefiltrecpf(); + } + + const [mymetier, setmymetier] = useState(""); + + function getClassByMetier(my_liste_metier) { + + + if (NewSearchText && NewSearchText.length > 2) { + alert(" Réinitialiser les filtres pour utiliser cette fonctionalité"); + return; + } + var myelement; + + if (document.getElementById('rech_middlebox')) { + myelement = document.getElementById('rech_middlebox'); + } + + var check_metier = ""; + if (document.querySelector('input[name="metier_radio"]:checked')) { + + check_metier = document.querySelector('input[name="metier_radio"]:checked').value; + } + + setmymetier(check_metier); + ReinitFilters(); + + + if (check_metier === "tout") { + // Nettoyage du resultat precedent. + setResult([]); + setnewresult(""); + //alert(" tout et sortir"); + + setdomaine_v11(domaine_v11_orig); + DisplayXfirstClas(); + //setResult([]); + + /*const pieces = window.location.href.split("/") + const last = pieces[pieces.length - 1] + const last2 = pieces[pieces.length - 2] + + if (last === "Recherche_new_v2" || last2 === "Recherche_new_v2") { + console.log(" ## RELAOD"); + window.location.reload(true); + } else { + + + history.push("/Recherche_new_v2"); + } + */ + if (myelement) { + // 👇 Will scroll smoothly to the top of the next section + myelement.scrollIntoView({ behavior: 'smooth' }); + } + return; + + } + + + + // Nettoyage du resultat precedent. + setResult([]); + var myurl = process.env.REACT_APP_API_URL + "myclass/api/get_class_by_metier/"; + + + var form = new FormData(); + form.append("metier", check_metier); + form.append("token", ""); + + //console.log(" recherif pour metier ", check_metier); + //alert("myurl = "+myurl); + axios.post(myurl, form).then(res => { + if (String(res.data.status) != String("false")) { + + setmyApiResponse("True"); + setResult(res.data.message) + //textInput.current.focus(); + setbesoinaiderecherche(""); + setnewresult(""); + //console.log(" In getClassByMetier res.data.status = " + res.data.status); + //console.log(" In getClassByMetier res.data.message = " + res.data.message); + //setnewresult(res.data.message); + setCurrentPage2(1); + if (scrollDiv.current) { + scrollDiv.current.scrollIntoView({ behavior: "smooth" }); + } + + // reinitialisation de tous les filtre + + //setmyApimyApiMessage("OK") + //console.log("taille = "+res.data.message.length); + } + else { + //console.log(" In getClassByMetier res.data.status = " + res.data.status); + //console.log(" In getClassByMetier res.data.message = " + res.data.message); + setmyApiResponse("False"); + //setmyApimyApiMessage("") + //textInput.current.focus(); + } + + + }).catch((error) => { + console.warn(' getClassByMetier : Not good man :( mysearchtext = '); + setmyApiResponse("False"); + //setmyApimyApiMessage("") + }) + + //console.log(" ICI MOVE TO "); + if (myelement) { + // 👇 Will scroll smoothly to the top of the next section + myelement.scrollIntoView({ behavior: 'smooth' }); + } + + } + + + const [PartnerMenu, setPartnerMenu] = React.useState(null); + const [AccountMenu, setAccountMenu] = React.useState(null); + const [ProduitMenu, setproduitMenu] = React.useState(null); + const [AvisMenu, setavisMenu] = React.useState(null); + + + + const PartnerMenu_Close = () => { + setPartnerMenu(null); + }; + + const AccountMenu_Close = () => { + setAccountMenu(null); + }; + + + const ProduitMenu_Close = () => { + setproduitMenu(null); + }; + + const handlePartnerMenu = (event) => { + setPartnerMenu(event.currentTarget); + }; + + const handleAccountMenu = (event) => { + setAccountMenu(event.currentTarget); + }; + + + const handleProduitMenu = (event) => { + setproduitMenu(event.currentTarget); + }; + + + + + const handleClose_Account = () => { + //alert(" my account"); + setAccountMenu(null); + }; + + const handleBlogMenu = (event) => { + setproduitMenu(event.currentTarget); + history.push("/Recherche-Article-formation") + }; + + const handleQuisommesNousMenu = (event) => { + setproduitMenu(event.currentTarget); + history.push("/qui-sommes-nous") + }; + + const handleAccountConnexion = () => { + setAccountMenu(null); + history.push("/Connexion") + }; + + const handleMyAccount = () => { + setAccountMenu(null); + history.push("/mysy-user-account") + }; + + + const handleMyPartnerAccount = () => { + setAccountMenu(null); + history.push("/Partner") + }; + + + const handleAccountCreation = () => { + setAccountMenu(null); + history.push("/create_account") + }; + + const handlePartnerConnexion = () => { + setAccountMenu(null); + history.push("/PartnerLogin") + }; + + + const handleProduitService = () => { + setproduitMenu(null); + history.push("/tarifs_produits_services/") + }; + + const handleAvis = () => { + setavisMenu(null); + history.push("/Recherche-Article-formation") + }; + + function test() { + alert(" coucou"); + } + + + const [someoneconnected, setsomeoneconnected] = useState("0"); + const [partnerconnected, setpartnerconnected] = useState("0"); + const [cookie, setCookie, removeCookie] = useCookies(['tokenmysych']); + + const stored_part = getCookie('tokenmysypart'); + + + + function whosisconnected() { + var local_user_connect = 0; + var local_part_connect = 0; + + if (typeof (stored_user) === "undefined" || String(stored_user) === '') { + setuserconnected("0"); + local_user_connect = 0; + } else { + setuserconnected("1"); + setsomeoneconnected("1"); + local_user_connect = 1; + //alert(" user connected OK"); + } + + if (typeof (stored_part) === "undefined" || String(stored_part) === '') { + setpartnerconnected("0"); + local_part_connect = 0; + } else { + setpartnerconnected("1"); + setsomeoneconnected("1"); + local_part_connect = 1; + //alert(" partner connected OK"); + } + } + + function handleAccountLogout() { + + if (String(userconnected) === String("1")) { + user_logout(); + } + else if (String(partnerconnected) === String("1")) { + part_logout(); + } + } + + function user_logout_confirmation() { + /* si c'est une connexion partner qui est active */ + if (typeof (stored_user) != "undefined") { + setCookie("tokenmysych", ""); + } + history.push("/recherche-formation"); + } + + function user_logout() { + confirmAlert({ + title: '', + message: 'Confirmez la déconnexion (user)', + buttons: [ + { + label: 'Oui', + onClick: () => user_logout_confirmation() + }, + { + label: 'Non', + onClick: () => { return } + } + ] + }); + } + + + + + function handleAccountConnexion_v2() { + + if (String(userconnected) === String("1")) { + handleMyAccount(); + } + else if (String(partnerconnected) === String("1")) { + handleMyPartnerAccount(); + } + } + + + function part_logout_confirmation() { + /* si c'est une connexion partner qui est active */ + if (typeof (stored_part) != "undefined") { + const stored_cookie = getCookie('tokenmysypart'); + var acces_right_token_name = stored_cookie + "_uar"; + + setpartCookie("tokenmysypart", "", { path: '/' }); + + setpartCookie(acces_right_token_name, "", { path: '/' }); + removeCookie(acces_right_token_name, { path: '/' }); + + } + setsomeoneconnected("0"); + setDialog_1_open(false); + history.push("/recherche-formation"); + } + + function part_logout() { + confirmAlert({ + title: '', + message: 'Confirmez la déconnexion (pro)', + buttons: [ + { + label: 'Oui', + onClick: () => part_logout_confirmation() + }, + { + label: 'Non', + onClick: () => { return } + } + ] + }); + } + + const [range_price, setrange_price] = useState({ min: 0, max: 9999, }); + function rangevalue() { + alert(range_price.max + " - " + range_price.min); + //console.log(" range = " + range_price); + } + + const [trainingonsite, settrainingonsite] = useState() + function isonsite() { + settrainingonsite(document.querySelector('input[name="TrainingPresentiel"]:checked').value) + + } + + const [certifchecked, setcertifchecked] = useState(); + function annulefiltrecertif() { + if (document.querySelector('input[name="TrainingCertif"]:checked')) { + var radio = document.querySelector('input[name="TrainingCertif"]:checked'); + radio.checked = false; + setcertifchecked(""); + + var toto = ""; + var filtre1 = ""; + + + // Reinitialisation + filtre1 = result; + setv11(filtre1); + + + // recuperation du filtre du support + var crit_TrainingSupport = ""; + if (document.getElementById("supoort_list_derou")) { + crit_TrainingSupport = document.getElementById("supoort_list_derou").value; + if (crit_TrainingSupport.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport); + + } + + // recuperation du filtre du CPF + var crit_TrainingCPF = ""; + if (document.querySelector('input[name="TrainingCPF"]:checked')) { + crit_TrainingCPF = document.querySelector('input[name="TrainingCPF"]:checked').value; + if (crit_TrainingCPF.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).cpf === crit_TrainingCPF); + + } + + // recuperation du filtre du type + var crit_TrainingType = ""; + if (document.querySelector('input[name="TrainingType"]:checked')) { + crit_TrainingType = document.querySelector('input[name="TrainingType"]:checked').value + if (crit_TrainingType.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingType); + + } + + // recuperation du filtre de la distance + var crit_Trainingdistance = ""; + if (document.querySelector('input[name="TrainingPresentiel"]:checked')) { + crit_Trainingdistance = document.querySelector('input[name="TrainingPresentiel"]:checked').value + if (crit_Trainingdistance.length > 0) { + // filtre presentiel = 1 + if (String(crit_Trainingdistance) === String("1")) { + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.distantiel === "1"); + setv11(filtre1); + + } + else if (String(crit_Trainingdistance) === String("0")) { + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.presentiel === "1"); + setv11(filtre1); + } + } + + } + + var crit_TrainingPrice = range_price.min + ":" + range_price.max; + + setnewresult(filtre1); + //alert("crit_TrainingCertif = " + crit_TrainingCertif + " ET crit_TrainingSupport = " + crit_TrainingSupport + " ET crit_TrainingType = " + crit_TrainingType); + //console.log("############################ filtre1 = " + filtre1); + setCurrentPage2(1); + //console.log(" ????????????????????????????filtre2 = "+filtre2); + + } + return; + + + } + + + function annulefiltrecpf() { + if (document.querySelector('input[name="TrainingCPF"]:checked')) { + var radio = document.querySelector('input[name="TrainingCPF"]:checked'); + radio.checked = false; + setcpfchecked(""); + + var toto = ""; + var filtre1 = ""; + + + // Reinitialisation + filtre1 = result; + setv11(filtre1); + + // recuperation du filtre de la certification + var crit_TrainingCertif = ""; + if (document.querySelector('input[name="TrainingCertif"]:checked')) { + crit_TrainingCertif = document.querySelector('input[name="TrainingCertif"]:checked').value; + if (crit_TrainingCertif.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingCertif); + + } + + // recuperation du filtre du support + var crit_TrainingSupport = ""; + if (document.getElementById("supoort_list_derou")) { + crit_TrainingSupport = document.getElementById("supoort_list_derou").value; + if (crit_TrainingSupport.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport); + + } + + + // recuperation du filtre du type + var crit_TrainingType = ""; + if (document.querySelector('input[name="TrainingType"]:checked')) { + crit_TrainingType = document.querySelector('input[name="TrainingType"]:checked').value + if (crit_TrainingType.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingType); + + } + + // recuperation du filtre de la distance + var crit_Trainingdistance = ""; + if (document.querySelector('input[name="TrainingPresentiel"]:checked')) { + crit_Trainingdistance = document.querySelector('input[name="TrainingPresentiel"]:checked').value + if (crit_Trainingdistance.length > 0) { + // filtre presentiel = 1 + if (String(crit_Trainingdistance) === String("1")) { + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.distantiel === "1"); + setv11(filtre1); + + } + else if (String(crit_Trainingdistance) === String("0")) { + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.presentiel === "1"); + setv11(filtre1); + } + } + + } + + var crit_TrainingPrice = range_price.min + ":" + range_price.max; + + setnewresult(filtre1); + //alert("crit_TrainingCertif = " + crit_TrainingCertif + " ET crit_TrainingSupport = " + crit_TrainingSupport + " ET crit_TrainingType = " + crit_TrainingType); + //console.log("############################ filtre1 = " + filtre1); + setCurrentPage2(1); + //console.log(" ????????????????????????????filtre2 = "+filtre2); + + } + return; + + + } + + const [supportchecked, setsupportchecked] = useState(); + function annulefiltresupportchecked() { + //var radio = document.querySelector('input[name="TrainingSupport"]:checked'); + //radio.checked = false; + setsupportchecked(""); + var crit_TrainingSupport = ""; + var toto = ""; + var filtre1 = ""; + + + + // Reinitialisation + filtre1 = result; + setv11(filtre1); + + // recuperation du filtre de la certification + var crit_TrainingCertif = ""; + if (document.querySelector('input[name="TrainingCertif"]:checked')) { + crit_TrainingCertif = document.querySelector('input[name="TrainingCertif"]:checked').value; + if (crit_TrainingCertif.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingCertif); + + } + + + // recuperation du filtre du CPF + var crit_TrainingCPF = ""; + if (document.querySelector('input[name="TrainingCPF"]:checked')) { + crit_TrainingCPF = document.querySelector('input[name="TrainingCPF"]:checked').value; + if (crit_TrainingCPF.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).cpf === crit_TrainingCPF); + + } + + + // recuperation du filtre du type (cours, tuto, etc) + var crit_TrainingType = ""; + if (document.querySelector('input[name="TrainingType"]:checked')) { + crit_TrainingType = document.querySelector('input[name="TrainingType"]:checked').value; + if (crit_TrainingType.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).type === crit_TrainingType); + + } + + // recuperation du filtre de la distance + var crit_Trainingdistance = ""; + if (document.querySelector('input[name="TrainingPresentiel"]:checked')) { + crit_Trainingdistance = document.querySelector('input[name="TrainingPresentiel"]:checked').value; + if (crit_Trainingdistance.length > 0) { + // filtre presentiel = 1 + if (String(crit_Trainingdistance) === String("1")) { + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.distantiel === "1"); + setv11(filtre1); + + } + else if (String(crit_Trainingdistance) === String("0")) { + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.presentiel === "1"); + setv11(filtre1); + } + } + } + // Recup du filtre de prix + var crit_TrainingPrice = ""; + + setnewresult(filtre1); + + //alert("crit_TrainingCertif = " + crit_TrainingCertif + " ET crit_TrainingSupport = " + crit_TrainingSupport + " ET crit_TrainingType = " + crit_TrainingType); + //console.log("############################ filtre1 = " + filtre1); + setCurrentPage2(1); + //console.log(" ????????????????????????????filtre2 = "+filtre2); + } + + + const [typechecked, settypechecked] = useState(); + function annulefiltretypechecked() { + + if (document.querySelector('input[name="TrainingType"]:checked')) { + var radio = document.querySelector('input[name="TrainingType"]:checked'); + radio.checked = false; + settypechecked(""); + + var toto = ""; + var filtre1 = ""; + var filtre2 = ""; + var filtre3 = ""; + + + + // Reinitialisation + filtre1 = result; + setv11(filtre1); + //alert("rinitialisation") + ; + + // recuperation du filtre du support + var crit_TrainingSupport = ""; + if (document.getElementById("supoort_list_derou")) { + crit_TrainingSupport = document.getElementById("supoort_list_derou").value; + if (crit_TrainingSupport.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport); + + } + + // recuperation du filtre du certificat + var crit_TrainingCertif = ""; + if (document.querySelector('input[name="TrainingCertif"]:checked')) { + crit_TrainingCertif = document.querySelector('input[name="TrainingCertif"]:checked').value + if (crit_TrainingCertif.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingCertif); + + } + + // recuperation du filtre du CPF + var crit_TrainingCPF = ""; + if (document.querySelector('input[name="TrainingCPF"]:checked')) { + crit_TrainingCPF = document.querySelector('input[name="TrainingCPF"]:checked').value; + if (crit_TrainingCPF.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).cpf === crit_TrainingCPF); + + } + + + // recuperation du filtre de la distance + var crit_Trainingdistance = ""; + if (document.querySelector('input[name="TrainingPresentiel"]:checked')) { + crit_Trainingdistance = document.querySelector('input[name="TrainingPresentiel"]:checked').value + if (crit_Trainingdistance.length > 0) { + // filtre presentiel = 1 + if (String(crit_Trainingdistance) === String("1")) { + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.distantiel === "1"); + setv11(filtre1); + + } + else if (String(crit_Trainingdistance) === String("0")) { + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.presentiel === "1"); + setv11(filtre1); + } + } + + } + + + setnewresult(filtre1); + //alert("crit_TrainingCertif = " + crit_TrainingCertif + " ET crit_TrainingSupport = " + crit_TrainingSupport + " ET crit_TrainingType = " + crit_TrainingType); + //console.log("############################ filtre1 = " + filtre1); + setCurrentPage2(1); + //console.log(" ????????????????????????????filtre2 = "+filtre2); + } + return; + + } + + + const [lieuchecked, setlieuchecked] = useState(); + function annulefiltrelieuchecked() { + if (document.querySelector('input[name="TrainingPresentiel"]:checked')) { + var radio = document.querySelector('input[name="TrainingPresentiel"]:checked'); + radio.checked = false; + setlieuchecked(""); + var toto = ""; + var filtre1 = ""; + settrainingonsite(''); + + + + //reinitialisation des filtres + filtre1 = result; + setv11(filtre1); + + // Annulation de la suggestion de villes + setsuggestioncities([]); + + + /* Recuperation des autres filtres */ + // recuperation du filtre du support + var crit_TrainingSupport = ""; + if (document.getElementById("supoort_list_derou")) { + crit_TrainingSupport = document.getElementById("supoort_list_derou").value; + if (crit_TrainingSupport.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport); + } + + // recuperation du filtre du certification + var crit_TrainingCertif = ""; + if (document.querySelector('input[name="TrainingCertif"]:checked')) { + crit_TrainingCertif = document.querySelector('input[name="TrainingCertif"]:checked').value; + if (crit_TrainingCertif.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingCertif); + } + + // recuperation du filtre du CPF + var crit_TrainingCPF = ""; + if (document.querySelector('input[name="TrainingCPF"]:checked')) { + crit_TrainingCPF = document.querySelector('input[name="TrainingCPF"]:checked').value; + if (crit_TrainingCPF.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).cpf === crit_TrainingCPF); + + } + + // recuperation du filtre du type (cours, tuto, etc) + var crit_TrainingType = ""; + if (document.querySelector('input[name="TrainingType"]:checked')) { + crit_TrainingType = document.querySelector('input[name="TrainingType"]:checked').value; + if (crit_TrainingType.length > 0) + filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).type === crit_TrainingType); + } + setnewresult(filtre1); + setCurrentPage2(1); + } + } + + function OnblurHandle(e) { + setTimeout(() => { + setsuggestion2([]) + }, 100) + } + + + function OnSuggestionHandler(text) { + var val = text; + settext(val); + } + + function OnCitiesSuggestionHandler(text) { + var val = text; + setcities(val); + document.getElementById("ville").value = val; + LeaveCity(); + // Annulation de la suggestion de villes + setsuggestioncities([]); + } + + function publiecatalogue() { + + history.push("/Partner", { mysy_arg: 'partner' }); + } + + function LeaveCity() { + TrainingDistancielHandle(); + } + + function LeaveZipCode() { + TrainingDistancielHandle(); + } + + const Recherche_Domaine_Metier = (event) => { + + //console.log(" ### liste domaine = ", list_domaine); + //console.log(" ### liste metier = ", list_metier); + + } + + const [displayAllmetiers, setdisplayAllmetiers] = useState(); + + function DisplayAllmetier() { + if (displayAllmetiers) + setdisplayAllmetiers(false); + else + setdisplayAllmetiers(true); + } + + + function init_Filter_Change_url() { + history.push("/"); + window.location.reload(); + + /* window.scrollTo({ + top: 0, + behavior: "smooth", + });*/ + + } + + function message_to_init_Filter_Change_url() { + alert(" Réinitialiser les filtres pour réactivier cette fonctionnalité") + + } + + + const [Dialog_1_message, setDialog_1_message] = React.useState(false); + const [Dialog_1_open, setDialog_1_open] = React.useState(false); + function Dialog_1_handle_change_participant_session(message) { + setDialog_1_message(message); + setDialog_1_open(true); + } + + const Dialog_1_handleClose = () => { + //alert(" Utiliser le bouton 'fermer' "); + //setOpen(false); + }; + + const Dialog_1_handleClose_buton = () => { + setDialog_1_open(false); + }; + + + //console.log(" c'est url_subdomain ", url_subdomain); + + const [subdomain_recid, setsubdomain_recid] = useState(""); + const [my_theme_code, setmy_theme_code] = useState(""); + + + const [New_Get_Subdomain_Partner_Data_result, setNew_Get_Subdomain_Partner_Data_result] = useState([]); + + const [Get_Subdomain_Partner_Data_api, setGet_Subdomain_Partner_Data_api] = useState(); + const [Get_Subdomain_Partner_Data_message, setGet_Subdomain_Partner_Data_message] = useState(); + const [Get_Subdomain_Partner_Data_result, setGet_Subdomain_Partner_Data_result] = useState(); + function Get_Subdomain_Partner_Data(local_url_subdomain) { + + let domain = local_url_subdomain; + if (local_url_subdomain.includes("://")) { + domain = url.split('://')[1]; + } + + // console.log(" ### local_url_subdomain = ", local_url_subdomain); + + const subdomain = domain.split('.')[0]; + + // console.log(" ### subdomain = ", subdomain); + + var form = new FormData(); + + form.append("subdomain", subdomain); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Partner_Data_From_Subdomain/"; + + axios.post(myurl, form).then(res => { + + if (String(res.data.status) === "true") { + // console.log(" In Get_Subdomain_Partner_Data res.data.status = " + res.data.status); + // console.log(" In Get_Subdomain_Partner_Data res.data.message r_class = " + res.data.message); + setGet_Subdomain_Partner_Data_api("true"); + setGet_Subdomain_Partner_Data_result(res.data.message); + + var new_data2 = []; + const new_data = res.data.message.map((x) => { + + //--- + + var _id = JSON.parse(x)._id; + var recid = JSON.parse(x).recid; + var nom = JSON.parse(x).nom; + + var catalog_pub_logo = JSON.parse(x).catalog_pub_logo; + var catalog_pub_banniere_img = JSON.parse(x).catalog_pub_banniere_img; + + var theme_code = JSON.parse(x).theme_code; + + var catalog_pub_message_1_txt = JSON.parse(x).catalog_pub_message_1_txt; + + var catalog_pub_cgv_pdf = "" + if (JSON.parse(x).catalog_pub_cgv_pdf) + catalog_pub_cgv_pdf = JSON.parse(x).catalog_pub_cgv_pdf; + + + var catalog_pub_cgu_pdf = "" + if (JSON.parse(x).catalog_pub_cgu_pdf) + catalog_pub_cgu_pdf = JSON.parse(x).catalog_pub_cgu_pdf; + + var catalog_pub_mention_legale_pdf = "" + if (JSON.parse(x).catalog_pub_mention_legale_pdf) + catalog_pub_mention_legale_pdf = JSON.parse(x).catalog_pub_mention_legale_pdf; + + + + var catalog_pub_message_1_taille = "12" + if (JSON.parse(x).catalog_pub_message_1_taille) + catalog_pub_message_1_taille = JSON.parse(x).catalog_pub_message_1_taille; + + var catalog_pub_message_1_color = "#000000"; + if (JSON.parse(x).catalog_pub_message_1_color) + catalog_pub_message_1_color = JSON.parse(x).catalog_pub_message_1_color; + + var catalog_pub_message_1_gras = "400" + if (JSON.parse(x).catalog_pub_message_1_gras) + catalog_pub_message_1_gras = JSON.parse(x).catalog_pub_message_1_gras; + + + var catalog_pub_message_2_txt = "" + if (JSON.parse(x).catalog_pub_message_2_txt) + catalog_pub_message_2_txt = JSON.parse(x).catalog_pub_message_2_txt; + + + var catalog_pub_message_2_taille = "12" + if (JSON.parse(x).catalog_pub_message_2_taille) + catalog_pub_message_2_taille = JSON.parse(x).catalog_pub_message_2_taille; + + var catalog_pub_message_2_color = "#000000" + if (JSON.parse(x).catalog_pub_message_2_color) + catalog_pub_message_2_color = JSON.parse(x).catalog_pub_message_2_color; + + var catalog_pub_message_2_gras = "400" + if (JSON.parse(x).catalog_pub_message_2_gras) + catalog_pub_message_2_gras = JSON.parse(x).catalog_pub_message_2_gras; + + + + var catalog_pub_message_3_txt = "" + if (JSON.parse(x).catalog_pub_message_3_txt) + catalog_pub_message_3_txt = JSON.parse(x).catalog_pub_message_3_txt; + + var catalog_pub_message_3_taille = "12" + if (JSON.parse(x).catalog_pub_message_3_taille) + catalog_pub_message_3_taille = JSON.parse(x).catalog_pub_message_3_taille; + + var catalog_pub_message_3_color = "#000000"; + if (JSON.parse(x).catalog_pub_message_3_color) + catalog_pub_message_3_color = JSON.parse(x).catalog_pub_message_3_color; + + var catalog_pub_message_3_gras = "400" + if (JSON.parse(x).catalog_pub_message_3_gras) + catalog_pub_message_3_gras = JSON.parse(x).catalog_pub_message_3_gras; + + // Indicateur 1 + var catalog_pub_indicateur_1_txt = "" + if (JSON.parse(x).catalog_pub_indicateur_1_txt) + catalog_pub_indicateur_1_txt = JSON.parse(x).catalog_pub_indicateur_1_txt; + + var catalog_pub_indicateur_1_color = "#000000"; + if (JSON.parse(x).catalog_pub_indicateur_1_color) + catalog_pub_indicateur_1_color = JSON.parse(x).catalog_pub_indicateur_1_color; + + var catalog_pub_indicateur_1_gras = "400" + if (JSON.parse(x).catalog_pub_indicateur_1_gras) + catalog_pub_indicateur_1_gras = JSON.parse(x).catalog_pub_indicateur_1_gras; + + var catalog_pub_indicateur_1_taille = "12" + if (JSON.parse(x).catalog_pub_indicateur_1_taille) + catalog_pub_indicateur_1_taille = JSON.parse(x).catalog_pub_indicateur_1_taille; + + // Indicateur 2 + var catalog_pub_indicateur_2_txt = "" + if (JSON.parse(x).catalog_pub_indicateur_2_txt) + catalog_pub_indicateur_2_txt = JSON.parse(x).catalog_pub_indicateur_2_txt; + + var catalog_pub_indicateur_2_color = "#000000"; + if (JSON.parse(x).catalog_pub_indicateur_2_color) + catalog_pub_indicateur_2_color = JSON.parse(x).catalog_pub_indicateur_2_color; + + var catalog_pub_indicateur_2_gras = "400" + if (JSON.parse(x).catalog_pub_indicateur_2_gras) + catalog_pub_indicateur_2_gras = JSON.parse(x).catalog_pub_indicateur_2_gras; + + var catalog_pub_indicateur_2_taille = "12" + if (JSON.parse(x).catalog_pub_indicateur_2_taille) + catalog_pub_indicateur_2_taille = JSON.parse(x).catalog_pub_indicateur_2_taille; + + // Indicateur 3 + var catalog_pub_indicateur_3_txt = "" + if (JSON.parse(x).catalog_pub_indicateur_3_txt) + catalog_pub_indicateur_3_txt = JSON.parse(x).catalog_pub_indicateur_3_txt; + + var catalog_pub_indicateur_3_color = "#000000"; + if (JSON.parse(x).catalog_pub_indicateur_3_color) + catalog_pub_indicateur_3_color = JSON.parse(x).catalog_pub_indicateur_3_color; + + var catalog_pub_indicateur_3_gras = "400" + if (JSON.parse(x).catalog_pub_indicateur_3_gras) + catalog_pub_indicateur_3_gras = JSON.parse(x).catalog_pub_indicateur_3_gras; + + var catalog_pub_indicateur_3_taille = "12" + if (JSON.parse(x).catalog_pub_indicateur_3_taille) + catalog_pub_indicateur_3_taille = JSON.parse(x).catalog_pub_indicateur_3_taille; + + + // Indicateur 4 + var catalog_pub_indicateur_4_txt = "" + if (JSON.parse(x).catalog_pub_indicateur_4_txt) + catalog_pub_indicateur_4_txt = JSON.parse(x).catalog_pub_indicateur_4_txt; + + var catalog_pub_indicateur_4_color = "#000000"; + if (JSON.parse(x).catalog_pub_indicateur_4_color) + catalog_pub_indicateur_4_color = JSON.parse(x).catalog_pub_indicateur_4_color; + + var catalog_pub_indicateur_4_gras = "400" + if (JSON.parse(x).catalog_pub_indicateur_4_gras) + catalog_pub_indicateur_4_gras = JSON.parse(x).catalog_pub_indicateur_4_gras; + + var catalog_pub_indicateur_4_taille = "12" + if (JSON.parse(x).catalog_pub_indicateur_4_taille) + catalog_pub_indicateur_4_taille = JSON.parse(x).catalog_pub_indicateur_4_taille; + + // Les contacts publics + var catalog_pub_contact_public_email = "" + if (JSON.parse(x).catalog_pub_contact_public_email) + catalog_pub_contact_public_email = JSON.parse(x).catalog_pub_contact_public_email; + + var catalog_pub_contact_public_telephone = "" + if (JSON.parse(x).catalog_pub_contact_public_telephone) + catalog_pub_contact_public_telephone = JSON.parse(x).catalog_pub_contact_public_telephone; + + + var catalog_pub_theme_id = JSON.parse(x).catalog_pub_theme_id; + + setmy_theme_code(theme_code); + + var catalog_pub_affiche_indicateur = "" + if (JSON.parse(x).affiche_indicateur) + catalog_pub_affiche_indicateur = JSON.parse(x).affiche_indicateur; + + + var catalog_pub_affiche_raison_sociale = "" + if (JSON.parse(x).affiche_raison_sociale) + catalog_pub_affiche_raison_sociale = JSON.parse(x).affiche_raison_sociale; + + var catalog_pub_affiche_contact = "" + if (JSON.parse(x).affiche_contact) + catalog_pub_affiche_contact = JSON.parse(x).affiche_contact; + + // console.log(" ### setmy_theme_code = ", theme_code); + + + //--- + var node = { + "_id": _id, + "recid": recid, + "nom": nom, + "label": nom, + + "catalog_pub_cgv_pdf": catalog_pub_cgv_pdf, + "catalog_pub_cgu_pdf": catalog_pub_cgu_pdf, + "catalog_pub_mention_legale_pdf": catalog_pub_mention_legale_pdf, + + "catalog_pub_logo": catalog_pub_logo, + "catalog_pub_banniere_img": catalog_pub_banniere_img, + "catalog_pub_message_1_txt": catalog_pub_message_1_txt, + "catalog_pub_message_1_taille": catalog_pub_message_1_taille, + "catalog_pub_message_1_color": catalog_pub_message_1_color, + "catalog_pub_message_1_gras": catalog_pub_message_1_gras, + + + "catalog_pub_message_2_txt": catalog_pub_message_2_txt, + "catalog_pub_message_2_taille": catalog_pub_message_2_taille, + "catalog_pub_message_2_color": catalog_pub_message_2_color, + "catalog_pub_message_2_gras": catalog_pub_message_2_gras, + + + "catalog_pub_message_3_txt": catalog_pub_message_3_txt, + "catalog_pub_message_3_taille": catalog_pub_message_3_taille, + "catalog_pub_message_3_color": catalog_pub_message_3_color, + "catalog_pub_message_3_gras": catalog_pub_message_3_gras, + + /// les indicateurs + "catalog_pub_indicateur_1_txt": catalog_pub_indicateur_1_txt, + "catalog_pub_indicateur_1_color": catalog_pub_indicateur_1_color, + "catalog_pub_indicateur_1_gras": catalog_pub_indicateur_1_gras, + "catalog_pub_indicateur_1_taille": catalog_pub_indicateur_1_taille, + + "catalog_pub_indicateur_2_txt": catalog_pub_indicateur_2_txt, + "catalog_pub_indicateur_2_color": catalog_pub_indicateur_2_color, + "catalog_pub_indicateur_2_gras": catalog_pub_indicateur_2_gras, + "catalog_pub_indicateur_2_taille": catalog_pub_indicateur_2_taille, + + "catalog_pub_indicateur_3_txt": catalog_pub_indicateur_3_txt, + "catalog_pub_indicateur_3_color": catalog_pub_indicateur_3_color, + "catalog_pub_indicateur_3_gras": catalog_pub_indicateur_3_gras, + "catalog_pub_indicateur_3_taille": catalog_pub_indicateur_3_taille, + + "catalog_pub_indicateur_4_txt": catalog_pub_indicateur_4_txt, + "catalog_pub_indicateur_4_color": catalog_pub_indicateur_4_color, + "catalog_pub_indicateur_4_gras": catalog_pub_indicateur_4_gras, + "catalog_pub_indicateur_4_taille": catalog_pub_indicateur_4_taille, + + // les contacts publics + "catalog_pub_contact_public_email": catalog_pub_contact_public_email, + "catalog_pub_contact_public_telephone": catalog_pub_contact_public_telephone, + + "catalog_pub_theme_id": catalog_pub_theme_id, + "theme_code": theme_code, + + "affiche_indicateur": catalog_pub_affiche_indicateur, + "affiche_raison_sociale": catalog_pub_affiche_raison_sociale, + "affiche_contact": catalog_pub_affiche_contact, + + }; + // console.log(" --- node = ", node); + new_data2.push(node); + }); + + if (new_data2.length > 0) + setNew_Get_Subdomain_Partner_Data_result(new_data2); + + + if (res.data.message.length > 0) { + var mylocal_materiel = JSON.parse(res.data.message); + + if (mylocal_materiel.recid) + setsubdomain_recid(mylocal_materiel.recid); + else + setsubdomain_recid(""); + + } + + + } + else { + setGet_Subdomain_Partner_Data_api("false"); + setGet_Subdomain_Partner_Data_message(res.data.message); + alert(res.data.message); + } + + }).catch((error) => { + console.warn('Not good man :( Get_Subdomain_Partner_Data = ', error); + setGet_Subdomain_Partner_Data_api("false"); + alert(" Impossible de recuperer les données du sous domaine"); + //setmyApimyApiMessage("") + }) + } + + const [display_mode_grid_or_list, setdisplay_mode_grid_or_list] = useState("list"); + + function func_display_grid_view() { + setdisplay_mode_grid_or_list("grid"); + } + + function func_display_list_view() { + setdisplay_mode_grid_or_list("list"); + } + + + + return ( + + +
+ + + + Formation & Tutoriel Gratuit ou payant Excellente qualité + + + + + + + {/******* Gestion du THEME "MySy_Theme2" */} + {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 + && String(my_theme_code) === "MySy_Theme2" &&
+ +
+ + {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 + && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_banniere_img &&
+ + +
} + +
+ +
+ +
+ +
+ +   +
+ +
+   +
+
+ + +
+ +
+ + {String(New_Get_Subdomain_Partner_Data_result[0].affiche_indicateur) === "1" &&
+ Indicateurs
+ {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 + && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_1_txt && +
{New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_1_txt} +
} + + {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 + && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_2_txt && +
{New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_2_txt} +
} + + {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 + && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_3_txt && +
{New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_3_txt} +
} + + {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 + && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_4_txt && +
{New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_4_txt} +
} + +
} + + + {String(New_Get_Subdomain_Partner_Data_result[0].affiche_raison_sociale) === "1" &&
+ {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 && + } + + + {New_Get_Subdomain_Partner_Data_result[0] && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_message_2_txt && + } + +
} + + + {String(New_Get_Subdomain_Partner_Data_result[0].affiche_contact) === "1" &&
+ + Contact
+ Tel : {New_Get_Subdomain_Partner_Data_result[0].catalog_pub_contact_public_telephone}
+ Email : {New_Get_Subdomain_Partner_Data_result[0].catalog_pub_contact_public_email} + +
} +
+ +
+ + + +
+ + + +
+ +
+
+ +
Nos Formations & Tutoriels
+ {showelement === "true" &&
+ +
Masquer les Métiers & Filtres
+
+ +
+ } + + {showelement === "false" &&
+
Afficher les Métiers & Filtres
+
+ +
+ } + + {showelement === "true" &&
+
+
Les filtres
+ +
+ +
+
+
+
Eligible CPF +
+
+
+ +
+ + +
+
+ +
+
+ + +
+
+ + {String(cpfchecked) === String("1") &&
+
+ KO + +
+
} + +
+
+ + +
+
Certification +
+ +
+
+
+ + +
+
+ +
+
+ + +
+
+ {String(certifchecked) === String("1") &&
+
+ KO + +
+
} +
+
+
+
+ +
+
+
+
Type +
+ +
+
+
+ + +
+
+ +
+
+ + +
+
+ {String(typechecked) === String("1") &&
+
+ KO + +
+
} +
+
+ + +
+
Lieu +
+ +
+
+
+ + +
+
+ +
+
+ + +
+
+ {String(lieuchecked) === String("1") &&
+
+ KO + +
+
} +
+
+ + + {trainingonsite && String(trainingonsite) === String("0") &&
+
Ville +
+ +
+ + {suggestioncities && suggestioncities.slice(0, 3).map((suggestion, id) => +
OnCitiesSuggestionHandler(JSON.parse(suggestion).ville)}> {JSON.parse(suggestion).ville}
+ )} + +
+ + +
 
+
} + + {trainingonsite && String(trainingonsite) === String("0") &&
+
Code postale +
+ +
+ +
+ + +
 
+
} + +
+
+ +
+ +
+ +
+
Support +
+ +
+ + + + +
+
+ +
+
Prix +
+ +
+ `${value} €`} + value={range_price} + step={500} + name="toto" + + onChange={value => setrange_price(value)} + //onChange={TrainingPriceHandle} + onChangeComplete={value => console.log(value)} + /> +
+ + +
 
+
+ +
+ +
+ +
+
+ +
+ } + +
+ +
Nos Formations & Tutoriels
+ {String(userconnected) === String("1") &&
+ +
+ } + + {myApiResponse == "False" &&
+ + Impossible de contacter l'hote distant +
} + + {myApiResponse == "True" && String(besoinaiderecherche) === String("1") &&
+ + Le resultat est vide, besoin d'aide ? + + +
} + + + + + + {result && myApiResponse === "True" && !newresult && +
+
+
+ +
+ setCurrentPage2(page)} + /> +
+ + +
+
+ Trier par + + + { + if (trier_par === "1") + settrier_par("-1"); + else + settrier_par("1"); + + trier(); + }} + + /> +
+
+ +
+ {result && result.length > 0 && +
+ + +
} +
+ + +
+ +
+
} + + + + {result && myApiResponse === "True" && newresult && +
+ +
+
+ + setCurrentPage2(page)} + /> + +
+ +
+ {result && result.length > 0 && +
+ + +
} +
+ +
+ + +
} + + + {newresult && (newresult.length <= PageSize) &&
88 +   +
+   +
} + +
 
+ + + + + {String(display_mode_grid_or_list) !== "grid" &&
+ {result && myApiResponse == "True" && fin == 0 && !newresult && + result.slice(0, PageSize).map((formation) => ( +
+ +
+ ))} + + + {result && myApiResponse == "True" && fin == 0 && newresult && + newresult.slice(0, PageSize).map((formation) => ( +
+ +
+ + ))} + + + + {result && myApiResponse === "True" && fin === 1 && !newresult + && currentTableData2 + && currentTableData2.map((formation) => ( +
+ +
+ + ))} + + {result && myApiResponse === "True" && fin === 1 && newresult + && currentTableData2 + && currentTableData2.map((formation) => ( +
+ +
+ + ))} +
} + + + {String(display_mode_grid_or_list) === "grid" &&
+ {result && myApiResponse == "True" && fin == 0 && !newresult && + result.slice(0, PageSize).map((formation) => ( +
+ +
+ ))} + + + {result && myApiResponse == "True" && fin == 0 && newresult && + newresult.slice(0, PageSize).map((formation) => ( +
+ +
+ + ))} + + + + {result && myApiResponse === "True" && fin === 1 && !newresult + && currentTableData2 + && currentTableData2.map((formation) => ( +
+ +
+ + ))} + + {result && myApiResponse === "True" && fin === 1 && newresult + && currentTableData2 + && currentTableData2.map((formation) => ( +
+ +
+ + ))} +
} + + + + + {result && !newresult &&
+ + {String(userconnected) === String("1") && } + setCurrentPage2(page)} + /> +
+ } + + {result && newresult &&
+ + {String(userconnected) === String("1") && } + setCurrentPage2(page)} + /> +
+ } +
+ + + +
+ + +
+ +
+
Notre actualité + +
+ +
+ +
+ +
+ +
+ +
+ +
+ 19 DECEMBRE 2022 +
+ +
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit +
+ +
+ + +
+ +
+ +
+ +
+ +
+ +
+ 19 DECEMBRE 2022 +
+ +
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit +
+ +
+ + +
+ +
+ +
+ +
+ +
+ +
+ 19 DECEMBRE 2022 +
+ +
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit +
+ +
+ + +
+ + + + +
+ +
+ + +
+ +
+
+ + +
+ +
+ + +
} + + {/******* FIN Gestion du THEME "MySy_Theme2" */} + + + + {/******* Gestion du THEME PAR DEFAULT " */} + {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 + && String(my_theme_code) !== "MySy_Theme2" && String(my_theme_code) !== "MySy_Theme_JMJ" &&
+ + {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 + && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_banniere_img &&
+ + +
} + +
+ +
+ +
+ + {String(New_Get_Subdomain_Partner_Data_result[0].affiche_contact) === "1" &&
+ + Contact
+ Tel : {New_Get_Subdomain_Partner_Data_result[0].catalog_pub_contact_public_telephone}
+ Email : {New_Get_Subdomain_Partner_Data_result[0].catalog_pub_contact_public_email} +
} + + {String(New_Get_Subdomain_Partner_Data_result[0].affiche_indicateur) === "1" &&
+ Indicateurs
+ {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 + && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_1_txt && +
{New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_1_txt} +
} + + {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 + && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_2_txt && +
{New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_2_txt} +
} + + {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 + && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_3_txt && +
{New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_3_txt} +
} + + {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 + && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_4_txt && +
{New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_4_txt} +
} +
} +
+ + + {String(New_Get_Subdomain_Partner_Data_result[0].affiche_raison_sociale) === "1" &&
+ +
+ {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 && + } + + + {New_Get_Subdomain_Partner_Data_result[0] && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_message_2_txt && + } +
+
+ +
+
} + + +
+
+
+ + +
+
+ +
Nos Formations
+ {showelement === "true" &&
+ +
Masquer les Métiers & Filtres
+
+ +
+ } + + {showelement === "false" &&
+
Afficher les Métiers & Filtres
+
+ +
+ } + + {showelement === "true" &&
+
+
Les filtres
+ + +
+
+
Eligible CPF +
+
+
+ +
+ + +
+
+ +
+
+ + +
+
+ + {String(cpfchecked) === String("1") &&
+
+ KO + +
+
} + +
+
+ + +
+
Certification +
+ +
+
+
+ + +
+
+ +
+
+ + +
+
+ {String(certifchecked) === String("1") &&
+
+ KO + +
+
} +
+
+ + +
+
Type +
+ +
+
+
+ + +
+
+ +
+
+ + +
+
+ {String(typechecked) === String("1") &&
+
+ KO + +
+
} +
+
+ + + {/*
+
Support +
+ +
+
+
+ + +
+
+ +
+
+ + +
+
+ {String(supportchecked) === String("1") &&
+
+ KO + +
+
} +
+
*/} + + + +
+
Lieu +
+ +
+
+
+ + +
+
+ +
+
+ + +
+
+ {String(lieuchecked) === String("1") &&
+
+ KO + +
+
} +
+
+ + + {trainingonsite && String(trainingonsite) === String("0") &&
+
Ville +
+ +
+ + {suggestioncities && suggestioncities.slice(0, 3).map((suggestion, id) => +
OnCitiesSuggestionHandler(JSON.parse(suggestion).ville)}> {JSON.parse(suggestion).ville}
+ )} + +
+ + +
 
+
} + + {trainingonsite && String(trainingonsite) === String("0") &&
+
Code postale +
+ +
+ +
+ + +
 
+
} + +
+
Support +
+ +
+ + + + +
+
+ +
+
Prix +
+ +
+ `${value} €`} + value={range_price} + step={500} + name="toto" + + onChange={value => setrange_price(value)} + //onChange={TrainingPriceHandle} + onChangeComplete={value => console.log(value)} + /> +
+ + +
 
+
+ + +
+ + +
+ + + +
Les Métiers
+ {NewSearchText &&
+ +
+
+ Recherhe pour : "{NewSearchText}" +
+ +
+
+ +
+
+ Réinitaliser les filtres +
+
+
+
+
+
+ +
+
+ +
+
+ Management
+
+ +
+ +
+
+
+ +
+
+ +
+
+ Informatique
+
+ +
+ +
+
+
+ +
+
+ +
+
+ Graphisme
+
+ +
+ +
+
+
+ +
+
+
+ + +
+
+ Afficher plus de métiers +
+ +
+
+ + +
+
} + + + {!NewSearchText &&
+
+ +
+
+ + +
+
+ Tous les métiers +
+
+
+
+
+
+ + +
+
+ {mymetier && String(mymetier) === "management" && + } + + {!mymetier || String(mymetier) !== "management" && + } + + {!mymetier && + } + + +
+
+ Management +
+
+ +
+ +
+
+
+ + +
+
+ {mymetier && String(mymetier) === "IT" && + } + + {!mymetier || String(mymetier) !== "IT" && + } + + {!mymetier && + } + +
+
+ Informatique +
+
+ +
+
+
+
+ +
+
+ {mymetier && String(mymetier) === "graphisme" && + } + + {!mymetier || String(mymetier) !== "graphisme" && + } + + {!mymetier && + } + + +
+ +
+ Graphisme +
+
+ +
+
+
+
+
+
+ {mymetier && String(mymetier) === "sante_nat" && + } + + {!mymetier || String(mymetier) !== "sante_nat" && + } + + {!mymetier && + } + + +
+ +
+ Santé naturelle +
+
+ +
+
+
+
+ + + + + {!displayAllmetiers &&
+
+
+ + +
+
+ Afficher plus de métiers +
+ +
+
} + + + + {displayAllmetiers &&
+
+ + +
+
+ Développement Personnel +
+
+ +
+
+ +
+
} + + {displayAllmetiers &&
+
+ {mymetier && String(mymetier) === "projets" && + } + + {!mymetier || String(mymetier) !== "projets" && + } + + {!mymetier && + } + +
+
+ Projets +
+
+ +
+
+ +
+
} + {displayAllmetiers &&
+
+ + +
+
+ Sport +
+
+ +
+
+ +
+
} + + + {displayAllmetiers &&
+
+
+ - +
+
+ Afficher Moins de métiers +
+ +
+
} + + +
+
} + + + {/*
+
+
+ Formation Programmation +
+

Informatique

+
+
+
+ + +
+
+ Formation graphisme +
+

Graphisme

+
+
+
+ + +
+
+ Formation gestion projets +
+

Projets

+
+
+
+ +
 
+ +
+
+ Formation Management +
+

Management

+
+
+ + + +
+ +
+
+ Formation Digitale +
+

Digital

+
+
+
+ +
+
+ Ressources Humaines +
+

RH

+
+
+ + + +
+
 
+
+
+ Marketing +
+

Marketing

+
+
+
+ +
+
+ Autres +
+

Bureautique

+
+
+ +
+ + +
+
+ Commerce +
+

Commerce

+
+
+
+
 
+ +
+
+ Autres +
+

Dev. Personnel

+
+
+ + +
+
 
+
*/} + + {/*
+
+
+
+

Tous les Métiers

+
+
+
+
*/} + + + + +
+ } + +
+ +
Nos Formations
+ {String(userconnected) === String("1") &&
+ +
+ } + + {myApiResponse == "False" &&
+ + Impossible de contacter l'hote distant +
} + + {myApiResponse == "True" && String(besoinaiderecherche) === String("1") &&
+ + Le resultat est vide, besoin d'aide ? + + +
} + + + {result && myApiResponse === "True" && !newresult && +
+
+
+ setCurrentPage2(page)} + /> +
+
+
+ Trier par + + + { + if (trier_par === "1") + settrier_par("-1"); + else + settrier_par("1"); + + trier(); + }} + + /> +
+
+ + +
+ + +
} + + {result && myApiResponse === "True" && newresult && +
+ setCurrentPage2(page)} + /> + + +
} + + + {newresult && (newresult.length <= PageSize) &&
+   +
+   +
} + + + {result && myApiResponse == "True" && fin == 0 && !newresult && + result.slice(0, PageSize).map((formation) => ( +
+ + +
+ + ))} + + {result && myApiResponse == "True" && fin == 0 && newresult && + newresult.slice(0, PageSize).map((formation) => ( +
+ + +
+ + ))} + + + + {result && myApiResponse === "True" && fin === 1 && !newresult + && currentTableData2 + && currentTableData2.map((formation) => ( +
+ + +
+ + ))} + + {result && myApiResponse === "True" && fin === 1 && newresult + && currentTableData2 + && currentTableData2.map((formation) => ( +
+ + +
+ + ))} + + + {result && !newresult &&
+ + {String(userconnected) === String("1") && } + setCurrentPage2(page)} + /> +
+ } + + {result && newresult &&
+ + {String(userconnected) === String("1") && } + setCurrentPage2(page)} + /> +
+ } +
+ + + +
+ + +
+
+ + +
+ +
} + {/******* FIN Gestion du THEME PAR DEFAULT " */} + + + + {/******* Gestion du THEME THEME SPECIAL JMJ Formation " */} + {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 + && String(my_theme_code) === "MySy_Theme_JMJ" && +
+
+ +
+
+ {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 + && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_banniere_img &&
+ + +
} + + +
+ +
+ +
+ +
+ + {String(New_Get_Subdomain_Partner_Data_result[0].affiche_contact) === "1" &&
+ + Contact
+ Tel : {New_Get_Subdomain_Partner_Data_result[0].catalog_pub_contact_public_telephone}
+ Email : {New_Get_Subdomain_Partner_Data_result[0].catalog_pub_contact_public_email} +
} + + {String(New_Get_Subdomain_Partner_Data_result[0].affiche_indicateur) === "1" &&
+ Indicateurs
+ {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 + && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_1_txt && +
{New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_1_txt} +
} + + {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 + && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_2_txt && +
{New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_2_txt} +
} + + {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 + && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_3_txt && +
{New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_3_txt} +
} + + {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 + && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_4_txt && +
{New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_4_txt} +
} +
} + + {String(New_Get_Subdomain_Partner_Data_result[0].affiche_raison_sociale) === "1" &&
+
+ {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 && + + } + + {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 && + } + + + + + {New_Get_Subdomain_Partner_Data_result[0] && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_message_2_txt && + } +
+ +
+ +
+ +
} + +
+ +
+ +
+ {/* */}   +
+ +
+
+
+
+
+ {showelement === "true" &&
+
+ + +
+
+
Eligible CPF +
+
+
+ +
+ + +
+
+ +
+
+ + +
+
+ + {String(cpfchecked) === String("1") &&
+
+ KO + +
+
} + +
+
+ + +
+
Certification +
+ +
+
+
+ + +
+
+ +
+
+ + +
+
+ {String(certifchecked) === String("1") &&
+
+ KO + +
+
} +
+
+ + +
+
Type +
+ +
+
+
+ + +
+
+ +
+
+ + +
+
+ {String(typechecked) === String("1") &&
+
+ KO + +
+
} +
+
+ + +
+
Support +
+ +
+ + + + +
+
+ +
+
Prix +
+ +
+ `${value} €`} + value={range_price} + step={500} + name="toto" + + onChange={value => setrange_price(value)} + //onChange={TrainingPriceHandle} + onChangeComplete={value => console.log(value)} + /> +
+ + +
 
+
+ + +
+ + +
+ +
+ } +
+ +
+
+

Nos Formations

+ +
+ + +
+ {result && myApiResponse === "True" && !newresult && +
+
+
+ setCurrentPage2(page)} + /> +
+
+
+ Trier par + + + { + if (trier_par === "1") + settrier_par("-1"); + else + settrier_par("1"); + + trier(); + }} + + /> +
+
+ + +
+ + +
} + +
+ +
+ +
+ + {result && myApiResponse == "True" && fin == 0 && !newresult && + result.slice(0, PageSize).map((formation) => ( +
+ +
+ + ))} + + {result && myApiResponse == "True" && fin == 0 && newresult && + newresult.slice(0, PageSize).map((formation) => ( +
+ +
+ + ))} + + + + {result && myApiResponse === "True" && fin === 1 && !newresult + && currentTableData2 + && currentTableData2.map((formation) => ( +
+ +
+ + ))} + + {result && myApiResponse === "True" && fin === 1 && newresult + && currentTableData2 + && currentTableData2.map((formation) => ( +
+ + +
+ + ))} + +
+
+
+ + +
+
+ +
+
+
+ +
+ +
+
} + {/******* FIN Gestion du THEME SPECIAL JMJ Formation " */} + +
+ + ); +} + + +export default Mon_Catalogue_Public_ORIG_040726; \ No newline at end of file diff --git a/src/components/Partner_Facture.js b/src/components/Partner_Facture.js index d887649..a22400c 100644 --- a/src/components/Partner_Facture.js +++ b/src/components/Partner_Facture.js @@ -2429,7 +2429,7 @@ const Partner_Facture = (props) => { const stored_cookie = getCookie('tokenmysypart'); form.append("token", stored_cookie); - console.log(" ### form = ", form) + // console.log(" ### form = ", form) var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Partner_Invoice_with_filter/"; setLoading(true); diff --git a/src/components/header_automatic_files/Header_ENT_Student.jsx b/src/components/header_automatic_files/Header_ENT_Student.jsx index 0ece6c5..6dc1e50 100644 --- a/src/components/header_automatic_files/Header_ENT_Student.jsx +++ b/src/components/header_automatic_files/Header_ENT_Student.jsx @@ -298,7 +298,7 @@ const Header_ENT_Student = () => { removeCookie("tokenmysychapprenant"); - removeCookie("tokenmysych"); + // removeCookie("tokenmysych"); removeCookie("tokenmysychconnecteduserid"); removeCookie("tokenmysytypeconnexion"); @@ -328,7 +328,7 @@ const Header_ENT_Student = () => { removeCookie("tokenmysychapprenant"); removeCookie("tokenmysych"); - removeCookie("tokenmysypart"); + // removeCookie("tokenmysypart"); removeCookie("tokenmysytuteurrhid",); removeCookie("tokenmysychconnecteduserid"); removeCookie("tokenmysytypeconnexion"); diff --git a/src/styles/components/_module_atelier_catalogue.scss b/src/styles/components/_module_atelier_catalogue.scss new file mode 100644 index 0000000..ff764c7 --- /dev/null +++ b/src/styles/components/_module_atelier_catalogue.scss @@ -0,0 +1,719 @@ +.module_atelier_catalogue { + + width: 100%; + float: left; + + :root { + --mysy-blue: #104277; + --mysy-blue-2: #0f56bd; + --mysy-blue-3: #eaf2ff; + --text: #071943; + --muted: #63708c; + --border: #dbe4f2; + --soft-border: #edf2fa; + --bg: #f3f6fc; + --card: #ffffff; + --green: #11985a; + --green-bg: #e9fbf2; + --red: #c8203a; + --red-bg: #ffedf1; + --shadow: 0 14px 40px rgba(16, 66, 119, 0.1); + --shadow-soft: 0 8px 22px rgba(16, 66, 119, 0.08); + } + + * { + box-sizing: border-box; + } + + body { + margin: 0; + font-family: "DM Sans", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; + background: var(--bg); + color: var(--text); + } + + button, + input { + font: inherit; + } + + button { + cursor: pointer; + } + + .catalogue-page { + min-height: 100vh; + padding-bottom: 56px; + } + + .topbar { + height: 72px; + display: flex; + align-items: center; + gap: 32px; + padding: 0 56px; + background: rgba(255, 255, 255, 0.92); + border-bottom: 1px solid var(--soft-border); + position: sticky; + top: 0; + z-index: 20; + backdrop-filter: blur(14px); + } + + .brand { + font-size: 28px; + font-weight: 900; + letter-spacing: -1px; + color: var(--mysy-blue); + white-space: nowrap; + } + + .brand span { + font-weight: 700; + } + + .nav-links { + display: flex; + align-items: stretch; + gap: 8px; + height: 100%; + flex: 1; + justify-content: center; + } + + .nav-link { + display: flex; + align-items: center; + gap: 8px; + padding: 0 14px; + color: #697590; + text-decoration: none; + border-bottom: 3px solid transparent; + font-size: 14px; + font-weight: 700; + } + + .nav-link--active { + color: var(--mysy-blue-2); + border-color: var(--mysy-blue-2); + } + + .user-actions { + display: flex; + align-items: center; + gap: 14px; + } + + .notification-btn, + .avatar-btn { + border: 0; + background: transparent; + } + + .notification-btn { + position: relative; + width: 42px; + height: 42px; + display: grid; + place-items: center; + color: #31405f; + } + + .notification-btn span { + position: absolute; + top: 7px; + right: 5px; + background: #e43145; + color: #fff; + min-width: 17px; + height: 17px; + border-radius: 999px; + display: grid; + place-items: center; + font-size: 10px; + font-weight: 800; + } + + .avatar-btn { + display: inline-flex; + align-items: center; + gap: 7px; + background: var(--mysy-blue); + color: #fff; + padding: 10px 12px; + border-radius: 999px; + font-weight: 800; + } + + .hero-section, + .search-panel, + .results-info, + .formation-list { + width: min(1320px, calc(100% - 64px)); + margin-left: auto; + margin-right: auto; + } + + .hero-section { + display: flex; + justify-content: space-between; + align-items: flex-start; + gap: 24px; + padding: 42px 0 22px; + } + + .hero-section h1 { + margin: 0; + font-size: clamp(34px, 4vw, 46px); + letter-spacing: -1.4px; + line-height: 1.05; + } + + .hero-section p { + margin: 10px 0 0; + color: var(--muted); + font-size: 16px; + } + + .segment-tabs { + display: flex; + padding: 5px; + border: 1px solid var(--border); + border-radius: 999px; + background: #fff; + min-width: 360px; + box-shadow: var(--shadow-soft); + } + + .segment-tabs button { + flex: 1; + border: 0; + background: transparent; + color: var(--mysy-blue); + padding: 14px 26px; + border-radius: 999px; + font-weight: 800; + } + + .segment-tabs button.active { + background: linear-gradient(135deg, var(--mysy-blue), #0d56c4); + color: #fff; + box-shadow: 0 10px 22px rgba(15, 86, 196, 0.22); + } + + .search-panel { + background: #fff; + border: 1px solid var(--border); + border-radius: 18px; + padding: 20px; + box-shadow: var(--shadow); + } + + .search-row { + display: grid; + grid-template-columns: 1fr 180px; + gap: 18px; + } + + .search-input { + display: flex; + align-items: center; + gap: 12px; + height: 62px; + border: 1px solid #c8d7eb; + border-radius: 12px; + padding: 0 18px; + color: #71809b; + background: #fff; + } + + .search-input input { + border: 0; + outline: 0; + flex: 1; + color: var(--text); + font-size: 15px; + } + + .sort-btn { + display: grid; + grid-template-columns: 1fr auto; + align-items: center; + text-align: left; + gap: 2px 12px; + height: 62px; + border: 1px solid #c8d7eb; + background: #fff; + border-radius: 12px; + padding: 0 16px; + color: var(--text); + } + + .sort-btn span { + font-size: 12px; + color: var(--muted); + } + + .sort-btn svg { + grid-row: 1 / span 2; + grid-column: 2; + } + + .filter-row { + display: flex; + align-items: center; + justify-content: space-between; + gap: 18px; + margin-top: 20px; + } + + .filter-chips { + display: flex; + flex-wrap: wrap; + gap: 12px; + } + + .filter-chip { + display: inline-flex; + align-items: center; + gap: 8px; + height: 44px; + padding: 0 16px; + border: 1px solid var(--border); + border-radius: 10px; + color: var(--mysy-blue-2); + background: linear-gradient(180deg, #fff, #f8fbff); + font-weight: 800; + font-size: 14px; + } + + .filter-chip:hover { + border-color: #aac3e8; + box-shadow: 0 7px 16px rgba(16, 66, 119, 0.08); + } + + .reset-btn, + .program-btn { + border: 0; + background: transparent; + color: var(--mysy-blue-2); + font-weight: 800; + } + + .results-info { + margin-top: 22px; + color: var(--muted); + font-size: 15px; + } + + .results-info strong { + color: var(--text); + } + + .formation-list { + display: grid; + gap: 22px; + margin-top: 16px; + } + + .formation-card { + background: var(--card); + border: 1px solid var(--border); + border-radius: 18px; + box-shadow: var(--shadow-soft); + overflow: hidden; + } + + .formation-card__main { + display: grid; + grid-template-columns: 320px 1fr 250px; + gap: 28px; + padding: 22px; + } + + .formation-card__image-wrap { + position: relative; + min-height: 190px; + } + + .formation-card__image { + display: block; + width: 100%; + height: 190px; + object-fit: cover; + border-radius: 14px; + } + + .favorite-btn { + position: absolute; + top: 12px; + right: 12px; + width: 38px; + height: 38px; + border: 1px solid rgba(255, 255, 255, 0.8); + border-radius: 12px; + display: grid; + place-items: center; + background: rgba(255, 255, 255, 0.86); + color: #78859d; + backdrop-filter: blur(8px); + } + + .favorite-btn:hover { + color: #e43145; + } + + .formation-card__content { + display: grid; + grid-template-columns: 54px 1fr; + gap: 18px; + align-items: flex-start; + padding-top: 8px; + } + + .formation-icon { + width: 54px; + height: 54px; + display: grid; + place-items: center; + border-radius: 18px; + color: var(--mysy-blue-2); + background: var(--mysy-blue-3); + } + + .formation-icon--green { + color: #0f8b53; + background: #e9fbf2; + } + + .formation-icon--purple { + color: #7457e7; + background: #f1edff; + } + + .formation-copy h2 { + margin: 0 0 12px; + color: var(--mysy-blue); + font-size: 28px; + line-height: 1.15; + letter-spacing: -0.7px; + } + + .formation-copy p { + max-width: 700px; + margin: 0; + color: #475572; + line-height: 1.55; + } + + .rating-line { + display: flex; + align-items: center; + gap: 10px; + margin-top: 16px; + font-weight: 800; + color: #3e4b65; + font-size: 14px; + } + + .rating-stars { + display: inline-flex; + gap: 2px; + color: #f6ad19; + } + + .formation-card__meta { + padding-top: 6px; + } + + .badges { + display: flex; + align-items: center; + gap: 8px; + flex-wrap: wrap; + margin-bottom: 22px; + } + + .badge { + display: inline-flex; + align-items: center; + border-radius: 999px; + padding: 8px 12px; + font-size: 12px; + font-weight: 900; + } + + .badge--danger { + color: var(--red); + background: var(--red-bg); + } + + .badge--success { + color: var(--green); + background: var(--green-bg); + } + + .badge--soft { + color: var(--mysy-blue-2); + background: var(--mysy-blue-3); + } + + .meta-list { + display: grid; + gap: 16px; + } + + .meta-item { + display: grid; + grid-template-columns: 24px 1fr; + gap: 12px; + align-items: flex-start; + color: #53617d; + } + + .meta-item span, + .workshop-cell span { + display: block; + color: var(--muted); + font-size: 12px; + font-weight: 600; + } + + .meta-item strong, + .workshop-cell strong { + display: block; + margin-top: 2px; + color: var(--text); + font-size: 14px; + line-height: 1.25; + } + + .meta-item .price { + color: var(--mysy-blue-2); + font-size: 19px; + font-weight: 900; + } + + .meta-item .price-free { + color: var(--green); + font-size: 19px; + font-weight: 900; + } + + .workshops { + border-top: 1px solid var(--soft-border); + padding: 0 18px 18px; + } + + .workshops__header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 20px; + padding: 18px 0 12px; + } + + .workshops__header>div { + display: flex; + align-items: center; + gap: 10px; + color: var(--mysy-blue); + font-size: 18px; + } + + .workshops__header span { + min-width: 28px; + height: 26px; + padding: 0 9px; + border-radius: 999px; + display: inline-grid; + place-items: center; + background: var(--mysy-blue-3); + color: var(--mysy-blue-2); + font-weight: 900; + font-size: 13px; + } + + .program-btn { + display: inline-flex; + align-items: center; + gap: 4px; + } + + .workshops__list { + border: 1px solid var(--border); + border-radius: 14px; + overflow: hidden; + background: #fff; + } + + .workshop-row { + display: grid; + grid-template-columns: 1.5fr 1.5fr 1.2fr 1.15fr 1.15fr 144px; + align-items: center; + gap: 16px; + min-height: 72px; + padding: 10px 14px; + } + + .workshop-row+.workshop-row { + border-top: 1px solid var(--soft-border); + } + + .workshop-row:hover { + background: #f8fbff; + } + + .workshop-cell { + min-width: 0; + display: grid; + grid-template-columns: 24px 1fr; + align-items: center; + gap: 10px; + color: var(--mysy-blue-2); + } + + .workshop-code { + display: block; + padding-left: 6px; + } + + .workshop-code strong { + color: var(--mysy-blue); + } + + .workshop-places span { + color: var(--green); + } + + .details-btn { + border: 0; + background: linear-gradient(135deg, var(--mysy-blue), #0d56c4); + color: #fff; + height: 42px; + border-radius: 9px; + font-weight: 900; + box-shadow: 0 9px 18px rgba(16, 66, 119, 0.18); + } + + .details-btn:hover { + filter: brightness(1.04); + transform: translateY(-1px); + } + + @media (max-width: 1120px) { + .topbar { + padding: 0 24px; + } + + .nav-links { + display: none; + } + + .formation-card__main { + grid-template-columns: 240px 1fr; + } + + .formation-card__meta { + grid-column: 1 / -1; + display: flex; + justify-content: space-between; + gap: 22px; + } + + .meta-list { + grid-template-columns: repeat(3, 1fr); + flex: 1; + } + + .workshop-row { + grid-template-columns: 1.2fr 1.4fr 1fr 1fr; + } + + .workshop-row .workshop-cell:nth-of-type(5), + .details-btn { + grid-column: span 2; + } + } + + @media (max-width: 760px) { + + .hero-section, + .search-panel, + .results-info, + .formation-list { + width: min(100% - 28px, 1320px); + } + + .topbar { + height: auto; + min-height: 68px; + } + + .hero-section { + flex-direction: column; + padding-top: 26px; + } + + .segment-tabs { + width: 100%; + min-width: 0; + } + + .search-row { + grid-template-columns: 1fr; + } + + .filter-row { + align-items: flex-start; + flex-direction: column; + } + + .formation-card__main { + grid-template-columns: 1fr; + gap: 20px; + } + + .formation-card__image { + height: 220px; + } + + .formation-card__content { + grid-template-columns: 1fr; + } + + .formation-card__meta { + display: block; + } + + .meta-list { + grid-template-columns: 1fr; + } + + .formation-copy h2 { + font-size: 24px; + } + + .workshops__header { + align-items: flex-start; + flex-direction: column; + } + + .workshop-row { + grid-template-columns: 1fr; + gap: 12px; + padding: 16px; + } + + .workshop-row .workshop-cell:nth-of-type(5), + .details-btn { + grid-column: auto; + } + + .details-btn { + width: 100%; + } + } + + +} \ No newline at end of file diff --git a/src/styles/components/_updateuserinfo.scss b/src/styles/components/_updateuserinfo.scss index c8a843d..1252176 100644 --- a/src/styles/components/_updateuserinfo.scss +++ b/src/styles/components/_updateuserinfo.scss @@ -504,7 +504,7 @@ font-size: small !important; color: black; width: 90% !important; - height: 3.5rem !important; + height: 3rem !important; margin: 5px !important; //border: none !important; border-radius: 5px; @@ -641,7 +641,7 @@ font-size: small !important; color: black; width: 90% !important; - height: 3.5rem !important; + height: 3rem !important; margin: 5px !important; //border: none !important; border-radius: 5px; diff --git a/src/styles/index.scss b/src/styles/index.scss index 1ba27ab..8e3c39e 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -224,6 +224,7 @@ @import "./components/module_gestion_stage"; @import "./components/module_inscrit_suivi_paiement"; @import "./components/module_relance_client_facture"; +@import "./components/module_atelier_catalogue"; // New Design 2025