16/12/2022 - 22h00
parent
248c7c1aef
commit
e4bd79b6ac
|
@ -26,7 +26,7 @@ import fileDownload from 'js-file-download'
|
|||
import { ConsoleView } from "react-device-detect";
|
||||
import { confirmAlert } from 'react-confirm-alert';
|
||||
import SendIcon from '@mui/icons-material/Send';
|
||||
|
||||
import { FcViewDetails } from "react-icons/fc";
|
||||
|
||||
function GestionAdministrative(props) {
|
||||
|
||||
|
@ -290,7 +290,7 @@ function GestionAdministrative(props) {
|
|||
Display_Detail_Inscription(event, cellValues);
|
||||
}}
|
||||
>
|
||||
<FcApproval />
|
||||
<FcViewDetails />
|
||||
|
||||
</Button>
|
||||
|
||||
|
@ -299,8 +299,6 @@ function GestionAdministrative(props) {
|
|||
},
|
||||
|
||||
|
||||
|
||||
|
||||
]
|
||||
|
||||
const columns_list_emargement = [
|
||||
|
@ -847,6 +845,7 @@ function GestionAdministrative(props) {
|
|||
useEffect(() => {
|
||||
GetCurrentClass();
|
||||
GetCurrentClass_trainingsession();
|
||||
GetAttestation_Certif();
|
||||
|
||||
window.scrollTo(0, 0);
|
||||
|
||||
|
@ -860,6 +859,9 @@ function GestionAdministrative(props) {
|
|||
|
||||
setsessionChanged(false);
|
||||
clearSessionFields();
|
||||
setselectedCertif();
|
||||
seturlpreview_certif();
|
||||
|
||||
|
||||
var tab_date = [];
|
||||
|
||||
|
@ -1014,6 +1016,7 @@ function GestionAdministrative(props) {
|
|||
form.append("session_status", sessionStatus);
|
||||
form.append("date_debut_inscription", format(SessionstartDateInscription, 'dd/MM/yyyy kk:mm:ss'));
|
||||
form.append("date_fin_inscription", format(SessionendDateInscription, 'dd/MM/yyyy kk:mm:ss'));
|
||||
form.append("attestation_certif", selectedCertif);
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_SessionFormation/";
|
||||
|
||||
|
@ -1059,8 +1062,8 @@ function GestionAdministrative(props) {
|
|||
axios.post(myurl, form).then(res => {
|
||||
|
||||
if (res.data.status != "false") {
|
||||
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.status = " + res.data.status);
|
||||
//console.log(" In GetCurrentSession res.data.message r_class = " + res.data.message);
|
||||
setGetCurrentSession_api("true");
|
||||
setGetCurrentSession_result(res.data.message);
|
||||
var mylocaltraining = JSON.parse(res.data.message);
|
||||
|
@ -1087,6 +1090,13 @@ function GestionAdministrative(props) {
|
|||
setSessionendDateInscription(date_fin_inscript);
|
||||
}
|
||||
|
||||
document.getElementsByName("certif_liste")[0].value = "";
|
||||
if (mylocaltraining.attestation_certif) {
|
||||
|
||||
setselectedCertif(mylocaltraining.attestation_certif);
|
||||
GetSpecificAttestation_Certif(mylocaltraining.attestation_certif);
|
||||
|
||||
}
|
||||
|
||||
|
||||
document.getElementsByName("nb_participant")[0].value = "";
|
||||
|
@ -1149,7 +1159,15 @@ function GestionAdministrative(props) {
|
|||
return currentDate.getTime() < selectedDate.getTime();
|
||||
};
|
||||
|
||||
const [detailuser_date_inscription, setdetailuser_date_inscription] = useState();
|
||||
const [detailuser_date_evaluation, setdetailuser_date_evaluation] = useState();
|
||||
const [detailuser_date_certification, setdetailuser_date_certification] = useState();
|
||||
|
||||
|
||||
|
||||
const [SessionstartDateInscription, setSessionstartDateInscription] = useState();
|
||||
|
||||
|
||||
const filterPassedTime_start_Inscription = (time) => {
|
||||
const currentDate = new Date();
|
||||
const selectedDate = new Date(time);
|
||||
|
@ -1278,6 +1296,23 @@ function GestionAdministrative(props) {
|
|||
}
|
||||
|
||||
|
||||
const [selectedattendeeemail, setselectedattendeeemail] = useState([])
|
||||
function DownloadAttendeeDetail(event) {
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
|
||||
var nom_fiche_detaillee = "Fiche_Detaillee.pdf";
|
||||
|
||||
var url = process.env.REACT_APP_API_URL + "myclass/api/PrintAttendeeDetail_perSession/" + stored_cookie + "/" + mysession + "/" + selectedattendeeemail;
|
||||
|
||||
|
||||
|
||||
axios.get(url, { responseType: 'blob', },)
|
||||
.then((res) => {
|
||||
fileDownload(res.data, nom_fiche_detaillee)
|
||||
})
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
desableSessionFields();
|
||||
setCreateListEmargement_api();
|
||||
|
@ -1566,6 +1601,7 @@ function GestionAdministrative(props) {
|
|||
var montant = String(cellValues.row.amount);
|
||||
var nom = cellValues.row.nom;
|
||||
var email = cellValues.row.email;
|
||||
setselectedattendeeemail(email);
|
||||
var prenom = cellValues.row.prenom;
|
||||
GetAttendee_Data(email, mysession);
|
||||
}
|
||||
|
@ -1588,12 +1624,92 @@ function GestionAdministrative(props) {
|
|||
axios.post(myurl, form).then(res => {
|
||||
|
||||
if (res.data.status != "false") {
|
||||
console.log(" In GetAttendee res.data.status = " + res.data.status);
|
||||
console.log(" In GetAttendee res.data.message r_class = " + res.data.message);
|
||||
//console.log(" In GetAttendee res.data.status = " + res.data.status);
|
||||
//console.log(" In GetAttendee res.data.message r_class = " + res.data.message);
|
||||
setGetAttendee_api("true");
|
||||
setGetAttendee_result(res.data.message);
|
||||
var mylocalattendee = JSON.parse(res.data.message);
|
||||
|
||||
|
||||
if (mylocalattendee.inscription_validation_date) {
|
||||
var date_du = new Date(moment(mylocalattendee.inscription_validation_date, "DD/MM/YYYY HH:mm:ss"));
|
||||
setdetailuser_date_inscription(date_du);
|
||||
}
|
||||
|
||||
|
||||
|
||||
document.getElementsByName("detail_nom")[0].value = "";
|
||||
if (mylocalattendee.nom)
|
||||
document.getElementsByName("detail_nom")[0].value = mylocalattendee.nom;
|
||||
|
||||
document.getElementsByName("detail_prenom")[0].value = "";
|
||||
if (mylocalattendee.prenom)
|
||||
document.getElementsByName("detail_prenom")[0].value = mylocalattendee.prenom;
|
||||
|
||||
document.getElementsByName("detail_mail")[0].value = "";
|
||||
if (mylocalattendee.email) {
|
||||
document.getElementsByName("detail_mail")[0].value = mylocalattendee.email;
|
||||
}
|
||||
|
||||
|
||||
document.getElementsByName("detail_tel")[0].value = "";
|
||||
if (mylocalattendee.telephone) {
|
||||
document.getElementsByName("detail_tel")[0].value = mylocalattendee.telephone;
|
||||
}
|
||||
|
||||
document.getElementsByName("detail_adresse")[0].value = "";
|
||||
if (mylocalattendee.adresse) {
|
||||
document.getElementsByName("detail_adresse")[0].value = mylocalattendee.adresse;
|
||||
}
|
||||
|
||||
document.getElementsByName("detail_code_postal")[0].value = "";
|
||||
if (mylocalattendee.code_postal) {
|
||||
document.getElementsByName("detail_code_postal")[0].value = mylocalattendee.code_postal;
|
||||
}
|
||||
|
||||
document.getElementsByName("detail_ville")[0].value = "";
|
||||
if (mylocalattendee.ville) {
|
||||
document.getElementsByName("detail_ville")[0].value = mylocalattendee.ville;
|
||||
}
|
||||
|
||||
|
||||
|
||||
document.getElementsByName("detail_cout")[0].value = "";
|
||||
if (mylocalattendee.price) {
|
||||
document.getElementsByName("detail_cout")[0].value = mylocalattendee.price;
|
||||
}
|
||||
|
||||
|
||||
document.getElementsByName("detail_mode_fin")[0].value = "";
|
||||
if (mylocalattendee.modefinancement) {
|
||||
document.getElementsByName("detail_mode_fin")[0].value = mylocalattendee.modefinancement;
|
||||
}
|
||||
|
||||
|
||||
document.getElementsByName("detail_employeur")[0].value = "";
|
||||
if (mylocalattendee.employeur) {
|
||||
document.getElementsByName("detail_employeur")[0].value = mylocalattendee.employeur;
|
||||
}
|
||||
|
||||
document.getElementsByName("date_evaluation")[0].value = "";
|
||||
if (mylocalattendee.date_evaluation) {
|
||||
|
||||
var date_eval = new Date(moment(mylocalattendee.date_evaluation, "DD/MM/YYYY HH:mm:ss"));
|
||||
setdetailuser_date_evaluation(date_eval);
|
||||
}
|
||||
|
||||
document.getElementsByName("note_eval")[0].value = "";
|
||||
if (mylocalattendee.note_evaluation) {
|
||||
document.getElementsByName("note_eval")[0].value = mylocalattendee.note_evaluation;
|
||||
}
|
||||
|
||||
document.getElementsByName("detail_evalution")[0].value = "";
|
||||
if (mylocalattendee.evaluation) {
|
||||
document.getElementsByName("detail_evalution")[0].value = mylocalattendee.evaluation;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
setGetAttendee_api("false");
|
||||
|
@ -1607,6 +1723,94 @@ function GestionAdministrative(props) {
|
|||
})
|
||||
}
|
||||
|
||||
const [selectedCertif, setselectedCertif] = useState();
|
||||
const [urlpreview_certif, seturlpreview_certif] = useState();
|
||||
function handleChangeselectedCertif(event) {
|
||||
|
||||
var val = event.target.value
|
||||
console.log(val);
|
||||
GetSpecificAttestation_Certif(val)
|
||||
|
||||
setselectedCertif(val);
|
||||
|
||||
//seturlpreview_certif(val[1]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
const [GetAttestation_Certif_api, setGetAttestation_Certif_api] = useState();
|
||||
const [GetAttestation_Certif_message, setGetAttestation_Certif_message] = useState();
|
||||
const [GetAttestation_Certif_result, setGetAttestation_Certif_result] = useState();
|
||||
function GetAttestation_Certif(event) {
|
||||
|
||||
var form = new FormData();
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetPartnerAttestation_Certificat/";
|
||||
|
||||
axios.post(myurl, form).then(res => {
|
||||
|
||||
if (res.data.status != "false") {
|
||||
//console.log(" In GetAttestation_Certif res.data.status = " + res.data.status);
|
||||
//console.log(" In GetAttestation_Certif res.data.message r_class = " + res.data.message);
|
||||
setGetAttestation_Certif_api("true");
|
||||
setGetAttestation_Certif_result(res.data.message);
|
||||
}
|
||||
else {
|
||||
setGetAttestation_Certif_api("false");
|
||||
setGetAttestation_Certif_message(res.data.message);
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
console.warn('Not good man :( GetAttestation_Certif = ', error);
|
||||
setGetAttestation_Certif_api("false");
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const [GetSpecificAttestation_Certif_api, setGetSpecificAttestation_Certif_api] = useState();
|
||||
const [GetSpecificAttestation_Certif_message, setGetSpecificAttestation_Certif_message] = useState();
|
||||
const [GetSpecificAttestation_Certif_result, setGetSpecificAttestation_Certif_result] = useState();
|
||||
function GetSpecificAttestation_Certif(nom) {
|
||||
|
||||
var form = new FormData();
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
form.append("nom", nom);
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetSpecificPartnerAttestation_Certificat/";
|
||||
|
||||
axios.post(myurl, form).then(res => {
|
||||
|
||||
if (res.data.status != "false") {
|
||||
//console.log(" In GetSpecificAttestation_Certif res.data.status = " + res.data.status);
|
||||
//console.log(" In GetSpecificAttestation_Certif res.data.message r_class = " + res.data.message);
|
||||
setGetSpecificAttestation_Certif_api("true");
|
||||
setGetSpecificAttestation_Certif_result(res.data.message);
|
||||
|
||||
var mylocal = JSON.parse(res.data.message);
|
||||
console.log(mylocal);
|
||||
seturlpreview_certif(mylocal.preview_url);
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
setGetSpecificAttestation_Certif_api("false");
|
||||
setGetSpecificAttestation_Certif_message(res.data.message);
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
console.warn('Not good man :( GetSpecificAttestation_Certif = ', error);
|
||||
setGetSpecificAttestation_Certif_api("false");
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<div className='gestionadministrative'>
|
||||
<Helmet>
|
||||
|
@ -1710,8 +1914,6 @@ function GestionAdministrative(props) {
|
|||
<div className="div_row_droite">
|
||||
|
||||
|
||||
|
||||
|
||||
<div className="field_droite">
|
||||
<select id="session_liste" value={mysession} onChange={handleChangeSession} className="selectsession">
|
||||
<option value="">Choisir </option>
|
||||
|
@ -1896,6 +2098,26 @@ function GestionAdministrative(props) {
|
|||
</div>
|
||||
|
||||
|
||||
<div className="div_row" style={{ "border": "None" }}>
|
||||
<div className="session_caract">Choisir un certificat
|
||||
<select id="certif_liste" name="certif_liste" value={selectedCertif} onChange={handleChangeselectedCertif} className="selectsession">
|
||||
<option value="">Choisir un certificat </option>
|
||||
{GetAttestation_Certif_result &&
|
||||
GetAttestation_Certif_result.map((certificat) => (
|
||||
<option value={JSON.parse(certificat).nom}>
|
||||
{JSON.parse(certificat).nom}
|
||||
|
||||
</option>
|
||||
))}
|
||||
</select> <br />
|
||||
<img className="preview_certif" src={urlpreview_certif} />
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div className="div_row" style={{ "border": "None" }}>
|
||||
|
||||
</div>
|
||||
|
@ -2295,14 +2517,8 @@ function GestionAdministrative(props) {
|
|||
<DatePicker
|
||||
name="detail_incr_date"
|
||||
id="detail_incr_date"
|
||||
selected={SessionstartDate}
|
||||
onChange={(date) => {
|
||||
setSessionstartDate(date);
|
||||
setsessionChanged(true);
|
||||
}
|
||||
}
|
||||
showTimeSelect
|
||||
filterTime={filterPassedTime_start}
|
||||
selected={detailuser_date_inscription}
|
||||
|
||||
dateFormat="dd/MM/yyyy HH:mm"
|
||||
className="disabled_style"
|
||||
locale='fr-FR'
|
||||
|
@ -2373,14 +2589,9 @@ function GestionAdministrative(props) {
|
|||
<DatePicker
|
||||
name="date_evaluation"
|
||||
id="date_evaluation"
|
||||
selected={SessionstartDate}
|
||||
onChange={(date) => {
|
||||
setSessionstartDate(date);
|
||||
setsessionChanged(true);
|
||||
}
|
||||
}
|
||||
showTimeSelect
|
||||
filterTime={filterPassedTime_start}
|
||||
selected={detailuser_date_evaluation}
|
||||
|
||||
|
||||
dateFormat="dd/MM/yyyy HH:mm"
|
||||
className="disabled_style"
|
||||
locale='fr-FR'
|
||||
|
@ -2441,7 +2652,7 @@ function GestionAdministrative(props) {
|
|||
|
||||
<div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }}>
|
||||
|
||||
<Button variant="contained" className="bton_fermer" onClick={"enableSessionFields"}>Imprimer fiche
|
||||
<Button variant="contained" className="bton_fermer" onClick={DownloadAttendeeDetail}>Imprimer fiche detaillee
|
||||
</Button>
|
||||
|
||||
|
||||
|
@ -2462,14 +2673,8 @@ function GestionAdministrative(props) {
|
|||
<DatePicker
|
||||
name="certif_date"
|
||||
id="certif_date"
|
||||
selected={SessionstartDate}
|
||||
onChange={(date) => {
|
||||
setSessionstartDate(date);
|
||||
setsessionChanged(true);
|
||||
}
|
||||
}
|
||||
showTimeSelect
|
||||
filterTime={filterPassedTime_start}
|
||||
selected={detailuser_date_certification}
|
||||
|
||||
dateFormat="dd/MM/yyyy HH:mm"
|
||||
className="disabled_style"
|
||||
locale='fr-FR'
|
||||
|
|
|
@ -178,7 +178,8 @@
|
|||
height: 2rem !important;
|
||||
margin: 5px !important;
|
||||
}
|
||||
.css-1x5jdm{
|
||||
|
||||
.css-1x5jdm {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
|
@ -200,11 +201,12 @@
|
|||
background-color: white;
|
||||
color: #104277 !important;
|
||||
}
|
||||
.css-1x5jdmq{
|
||||
|
||||
.css-1x5jdmq {
|
||||
padding: 6px !important;
|
||||
}
|
||||
|
||||
.css-qiwgdb{
|
||||
.css-qiwgdb {
|
||||
padding: 6px !important;
|
||||
}
|
||||
}
|
||||
|
@ -389,7 +391,8 @@
|
|||
height: 2rem !important;
|
||||
margin: 5px !important;
|
||||
}
|
||||
.css-1x5jdm{
|
||||
|
||||
.css-1x5jdm {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
|
@ -410,11 +413,12 @@
|
|||
background-color: white;
|
||||
color: #104277 !important;
|
||||
}
|
||||
.css-1x5jdmq{
|
||||
|
||||
.css-1x5jdmq {
|
||||
padding: 6px !important;
|
||||
}
|
||||
|
||||
.css-qiwgdb{
|
||||
.css-qiwgdb {
|
||||
padding: 6px !important;
|
||||
}
|
||||
|
||||
|
@ -601,7 +605,7 @@
|
|||
margin: 5px !important;
|
||||
}
|
||||
|
||||
.css-1x5jdm{
|
||||
.css-1x5jdm {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
|
@ -624,11 +628,11 @@
|
|||
color: #104277 !important;
|
||||
}
|
||||
|
||||
.css-1x5jdmq{
|
||||
.css-1x5jdmq {
|
||||
padding: 6px !important;
|
||||
}
|
||||
|
||||
.css-qiwgdb{
|
||||
.css-qiwgdb {
|
||||
padding: 6px !important;
|
||||
}
|
||||
|
||||
|
@ -814,6 +818,15 @@
|
|||
height: 2rem !important;
|
||||
margin: 5px !important;
|
||||
}
|
||||
|
||||
.preview_certif{
|
||||
display: block;
|
||||
width: 128px;
|
||||
height: 128px;
|
||||
border-radius: 1rem !important;
|
||||
margin-top: 1rem !important;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.css-1t8l2tu-MuiInputBase-input-MuiOutlinedInput-input:invalid {
|
||||
|
@ -840,7 +853,7 @@
|
|||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.css-1x5jdm{
|
||||
.css-1x5jdm {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
|
@ -861,11 +874,12 @@
|
|||
background-color: white;
|
||||
color: #104277 !important;
|
||||
}
|
||||
.css-1x5jdmq{
|
||||
|
||||
.css-1x5jdmq {
|
||||
padding: 6px !important;
|
||||
}
|
||||
|
||||
.css-qiwgdb{
|
||||
.css-qiwgdb {
|
||||
padding: 6px !important;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue