07/04/23 - 11h11

recette2
cherif 2023-04-07 11:12:02 +02:00
parent 88b55d55c5
commit 548e9521c1
1 changed files with 122 additions and 97 deletions

View File

@ -1150,7 +1150,7 @@ function GestionAdministrative(props) {
const [selectedsession_date_du, setselectedsession_date_du] = useState(new Date());
const [selectedsession_date_au, setselectedsession_date_au] = useState(new Date());
function handleChangeSession(event) {
setreduction_session("0");
setsessionChanged(false);
clearSessionFields();
setselectedCertif();
@ -1158,6 +1158,13 @@ function GestionAdministrative(props) {
setdisplay_detail_insc();
setCreateSessionFormation_api();
setSendInscriptionConfirmation_api();
setreduction_session("0");
console.log(" reduction_session = ", reduction_session);
/*
if (String(reduction_session) === "1")
setreduction_session("0");
*/
var tab_date = [];
@ -1435,101 +1442,104 @@ function GestionAdministrative(props) {
axios.post(myurl, form).then(res => {
if (res.data.status != "false") {
if (String(res.data.status) === "true") {
//console.log(" In GetCurrentSession res.data.status = " + res.data.status);
//console.log(" In GetCurrentSession res.data.message r_class = " + res.data.message);
//console.log(" In GetCurrentSession res.data.message len = " + String(res.data.message).length);
setGetCurrentSession_api("true");
setGetCurrentSession_result(res.data.message);
var mylocaltraining = JSON.parse(res.data.message);
if (String(res.data.message).length > 0) {
setGetCurrentSession_result(res.data.message);
var mylocaltraining = JSON.parse(res.data.message);
if (mylocaltraining.date_debut) {
var date_du = new Date(moment(mylocaltraining.date_debut, "DD/MM/YYYY HH:mm:ss"));
setSessionstartDate(date_du);
}
if (mylocaltraining.date_debut) {
var date_du = new Date(moment(mylocaltraining.date_debut, "DD/MM/YYYY HH:mm:ss"));
setSessionstartDate(date_du);
}
if (mylocaltraining.date_fin) {
var date_fin = new Date(moment(mylocaltraining.date_fin, "DD/MM/YYYY HH:mm:ss"));
setSessionendDate(date_fin);
}
if (mylocaltraining.date_fin) {
var date_fin = new Date(moment(mylocaltraining.date_fin, "DD/MM/YYYY HH:mm:ss"));
setSessionendDate(date_fin);
}
if (mylocaltraining.date_debut_inscription) {
var date_du_inscript = new Date(moment(mylocaltraining.date_debut_inscription, "DD/MM/YYYY HH:mm:ss"));
setSessionstartDateInscription(date_du_inscript);
if (mylocaltraining.date_debut_inscription) {
var date_du_inscript = new Date(moment(mylocaltraining.date_debut_inscription, "DD/MM/YYYY HH:mm:ss"));
setSessionstartDateInscription(date_du_inscript);
}
if (mylocaltraining.date_fin_inscription) {
var date_fin_inscript = new Date(moment(mylocaltraining.date_fin_inscription, "DD/MM/YYYY HH:mm:ss"));
setSessionendDateInscription(date_fin_inscript);
}
if (mylocaltraining.attestation_certif) {
setselectedCertif(mylocaltraining.attestation_certif);
GetSpecificAttestation_Certif(mylocaltraining.attestation_certif);
}
document.getElementsByName("code_session")[0].value = "";
if (mylocaltraining.code_session)
document.getElementsByName("code_session")[0].value = mylocaltraining.code_session;
document.getElementsByName("nb_participant")[0].value = "";
if (mylocaltraining.nb_participant)
document.getElementsByName("nb_participant")[0].value = mylocaltraining.nb_participant;
document.getElementsByName("prix_session")[0].value = "";
if (mylocaltraining.prix_session)
document.getElementsByName("prix_session")[0].value = mylocaltraining.prix_session;
document.getElementsByName("distantiel")[0].value = "";
if (mylocaltraining.distantiel)
document.getElementsByName("distantiel")[0].value = mylocaltraining.distantiel;
document.getElementsByName("presentiel")[0].value = "";
if (mylocaltraining.presentiel)
document.getElementsByName("presentiel")[0].value = mylocaltraining.presentiel;
if (mylocaltraining.contenu_ftion)
setfield_contenu_ftion(mylocaltraining.contenu_ftion);
document.getElementsByName("adresse")[0].value = "";
if (mylocaltraining.adresse)
document.getElementsByName("adresse")[0].value = mylocaltraining.adresse;
document.getElementsByName("ville")[0].value = "";
if (mylocaltraining.ville) {
document.getElementsByName("ville")[0].value = mylocaltraining.ville;
}
document.getElementsByName("formateur")[0].value = "";
if (mylocaltraining.formateur) {
document.getElementsByName("formateur")[0].value = mylocaltraining.formateur;
}
document.getElementsByName("lms_class_code")[0].value = "";
if (mylocaltraining.lms_class_code) {
document.getElementsByName("lms_class_code")[0].value = mylocaltraining.lms_class_code;
setis_lms_class_code(mylocaltraining.lms_class_code);
}
document.getElementsByName("code_postal")[0].value = "";
if (mylocaltraining.code_postal)
document.getElementsByName("code_postal")[0].value = mylocaltraining.code_postal;
if (String(mylocaltraining.session_status) === "true")
setsessionStatus(true);
else if (String(mylocaltraining.session_status) === "false")
setsessionStatus(false);
}
if (mylocaltraining.date_fin_inscription) {
var date_fin_inscript = new Date(moment(mylocaltraining.date_fin_inscription, "DD/MM/YYYY HH:mm:ss"));
setSessionendDateInscription(date_fin_inscript);
}
if (mylocaltraining.attestation_certif) {
setselectedCertif(mylocaltraining.attestation_certif);
GetSpecificAttestation_Certif(mylocaltraining.attestation_certif);
}
document.getElementsByName("code_session")[0].value = "";
if (mylocaltraining.code_session)
document.getElementsByName("code_session")[0].value = mylocaltraining.code_session;
document.getElementsByName("nb_participant")[0].value = "";
if (mylocaltraining.nb_participant)
document.getElementsByName("nb_participant")[0].value = mylocaltraining.nb_participant;
document.getElementsByName("prix_session")[0].value = "";
if (mylocaltraining.prix_session)
document.getElementsByName("prix_session")[0].value = mylocaltraining.prix_session;
document.getElementsByName("distantiel")[0].value = "";
if (mylocaltraining.distantiel)
document.getElementsByName("distantiel")[0].value = mylocaltraining.distantiel;
document.getElementsByName("presentiel")[0].value = "";
if (mylocaltraining.presentiel)
document.getElementsByName("presentiel")[0].value = mylocaltraining.presentiel;
if (mylocaltraining.contenu_ftion)
setfield_contenu_ftion(mylocaltraining.contenu_ftion);
document.getElementsByName("adresse")[0].value = "";
if (mylocaltraining.adresse)
document.getElementsByName("adresse")[0].value = mylocaltraining.adresse;
document.getElementsByName("ville")[0].value = "";
if (mylocaltraining.ville) {
document.getElementsByName("ville")[0].value = mylocaltraining.ville;
}
document.getElementsByName("formateur")[0].value = "";
if (mylocaltraining.formateur) {
document.getElementsByName("formateur")[0].value = mylocaltraining.formateur;
}
document.getElementsByName("lms_class_code")[0].value = "";
if (mylocaltraining.lms_class_code) {
document.getElementsByName("lms_class_code")[0].value = mylocaltraining.lms_class_code;
setis_lms_class_code(mylocaltraining.lms_class_code);
}
document.getElementsByName("code_postal")[0].value = "";
if (mylocaltraining.code_postal)
document.getElementsByName("code_postal")[0].value = mylocaltraining.code_postal;
if (String(mylocaltraining.session_status) === "true")
setsessionStatus(true);
else if (String(mylocaltraining.session_status) === "false")
setsessionStatus(false);
}
else {
setGetCurrentSession_api("false");
@ -1734,17 +1744,32 @@ function GestionAdministrative(props) {
document.getElementsByName("code_session")[0].value = "";
document.getElementsByName("sessiondatedebut")[0].value = "";
document.getElementsByName("sessiondatefin")[0].value = "";
document.getElementsByName("adresse")[0].value = "";
if (document.getElementsByName("adresse")[0])
document.getElementsByName("adresse")[0].value = "";
document.getElementsByName("code_postal")[0].value = "";
document.getElementsByName("ville")[0].value = "";
document.getElementsByName("nb_participant")[0].value = "";
document.getElementsByName("prix_session")[0].value = "";
document.getElementsByName("presentiel")[0].value = "";
if (document.getElementsByName("code_postal")[0])
document.getElementsByName("code_postal")[0].value = "";
document.getElementsByName("distantiel")[0].value = "";
document.getElementsByName("sessiondatedebutinscription")[0].value = "";
document.getElementsByName("sessiondatefininscription")[0].value = "";
if (document.getElementsByName("ville")[0])
document.getElementsByName("ville")[0].value = "";
if (document.getElementsByName("nb_participant")[0])
document.getElementsByName("nb_participant")[0].value = "";
if (document.getElementsByName("prix_session")[0])
document.getElementsByName("prix_session")[0].value = "";
if (document.getElementsByName("presentiel")[0])
document.getElementsByName("presentiel")[0].value = "";
if (document.getElementsByName("distantiel")[0])
document.getElementsByName("distantiel")[0].value = "";
if (document.getElementsByName("sessiondatedebutinscription")[0])
document.getElementsByName("sessiondatedebutinscription")[0].value = "";
if (document.getElementsByName("sessiondatefininscription")[0])
document.getElementsByName("sessiondatefininscription")[0].value = "";
setSessionstartDateInscription();
setSessionendDateInscription();