import React, { useRef, useState, useEffect } from "react";
import TextField from '@mui/material/TextField';
import MenuItem from '@mui/material/MenuItem';
import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css
import Button from '@mui/material/Button';
import axios from "axios";
import { getCookie, setCookie } from 'react-use-cookie';
import { useHistory } from "react-router-dom";
import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid';
import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css";
import TextareaAutosize from '@mui/material/TextareaAutosize';
import MoreVertIcon from '@mui/icons-material/MoreVert';
import Menu from '@mui/material/Menu';
import 'react-tooltip/dist/react-tooltip.css'
import { Tooltip } from 'react-tooltip'

import fileDownload from 'js-file-download';
import Popup from 'reactjs-popup';
import 'reactjs-popup/dist/index.css';

import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
import { format } from 'date-fns'
import moment from "moment";
import InputAdornment from '@mui/material/InputAdornment';
import { AiFillCloseCircle } from "react-icons/ai";
import Box from '@mui/material/Box';

import { MdAddCircleOutline, MdRemoveCircleOutline } from "react-icons/md";
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 { Fab } from "@material-ui/core";
import { IoMdAddCircle, IoIosRemoveCircleOutline } from "react-icons/io";
import { AiTwotoneSave } from "react-icons/ai";
import Autocomplete from '@mui/material/Autocomplete';
import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif";

import { gridClasses } from '@mui/x-data-grid';
import Link from '@mui/material/Link';
import { PiDotsThree } from "react-icons/pi";
import { IoAddCircleOutline } from "react-icons/io5";
import AttachFileIcon from '@mui/icons-material/AttachFile';
import {  FcAcceptDatabase,  FcPlanner } from "react-icons/fc";

import Module_Alert_Confirmation from "./Module_Alert_Confirmation";
import Module_Historique_Action from "./Module_Historique_Action";
import ToggleSwitch from "./ToggleSwitch";
import daygridPlugin from "@fullcalendar/daygrid";

import FullCalendar, { formatDate } from "@fullcalendar/react";
import timeGridPlugin from "@fullcalendar/timegrid";
import interactionPlugin from "@fullcalendar/interaction";

import allLocales from '@fullcalendar/core/locales-all'
import { CiTrash, CiBoxList } from "react-icons/ci";

import { makeStyles } from "@material-ui/core/styles";
import CancelPresentationIcon from '@mui/icons-material/CancelPresentation';
import { IconButton } from '@material-ui/core';
import Paper from '@material-ui/core/Paper';
import Draggable from 'react-draggable';
import {
    GridToolbarContainer, GridToolbarExport, GridToolbarColumnsButton,
    GridToolbarFilterButton, GridToolbarDensitySelector, GridToolbarExportContainer, useGridApiContext,
    gridFilteredSortedRowIdsSelector,
    gridVisibleColumnFieldsSelector,
    GridValueGetterParams,
    GridPreferencePanelsValue,

} from '@mui/x-data-grid';
import * as XLSX from 'xlsx';
import { TbUsersGroup } from "react-icons/tb";
import Module_Jury_Selection_Apprenants from "./Module_Jury_Selection_Apprenants";

import { FcSearch } from "react-icons/fc";
import { FcViewDetails, FcDisapprove, FcInfo } from "react-icons/fc";
import Module_Session_Notes_Classement from "./Module_Session_Notes_Classement";
import { FaBullseye } from "react-icons/fa";

function PaperComponent(props) {
    return (
        <Draggable
            handle="#draggable-dialog-title"
            cancel={'[class*="MuiDialogContent-root"]'}
        >
            <Paper {...props} />
        </Draggable>
    );
}


const useStyles = makeStyles((theme) => ({

    dialog: {
        position: 'absolute',
        // left: 10,
        top: 400
    },

    paper: {
        overflowY: 'unset',
    },
    customizedButton: {
        position: 'absolute',
        left: '95%',
        top: '-3%',
        backgroundColor: 'lightgray',
        color: 'gray',
    },
}));


const Jury = (props) => {

    const classes = useStyles();
    const history = useHistory();
    const [submenu, setsubmenu] = useState("");

    const [submenu_detail_seance, setsubmenu_detail_seance] = useState("");


    const [rowss, setRows] = useState([]);
    const [selectionModel, setSelectionModel] = React.useState([]);
    const [isLoading, setLoading] = useState();

    var date_today_90j = new Date();
    date_today_90j.setDate(date_today_90j.getDate() + 90);


    const [p_filtre1, setp_filtre1] = useState("");
    const [p_filtre1_value, setp_filtre1_value] = useState("");

    const [p_filtre2, setp_filtre2] = useState("");
    const [p_filtre2_value, setp_filtre2_value] = useState("");

    const [p_filtre3, setp_filtre3] = useState("");
    const [p_filtre3_value, setp_filtre3_value] = useState("");

    const [p_filtre4, setp_filtre4] = useState("");
    const [p_filtre4_value, setp_filtre4_value] = useState("");

    const [selected_id, setselected_id] = React.useState("");

    const [selected_session_id, setselected_session_id] = React.useState("");

    const [selected_jury_cible, setselected_jury_cible] = React.useState("");

    const [selected_agenda_id, setselected_agenda_id] = React.useState("");

    const [selected_jury_soutenance_id, setselected_jury_soutenance_id] = React.useState("");

    const [selected_ue_id, setselected_ue_id] = React.useState("");

    const [selected_ue_code, setselected_ue_code] = React.useState("");


    const [gridline_id, setgridline_id] = useState("");

    function ExpandableCell_50({ value }) {
        const [expanded, setExpanded] = React.useState(false);

        return (
            <nav>
                {value && <div style={{ paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all" }}>

                    {expanded ? value : value.slice(0, 50)}&nbsp;
                    {value.length > 50 && (
                        // eslint-disable-next-line jsx-a11y/anchor-is-valid
                        <Link
                            type="button"
                            component="button"
                            sx={{ fontSize: 'inherit' }}
                            onClick={() => setExpanded(!expanded)}
                        >
                            {expanded ? <nav>  <PiDotsThree />Réduire</nav> : <nav> <PiDotsThree />Voir</nav>}
                        </Link>
                    )}
                </div>}

                {value && <div style={{ paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all" }}>
                    &nbsp;
                </div>
                }
            </nav>
        );
    }

    function ExpandableCell_50_bg_hiligt({ value }) {
        const [expanded, setExpanded] = React.useState(false);

        return (
            <nav>
                {value && <div style={{
                    paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all", color: '#0000FF',
                    "textAlign": "center"
                }}>

                    {expanded ? value : value.slice(0, 50)}&nbsp;
                    {value.length > 50 && (
                        // eslint-disable-next-line jsx-a11y/anchor-is-valid
                        <Link
                            type="button"
                            component="button"
                            sx={{ fontSize: 'inherit' }}
                            onClick={() => setExpanded(!expanded)}
                        >
                            {expanded ? <nav>  <PiDotsThree />Réduire</nav> : <nav> <PiDotsThree />Voir</nav>}
                        </Link>
                    )}
                </div>}

                {value && <div style={{ paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all", color: '#0000FF' }}>
                    &nbsp;
                </div>
                }
            </nav>
        );
    }

    const columns_jury = [
        { field: '_id', headerName: '_id', hide: true, Width: 0, disableExport: true, },
        { field: 'id', headerName: 'id', hide: true, Width: 0, disableExport: true, },
        { field: 'session_id', headerName: 'session_id', hide: true, Width: 0, disableExport: true, },

        { field: 'chef_jury_id', headerName: 'chef_jury_id', hide: true, Width: 0, disableExport: true, },

        { field: 'code', headerName: 'Code', flex: 1, hide: false, minWidth: 180, renderCell: (params) => <ExpandableCell_50 {...params} />, },
        { field: 'description', headerName: 'Description', flex: 1, hide: false, minWidth: 180, renderCell: (params) => <ExpandableCell_50 {...params} />, },

        { field: 'cible', headerName: 'Cible', flex: 1, hide: false, minWidth: 180, renderCell: (params) => <ExpandableCell_50 {...params} />, },

        { field: 'email_jury', headerName: 'Mail Diff.', flex: 1, hide: false, minWidth: 180, renderCell: (params) => <ExpandableCell_50 {...params} />, },
        { field: 'chef_jury_nom_prenom', headerName: 'Responsable', flex: 1, hide: false, minWidth: 180, renderCell: (params) => <ExpandableCell_50 {...params} />, },
        { field: 'nb_membre', headerName: 'Nb membres', flex: 1, hide: false, minWidth: 180, renderCell: (params) => <ExpandableCell_50 {...params} />, },

        { field: 'code_session', headerName: 'Promotion', flex: 1, hide: false, minWidth: 180, renderCell: (params) => <ExpandableCell_50 {...params} />, },
        { field: 'ue_code', headerName: 'Matière', flex: 1, hide: false, minWidth: 180, renderCell: (params) => <ExpandableCell_50 {...params} />, },

        {
            field: "delete", headerName: 'Supprimer', disableExport: true,
            renderCell: (cellValues) => {
                return (
                    <nav>
                        {String(cellValues.row.nb_membre) !== "0" && <Button onClick={(e) => {
                            alert(" Vous devez supprimer les membres avant de supprimer le jury");
                        }}>
                            <CiTrash />

                        </Button>}

                        {String(cellValues.row.nb_membre) === "0" &&
                            <Popup
                                trigger={<Button


                                >
                                    <CiTrash />

                                </Button>}
                                modal
                                nested
                                position="center center"
                            >
                                {close => (
                                    <div>
                                        <button className="gest_close" onClick={close}>
                                            &times;
                                        </button>
                                        <div className="gest_header"> MySy Information </div>
                                        <div className="gest_content">
                                            {' '}

                                            En confirmant cette opération, le jury sera <i><font color="red"> définitivement supprimé</font></i>. <br />

                                        </div>
                                        <div className="gest_actions">
                                            <div style={{ "width": "45%", "float": "left" }}>
                                                <button className="gest_bton_popup" onClick={(event) => {

                                                    Delete_Given_Jury(cellValues.row._id);
                                                    //console.log('modal closed ');
                                                    close();
                                                }}> Valider </button>

                                            </div>
                                            <div style={{ "width": "45%", "float": "right" }}>
                                                <button
                                                    className="gest_bton_popup"
                                                    onClick={() => {
                                                        //console.log('modal closed ');
                                                        close();
                                                    }}
                                                >
                                                    Annuler
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                )}
                            </Popup>}

                    </nav>
                );
            }
        }

    ]

    const columns_jury_membre = [
        { field: '_id', headerName: '_id', hide: true, Width: 0, disableExport: true, },
        { field: 'id', headerName: 'id', hide: true, Width: 0, disableExport: true, },
        {
            field: 'leader', headerName: 'Leader', hide: false, Width: 100,
            renderCell: (cellValues) => {
                return (
                    <div style={{ paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all" }}>
                        {cellValues.row.leader && String(cellValues.row.leader) === "1" && "Oui"}
                        {cellValues.row.leader && String(cellValues.row.leader) !== "1" && ""}
                    </div>

                );
            }
        },
        {
            field: 'civilite', headerName: 'Civilite', hide: false, Width: 100,
            valueFormatter: (params) => {
                if (params.value)
                    return String(params.value)[0].toUpperCase() + String(params.value).slice(1);
                else
                    return ""

            },
        },
        { field: 'nom', headerName: 'Nom', flex: 1, hide: false, minWidth: 180, renderCell: (params) => <ExpandableCell_50 {...params} />, },
        { field: 'prenom', headerName: 'Prenom', flex: 1, hide: false, minWidth: 180, renderCell: (params) => <ExpandableCell_50 {...params} />, },
        { field: 'email', headerName: 'Email', flex: 1, hide: false, minWidth: 180, renderCell: (params) => <ExpandableCell_50 {...params} />, },
        { field: 'role', headerName: 'Rôle', flex: 1, hide: false, minWidth: 180, renderCell: (params) => <ExpandableCell_50 {...params} />, },

        {
            field: "delete", headerName: 'Supprimer', disableExport: true,
            renderCell: (cellValues) => {
                return (

                    <Popup
                        trigger={<Button

                            onClick={(event) => {

                                // handleClick_delete(event, cellValues);
                            }}
                        >
                            <CiTrash />

                        </Button>}
                        modal
                        nested
                        position="center center"
                    >
                        {close => (
                            <div>
                                <button className="gest_close" onClick={close}>
                                    &times;
                                </button>
                                <div className="gest_header"> MySy Information </div>
                                <div className="gest_content">
                                    {' '}

                                    En confirmant cette opération, la personne sera <i><font color="red"> supprimée de l'équipe </font></i>. <br />



                                </div>
                                <div className="gest_actions">
                                    <div style={{ "width": "45%", "float": "left" }}>
                                        <button className="gest_bton_popup" onClick={(event) => {
                                            var tab = []
                                            tab.push(String(cellValues.row._id));
                                            Delete_List_Membre_From_Jury(tab);
                                            close();
                                        }}> Valider </button>

                                    </div>
                                    <div style={{ "width": "45%", "float": "right" }}>
                                        <button
                                            className="gest_bton_popup"
                                            onClick={() => {
                                                //console.log('modal closed ');
                                                close();
                                            }}
                                        >
                                            Annuler
                                        </button>
                                    </div>
                                </div>
                            </div>
                        )}
                    </Popup>


                );
            }
        }

    ]

    const columns_jury_seance_planning = [
        { field: '_id', headerName: '_id', hide: true },
        { field: 'id', headerName: 'id', hide: true },

        { field: 'jury_soutenance_id', headerName: 'jury_soutenance_id', hide: true },
        { field: 'jury_session_id', headerName: 'jury_session_id', hide: true },


        { field: 'event_title', headerName: 'Titre', hide: true },
        {
            field: 'event_start', headerName: 'Debut', flex: 1, hide: false, editable: false,
            valueFormatter: (params) => {
                return moment(params.value).format('D/MM/YYYY - H:mm');
            }
        },
        {
            field: 'event_end', headerName: 'Fin', flex: 1, hide: false, editable: false,
            valueFormatter: (params) => {
                return moment(params.value).format('D/MM/YYYY - H:mm');
            }
        },
        {
            field: 'convocation_apprenant_send', headerName: 'Conv. Envoyé', flex: 1, hide: false, minWidth: 180, renderCell: (params) => <ExpandableCell_50 {...params} />,
            renderCell: (cellValues) => {
                return (
                    <div style={{ paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all" }}>

                        {cellValues.row.convocation_apprenant_send && String(cellValues.row.convocation_apprenant_send) === "1" && "Oui"}
                        {cellValues.row.convocation_apprenant_send && String(cellValues.row.convocation_apprenant_send) === "0" && "Non"}

                    </div>

                );
            }
        },
        { field: 'convocation_apprenant_date_sending', headerName: 'Date Envoi Conv.', flex: 1, hide: false, minWidth: 180, renderCell: (params) => <ExpandableCell_50 {...params} />, },
        {
            field: "apprenant", headerName: 'Apprenant', disableExport: true,
            renderCell: (cellValues) => {
                return (
                    <nav>
                        <Button onClick={(e) => {

                            Get_Jury_List_Apprenant_Soutenance(cellValues.row._id, cellValues.row.jury_soutenance_id);

                            setStartDate(new Date(cellValues.row.event_start));
                            setendDate(new Date(cellValues.row.event_end));
                            Get_Jury_List_Apprenant_Seance(cellValues.row._id, cellValues.row.jury_soutenance_id);
                            setselected_agenda_id(cellValues.row._id);
                            setselected_jury_soutenance_id(cellValues.row.jury_soutenance_id);
                            GetListeInscrit();
                            setDialog_Jury_Apprenant_open(true);
                            settab_selected_apprenant([]);

                        }}>
                            <TbUsersGroup />

                        </Button>



                    </nav>
                );
            }
        },

        {
            field: "delete", headerName: 'Supprimer', disableExport: true,
            renderCell: (cellValues) => {
                return (
                    <nav>
                        <Popup
                            trigger={<Button
                            >
                                <CiTrash />

                            </Button>}
                            modal
                            nested
                            position="center center"
                        >
                            {close => (
                                <div>
                                    <button className="gest_close" onClick={close}>
                                        &times;
                                    </button>
                                    <div className="gest_header"> MySy Information </div>
                                    <div className="gest_content">
                                        {' '}

                                        En confirmant cette opération, la Soutenance sera <i><font color="red"> définitivement supprimée</font></i>. <br />

                                    </div>
                                    <div className="gest_actions">
                                        <div style={{ "width": "45%", "float": "left" }}>
                                            <button className="gest_bton_popup" onClick={(event) => {

                                                Delete_Given_Jury_Seance(cellValues.row.jury_soutenance_id);
                                                //console.log('modal closed ');
                                                close();
                                            }}> Valider </button>

                                        </div>
                                        <div style={{ "width": "45%", "float": "right" }}>
                                            <button
                                                className="gest_bton_popup"
                                                onClick={() => {
                                                    //console.log('modal closed ');
                                                    close();
                                                }}
                                            >
                                                Annuler
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            )}
                        </Popup>

                    </nav>
                );
            }
        },

        {
            field: 'gestion', headerName: 'Gestion', minWidth: 50, flex: 1, maxWidth: 100, hideable: true, hide: false, editable: false, align: "center",
            renderCell: (cellValues) => {
                return (
                    <div>
                        <nav style={{ width: '100%', 'textAlign': 'center' }}>
                            <IconButton
                                aria-label="more"
                                id="long-button"
                                aria-controls={open ? 'long-menu_p' : undefined}
                                aria-expanded={open ? 'true' : undefined}
                                aria-haspopup="true"
                                // onClick={handleClick_option_button_vertical}
                                onClick={(e) => {
                                    setselected_agenda_id(cellValues.row._id);
                                    setselected_jury_soutenance_id(cellValues.row.jury_soutenance_id);
                                    GetCurrentSession(cellValues.row.jury_session_id);
                                    handleClick_option_button_vertical(e);
                                    setworking_cellValues(cellValues);

                                    Get_Jury_List_Apprenant_Soutenance(cellValues.row._id, cellValues.row.jury_soutenance_id);

                                    if (String(selected_jury_cible) === "soutenance") {
                                        setStartDate(new Date(cellValues.row.event_start));
                                        setendDate(new Date(cellValues.row.event_end));
                                        Get_Jury_List_Apprenant_Seance(cellValues.row._id, cellValues.row.jury_soutenance_id);

                                        GetListeInscrit();

                                        settab_selected_apprenant([]);
                                    }
                                    else if (String(selected_jury_cible) === "examen") {
                                        setp_detail_linked_collection_recid(cellValues.row.jury_session_id);

                                    }


                                }}

                            >
                                <MoreVertIcon />
                            </IconButton>
                            <Menu
                                id="long-menu_p"
                                MenuListProps={{
                                    'aria-labelledby': 'long-button',
                                }}
                                anchorEl={anchorEl}
                                open={open}
                                onClose={handleClose_option_button_vertical}
                                slotProps={{
                                    paper: {
                                        style: {
                                            maxHeight: ITEM_HEIGHT * 4.5,
                                            width: '20ch',
                                            boxShadow: "-3px 4px 0px -30px #000000",
                                            borderRadius: '0px !important',
                                            lineHeight: '3rem'
                                        },
                                    },
                                }}
                            >
                                {options_menu_vertical.map((option) => (
                                    <MenuItem key={option}

                                        onClick={(e) => {
                                            //handleClose_option_button_vertical(e, option);
                                            setAnchorEl(null);

                                            if (option && String(option) === "Jury Edit" && String(selected_jury_cible) === "soutenance") {
                                                setDialog_JURY_INFO_open(true);
                                            }

                                            else if (option && String(option) === "Jury Edit" && String(selected_jury_cible) === "examen") {
                                                setsubmenu_detail_seance("display_jury_seance");

                                                if (document.getElementById('myRef_note_classemment')) {
                                                    var divh = document.getElementById('myRef_note_classemment').offsetTop;

                                                    window.scrollTo({
                                                        top: divh,
                                                        behavior: "smooth",
                                                    });
                                                }
                                            }

                                            else if (option && String(option) === "Apprenants") {
                                                setDialog_Jury_Apprenant_open(true);
                                            }



                                        }}
                                    >
                                        {option}
                                    </MenuItem>
                                ))}
                            </Menu>



                        </nav>
                    </div>
                );
            },
        },



        { field: 'event_comment', headerName: 'Comment', flex: 1, hide: true, editable: false, },

    ]

    const columns_jury_seance_participant = [
        { field: '_id', headerName: '_id', hide: true, Width: 0 },
        { field: 'id', headerName: 'id', hide: true, Width: 0 },
        { field: 'ue_id', headerName: 'ue_id', hide: true, Width: 0 },
        { field: 'ue_code', headerName: 'UE', hide: true, Width: 0 },

        { field: 'email', headerName: 'email', flex: 1, hide: false, minWidth: 180, renderCell: (params) => <ExpandableCell_50 {...params} />, },
        { field: 'nom', headerName: 'nom', flex: 1, hide: false, minWidth: 180, renderCell: (params) => <ExpandableCell_50 {...params} />, },
        { field: 'prenom', headerName: 'prenom', flex: 1, hide: false, minWidth: 180, renderCell: (params) => <ExpandableCell_50 {...params} />, },


        {
            field: "delete", headerName: 'Supprimer', disableExport: true,
            renderCell: (cellValues) => {
                return (
                    <nav>
                        <Popup
                            trigger={<Button
                            >
                                <CiTrash />

                            </Button>}
                            modal
                            nested
                            position="center center"
                        >
                            {close => (
                                <div>
                                    <button className="gest_close" onClick={close}>
                                        &times;
                                    </button>
                                    <div className="gest_header"> MySy Information </div>
                                    <div className="gest_content">
                                        {' '}

                                        En confirmant cette opération, l'apprenant sera <i><font color="red"> définitivement supprimé du jury</font></i>. <br />

                                    </div>
                                    <div className="gest_actions">
                                        <div style={{ "width": "45%", "float": "left" }}>
                                            <button className="gest_bton_popup" onClick={(event) => {

                                                Delete_Given_Jury_Apprenant(cellValues.row._id);
                                                //console.log('modal closed ');
                                                close();
                                            }}> Valider </button>

                                        </div>
                                        <div style={{ "width": "45%", "float": "right" }}>
                                            <button
                                                className="gest_bton_popup"
                                                onClick={() => {
                                                    //console.log('modal closed ');
                                                    close();
                                                }}
                                            >
                                                Annuler
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            )}
                        </Popup>

                    </nav>
                );
            }
        }

    ]


    const [working_cellValues, setworking_cellValues] = useState(false);

    const [dialogOpen_supp, setdialogOpen_supp] = useState(false);
    const Dialog_menuitem_close_supp = () => {
        setdialogOpen_supp(false)
    };


    const options_menu_vertical = [
        'Apprenants',
        'Supprimer',
        'Jury Edit',
    ];


    const ITEM_HEIGHT = 48;


    const [anchorEl, setAnchorEl] = React.useState(null);
    const open = Boolean(anchorEl);
    const handleClick_option_button_vertical = (event) => {
        setAnchorEl(event.currentTarget);
    };
    const handleClose_option_button_vertical = (event, value) => {
        setAnchorEl(null);
    };



    const [selectionModel_jury_seance_participants, setselectionModel_jury_seance_participants] = React.useState([]);

    const [selectionModel_columns_jury_seance, setselectionModel_columns_jury_seance] = React.useState([]);


    const [selectionModel_columns_jury, setselectionModel_columns_jury] = React.useState([]);
    const [selectionModel_columns_jury_membre, setselectionModel_columns_jury_membre] = React.useState([]);

    const [New_Getall_Training_Employee_No_Filter_result, setNew_Getall_Training_Employee_No_Filter_result] = useState([]);

    const [Getall_Training_Employee_No_Filter_api, setGetall_Training_Employee_No_Filter_api] = useState();
    const [Getall_Training_Employee_No_Filter_message, setGetall_Training_Employee_No_Filter_message] = useState();
    const [Getall_Training_Employee_No_Filter_result, setGetall_Training_Employee_No_Filter_result] = useState([]);
    function Getall_Training_Employee_No_Filter(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/Get_List_Ressource_Humaine_no_filter/";



        axios.post(myurl, form).then(res => {

            setLoading(true);

            if (String(res.data.status) === String("true")) {
                setLoading(false);
                //console.log(" In Getall_Training_Employee_No_Filter  res.data.status = " + res.data.status);
                //console.log(" In Getall_Training_Employee_No_Filter  res.data.message r_class = " + res.data.message);
                setGetall_Training_Employee_No_Filter_api("true");
                setGetall_Training_Employee_No_Filter_result(res.data.message);

                var new_data2 = [];
                const new_data = res.data.message.map((x) => {

                    //---
                    var localid = JSON.parse(x).id;
                    var local_id = JSON.parse(x)._id;
                    var local_nom = JSON.parse(x).nom;
                    var local_prenom = JSON.parse(x).prenom;
                    var local_ismanager = JSON.parse(x).ismanager;


                    //---
                    var node = {
                        "_id": local_id,
                        "id": localid,
                        "label": local_nom + " " + local_prenom,
                        "nom": local_nom,
                        "prenom": local_prenom,
                        "ismanager": local_ismanager
                    };
                    new_data2.push(node);
                });

                //---
                var node = {
                    "_id": "",
                    "id": "",
                    "label": "",
                    "nom": "",
                    "prenom": "",
                    "ismanager": ""

                };
                new_data2.push(node);

                if (new_data2.length > 0)
                    setNew_Getall_Training_Employee_No_Filter_result(new_data2);

            }
            else {
                setGetall_Training_Employee_No_Filter_api("false");
                setGetall_Training_Employee_No_Filter_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('Not good man :( Getall_Training_Employee_No_Filter = ', error);
            setGetall_Training_Employee_No_Filter_api("false");
            alert(" Impossible de recuperer la liste des employés");
            //setmyApimyApiMessage("")
        })
    }

    const [Delete_Given_Jury_api, setDelete_Given_Jury_api] = useState();
    const [Delete_Given_Jury_message, setDelete_Given_Jury_message] = useState();
    const [Delete_Given_Jury_result, setDelete_Given_Jury_result] = useState();
    function Delete_Given_Jury(local_grp_id) {

        var form = new FormData();

        const stored_cookie = getCookie('tokenmysypart');
        form.append("token", stored_cookie);
        form.append("_id", local_grp_id);


        var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_Jury/";

        axios.post(myurl, form).then(res => {
            //console.log(" In Delete_Given_Jury  res.data.status = " + res.data.status);
            //console.log(" In Delete_Given_Jury  res.data.message r_class = " + res.data.message);

            if (String(res.data.status) === String("true")) {
                setDelete_Given_Jury_api("true");
                setDelete_Given_Jury_result(res.data.message);

                Getall_Partner_Jury();
                setdisplay_jury("");
                setequipe_data_changed("");
                setequipe_data_edit_mode("");
                setadd_one_jury("");


                setselected_id("");
                setgridline_id("");

                setsubmenu("");

                setdisplay_alert_mysy("1");
                setalert_message(res.data.message);
                setalert_type("success");

            }
            else {
                setDelete_Given_Jury_api("false");
                setDelete_Given_Jury_message(res.data.message);
                // alert(res.data.message);
                setdisplay_alert_mysy("1");
                setalert_message(res.data.message);
                setalert_type("error");
            }

        }).catch((error) => {

            console.warn('Delete_Given_Jury : Not good man :( mysearchtext = ' + error);
            setDelete_Given_Jury_api("false");
            alert(" Impossible de supprimer le jury ");
        })
    }

    const [Delete_Given_Jury_Apprenant_api, setDelete_Given_Jury_Apprenant_api] = useState();
    const [Delete_Given_Jury_Apprenant_message, setDelete_Given_Jury_Apprenant_message] = useState();
    const [Delete_Given_Jury_Apprenant_result, setDelete_Given_Jury_Apprenant_result] = useState();
    function Delete_Given_Jury_Apprenant(local_jury_apprenant_id) {

        var form = new FormData();

        const stored_cookie = getCookie('tokenmysypart');
        form.append("token", stored_cookie);
        form.append("jury_id", selected_id);
        form.append("tab_ids", local_jury_apprenant_id);

        var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_Jury_Apprenant_Membres/";
        setLoading(true);
        axios.post(myurl, form).then(res => {
            //console.log(" In Delete_Given_Jury_Apprenant  res.data.status = " + res.data.status);
            //console.log(" In Delete_Given_Jury_Apprenant  res.data.message r_class = " + res.data.message);

            setLoading(false);
            if (String(res.data.status) === String("true")) {
                setDelete_Given_Jury_Apprenant_api("true");
                setDelete_Given_Jury_Apprenant_result(res.data.message);

                Get_Jury_List_Apprenant_Seance(selected_agenda_id, selected_jury_soutenance_id);
                setdisplay_alert_mysy("1");
                setalert_message(res.data.message);
                setalert_type("success");

            }
            else {
                setDelete_Given_Jury_Apprenant_api("false");
                setDelete_Given_Jury_Apprenant_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('Delete_Given_Jury_Apprenant : Not good man :( mysearchtext = ' + error);
            setDelete_Given_Jury_Apprenant_api("false");
            alert(" Impossible de supprimer l'apprenant ");
        })
    }



    const [Delete_Given_Jury_Seance_api, setDelete_Given_Jury_Seance_api] = useState();
    const [Delete_Given_Jury_Seance_message, setDelete_Given_Jury_Seance_message] = useState();
    const [Delete_Given_Jury_Seance_result, setDelete_Given_Jury_Seance_result] = useState();
    function Delete_Given_Jury_Seance(local_jury_soutenance_id) {

        var form = new FormData();

        const stored_cookie = getCookie('tokenmysypart');
        form.append("token", stored_cookie);
        form.append("jury_id", selected_id);
        form.append("jury_soutenance_id", local_jury_soutenance_id);

        var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_Jury_Seance/";
        setLoading(true);
        axios.post(myurl, form).then(res => {
            //console.log(" In Delete_Given_Jury_Seance  res.data.status = " + res.data.status);
            //console.log(" In Delete_Given_Jury_Seance  res.data.message r_class = " + res.data.message);

            setLoading(false);
            if (String(res.data.status) === String("true")) {
                setDelete_Given_Jury_Seance_api("true");
                setDelete_Given_Jury_Seance_result(res.data.message);

                Get_List_Agenda_Events_For_Given_User(selected_id);
                setdisplay_alert_mysy("1");
                setalert_message(res.data.message);
                setalert_type("success");

            }
            else {
                setDelete_Given_Jury_Seance_api("false");
                setDelete_Given_Jury_Seance_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('Delete_Given_Jury_Seance : Not good man :( mysearchtext = ' + error);
            setDelete_Given_Jury_Seance_api("false");
            alert(" Impossible de supprimer la Soutenance ");
        })
    }



    function GetSelectedRows_Jury_Membres_Ids() {


        var tab_tmp = []
        for (var i = 0; i < selectionModel_columns_jury_membre.length; i++) {
            //console.log(" ### selectionModel_insc[i] = ", selectionModel_insc[i]);
            var myid = parseInt(String(selectionModel_columns_jury_membre[i]));
            //var line = JSON.parse(rowss[myid]);
            tab_tmp.push(myid);
        }
        return tab_tmp;

    }

    async function actionmass_jury_membre_Traitemet() {

        var liste_membre_id = GetSelectedRows_Jury_Membres_Ids();
        var tab_mongo_members_ids = [];

        for (var i = 0; i < liste_membre_id.length; i++) {

            var line = New_Getall_Jury_Members[liste_membre_id[i]]


            var line_json = line;
            //console.log(" line_json['prenom'] = ", line_json['prenom']);
            //console.log(" line_json['_id'] = ", line_json['_id']);
            tab_mongo_members_ids.push(line_json['_id'])

        }

        if (String(actionmass_jury_membre_val) === String("delete_jury_membre")) {
            Delete_List_Membre_From_Jury(tab_mongo_members_ids);

        }
    }


    const [New_Getall_Partner_Jury_result, setNew_Getall_Partner_Jury_result] = useState([]);

    const [Getall_Partner_Jury_api, setGetall_Partner_Jury_api] = useState();
    const [Getall_Partner_Jury_message, setGetall_Partner_Jury_message] = useState();
    const [Getall_Partner_Jury_result, setGetall_Partner_Jury_result] = useState([]);
    function Getall_Partner_Jury(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/Get_List_Jury/";

        axios.post(myurl, form).then(res => {

            if (String(res.data.status) === String("true")) {
                //console.log(" In Getall_Partner_Jury  res.data.status = " + res.data.status);
                //console.log(" In Getall_Partner_Jury  res.data.message r_class = " + res.data.message);
                setGetall_Partner_Jury_api("true");
                setGetall_Partner_Jury_result(res.data.message);


                var new_data2 = [];
                const new_data = res.data.message.map((x) => {

                    //---
                    var localid = JSON.parse(x).id;
                    var local_id = JSON.parse(x)._id;
                    var local_code = JSON.parse(x).code;
                    var local_description = JSON.parse(x).description;
                    var local_email_jury = JSON.parse(x).email_jury;
                    var local_chef_jury_id = JSON.parse(x).chef_jury_id;
                    var local_chef_jury_nom_prenom = JSON.parse(x).chef_jury_nom_prenom;
                    var local_nb_membre = JSON.parse(x).nb_membre;
                    var local_session_id = JSON.parse(x).session_id;


                    //---
                    var node = {
                        "_id": local_id,
                        "id": localid,
                        "label": local_code,
                        "code": local_code,
                        "description": local_description,
                        "email_jury": local_email_jury,
                        "chef_jury_id": local_chef_jury_id,
                        "chef_jury_nom_prenom": local_chef_jury_nom_prenom,
                        "nb_membre": local_nb_membre,
                        "session_id": local_session_id,
                    };
                    new_data2.push(node);
                });

                //---
                var node = {
                    "_id": "",
                    "_id": "",
                    "id": "",
                    "label": "",
                    "code": "",
                    "description": "",
                    "email_jury": "",
                    "chef_jury_id": "",
                    "chef_jury_nom_prenom": "",
                    "nb_membre": "",
                    "session_id": "",

                };
                new_data2.push(node);

                if (new_data2.length > 0)
                    setNew_Getall_Partner_Jury_result(new_data2);

            }
            else {
                setGetall_Partner_Jury_api("false");
                setGetall_Partner_Jury_message(res.data.message);
                // alert(res.data.message);
                setdisplay_alert_mysy("1");
                setalert_message(res.data.message);
                setalert_type("error");
            }

        }).catch((error) => {
            console.warn('Not good man :( Getall_Partner_Jury = ', error);
            setGetall_Partner_Jury_api("false");
            alert(" Impossible de recuperer la liste des jurys");
            //setmyApimyApiMessage("")
        })
    }

    const New_Option = [
        { "id": "0", "label": "Supprimer", "value": "supprimer" },
        { "id": "2", "label": "Conv. Membre Jury", "value": "convocation_jury" },
    ]


    const New_Option_Jury_Seance = [
        { "id": "0", "label": "Supprimer", "value": "supprimer" },
        { "id": "1", "label": "Conv. Apprenant", "value": "convocation_apprenant" },
    ]

    const New_Option_jury_membre = [
        { "id": "delete_jury_membre", "label": "Supprimer les membres", "value": "delete_jury_membre" },
        { "id": "convocation", "label": "Env. Convocation", "value": "convocation" },
        { "id": "", "label": "", "value": "" },
    ]
    const [actionmass_ftion_val, setactionmass_ftion_val] = useState();

    const actionmass_ftion = (event) => {
        const value = event.target.value;


        if (String(value) === "supprimer") {
            setactionmass_ftion_val(value);
        }
        else {
            setactionmass_ftion_val();
        }
    }

    const [actionmass_jury_seance, setactionmass_jury_seance] = useState();

    const func_actionmass_jury_seance = (event) => {
        const value = event.target.value;


        if (String(value) === "supprimer") {
            actionmass_jury_seance(value);
        }
        else if (String(value) === "convocation_apprenant") {
            actionmass_jury_seance(value);
        }
        else {
            actionmass_jury_seance();
        }
    }


    const [actionmass_jury_membre, setactionmass_jury_membre] = useState();

    const func_actionmass_jury_membre = (event) => {
        const value = event.target.value;


        if (String(value) === "supprimer") {
            setactionmass_jury_membre(value);
        }
        else if (String(value) === "convocation_membre") {
            setactionmass_jury_membre(value);
        }
        else {
            setactionmass_jury_membre();
        }
    }



    const [history_securite_read, sethistory_securite_read] = useState("");

    useEffect(() => {
        Getall_Training_Employee_No_Filter();
        Getall_Partner_Jury();

        sethistory_securite_read(props.check_user_acces_right("historique", "read"))

        Getall_Partner_Site_Formation();

        Getall_TrainingSession();

        window.scrollTo({
            top: 0,
            behavior: "smooth",
        });

    }, [])



    const [New_Getall_Partner_Site_Formation_result, setNew_Getall_Partner_Site_Formation_result] = useState([]);

    const [Getall_Partner_Site_Formation_api, setGetall_Partner_Site_Formation_api] = useState();
    const [Getall_Partner_Site_Formation_message, setGetall_Partner_Site_Formation_message] = useState();
    const [Getall_Partner_Site_Formation_result, setGetall_Partner_Site_Formation_result] = useState([]);
    function Getall_Partner_Site_Formation(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/Get_List_Site_Formation_with_filter/";

        setLoading(true);
        axios.post(myurl, form).then(res => {
            setLoading(false);

            if (String(res.data.status) === String("true")) {
                //console.log(" In Getall_Partner_Site_Formation  res.data.status = " + res.data.status);
                //console.log(" In Getall_Partner_Site_Formation  res.data.message r_class = " + res.data.message);
                setGetall_Partner_Site_Formation_api("true");
                setGetall_Partner_Site_Formation_result(res.data.message);

                var new_data2 = [];
                const new_data = res.data.message.map((x) => {

                    //---
                    var localid = JSON.parse(x).id;
                    var local_id = JSON.parse(x)._id;
                    var local_code_site = JSON.parse(x).code_site;
                    var local_nom_site = JSON.parse(x).nom_site;
                    var local_adr_site = JSON.parse(x).site_adr;
                    var local_cp_site = JSON.parse(x).site_cp;
                    var local_ville_site = JSON.parse(x).site_ville;
                    var local_pays_site = JSON.parse(x).site_pays;


                    //---
                    var node = {
                        "_id": local_id,
                        "id": localid,
                        "label": local_code_site,
                        "code_site": local_code_site,
                        "nom_site": local_nom_site,
                        "adr_site": local_adr_site,
                        "cp_site": local_cp_site,
                        "ville_site": local_ville_site,
                        "pays_site": local_pays_site,


                    };
                    new_data2.push(node);
                });

                //---
                var node = {
                    "_id": "",
                    "id": "",
                    "label": "",
                    "code_site": "",
                    "nom_site": "",
                    "adr_site": "",
                    "cp_site": "",
                    "ville_site": "",
                    "pays_site": "",

                };
                new_data2.push(node);


                if (new_data2.length > 0)
                    setNew_Getall_Partner_Site_Formation_result(new_data2);


            }
            else {
                setGetall_Partner_Site_Formation_api("false");
                setGetall_Partner_Site_Formation_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('Not good man :( Getall_Partner_Site_Formation = ', error);
            setGetall_Partner_Site_Formation_api("false");
            alert(" Impossible de recuperer la liste des sites de formation");
            //setmyApimyApiMessage("")
        })
    }

    const [New_Get_List_UE_From_Session_Id_result, setNew_Get_List_UE_From_Session_Id_result] = useState([]);

    const [Get_List_UE_From_Session_Id_api, setGet_List_UE_From_Session_Id_api] = useState();
    const [Get_List_UE_From_Session_Id_message, setGet_List_UE_From_Session_Id_message] = useState();
    const [Get_List_UE_From_Session_Id_result, setGet_List_UE_From_Session_Id_result] = useState([]);
    function Get_List_UE_From_Session_Id(local_session_id) {

        var form = new FormData();


        const stored_cookie = getCookie('tokenmysypart');
        form.append("token", stored_cookie);
        form.append("session_id", local_session_id);

        var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Unite_Enseignement_Of_Given_Class_From_Session_Id/";

        setLoading(true);

        axios.post(myurl, form).then(res => {


            setLoading(false);
            if (String(res.data.status) === String("true")) {
                //console.log(" In Get_List_UE_From_Session_Id  res.data.status = " + res.data.status);
                //console.log(" In Get_List_UE_From_Session_Id  res.data.message r_class = " + res.data.message);
                setGet_List_UE_From_Session_Id_api("true");
                setGet_List_UE_From_Session_Id_result(res.data.message);

                var new_data2 = [];
                const new_data = res.data.message.map((x) => {

                    //---
                    var localid = JSON.parse(x).id;
                    var local_id = JSON.parse(x)._id;
                    var local_code = JSON.parse(x).code;
                    var local_titre = JSON.parse(x).titre;

                    var local_class_id = JSON.parse(x).class_id;
                    var local_internal_url = JSON.parse(x).internal_url;




                    //---
                    var node = {
                        "_id": local_id,
                        "id": localid,
                        "label": local_code,
                        "code": local_code,
                        "titre": local_titre,
                        "class_id": local_class_id,
                        "internal_url": local_internal_url,

                    };
                    new_data2.push(node);
                });

                //---
                var node = {
                    "_id": "",
                    "id": "",
                    "label": "",
                    "code": "",
                    "titre": "",
                    "class_id": "",
                    "internal_url": "",

                };
                new_data2.push(node);

                if (new_data2.length > 0)
                    setNew_Get_List_UE_From_Session_Id_result(new_data2);
            }
            else {
                setGet_List_UE_From_Session_Id_api("false");
                setGet_List_UE_From_Session_Id_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('Not good man :( Get_List_UE_From_Session_Id = ', error);
            setGet_List_UE_From_Session_Id_api("false");
            //   alert(" Impossible de recuperer la liste des UE de la formation");
            setdisplay_alert_mysy("1");
            setalert_message(" Impossible de recuperer la liste des UE de la formation");
            setalert_type("error");
            //setmyApimyApiMessage("")
        })
    }

    const [GetCurrentSession_api, setGetCurrentSession_api] = useState();
    const [GetCurrentSession_message, setGetCurrentSession_message] = useState();
    const [GetCurrentSession_result, setGetCurrentSession_result] = useState([]);
    function GetCurrentSession(local_session_id) {


        var form = new FormData();
        //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
        const stored_cookie = getCookie('tokenmysypart');
        form.append("token", stored_cookie);
        form.append("session_id", local_session_id);

        var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Given_SessionFormation_From_Id/";

        setLoading(true);
        axios.post(myurl, form).then(res => {

            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);

                setLoading(false);
                setGetCurrentSession_api("true");
                if (String(res.data.message).length > 0) {
                    setGetCurrentSession_result(res.data.message);
                }

            } else if (String(res.data.status) === String("Err_Connexion")) {
                setLoading(false);
                alert('Erreur: ' + res.data.message);
                history.push("/Connexion");
            }

            else {
                setLoading(false);
                setGetCurrentSession_api("false");
                setGetCurrentSession_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('Not good man :( GetCurrentSession = ', error);
            setGetCurrentSession_api("false");
            alert(" Impossible de récuperer les données de la session ");


        })
    }


    const myRef_head = useRef(null);
    const myRef = useRef(null)
    const myRef_note_classemment = useRef(null)



    const sleep = (milliseconds) => {
        return new Promise(resolve => setTimeout(resolve, milliseconds))
    }

    const New_Option_Filter = [
        { "id": "code", "label": "Code Equipe  ", "value": "code" },
        { "id": "description", "label": "Description ", "value": "description" },
        { "id": "membre", "label": "Nom / Prenom membre ", "value": "membre" },
        { "id": "", "label": "", "value": "" },
        { "id": "1", "label": "", "value": "1" }, // Cette ligne pour couvrir l'ajout d'une ligne de filter. C'est fait expres.
    ]


    async function Disable_Jury_DetailFields() {
        await sleep(5);
        setequipe_data_edit_mode("0");

        var liste_champs = ['detail_code', 'detail_description', 'detail_email_diffusion', 'detail_responsable', 'detail_session_id',
            'detail_jury_matiere', 'detail_jury_cible', 'detail_adresse', 'detail_code_postal', 'detail_ville', 'detail_pays',
            'detail_site_formation', 'detail_salle']


        for (let i = 0; i < liste_champs.length; i++) {

            if (document.getElementsByName(String(liste_champs[i])) && document.getElementsByName(String(liste_champs[i]))[0]) {
                document.getElementsByName(String(liste_champs[i]))[0].disabled = true;
                document.getElementsByName(String(liste_champs[i]))[0].style.backgroundColor = "#ECEFF1";

            }
        }

    }


    function handleClick_edit_jury_From_Line(selected_row_id) {

        var line = New_Getall_Partner_Jury_result[selected_row_id];

        setselected_id(line._id);
        setgridline_id(selected_row_id);

        Get_Given_Jury_Data(line._id);
        Get_List_Agenda_Events_For_Given_User(line._id);

        setdisplay_jury("1");
        setadd_one_jury("");
        setequipe_data_changed("");
        setequipe_data_edit_mode("");
        submenu_detail();

        //Getall_Evaluation_Participant_List();

    }


    const [New_Employee_Not_Member, setNew_Employee_Not_Member] = useState([]);

    const [New_List_Jury_Members_Id, setNew_List_Jury_Members_Id] = useState([]);
    const [New_Getall_Jury_Members, setNew_Getall_Jury_Members] = useState([]);

    const [Get_Given_Jury_Data_api, setGet_Given_Jury_Data_api] = useState();
    const [Get_Given_Jury_Data_message, setGet_Given_Jury_Data_message] = useState();
    const [Get_Given_Jury_Data_result, setGet_Given_Jury_Data_result] = useState([]);
    function Get_Given_Jury_Data(equipe_id) {
        setequipe_data_changed("");
        setequipe_data_edit_mode("");


        var form = new FormData();

        const stored_cookie = getCookie('tokenmysypart');
        form.append("token", stored_cookie);
        form.append("_id", equipe_id);


        var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Given_Jury_With_Members/";

        setLoading(true);
        axios.post(myurl, form).then(res => {

            if (String(res.data.status) === "true") {
                setLoading(false);
                //console.log(" In Get_Given_Jury_Data  res.data.status = " + res.data.status);
                //console.log(" In Get_Given_Jury_Data  res.data.message r_class = " + res.data.message);
                setGet_Given_Jury_Data_api("true");
                setGet_Given_Jury_Data_result(res.data.message);

                if (res.data.message.length > 0) {
                    var mylocal_groupe = JSON.parse(res.data.message);

                    if (mylocal_groupe.code)
                        setp_detail_code(mylocal_groupe.code);
                    else
                        setp_detail_code("");

                    if (mylocal_groupe.email_jury) {
                        setp_detail_email_jury(mylocal_groupe.email_jury);
                    } else {
                        setp_detail_email_jury("");
                    }

                    if (mylocal_groupe.session_id) {
                        setselected_session_id(mylocal_groupe.session_id);
                    } else {
                        setselected_session_id("");
                    }


                    if (mylocal_groupe.description) {
                        setp_detail_description(mylocal_groupe.description);
                    } else {
                        setp_detail_description("");
                    }

                    if (mylocal_groupe.chef_jury_id) {
                        setp_detail_chef_jury_id(mylocal_groupe.chef_jury_id);
                    } else {
                        setp_detail_chef_jury_id("");
                    }


                    if (mylocal_groupe.adresse) {
                        setp_detail_adresse(mylocal_groupe.adresse);
                    } else {
                        setp_detail_adresse("");
                    }

                    if (mylocal_groupe.code_postal) {
                        setp_detail_code_postal(mylocal_groupe.code_postal);
                    } else {
                        setp_detail_code_postal("");
                    }

                    if (mylocal_groupe.ville) {
                        setp_detail_ville(mylocal_groupe.ville);
                    } else {
                        setp_detail_ville("");
                    }

                    if (mylocal_groupe.pays) {
                        setp_detail_pays(mylocal_groupe.pays);
                    } else {
                        setp_detail_pays("");
                    }

                    if (mylocal_groupe.site_formation_id) {
                        setp_detail_site_formation_id(mylocal_groupe.site_formation_id);
                    } else {
                        setp_detail_site_formation_id("");
                    }

                    if (mylocal_groupe.jury_salle) {
                        setp_detail_salle(mylocal_groupe.jury_salle);
                    } else {
                        setp_detail_salle("");
                    }


                    var new_data2 = [];
                    const new_data = res.data.message.map((x) => {

                        //---
                        var tab_employe_not_member = [];

                        var local_jury_membres = JSON.parse(x).list_membre;
                        setNew_Getall_Jury_Members(local_jury_membres);

                        var local_all_Training_Employee = New_Getall_Training_Employee_No_Filter_result;

                        for (var i = 0; i < local_all_Training_Employee.length; i++) {

                            var is_member = "0";

                            for (var x = 0; x < local_jury_membres.length; x++) {
                                if (local_all_Training_Employee[i]._id === local_jury_membres[x].rh_id) {
                                    is_member = "1"
                                }
                            }

                            if (is_member === "0") {
                                //   console.log(" NOT MEMBER = ", local_all_Training_Employee[i]);
                                tab_employe_not_member.push(local_all_Training_Employee[i]);
                            }


                        }

                        setNew_Employee_Not_Member(tab_employe_not_member);

                    });


                    if (document.getElementById('myRef')) {
                        var divh = document.getElementById('myRef').offsetTop;
                        window.scrollTo({
                            top: divh,
                            behavior: "smooth",
                        });
                    }

                    Disable_Jury_DetailFields();
                } else {
                    alert(" Aucune donnée recuperée");
                }


            } else if (String(res.data.status) === String("Err_Connexion")) {
                alert('Erreur: ' + res.data.message);
                history.push("/Connexion");
            }

            else {
                setLoading(false);
                setGet_Given_Jury_Data_api("false");
                setGet_Given_Jury_Data_message(res.data.message);
                // alert(res.data.message);
                setdisplay_alert_mysy("1");
                setalert_message(res.data.message);
                setalert_type("error");
            }

        }).catch((error) => {
            console.warn('Not good man :( Get_Given_Jury_Data = ', error);
            setGet_Given_Jury_Data_api("false");
            alert(" Impossible de recuperer les données du jurys");
            //setmyApimyApiMessage("")
        })
    }


    function clean_all_filters() {
        setgridline_id('');
        setp_filtre1("");
        setp_filtre1_value("");

        setp_filtre2("");
        setp_filtre2_value("");

        setp_filtre3("");
        setp_filtre3_value("");

        setp_filtre4("");
        setp_filtre4_value("");

        Annule_Add_One_Jury_DetailFields();

        Getall_Partner_Jury();

    }



    const [Add_Update_Jury_Data_api, setAdd_Update_Jury_Data_api] = useState();
    const [Add_Update_Jury_Data_message, setAdd_Update_Jury_Data_message] = useState();
    const [Add_Update_Jury_Data_result, setAdd_Update_Jury_Data_result] = useState([]);
    function Add_Update_Jury_Data() {
        var form = new FormData();
        //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");


        const stored_cookie = getCookie('tokenmysypart');
        form.append("token", stored_cookie);

        form.append("code", p_detail_code);
        form.append("session_id", selected_session_id);
        form.append("description", p_detail_description);
        form.append("email_jury", p_detail_email_jury);
        form.append("chef_jury_id", p_detail_chef_jury_id);

        form.append("cible", selected_jury_cible);
        form.append("ue_id", selected_ue_id);

        form.append("adresse", p_detail_adresse);
        form.append("adresse", p_detail_adresse);
        form.append("code_postal", p_detail_code_postal);
        form.append("ville", p_detail_ville);
        form.append("pays", p_detail_pays);
        form.append("site_formation_id", p_detail_site_formation_id);
        form.append("jury_salle", p_detail_salle);


        var myurl = "";

        if (selected_id && String(selected_id).length > 5) {
            form.append("_id", selected_id);
            myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_Jury/";
        } else {
            myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Jury/";
        }



        setLoading(true);
        axios.post(myurl, form).then(res => {
            //console.log(" In Add_Update_Jury_Data  res.data.status = " + res.data.status);
            //console.log(" In Add_Update_Jury_Data  res.data.message r_class = " + res.data.message);

            setLoading(false);

            if (String(res.data.status) === String("true")) {
                setAdd_Update_Jury_Data_api("true");
                setAdd_Update_Jury_Data_result(res.data.message);
                Disable_Jury_DetailFields();
                setequipe_data_changed("");
                setequipe_data_edit_mode("");
                clear_DetailFieds();

                if (selected_id && String(selected_id).length > 5) {
                    handleClick_edit_jury_From_Line(gridline_id);
                    Disable_Jury_DetailFields();
                    setequipe_data_changed("");
                    setequipe_data_edit_mode("");

                    setdisplay_jury('1');
                    if (document.getElementById('myRef')) {
                        // myRef.current.scrollIntoView({ behavior: "smooth" });
                        var divh = document.getElementById('myRef').offsetTop;
                        window.scrollTo({
                            top: divh,
                            behavior: "smooth",
                        });
                    }

                } else {
                    Disable_Jury_DetailFields();
                    setequipe_data_changed("");
                    setequipe_data_edit_mode("");
                    setdisplay_jury("");
                    setadd_one_jury("");
                    setsubmenu("");


                    window.scrollTo({
                        top: 0,
                        behavior: "smooth",
                    });

                }


                Getall_Partner_Jury();


                // alert(res.data.message);
                setdisplay_alert_mysy("1");
                setalert_message(res.data.message);
                setalert_type("success");



            }
            else {
                setAdd_Update_Jury_Data_api("false");
                setAdd_Update_Jury_Data_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.log('UpdateStagiaireData : Not good man :( Add_Update_Jury_Data = ' + error);
            setAdd_Update_Jury_Data_api("false");
            alert(" Impossible d'ajouter ou  mettre à jour les données du jury ");

        })
    }


    const [Add_Update_Jury_Soutenance_Data_api, setAdd_Update_Jury_Soutenance_Data_api] = useState();
    const [Add_Update_Jury_Soutenance_Data_message, setAdd_Update_Jury_Soutenance_Data_message] = useState();
    const [Add_Update_Jury_Soutenance_Data_result, setAdd_Update_Jury_Soutenance_Data_result] = useState([]);
    function Add_Update_Jury_Soutenance_Data() {
        var form = new FormData();
        //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");


        const stored_cookie = getCookie('tokenmysypart');
        form.append("token", stored_cookie);

        form.append("jury_id", selected_id);
        form.append("jury_soutenance_id", selected_jury_soutenance_id);
        form.append("agenda_id", selected_agenda_id);
        form.append("sujet", p_detail_soutenance_sujet);
        form.append("note", p_detail_soutenance_note);
        form.append("observation", p_detail_soutenance_observation);


        var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_Jury_Soutenance/";


        setLoading(true);
        axios.post(myurl, form).then(res => {
            //console.log(" In Add_Update_Jury_Soutenance_Data  res.data.status = " + res.data.status);
            //console.log(" In Add_Update_Jury_Soutenance_Data  res.data.message r_class = " + res.data.message);

            setLoading(false);

            if (String(res.data.status) === String("true")) {
                setAdd_Update_Jury_Soutenance_Data_api("true");
                setAdd_Update_Jury_Soutenance_Data_result(res.data.message);
                Disable_Jury_Soutenance_DetailFields();


                // alert(res.data.message);
                setdisplay_alert_mysy("1");
                setalert_message(res.data.message);
                setalert_type("success");



            }
            else {
                setAdd_Update_Jury_Soutenance_Data_api("false");
                setAdd_Update_Jury_Soutenance_Data_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.log('UpdateStagiaireData : Not good man :( Add_Update_Jury_Soutenance_Data = ' + error);
            setAdd_Update_Jury_Soutenance_Data_api("false");
            alert(" Impossible d'ajouter ou  mettre à jour les données de la soutenance du jury ");

        })
    }


    const [Add_Member_To_Jury_api, setAdd_Member_To_Jury_api] = useState();
    const [Add_Member_To_Jury_message, setAdd_Member_To_Jury_message] = useState();
    const [Add_Member_To_Jury_result, setAdd_Member_To_Jury_result] = useState([]);
    function Add_Member_To_Jury() {

        var tab_rh_ids = [];
        for (var i = 0; i < tab_selected_users.length; i++) {

            var local_rh_id = tab_selected_users[i]._id;
            tab_rh_ids.push(local_rh_id);
        }


        var form = new FormData();


        const stored_cookie = getCookie('tokenmysypart');
        form.append("token", stored_cookie);
        form.append("_id", selected_id);
        form.append("tab_ressource_humaine_ids", tab_rh_ids);
        form.append("role", p_detail_member_role);




        var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_Jury_Membres/";

        setLoading(true);
        axios.post(myurl, form).then(res => {
            //console.log(" In Add_Member_To_Jury  res.data.status = " + res.data.status);
            //console.log(" In Add_Member_To_Jury  res.data.message r_class = " + res.data.message);

            setLoading(false);

            if (String(res.data.status) === String("true")) {
                Dialog_Jury_Membre_handleClose_buton();
                setAdd_Member_To_Jury_api("true");
                setAdd_Member_To_Jury_result(res.data.message);
                Disable_Jury_DetailFields();
                setequipe_data_changed("");
                setequipe_data_edit_mode("");
                clear_DetailFieds();

                Get_Given_Jury_Data(selected_id);

                // alert(res.data.message);
                setdisplay_alert_mysy("1");
                setalert_message(res.data.message);
                setalert_type("success");



            }
            else {
                setAdd_Member_To_Jury_api("false");
                setAdd_Member_To_Jury_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.log('UpdateStagiaireData : Not good man :( Add_Member_To_Jury = ' + error);
            setAdd_Member_To_Jury_api("false");
            alert(" Impossible d'ajouter les membre ou  mettre à jour le jury");

        })
    }


    const [Add_Apprenant_To_Jury_api, setAdd_Apprenant_To_Jury_api] = useState();
    const [Add_Apprenant_To_Jury_message, setAdd_Apprenant_To_Jury_message] = useState();
    const [Add_Apprenant_To_Jury_result, setAdd_Apprenant_To_Jury_result] = useState([]);
    function Add_Apprenant_To_Jury() {

        var tab_inscrit_ids = [];
        for (var i = 0; i < tab_selected_apprenant.length; i++) {

            var local_rh_id = tab_selected_apprenant[i]._id;
            tab_inscrit_ids.push(local_rh_id);
        }

        if (moment(endDate) <= moment(startDate)) {
            //  alert(" Les dates de début et de fin sont incohérentes");
            setdisplay_alert_mysy("1");
            setalert_message("Les dates de début et de fin sont incohérentes");
            setalert_type("error");
            return;
        }

        var new_start_date = moment(startDate).format();
        var new_end_date = moment(endDate).format();



        var form = new FormData();


        const stored_cookie = getCookie('tokenmysypart');
        form.append("token", stored_cookie);
        form.append("_id", selected_id);
        form.append("tab_inscriptions_ids", tab_inscrit_ids);
        form.append("agenda_id", selected_agenda_id);
        form.append("jury_soutenance_id", selected_jury_soutenance_id);
        form.append("jury_seance_ue_id", jury_seance_ue_id);

        form.append("event_start", new_start_date);
        form.append("event_end", new_end_date);

        form.append("jury_soutenance_salle", p_detail_soutenance_salle);
        form.append("jury_soutenance_adresse", p_detail_soutenance_adresse);
        form.append("jury_soutenance_code_postal", p_detail_soutenance_code_postal);
        form.append("jury_soutenance_ville", p_detail_soutenance_ville);
        form.append("jury_soutenance_pays", p_detail_soutenance_pays);


        Dialog_Jury_Membre_handleClose_buton();


        var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_Apprenant_To_Jury/";

        setLoading(true);
        axios.post(myurl, form).then(res => {

            //console.log(" In Add_Apprenant_To_Jury  res.data.status = " + res.data.status);
            //console.log(" In Add_Apprenant_To_Jury  res.data.message r_class = " + res.data.message);

            setLoading(false);

            if (String(res.data.status) === String("true")) {

                //console.log(" In Add_Apprenant_To_Jury  res.data.message r_class = ", res.data);
                setselected_agenda_id(res.data.agenda_id);
                setselected_jury_soutenance_id(res.data.soutenance_id);

                setAdd_Apprenant_To_Jury_api("true");
                setAdd_Apprenant_To_Jury_result(res.data.message);

                Get_Jury_List_Apprenant_Seance(res.data.agenda_id, res.data.soutenance_id);
                Get_List_Agenda_Events_For_Given_User(selected_id);



                setdisplay_alert_mysy("1");
                setalert_message(res.data.message);
                setalert_type("success");

                settab_selected_apprenant([]);
            }
            else {
                setAdd_Apprenant_To_Jury_api("false");
                setAdd_Apprenant_To_Jury_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.log('UpdateStagiaireData : Not good man :( Add_Apprenant_To_Jury = ' + error);
            setAdd_Apprenant_To_Jury_api("false");
            alert(" Impossible d'ajouter les membre ou  mettre à jour les apprenants du jury");

        })
    }


    async function submenu_detail() {
        await sleep(5);
        setsubmenu("detail_jury");
        inactive_active_menu_header("detail_jury");


        if (String(equipe_data_edit_mode) !== "1") {
            Disable_Jury_DetailFields();
        }

    }

    async function submenu_membres() {
        await sleep(5);
        setsubmenu("membre");
        inactive_active_menu_header("membre");


        if (String(equipe_data_edit_mode) !== "1") {
            Disable_Jury_DetailFields();
        }

    }

    async function submenu_piece_jointe() {
        await sleep(5);
        setsubmenu("piece_jointe");
        inactive_active_menu_header("piece_jointe");

        // Refresh affichage des pièces jointes
        Get_List_Of_All_PJ(props.client_id);


        if (String(equipe_data_edit_mode) !== "1") {
            Disable_Jury_DetailFields();
        }

    }

    async function submenu_selection() {
        await sleep(5);
        setsubmenu("selection");
        inactive_active_menu_header("selection");


        if (String(equipe_data_edit_mode) !== "1") {
            Disable_Jury_DetailFields();
        }

    }

    async function submenu_planning() {
        await sleep(5);
        setsubmenu("planning");
        inactive_active_menu_header("planning");

        // Refresh affichage des pièces jointes
        Get_List_Of_All_PJ(props.client_id);


        if (String(equipe_data_edit_mode) !== "1") {
            Disable_Jury_DetailFields();
        }

    }

    async function submenu_historique() {
        await sleep(5);
        setsubmenu("historique");
        inactive_active_menu_header("historique");

        if (String(equipe_data_edit_mode) !== "1") {
            Disable_Jury_DetailFields();
        }

    }

    // Cette fontion desactive tous les menu header et reactive just le menu_header concerné
    function inactive_active_menu_header(current_menu_header) {


        const list_menu_header_names = ['detail_jury', 'membre', 'piece_jointe', 'historique', 'planning', 'selection']
        for (let i = 0; i < list_menu_header_names.length; i++) {
            if (document.getElementsByName(String(list_menu_header_names[i])) && document.getElementsByName(String(list_menu_header_names[i]))[0]) {
                document.getElementsByName(String(list_menu_header_names[i]))[0].style.fontWeight = "400";
                document.getElementsByName(String(list_menu_header_names[i]))[0].style.backgroundColor = "#d8edfc";
                document.getElementsByName(String(list_menu_header_names[i]))[0].style.color = "#3b3e40";

            }
        }


        if (document.getElementsByName(String(current_menu_header)) && document.getElementsByName(String(current_menu_header))[0]) {
            document.getElementsByName(String(current_menu_header))[0].style.fontWeight = "700";
            document.getElementsByName(String(current_menu_header))[0].style.backgroundColor = "#107758";
            document.getElementsByName(String(current_menu_header))[0].style.color = "white";
        }
    }



    // DEBUT  EXPORT EXCEL DATAGRID 

    function CustomToolbar(props) {


        return (
            <GridToolbarContainer {...props}>

                <GridToolbarColumnsButton />
                <GridToolbarFilterButton />
                <GridToolbarDensitySelector
                    slotProps={{ tooltip: { title: 'Change density' } }}
                />
                <Box sx={{ flexGrow: 1 }} />
                <ExportButton data_colums={props.data_colums} />


            </GridToolbarContainer>
        );
    }

    function getExcelData(apiRef) {
        // Select rows and columns
        const filteredSortedRowIds = gridFilteredSortedRowIdsSelector(apiRef);
        const visibleColumnsField = gridVisibleColumnFieldsSelector(apiRef);

        // Format the data. Here we only keep the value
        const data = filteredSortedRowIds.map((id) => {
            const row = {};
            visibleColumnsField.forEach((field) => {
                row[field] = apiRef.current.getCellParams(id, field).value;
            });
            return row;
        });

        return data;
    }


    function ExportButton(props) {
        return (
            <GridToolbarExportContainer {...props}>
                <ExportMenuItem data_colums={props.data_colums} />
            </GridToolbarExportContainer>
        );
    }

    function handleExport(apiRef, data_colums) {
        const data = getExcelData(apiRef);
        const visibleColumnsField = gridVisibleColumnFieldsSelector(apiRef);


        const local_config = {
            keys: visibleColumnsField,

            columnNames: data_colums.filter((mydata) => (mydata).disableExport !== true).map(function (mydata) {
                if (mydata.headerName && visibleColumnsField.includes(mydata.field)) {
                    if (mydata.headerName) {
                        return mydata.headerName;
                    }
                }

            }),

            fileName: 'data_' + String(new Date().toJSON().slice(0, 10)).replaceAll("-", "_") + '.xlsx',
            sheetName: 'Export_' + String(new Date().toJSON().slice(0, 10)).replaceAll("-", "_"),
        };

        local_config.columnNames = local_config.columnNames.filter(function (element) {
            return element !== undefined;
        });


        const rows = data.map((row) => {
            const mRow = {};
            for (const key of local_config.keys) {
                mRow[key] = row[key];
            }
            return mRow;
        });

        const worksheet = XLSX.utils.json_to_sheet(rows);
        XLSX.utils.sheet_add_aoa(worksheet, [[...local_config.columnNames]], {
            origin: 'A1',
        });

        const workbook = XLSX.utils.book_new();
        XLSX.utils.book_append_sheet(workbook, worksheet, local_config.sheetName);
        XLSX.writeFile(workbook, local_config.fileName, { compression: true });
    }

    function ExportMenuItem(props) {
        const apiRef = useGridApiContext();
        const { hideMenu } = props;

        return (
            <MenuItem
                onClick={() => {
                    handleExport(apiRef, props.data_colums);
                    // Hide the export menu after the export
                    hideMenu?.();
                }}
            >
                Export Excel
            </MenuItem>
        );
    }

    // FIN EXPORT EXCEL DATAGRID 


    const [display_alert_mysy, setdisplay_alert_mysy] = useState("");
    const [alert_message, setalert_message] = useState("");
    const [alert_type, setalert_type] = useState("");

    function clear_alert_message() {
        setalert_message("");
    }
    function clear_alert_type() {
        setalert_type("");
    }

    function clear_display_alert_mysy() {
        setdisplay_alert_mysy("");
    }

    function Ajout_1_jury() {

        clear_DetailFieds();

        setdisplay_jury("");
        setequipe_data_changed("");
        setequipe_data_edit_mode("");

        setselected_id("");
        setgridline_id("");
        setadd_one_jury("1");
        setsubmenu("detail_jury");

        if (document.getElementById('myRef')) {
            // myRef.current.scrollIntoView({ behavior: "smooth" });
            var divh = document.getElementById('myRef').offsetTop;
            window.scrollTo({
                top: divh,
                behavior: "smooth",
            });
        }

    }


    function Annule_Add_One_Jury_DetailFields() {

        clear_DetailFieds();

        setdisplay_jury("");
        setequipe_data_changed("");
        setequipe_data_edit_mode("");
        setadd_one_jury("");


        setselected_id("");
        setgridline_id("");

        setsubmenu("");

        window.scrollTo({
            top: 0,
            behavior: "smooth",
        });


    }

    function Annule_Jury_DetailFields() {
        Get_Given_Jury_Data(selected_id);
        setequipe_data_changed("");
        setequipe_data_edit_mode("");
    }


    function Enable_Jury_DetailFields() {
        setequipe_data_edit_mode("1");

        var liste_champs = ['detail_code', 'detail_description', 'detail_email_diffusion', 'detail_responsable', 'detail_session_id',
            'detail_jury_matiere', 'detail_jury_cible', 'detail_adresse', 'detail_code_postal', 'detail_ville', 'detail_pays',
            'detail_site_formation', 'detail_salle']

        for (let i = 0; i < liste_champs.length; i++) {
            if (document.getElementsByName(String(liste_champs[i])) && document.getElementsByName(String(liste_champs[i]))[0]) {
                document.getElementsByName(String(liste_champs[i]))[0].disabled = false;
                document.getElementsByName(String(liste_champs[i]))[0].style.backgroundColor = "#FFFFFF";

            }
        }
    }


    function Enable_Jury_Soutenance_DetailFields() {
        setsoutenance_data_edit_mode("1");

        var liste_champs = ['detail_soutenance_sujet', 'detail_soutenance_observation', 'detail_soutenance_note']

        for (let i = 0; i < liste_champs.length; i++) {
            if (document.getElementsByName(String(liste_champs[i])) && document.getElementsByName(String(liste_champs[i]))[0]) {
                document.getElementsByName(String(liste_champs[i]))[0].disabled = false;
                document.getElementsByName(String(liste_champs[i]))[0].style.backgroundColor = "#FFFFFF";

            }
        }
    }

    async function Disable_Jury_Soutenance_DetailFields() {


        setsoutenance_data_edit_mode("0");
        await sleep(5);
        var liste_champs = ['detail_soutenance_sujet', 'detail_soutenance_observation', 'detail_soutenance_note']

        for (let i = 0; i < liste_champs.length; i++) {

            if (document.getElementsByName(String(liste_champs[i])) && document.getElementsByName(String(liste_champs[i]))[0]) {
                document.getElementsByName(String(liste_champs[i]))[0].disabled = true;
                document.getElementsByName(String(liste_champs[i]))[0].style.backgroundColor = "#ECEFF1";
            }
        }

    }




    function Annule_Jury_Soutenance_DetailFields() {

        Get_Jury_List_Apprenant_Soutenance(selected_agenda_id, selected_jury_soutenance_id);
        setsoutenance_data_edit_mode("0");
        setsoutenance_data_changed("");
        Disable_Jury_Soutenance_DetailFields();
    }


    const [p_detail_code, setp_detail_code] = React.useState("");
    const [p_detail_description, setp_detail_description] = React.useState("");
    const [p_detail_email_jury, setp_detail_email_jury] = React.useState("");
    const [p_detail_chef_jury_id, setp_detail_chef_jury_id] = React.useState("");


    const [p_detail_site_formation_id, setp_detail_site_formation_id] = React.useState("");

    const [p_detail_adresse, setp_detail_adresse] = React.useState("");
    const [p_detail_code_postal, setp_detail_code_postal] = React.useState("");
    const [p_detail_ville, setp_detail_ville] = React.useState("");
    const [p_detail_pays, setp_detail_pays] = React.useState("");

    const [p_detail_salle, setp_detail_salle] = React.useState("");


    const [p_detail_soutenance_adresse, setp_detail_soutenance_adresse] = React.useState("");
    const [p_detail_soutenance_code_postal, setp_detail_soutenance_code_postal] = React.useState("");
    const [p_detail_soutenance_ville, setp_detail_soutenance_ville] = React.useState("");
    const [p_detail_soutenance_pays, setp_detail_soutenance_pays] = React.useState("");
    const [p_detail_soutenance_salle, setp_detail_soutenance_salle] = React.useState("");

    const [display_jury, setdisplay_jury] = React.useState("");
    const [equipe_data_changed, setequipe_data_changed] = React.useState("");
    const [equipe_data_edit_mode, setequipe_data_edit_mode] = useState("");
    const [add_one_jury, setadd_one_jury] = React.useState("");


    function clear_DetailFieds() {
        setp_detail_code("");
        setp_detail_description("");
        setselected_session_id("");
        setp_detail_email_jury("");
        setp_detail_chef_jury_id("");

        setp_detail_adresse("");
        setp_detail_code_postal("");
        setp_detail_ville("");
        setp_detail_pays("");
        setp_detail_site_formation_id("");
        setp_detail_salle("");

    }


    function clear_Soutenance_DetailFieds() {
        setp_detail_soutenance_sujet("");
        setp_detail_soutenance_observation("");
        setp_detail_soutenance_note("");
    }

    const [p_detail_member_role, setp_detail_member_role] = React.useState("");

    const [gridline_jury_member_id, setgridline_jury_member_id] = useState("");

    const [Getall_Partner_Jury_With_Filter_api, setGetall_Partner_Jury_With_Filter_api] = useState();
    const [Getall_Partner_Jury_With_Filter_message, setGetall_Partner_Jury_With_Filter_message] = useState();
    const [Getall_Partner_Jury_With_Filter_result, setGetall_Partner_Jury_With_Filter_result] = useState();
    function Getall_Partner_Jury_With_Filter(event) {

        var form = new FormData();


        // Recuperation des parametres
        var filtre1 = p_filtre1;
        var filtre2 = p_filtre2;
        var filtre3 = p_filtre3;
        var filtre4 = p_filtre4;

        var filtre1_value = "";
        var filtre2_value = "";
        var filtre3_value = "";
        var filtre4_value = "";
        // Recuperation des valeurs de filtres

        if (p_filtre1_value) {
            filtre1_value = p_filtre1_value;
            form.append(filtre1, filtre1_value);
        }

        if (p_filtre2_value) {
            filtre2_value = p_filtre2_value;
            form.append(filtre2, filtre2_value);
        }

        if (p_filtre3_value) {
            filtre3_value = p_filtre3_value;
            form.append(filtre3, p_filtre3_value);
        }

        if (p_filtre4_value) {
            filtre4_value = p_filtre4_value;
            form.append(filtre4, p_filtre4_value);
        }


        const stored_cookie = getCookie('tokenmysypart');
        form.append("token", stored_cookie);

        var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_jury_With_Filter/";

        Annule_Add_One_Jury_DetailFields();

        axios.post(myurl, form).then(res => {

            if (String(res.data.status) === String("true")) {
                //console.log(" In Getall_Partner_Jury_With_Filter  res.data.status = " + res.data.status);
                //console.log(" In Getall_Partner_Jury_With_Filter  res.data.message r_class = " + res.data.message);
                setGetall_Partner_Jury_With_Filter_api("true");
                setGetall_Partner_Jury_With_Filter_result(res.data.message);

                setGetall_Partner_Jury_result(res.data.message);

                var new_data2 = [];
                const new_data = res.data.message.map((x) => {

                    //---
                    var localid = JSON.parse(x).id;
                    var local_id = JSON.parse(x)._id;
                    var local_code = JSON.parse(x).code;
                    var local_description = JSON.parse(x).description;
                    var local_email_jury = JSON.parse(x).email_jury;
                    var local_chef_jury_id = JSON.parse(x).chef_jury_id;
                    var local_chef_jury_nom_prenom = JSON.parse(x).chef_jury_nom_prenom;
                    var local_nb_membre = JSON.parse(x).nb_membre;


                    //---
                    var node = {
                        "_id": local_id,
                        "id": localid,
                        "label": local_code,
                        "code": local_code,
                        "description": local_description,
                        "email_jury": local_email_jury,
                        "chef_jury_id": local_chef_jury_id,
                        "chef_jury_nom_prenom": local_chef_jury_nom_prenom,
                        "nb_membre": local_nb_membre,
                    };
                    new_data2.push(node);
                });

                //---
                var node = {
                    "_id": "",
                    "_id": "",
                    "id": "",
                    "label": "",
                    "code": "",
                    "description": "",
                    "email_jury": "",
                    "chef_jury_id": "",
                    "chef_jury_nom_prenom": "",
                    "nb_membre": "",

                };
                new_data2.push(node);

                if (new_data2.length > 0)
                    setNew_Getall_Partner_Jury_result(new_data2);

            }
            else {
                setGetall_Partner_Jury_With_Filter_api("false");
                setGetall_Partner_Jury_With_Filter_message(res.data.message);
            }

        }).catch((error) => {
            console.warn('Not good man :( Getall_Partner_Jury_With_Filter = ', error);
            setGetall_Partner_Jury_With_Filter_api("false");
            //setmyApimyApiMessage("")
        })
    }


    const [p_detail_soutenance_sujet, setp_detail_soutenance_sujet] = React.useState("");
    const [p_detail_soutenance_observation, setp_detail_soutenance_observation] = React.useState("");
    const [p_detail_soutenance_note, setp_detail_soutenance_note] = React.useState("");

    const [soutenance_data_edit_mode, setsoutenance_data_edit_mode] = React.useState("0");
    const [soutenance_display, setsoutenance_display] = React.useState("");
    const [soutenance_data_changed, setsoutenance_data_changed] = React.useState("");


    // -- Gestion pièces jointes 

    const [Download_one_attached_document_api, setDownload_one_attached_document_api] = useState();
    const [Download_one_attached_document_result, setDownload_one_attached_document_result] = useState();
    const [Download_one_attached_document_message, setDownload_one_attached_document_message] = useState();
    const Download_one_attached_document = (event) => {
        const stored_cookie = getCookie('tokenmysypart');


        var nom_fiche_detaillee = "Fiche_Detaillee.pdf";
        var token = stored_cookie;
        var file_name = event.target.id;


        var url = process.env.REACT_APP_API_URL + "myclass/api/Get_Stored_Downloaded_File/" + token + "/" + file_name;
        setLoading(true);

        axios.get(url, { responseType: 'blob', },)
            .then((res) => {
                setLoading(false);
                fileDownload(res.data, nom_fiche_detaillee);
                setDownload_one_attached_document_api("true");
            }).catch((error) => {
                setLoading(false);
                console.error('Error:', error);
                setDownload_one_attached_document_api("false");

            });
    }


    const editorRef_competence = useRef(null);
    const [editorRef_competence_limite, seteditorRef_competence_limite] = useState(800);


    const [file_1_name, setfile_1_name] = useState();

    const [sessions_file_change_1_api, setsessions_file_change_1_api] = useState();
    const [sessions_file_change_1_result, setsessions_file_change_1_result] = useState();
    const [sessions_file_change_1_message, setsessions_file_change_1_message] = useState();
    const sessions_file_change_1 = event => {

        const fileUploaded = event.target.files[0];
        let file_size = event.target.files[0].size;
        let file_type = event.target.files[0].type;




        console.log("file_size =  ", file_size, " file_type = ", file_type);
        if (file_size > 10000000) {
            alert("Le fichier ne doit pas depasser un 1 Méga octets");
            //  console.log("Le fichier ne doit pas depasser un 1 Méga octets");
            return;
        }

        setfile_1_name(event.target.files[0]);
        const formData = new FormData();
        formData.append('File', fileUploaded);
        //formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
        const stored_cookie = getCookie('tokenmysypart');

        //formData.append("token", stored_cookie);
        //formData.append("class_internal_url", internal_url);
        //console.log("token = " + stored_cookie);

        return;

    };


    const [file_2_name, setfile_2_name] = useState();

    const [sessions_file_change_2_api, setsessions_file_change_2_api] = useState();
    const [sessions_file_change_2_result, setsessions_file_change_2_result] = useState();
    const [sessions_file_change_2_message, setsessions_file_change_2_message] = useState();
    const sessions_file_change_2 = event => {

        const fileUploaded = event.target.files[0];
        let file_size = event.target.files[0].size;
        let file_type = event.target.files[0].type;




        console.log("file_size =  ", file_size, " file_type = ", file_type);
        if (file_size > 10000000) {
            alert("Le fichier ne doit pas depasser un 1 Méga octets");
            console.log("Le fichier ne doit pas depasser un 1 Méga octets");
            return;
        }

        setfile_2_name(event.target.files[0]);
        const formData = new FormData();
        formData.append('File', fileUploaded);
        //formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
        const stored_cookie = getCookie('tokenmysypart');

        //formData.append("token", stored_cookie);
        //formData.append("class_internal_url", internal_url);
        //console.log("token = " + stored_cookie);

        return;

    };

    const [Record_All_PJ_api, setRecord_All_PJ_api] = useState();
    const [Record_All_PJ_result, setRecord_All_PJ_result] = useState();
    const [Record_All_PJ_message, setRecord_All_PJ_message] = useState();
    function Record_All_PJ() {

        if (!p_detail_one_file_to_download_type_name) {
            alert(" Vous devez donner un nom à la pièce jointe");
            return;
        }

        if (file_1_name && file_1_name.name) {

            const formData = new FormData();
            formData.append('File', file_1_name);
            //formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
            const stored_cookie = getCookie('tokenmysypart');

            formData.append("token", stored_cookie);
            formData.append("file_business_object", p_detail_one_file_to_download_type_name);
            formData.append("file_name", file_1_name.name);
            formData.append("status", "0");
            formData.append("object_owner_collection", "groupe_inscription");
            formData.append("object_owner_id", selected_id);
            formData.append("type_document", "");

            //formData.append("class_internal_url", internal_url);
            //console.log("token = " + stored_cookie);


            fetch(
                process.env.REACT_APP_API_URL + "myclass/api/Store_User_Downloaded_File/",
                {
                    method: 'POST',
                    body: formData,
                }
            )
                .then((response) => response.json())
                .then((result) => {

                    //console.log(" ## result['status'] = ", result['status'])
                    if (String(result['status']) === String("true")) {
                        //console.log('Success:', result['message']);
                        setRecord_All_PJ_result(result['message']);
                        setRecord_All_PJ_api("true");

                        Get_List_Of_All_PJ(props.client_id);
                        setfile_1_name();
                        setp_detail_one_file_to_download_type_name();
                        //GetCurrentClass_trainingsession();
                        alert(" La pièce jointe " + file_1_name.name + " a été bien enregistrée")

                    }
                    else {
                        setRecord_All_PJ_message(result['message']);
                        setRecord_All_PJ_api("false");
                    }

                })
                .catch((error) => {
                    console.error(' Record_All_PJ Error:', error);
                    setRecord_All_PJ_api("false");
                });

        }



    }


    const [Delete_one_attached_document_api, setDelete_one_attached_document_api] = useState();
    const [Delete_one_attached_document_result, setDelete_one_attached_document_result] = useState();
    const [Delete_one_attached_document_message, setDelete_one_attached_document_message] = useState();
    const Delete_one_attached_document = (event) => {
        const stored_cookie = getCookie('tokenmysypart');

        var formData = new FormData();
        var nom_fiche_detaillee = "Fiche_Detaillee.pdf";
        var file_name = event.target.id;


        formData.append("token", stored_cookie);
        formData.append("file_name", file_name);

        var url = process.env.REACT_APP_API_URL + "myclass/api/Delete_Stored_Downloaded_File/";


        fetch(
            process.env.REACT_APP_API_URL + "myclass/api/Delete_Stored_Downloaded_File/",
            {
                method: 'POST',
                body: formData,
            }
        )
            .then((response) => response.json())
            .then((result) => {

                //console.log(" ## result['status'] = ", result['status'])
                if (String(result['status']) === String("true")) {
                    //console.log('Success:', result['message']);
                    setDelete_one_attached_document_result(result['message']);
                    setDelete_one_attached_document_api("true");
                    Get_List_Of_All_PJ(props.client_id);
                    alert(result['message'])

                }
                else {
                    setDelete_one_attached_document_message(result['message']);
                    setDelete_one_attached_document_api("false");
                }

            })
            .catch((error) => {
                console.error(' Record_All_PJ Error:', error);
                setDelete_one_attached_document_api("false");
                alert(" Impossible de supprimer le document")

            });


    }

    const [Get_List_Of_All_PJ_api, setGet_List_Of_All_PJ_api] = useState();
    const [Get_List_Of_All_PJ_result, setGet_List_Of_All_PJ_result] = useState();
    const [Get_List_Of_All_PJ_message, setGet_List_Of_All_PJ_message] = useState();
    function Get_List_Of_All_PJ(local_employee_id) {

        const formData = new FormData();

        //formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
        const stored_cookie = getCookie('tokenmysypart');

        formData.append("token", stored_cookie);
        formData.append("object_owner_collection", "groupe_inscription");
        formData.append("object_owner_id", selected_id);


        //formData.append("class_internal_url", internal_url);
        //console.log("token = " + stored_cookie);


        fetch(
            process.env.REACT_APP_API_URL + "myclass/api/Get_List_object_owner_collection_Stored_Files/",
            {
                method: 'POST',
                body: formData,
            }
        )
            .then((response) => response.json())
            .then((result) => {

                //console.log(" ## result['status'] = ", result['status'])
                if (String(result['status']) === String("true")) {
                    //console.log('Message :', result['message']);
                    setGet_List_Of_All_PJ_result(result['message']);
                    setGet_List_Of_All_PJ_api("true");

                }
                else {
                    setGet_List_Of_All_PJ_message(result['message']);
                    setGet_List_Of_All_PJ_api("false");
                }

            })
            .catch((error) => {
                console.error(' Get_List_Of_All_PJ Error:', error);
                setGet_List_Of_All_PJ_api("false");
            });

    }



    function Delete_file_1_name() {
        setfile_1_name();
    }

    function Delete_file_2_name() {
        setfile_2_name();
    }

    const [p_detail_one_file_to_download_type_name, setp_detail_one_file_to_download_type_name] = useState();

    // -- end gestion pièces jointes


    const [actionmass_jury_membre_val, setactionmass_jury_membre_val] = useState("");
    const [Dialog_Jury_Membre_message, setDialog_Jury_Membre_message] = React.useState(false);
    const [Dialog_Jury_Membre_open, setDialog_Jury_Membre_open] = React.useState(false);


    const Dialog_Jury_Membre_handleClose = () => {
        //alert(" Utiliser le bouton 'fermer' ");
        //setOpen(false);
    };

    const Dialog_Jury_Membre_handleClose_buton = () => {

        setDialog_Jury_Membre_open(false);
        settab_selected_users([]);
        setp_detail_member_role("");


    };

    const fixedVal = [];
    const [tab_selected_users, settab_selected_users] = useState([...fixedVal]);

    const fixedVal_apprenant = [];
    const [tab_selected_apprenant, settab_selected_apprenant] = useState([...fixedVal_apprenant]);


    const [Delete_List_Membre_From_Jury_api, setDelete_List_Membre_From_Jury_api] = useState();
    const [Delete_List_Membre_From_Jury_message, setDelete_List_Membre_From_Jury_message] = useState();
    const [Delete_List_Membre_From_Jury_result, setDelete_List_Membre_From_Jury_result] = useState();
    function Delete_List_Membre_From_Jury(local_tab_ids) {


        var form = new FormData();

        const stored_cookie = getCookie('tokenmysypart');
        form.append("token", stored_cookie);
        form.append("jury_id", selected_id);
        form.append("tab_ids", local_tab_ids);


        var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_Jury_Membre/";
        setLoading(true);

        axios.post(myurl, form).then(res => {
            //console.log(" In Delete_List_Membre_From_Jury  res.data.status = " + res.data.status);
            //console.log(" In Delete_List_Membre_From_Jury  res.data.message r_class = " + res.data.message);

            setLoading(false);

            if (String(res.data.status) === String("true")) {
                setDelete_List_Membre_From_Jury_api("true");
                setDelete_List_Membre_From_Jury_result(res.data.message);

                var line = New_Getall_Partner_Jury_result[gridline_id];
                Get_Given_Jury_Data(line._id);

                setdisplay_alert_mysy("1");
                setalert_message(res.data.message);
                setalert_type("success");
                submenu_membres()
            }
            else {
                setDelete_List_Membre_From_Jury_api("false");
                setDelete_List_Membre_From_Jury_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('Delete_List_Membre_From_Jury : Not good man :( mysearchtext = ' + error);
            setDelete_List_Membre_From_Jury_api("false");
            alert(" Impossible de supprimer les membres");
        })
    }

    const [p_detail_event_id, setp_detail_event_id] = useState();
    const [p_detail_title, setp_detail_title] = useState();
    const [p_detail_start, setp_detail_start] = useState();
    const [p_detail_end, setp_detail_end] = useState();
    const [p_detail_comment, setp_detail_comment] = useState();
    const [p_detail_sequence_session_id, setp_detail_sequence_session_id] = useState("");

    const [p_detail_justified, setp_detail_justified] = useState(false);
    const [p_detail_event_type, setp_detail_event_type] = useState();

    // Ici il s'agit de liée la Soutenance a une session de formation 
    // En gros, le sens de lecture est : Le jury XXXX a une Soutenance le jj/mm/aaaa hhhh pour la session de formation 
    const [p_detail_linked_collection, setp_detail_linked_collection] = useState("");
    const [p_detail_linked_collection_recid, setp_detail_linked_collection_recid] = useState("");

    const [seance_linked_class_id, setseance_linked_class_id] = useState("");


    function add_one_seance_jury() {

        setp_detail_title("Nouvelle")
        setp_detail_start(new Date())
        setp_detail_end(new Date())
        setp_detail_comment("");
        setp_detail_sequence_session_id("");
        setp_detail_event_id("");

        setp_detail_linked_collection("");
        setp_detail_linked_collection_recid("");

        var current_date_add_1h = new Date();
        current_date_add_1h.setHours(current_date_add_1h.getHours() + 1);

        setStartDate(new Date());
        setendDate(current_date_add_1h);
        setDialog_1_open(true);
    }

    const [startDate, setStartDate] = useState(new Date());
    const [endDate, setendDate] = useState(new Date());
    const handleSelect = (info) => {

        if (String(props.write_access) !== "1") {
            // Pas d'acces en ecriture.

            return;
        }

        setp_detail_title("Nouvelle")
        setp_detail_start(info.start)
        setp_detail_end(info.end)
        setp_detail_comment("");
        setp_detail_sequence_session_id("");
        setp_detail_event_id("");

        setp_detail_linked_collection("");
        setp_detail_linked_collection_recid("");

        setStartDate(info.start);
        setendDate(info.end);
        setDialog_1_open(true);
    };


    const handleSelect_V2 = (info) => {



        GetListeInscrit();
        setGet_Jury_List_Apprenant_Seance_insc_result([]);
        setselected_agenda_id("");
        settab_selected_apprenant([]);

        var current_date_add_1h = new Date();
        current_date_add_1h.setHours(current_date_add_1h.getHours() + 1);

        setStartDate(info.start);
        setendDate(info.end);

        setDialog_Jury_Apprenant_open(true);
    };



    const renderEventContent = (eventInfo) => {
        //console.log(eventInfo);
        return (
            <>
                <b>{eventInfo.timeText}</b><br />
                <i>{eventInfo.event.title}</i>
            </>
        )
    };

    const handleEventClick = (arg) => {

        setp_detail_title(arg.event.title)
        setp_detail_start(arg.event.start)
        setp_detail_end(arg.event.end)
        setp_detail_event_id(arg.event.id);

        if (arg.event.extendedProps.comment) {
            setp_detail_comment(arg.event.extendedProps.comment);
        }
        else
            setp_detail_comment("");



        if (arg.event.extendedProps.linked_collection) {
            setp_detail_linked_collection(arg.event.extendedProps.linked_collection);
        }
        else
            setp_detail_linked_collection("");

        if (arg.event.extendedProps.linked_collection_recid) {
            setp_detail_linked_collection_recid(arg.event.extendedProps.linked_collection_recid);
        }
        else
            setp_detail_linked_collection_recid("");




        if (arg.event.extendedProps.sequence_session_id) {
            setp_detail_sequence_session_id(arg.event.extendedProps.sequence_session_id);
        }
        else
            setp_detail_sequence_session_id("");


        if (arg.event.extendedProps.justified) {
            if (String(arg.event.extendedProps.justified) === "true")
                setp_detail_justified(true);
            else
                setp_detail_justified(false);
        }
        else
            setp_detail_justified(false);



        if (arg.event.extendedProps.type) {
            setp_detail_event_type(arg.event.extendedProps.type);
        }
        else
            setp_detail_event_type("");

        setStartDate(arg.event.start);
        setendDate(arg.event.end);
        setDialog_1_open(true);
    }

    const [Dialog_1_message, setDialog_1_message] = React.useState(false);
    const [Dialog_1_open, setDialog_1_open] = React.useState(false);
    const [Partner_Debut_Journee, setPartner_Debut_Journee] = useState("7:00");
    const [Partner_Fin_Journee, setPartner_Fin_Journee] = useState("20:00");
    const [mysy_events, setmysy_events] = useState();



    const [Get_List_Agenda_Events_For_Given_User_api, setGet_List_Agenda_Events_For_Given_User_api] = useState();
    const [Get_List_Agenda_Events_For_Given_User_message, setGet_List_Agenda_Events_For_Given_User_message] = useState();
    const [Get_List_Agenda_Events_For_Given_User_result, setGet_List_Agenda_Events_For_Given_User_result] = useState([]);
    function Get_List_Agenda_Events_For_Given_User(local_selected_id) {


        var form = new FormData();
        const stored_cookie = getCookie('tokenmysypart');

        form.append("token", stored_cookie);
        form.append("jury_id", local_selected_id);


        var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Jury_Soutenenace/";

        setLoading(true);

        axios.post(myurl, form).then(res => {
            //  console.log(" In Get_List_Agenda_Events_For_Given_User  res.data.status = " + res.data.status);
            //  console.log(" In Get_List_Agenda_Events_For_Given_User  res.data.message r_class = " + res.data.message);
            setLoading(false);
            if (String(res.data.status) === String("true")) {
                setGet_List_Agenda_Events_For_Given_User_api("true");
                setGet_List_Agenda_Events_For_Given_User_result(res.data.message);

                var tab_event = []
                var filtre2 = res.data.message.map(obj => {

                    var local_val = {};

                    var local_comment = "";
                    if (JSON.parse(obj).comment) {
                        local_comment = String(JSON.parse(obj).comment);
                    }



                    //console.log( " ### obj = ", obj)

                    local_val = {
                        'title': String(JSON.parse(obj).soutenance_agenda_event_title),
                        'start': String(JSON.parse(obj).soutenance_agenda_event_start),
                        'end': String(JSON.parse(obj).soutenance_agenda_event_end),
                        'id': String(JSON.parse(obj).soutenance_agenda_id),
                        '_id': String(JSON.parse(obj).soutenance_agenda_id),
                        'jury_soutenance_id': String(JSON.parse(obj)._id),
                        'jury_session_id': String(JSON.parse(obj).session_id),
                        'convocation_apprenant_send': String(JSON.parse(obj).convocation_apprenant_send),
                        'convocation_apprenant_date_sending': String(JSON.parse(obj).convocation_apprenant_date_sending).substring(0, 10),

                    }

                    tab_event.push(local_val);



                });

                //   console.log('### tab_event = ', tab_event)
                setmysy_events(tab_event);

            }
            else if (String(res.data.status) === String("Err_Connexion")) {
                alert('Erreur: ' + res.data.message);
                history.push("/Connexion");
            }
            else {
                setGet_List_Agenda_Events_For_Given_User_api("false");
                setGet_List_Agenda_Events_For_Given_User_message(res.data.message);
            }

        }).catch((error) => {
            setLoading(false);
            console.warn('Not good man :( Get_List_Agenda_Events_For_Given_User = ', error);
            setGet_List_Agenda_Events_For_Given_User_api("false");
            //setmyApimyApiMessage("")
        })
    }

    const New_Option_Type_Event = [
        { "id": "0", "label": "Jury", "value": "jury" },
    ]


    const New_Option_Type_Selection = [
        { "id": "0", "label": "Individuel", "value": "individuel" },
        { "id": "1", "label": "Groupe TD", "value": "grp_td" },
        { "id": "2", "label": "Groupe TP", "value": "grp_tp" },
    ]

    const New_Option_Cible_Jury = [
        { "id": "soutenance", "label": "Jury Soutenance", "value": "soutenance" },
        { "id": "examen", "label": "Jury Examen", "value": "examen" },
        { "id": "", "label": "", "value": "" },
    ]

    function Close_Dialog_Detail_Event_open() {
        setDialog_1_open(false);
    }
    const [Update_One_Agenda_Event_api, setUpdate_One_Agenda_Event_api] = useState();
    const [Update_One_Agenda_Event_message, setUpdate_One_Agenda_Event_message] = useState();
    const [Update_One_Agenda_Event_result, setUpdate_One_Agenda_Event_result] = useState();
    const Update_One_Agenda_Event = event => {



        if (moment(endDate) <= moment(startDate)) {
            //  alert(" Les dates de début et de fin sont incohérentes");
            setdisplay_alert_mysy("1");
            setalert_message("Les dates de début et de fin sont incohérentes");
            setalert_type("error");
            return;
        }
        var new_title = p_detail_title;
        var new_start_date = moment(startDate).format();
        var new_end_date = moment(endDate).format();
        var event_id = p_detail_event_id

        //console.log(" ### new event = ", new_title, " -- ", new_start_date, " --- ", new_end_date, " : setp_detail_event_id = ", p_detail_event_id);


        var form = new FormData();
        //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");


        const stored_cookie = getCookie('tokenmysypart');
        form.append("token", stored_cookie);
        form.append("_id", p_detail_event_id);
        form.append("related_collection", "jury");

        form.append("event_title", new_title);
        form.append("event_start", new_start_date);
        form.append("event_end", new_end_date);
        form.append("related_collection_recid", selected_id);
        form.append("comment", p_detail_comment);

        form.append("event_type", p_detail_event_type);
        form.append("justified", p_detail_justified);

        form.append("linked_collection", "session_formation");
        form.append("linked_collection_recid", selected_session_id);

        form.append("ue_id", jury_seance_ue_id);

        // console.log(" form == ", form);

        var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_Agenda_Event/";

        setLoading(true);
        axios.post(myurl, form).then(res => {
            //console.log(" In Update_One_Agenda_Event  res.data.status = " + res.data.status);
            //console.log(" In Update_One_Agenda_Event  res.data.message r_class = " + res.data.message);

            setLoading(false);
            if (String(res.data.status) === String("true")) {
                setUpdate_One_Agenda_Event_api("true");
                setUpdate_One_Agenda_Event_result(res.data.message);

                setp_detail_event_id();
                setp_detail_title();
                setp_detail_start();
                setp_detail_end();
                setp_detail_comment();
                setp_detail_sequence_session_id("");
                setp_detail_justified(false);
                setp_detail_event_type();

                setp_detail_linked_collection("");
                setp_detail_linked_collection_recid("");

                Get_List_Agenda_Events_For_Given_User(selected_id);

                // alert(res.data.message)
                setdisplay_alert_mysy("1");
                setalert_message(res.data.message);
                setalert_type("success");
                Close_Dialog_Detail_Event_open();

            }
            else {
                setUpdate_One_Agenda_Event_api("false");
                setUpdate_One_Agenda_Event_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('UpdateStagiaireData : Not good man :( Update_One_Agenda_Event = ' + error);
            setUpdate_One_Agenda_Event_api("false");
            setdisplay_alert_mysy("1");
            setalert_message(" Impossible de mettre à jour l'événement ");
            setalert_type("error");


        })
    }


    const [Delete_One_Agenda_Event_api, setDelete_One_Agenda_Event_api] = useState();
    const [Delete_One_Agenda_Event_message, setDelete_One_Agenda_Event_message] = useState();
    const [Delete_One_Agenda_Event_result, setDelete_One_Agenda_Event_result] = useState();
    function Delete_One_Agenda_Event() {


        var event_id = p_detail_event_id

        var form = new FormData();
        //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");


        const stored_cookie = getCookie('tokenmysypart');
        form.append("token", stored_cookie);
        form.append("_id", p_detail_event_id);


        var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_Agenda_Event/";

        setLoading(true);

        axios.post(myurl, form).then(res => {
            //console.log(" In Delete_One_Agenda_Event  res.data.status = " + res.data.status);
            //console.log(" In Delete_One_Agenda_Event  res.data.message r_class = " + res.data.message);


            setLoading(false);
            if (String(res.data.status) === String("true")) {
                setDelete_One_Agenda_Event_api("true");
                setDelete_One_Agenda_Event_result(res.data.message);

                Get_List_Agenda_Events_For_Given_User(selected_id);

                setp_detail_event_id();
                setp_detail_title();
                setp_detail_start();
                setp_detail_end();
                setp_detail_comment();
                setp_detail_sequence_session_id("");

                setp_detail_linked_collection("");
                setp_detail_linked_collection_recid("");

                setp_detail_justified(false);
                setp_detail_event_type();

                // alert(res.data.message)
                setdisplay_alert_mysy("1");
                setalert_message(res.data.message);
                setalert_type("success");
                Close_Dialog_Detail_Event_open();

            }
            else {
                setDelete_One_Agenda_Event_api("false");
                setDelete_One_Agenda_Event_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('UpdateStagiaireData : Not good man :( Delete_One_Agenda_Event = ' + error);
            setDelete_One_Agenda_Event_api("false");
            setdisplay_alert_mysy("1");
            setalert_message(" Impossible de supprimer l'événement ");
            setalert_type("error");
            // alert(" Impossible de supprimer l'événement ");

        })
    }

    const [display_view, setdisplay_view] = useState("list");
    function func_display_planning_view() {
        setdisplay_view("planning");
    }

    function func_display_list_view() {
        setdisplay_view("list");
    }

    const [mysy_list_event_for_map, setmysy_list_event_for_map] = useState();


    const [New_Getall_TrainingSession_result, setNew_Getall_TrainingSession_result] = useState();

    const [Getall_TrainingSession_api, setGetall_TrainingSession_api] = useState();
    const [Getall_TrainingSession_message, setGetall_TrainingSession_message] = useState();
    const [Getall_TrainingSession_result, setGetall_TrainingSession_result] = useState();
    function Getall_TrainingSession(event) {
        var form = new FormData();

        const stored_cookie = getCookie('tokenmysypart');
        form.append("token", stored_cookie);
 form.append("archive", "0");
        var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetAllValideSessionPartner_List/";


        axios.post(myurl, form).then(res => {

            if (String(res.data.status) === String("true")) {
                //console.log(" In Getall_TrainingSession  res.data.status = " + res.data.status);
                //console.log(" In Getall_TrainingSession  res.data.message r_class = " + res.data.message);
                setGetall_TrainingSession_api("true");
                setGetall_TrainingSession_result(res.data.message);

                var new_data2 = [];
                const new_data = res.data.message.map((x) => {

                    //---
                    var localid = JSON.parse(x).id;
                    var local_id = JSON.parse(x)._id;
                    var local_internal_url = JSON.parse(x).class_internal_url;
                    var local_title_session = JSON.parse(x).titre;
                    var local_code_session = JSON.parse(x).code_session;
                    var local_invoiced_statut = JSON.parse(x).invoiced_statut;

                    var local_class_id = ""
                    if (JSON.parse(x).class_id)
                        local_class_id = JSON.parse(x).class_id;



                    //---
                    var node = {
                        "_id": local_id,
                        "id": localid,
                        "label": local_code_session,
                        "class_internal_url": local_internal_url,
                        "titre": local_title_session,
                        "code_session": local_code_session,
                        "invoiced_statut": local_invoiced_statut,
                        "class_id": local_class_id,
                    };
                    new_data2.push(node);

                    // return {"_id": " + str(local_id) + ", "label": " + local_courrier_template_ref_interne + '" , "courrier_template_ref_interne": "' + local_courrier_template_ref_interne + '", "nom_champ_technique": "' + local_nom_champ_technique + '",  "nom_champ_fonctionel": "' + local_nom_champ_fonctionel + '","valide": "1" };

                });

                var node = {
                    "_id": "",
                    "id": "",
                    "label": "",
                    "class_internal_url": "",
                    "titre": "",
                    "code_session": "",
                    "invoiced_statut": "",
                    "class_id": "",
                };
                new_data2.push(node);

                if (new_data2.length > 0)
                    setNew_Getall_TrainingSession_result(new_data2);

                //console.log(" ### new_data2 = ", new_data2)


            }
            else {
                setGetall_TrainingSession_api("false");
                setGetall_TrainingSession_message(res.data.message);
            }

        }).catch((error) => {
            console.warn('Not good man :( Getall_TrainingSession = ', error);
            setGetall_TrainingSession_api("false");
            //setmyApimyApiMessage("")
        })
    }

    const [type_selection, settype_selection] = useState("promo");
    const [Dialog_Jury_Apprenant_message, setDialog_Jury_Apprenant_message] = React.useState(false);
    const [Dialog_Jury_Apprenant_open, setDialog_Jury_Apprenant_open] = React.useState(false);


    const Dialog_Jury_Apprenant_handleClose = () => {
        //alert(" Utiliser le bouton 'fermer' ");
        //setOpen(false);
    };

    const Dialog_Jury_Apprenant_handleClose_buton = () => {

        setDialog_Jury_Apprenant_open(false);
        settab_selected_users([]);
        setp_detail_member_role("");
    };



    const [New_Session_Inscrit, setNew_Session_Inscrit] = useState([]);

    const [GetListePreinscrit_insc_api, setGetListePreinscrit_insc_api] = useState();
    const [GetListePreinscrit_insc_meassage, setGetListePreinscrit_insc_meassage] = useState();
    const [GetListePreinscrit_insc_result, setGetListePreinscrit_insc_result] = useState([])
    function GetListeInscrit() {

        var form = new FormData();
        //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
        const stored_cookie = getCookie('tokenmysypart');
        form.append("token", stored_cookie);
        form.append("session_id", selected_session_id);

        // 0,1,2 ==> Les inscription validé ou les preinscriptions
        form.append("tab_statut_ids", "0,1,2");


        setLoading(true);
        var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Insription_From_Session_id_Reduice_Fields_With_Filter/";

        fetch(myurl,
            {
                method: 'POST',
                body: form,
            })
            .then((data) => data.json())
            .then((data) => {
                setLoading(false);
                // console.log(' GetListeInscrit :  Success:', data['message'], "data['status'] = ", data['status']);
                setGetListePreinscrit_insc_result(data['message']);

                if (String(data['status']) === String("true")) {

                    setGetListePreinscrit_insc_api("true");

                    var new_data2 = [];
                    const new_data = data['message'].map((x) => {

                        //---
                        var localid = JSON.parse(x).id;
                        var local_id = JSON.parse(x)._id;
                        var apprenant_nom = JSON.parse(x).apprenant_nom;
                        var apprenant_prenom = JSON.parse(x).apprenant_prenom;
                        var apprenant_email = JSON.parse(x).apprenant_email;

                        //---
                        var node = {
                            "_id": local_id,
                            "id": localid,
                            "label": apprenant_nom + " " + apprenant_prenom,
                            "apprenant_nom": apprenant_nom,
                            "apprenant_prenom": apprenant_prenom,
                            "apprenant_email": apprenant_email,

                        };
                        new_data2.push(node);
                    });

                    //---
                    var node = {
                        "_id": "",
                        "id": "",
                        "label": "",
                        "apprenant_nom": "",
                        "apprenant_prenom": "",
                        "apprenant_email": "",

                    };
                    new_data2.push(node);

                    if (new_data2.length > 0)
                        setNew_Session_Inscrit(new_data2);

                    //console.log(" ### new_data2 =", new_data2)


                } else if (String(data['status']) === String("Err_Connexion")) {
                    alert('Erreur: ' + data['message']);
                    history.push("/Connexion");
                }
                else {
                    setGetListePreinscrit_insc_api("false");

                }

            }).catch((error) => {
                setLoading(false);
                console.error('Error:', error);
                setGetListePreinscrit_insc_api("false");
            });

    }

    const [Get_Jury_List_Apprenant_Seance_insc_api, setGet_Jury_List_Apprenant_Seance_insc_api] = useState();
    const [Get_Jury_List_Apprenant_Seance_insc_meassage, setGet_Jury_List_Apprenant_Seance_insc_meassage] = useState();
    const [Get_Jury_List_Apprenant_Seance_insc_result, setGet_Jury_List_Apprenant_Seance_insc_result] = useState([])
    function Get_Jury_List_Apprenant_Seance(local_agenda_id, local_soutenance_id) {

        var form = new FormData();
        //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
        const stored_cookie = getCookie('tokenmysypart');
        form.append("token", stored_cookie);
        form.append("_id", selected_id);
        form.append("agenda_id", local_agenda_id);
        form.append("jury_soutenance_id", local_soutenance_id);


        // console.log(" #### OKKKK ")
        setLoading(true);
        var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Given_Jury_Apprenant_With_Filter/";

        fetch(myurl,
            {
                method: 'POST',
                body: form,
            })
            .then((data) => data.json())
            .then((data) => {
                setLoading(false);
                //console.log(' Get_Jury_List_Apprenant_Seance :  Success:', data['message'], "data['status'] = ", data['status']);


                if (String(data['status']) === String("true")) {
                    setGet_Jury_List_Apprenant_Seance_insc_result(data['message']);
                    //console.log("erreur rrrr:" + data['status'])
                    setGet_Jury_List_Apprenant_Seance_insc_api("true");
                    // setnb_stagiaire_Inscrit(data['message'].length);
                    //console.log(" ### setnb_stagiaire_Inscrit = ", data['message'].length);

                } else if (String(data['status']) === String("Err_Connexion")) {
                    alert('Erreur: ' + data['message']);
                    history.push("/Connexion");
                }
                else {
                    setGet_Jury_List_Apprenant_Seance_insc_api("false");

                }

            }).catch((error) => {
                setLoading(false);
                console.error('Error:', error);
                setGet_Jury_List_Apprenant_Seance_insc_api("false");
            });

    }



    const [Get_Jury_List_Apprenant_Soutenance_insc_api, setGet_Jury_List_Apprenant_Soutenance_insc_api] = useState();
    const [Get_Jury_List_Apprenant_Soutenance_insc_meassage, setGet_Jury_List_Apprenant_Soutenance_insc_meassage] = useState();
    const [Get_Jury_List_Apprenant_Soutenance_insc_result, setGet_Jury_List_Apprenant_Soutenance_insc_result] = useState([])
    function Get_Jury_List_Apprenant_Soutenance(local_agenda_id, local_jury_soutenance_id) {

        var form = new FormData();
        //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
        const stored_cookie = getCookie('tokenmysypart');
        form.append("token", stored_cookie);
        form.append("jury_id", selected_id);
        form.append("agenda_id", local_agenda_id);
        form.append("jury_soutenance_id", local_jury_soutenance_id);


        // console.log(" #### OKKKK ")
        setLoading(true);
        var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Given_Jury_Soutenenace/";

        fetch(myurl,
            {
                method: 'POST',
                body: form,
            })
            .then((data) => data.json())
            .then((data) => {
                setLoading(false);
                //   console.log(' Get_Jury_List_Apprenant_Soutenance :  Success:', data['message'], "data['status'] = ", data['status']);

                if (String(data['status']) === String("true")) {

                    setGet_Jury_List_Apprenant_Soutenance_insc_result(data['message']);
                    setGet_Jury_List_Apprenant_Soutenance_insc_api("true");

                    if (data['message'].length > 0 && JSON.parse(data['message'])) {
                        var soutenance_JSON = JSON.parse(data['message']);
                        if (soutenance_JSON.sujet) {
                            setp_detail_soutenance_sujet(soutenance_JSON.sujet);
                        } else {
                            setp_detail_soutenance_sujet("");
                        }

                        if (soutenance_JSON.observation) {
                            setp_detail_soutenance_observation(soutenance_JSON.observation);
                        } else {
                            setp_detail_soutenance_observation("");
                        }

                        if (soutenance_JSON.note) {
                            setp_detail_soutenance_note(soutenance_JSON.note);
                        } else {
                            setp_detail_soutenance_note("");
                        }


                        if (soutenance_JSON.jury_soutenance_salle) {
                            setp_detail_soutenance_salle(soutenance_JSON.jury_soutenance_salle);
                        } else {
                            setp_detail_soutenance_salle("");
                        }


                        if (soutenance_JSON.jury_soutenance_adresse) {
                            setp_detail_soutenance_adresse(soutenance_JSON.jury_soutenance_adresse);
                        } else {
                            setp_detail_soutenance_adresse("");
                        }

                        if (soutenance_JSON.jury_soutenance_code_postal) {
                            setp_detail_soutenance_code_postal(soutenance_JSON.jury_soutenance_code_postal);
                        } else {
                            setp_detail_soutenance_code_postal("");
                        }

                        if (soutenance_JSON.jury_soutenance_ville) {
                            setp_detail_soutenance_ville(soutenance_JSON.jury_soutenance_ville);
                        } else {
                            setp_detail_soutenance_ville("");
                        }

                        if (soutenance_JSON.jury_soutenance_pays) {
                            setp_detail_soutenance_pays(soutenance_JSON.jury_soutenance_pays);
                        } else {
                            setp_detail_soutenance_pays("");
                        }

                        //console.log(" ### soutenance_JSON.jury_soutenance_salle = ", soutenance_JSON.jury_soutenance_salle);

                    } else {
                        setp_detail_soutenance_sujet("");
                        setp_detail_soutenance_observation("");
                        setp_detail_soutenance_note("");
                    }

                    setsoutenance_data_edit_mode("0");
                    Disable_Jury_Soutenance_DetailFields();

                } else if (String(data['status']) === String("Err_Connexion")) {
                    alert('Erreur: ' + data['message']);
                    history.push("/Connexion");
                }
                else {
                    setGet_Jury_List_Apprenant_Soutenance_insc_api("false");

                }

            }).catch((error) => {
                setLoading(false);
                console.error('Error:', error);
                setGet_Jury_List_Apprenant_Soutenance_insc_api("false");
            });

    }


    const [jury_seance_ue_id, setjury_seance_ue_id] = useState("");


    function Get_List_Selected_Jury_Id() {

        var tab_tmp = []

        for (var i = 0; i < selectionModel_columns_jury.length; i++) {
            var myid = parseInt(String(selectionModel_columns_jury[i]));
            var line = JSON.parse(Getall_Partner_Jury_result[myid]);
            tab_tmp.push(line._id);
        }

        return tab_tmp;

    }


    function actionmass_ftion_Traitemet() {

        var liste_jury = Get_List_Selected_Jury_Id();

        console.log(" Get_List_Selected_Jury_Id = ", liste_jury);


        if (String(actionmass_ftion_val) === String("supprimer")) {

            //console.log(" ### liste session : ", liste_session)
            //  Delete_LIST_Apprenant(liste_apprenant);

        }

        else if (String(actionmass_ftion_val) === String("convocation_apprenant")) {
            //  setDialog_add_inscription_open(true);
        }

        else if (String(actionmass_ftion_val) === String("convocation_jury")) {
            //  Export_apprenant(liste_apprenant);
        }

    }


    const [selected_jury_convocation_apprenant_id, setselected_jury_convocation_apprenant_id] = useState("");
    const [selected_jury_convocation_apprenant_type, setselected_jury_convocation_apprenant_type] = useState("");
    const [selected_jury_convocation_apprenant_email_destinataire_prod, setselected_jury_convocation_apprenant_email_destinataire_prod] = useState("");
    const [selected_jury_convocation_apprenant_email_test, setselected_jury_convocation_apprenant_email_test] = useState("");

    const [tab_jury_convocation_apprenant_pieces_jointes_result, settab_jury_convocation_apprenant_pieces_jointes_result] = useState([]);


    const [Dialog_CONVOCATION_JURY_APPRENANT_open, setDialog_CONVOCATION_JURY_APPRENANT_open] = React.useState(false);
    const Dialog_CONVOCATION_JURY_APPRENANT_handleClose = () => {
        //alert(" Utiliser le bouton 'fermer' ");
        //setOpen(false);
    };

    const Dialog_CONVOCATION_JURY_APPRENANT_handleClose_buton = () => {
        setDialog_CONVOCATION_JURY_APPRENANT_open(false);
        setselected_jury_convocation_apprenant_id();
        setselected_jury_convocation_apprenant_type("");
        setselected_jury_convocation_apprenant_email_destinataire_prod();
        setselected_jury_convocation_apprenant_email_test();

        setactionmass_ftion_val();

        settab_jury_convocation_apprenant_pieces_jointes_result([])
    };

    const [sessions_file_change_1_convention_api, setsessions_file_change_1_convention_api] = useState();
    const [sessions_file_change_1_convention_result, setsessions_file_change_1_convention_result] = useState();
    const [sessions_file_change_1_convention_message, setsessions_file_change_1_convention_message] = useState();
    const sessions_file_change_1_convention = event => {


        const fileUploaded = event.target.files[0];
        let file_size = event.target.files[0].size;
        let file_type = event.target.files[0].type;


        if (file_type !== "application/pdf") {
            alert("Le fichier n'est pas de type PDF");
            return;
        }



        if (file_size > 10000000) {
            alert("Le fichier ne doit pas depasser un 1 Méga octets");

            return;
        }

        //var new_node = {'name':event.target.files[0].name, 'type':event.target.files[0].type}


        var new_tmp = [];

        if (tab_jury_convocation_apprenant_pieces_jointes_result && tab_jury_convocation_apprenant_pieces_jointes_result.length > 0) {

            tab_jury_convocation_apprenant_pieces_jointes_result.map((x) => {
                new_tmp.push(x);

            });

        }

        new_tmp.push(event.target.files[0])

        settab_jury_convocation_apprenant_pieces_jointes_result(new_tmp);

        //console.log(" tab_jury_convocation_apprenant_pieces_jointes_result = ", tab_jury_convocation_apprenant_pieces_jointes_result)
        return;
    };

    function Delete_Convention_Attached_Doc(event) {

        var doc_to_del_name = event.target.id;
        const myArray = tab_jury_convocation_apprenant_pieces_jointes_result;

        let new_myArray = myArray.filter(file => file.name !== String(doc_to_del_name));

        //console.log(" new_myArray = ", new_myArray);


        var new_tab = []
        for (let i = 0; i < new_myArray.length; i++) {
            new_tab.push(new_myArray[i]);
        }

        settab_jury_convocation_apprenant_pieces_jointes_result(new_tab);


    }
    const [New_Get_List_JURY_APPRENANT_Convocations_result, setNew_Get_List_JURY_APPRENANT_Convocations_result] = useState([]);

    const [Get_List_JURY_APPRENANT_Convocations_api, setGet_List_JURY_APPRENANT_Convocations_api] = useState();
    const [Get_List_JURY_APPRENANT_Convocations_message, setGet_List_JURY_APPRENANT_Convocations_message] = useState();
    const [Get_List_JURY_APPRENANT_Convocations_result, setGet_List_JURY_APPRENANT_Convocations_result] = useState();
    function Get_List_JURY_APPRENANT_Convocations(type_doc) {

        var form = new FormData();

        const stored_cookie = getCookie('tokenmysypart');
        form.append("token", stored_cookie);
        form.append("ref_interne", "JURY_CONVOCATION_APPRENANT");
        form.append("type_doc", type_doc);

        var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Partner_Document_with_filter_No_HTML_Fields/";
        setLoading(true);

        axios.post(myurl, form).then(res => {
            //  console.log(" In Get_List_JURY_APPRENANT_Convocations  res.data.status = " + res.data.status);
            // console.log(" In Get_List_JURY_APPRENANT_Convocations  res.data.message r_class = " + res.data.message);
            setLoading(false);
            if (String(res.data.status) === String("true")) {


                setGet_List_JURY_APPRENANT_Convocations_api("true");
                setGet_List_JURY_APPRENANT_Convocations_result(res.data.message);

                var new_data2 = [];

                const new_data = res.data.message.map((x) => {

                    //---
                    var localid = JSON.parse(x).id;
                    var local_id = JSON.parse(x)._id;
                    var local_ref_interne = JSON.parse(x).ref_interne;
                    var local_nom = JSON.parse(x).nom;
                    var local_sujet = JSON.parse(x).sujet;
                    var local_type_doc = JSON.parse(x).type_doc;
                    var local_cible = JSON.parse(x).cible;
                    var local_joint_pdf = JSON.parse(x).joint_pdf;



                    //---
                    var node = {
                        "_id": local_id,
                        "id": localid,
                        "label": local_nom,
                        "ref_interne": local_ref_interne,
                        "nom": local_nom,
                        "sujet": local_sujet,
                        "type_doc": local_type_doc,
                        "cible": local_cible,
                        "joint_pdf": local_joint_pdf,

                    };
                    new_data2.push(node);
                });

                if (new_data2.length > 0)
                    setNew_Get_List_JURY_APPRENANT_Convocations_result(new_data2);


            }
            else {
                setGet_List_JURY_APPRENANT_Convocations_api("false");
                setGet_List_JURY_APPRENANT_Convocations_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('Not good man :( Get_List_JURY_APPRENANT_Convocations = ', error);
            setGet_List_JURY_APPRENANT_Convocations_api("false");
            alert("Impossible de récupérer les modèles de convocations");
            //setmyApimyApiMessage("")
        })
    }


    const [New_Get_List_JURY_MEMBRE_Convocations_result, setNew_Get_List_JURY_MEMBRE_Convocations_result] = useState([]);

    const [Get_List_JURY_MEMBRE_Convocations_api, setGet_List_JURY_MEMBRE_Convocations_api] = useState();
    const [Get_List_JURY_MEMBRE_Convocations_message, setGet_List_JURY_MEMBRE_Convocations_message] = useState();
    const [Get_List_JURY_MEMBRE_Convocations_result, setGet_List_JURY_MEMBRE_Convocations_result] = useState();
    function Get_List_JURY_MEMBRE_Convocations(type_doc) {

        var form = new FormData();

        const stored_cookie = getCookie('tokenmysypart');
        form.append("token", stored_cookie);
        form.append("ref_interne", "JURY_CONVOCATION_MEMBRE");
        form.append("type_doc", type_doc);

        var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Partner_Document_with_filter_No_HTML_Fields/";
        setLoading(true);

        axios.post(myurl, form).then(res => {
            //  console.log(" In Get_List_JURY_MEMBRE_Convocations  res.data.status = " + res.data.status);
            // console.log(" In Get_List_JURY_MEMBRE_Convocations  res.data.message r_class = " + res.data.message);
            setLoading(false);
            if (String(res.data.status) === String("true")) {


                setGet_List_JURY_MEMBRE_Convocations_api("true");
                setGet_List_JURY_MEMBRE_Convocations_result(res.data.message);

                var new_data2 = [];

                const new_data = res.data.message.map((x) => {

                    //---
                    var localid = JSON.parse(x).id;
                    var local_id = JSON.parse(x)._id;
                    var local_ref_interne = JSON.parse(x).ref_interne;
                    var local_nom = JSON.parse(x).nom;
                    var local_sujet = JSON.parse(x).sujet;
                    var local_type_doc = JSON.parse(x).type_doc;
                    var local_cible = JSON.parse(x).cible;
                    var local_joint_pdf = JSON.parse(x).joint_pdf;


                    //---
                    var node = {
                        "_id": local_id,
                        "id": localid,
                        "label": local_nom,
                        "ref_interne": local_ref_interne,
                        "nom": local_nom,
                        "sujet": local_sujet,
                        "type_doc": local_type_doc,
                        "cible": local_cible,
                        "joint_pdf": local_joint_pdf,

                    };
                    new_data2.push(node);
                });

                if (new_data2.length > 0)
                    setNew_Get_List_JURY_MEMBRE_Convocations_result(new_data2);


            }
            else {
                setGet_List_JURY_MEMBRE_Convocations_api("false");
                setGet_List_JURY_MEMBRE_Convocations_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('Not good man :( Get_List_JURY_MEMBRE_Convocations = ', error);
            setGet_List_JURY_MEMBRE_Convocations_api("false");
            alert("Impossible de récupérer les modèles de convocations");
            //setmyApimyApiMessage("")
        })
    }


    const New_Option_Type_Document = [
        { "id": "email", "label": "Email", "value": "email" },
        { "id": "pdf", "label": "PDF", "value": "pdf" },
    ]

    function Download_Jury_Convocation_membre_PDF() {

        const stored_cookie = getCookie('tokenmysypart');

        var nom_fichier_cmd = "Convocation_Jury_membres.zip";

        if (String(selected_jury_convocation_membre_id).trim() === "") {
            alert(" Vous devez choisir un modèle de document ");
            return;
        }


        // Recuperer la liste des soutenances selectionnées
        var tab_jury_id = []

        for (var i = 0; i < selectionModel_columns_jury.length; i++) {
            var myid = parseInt(String(selectionModel_columns_jury[i]));
            var line = Getall_Partner_Jury_result[myid];
            //console.log(" ### line = ", line)
            tab_jury_id.push(JSON.parse(line)._id);
        }

        var url = process.env.REACT_APP_API_URL + "myclass/api/Send_Jury_Membre_Convocation_By_PDF/" + stored_cookie + "/" + tab_jury_id + "/" + selected_jury_convocation_membre_id;

        //console.log(" ### url = ", url);

        setLoading(true);
        axios.get(url, { responseType: 'blob', },)
            .then((res) => {
                setLoading(false);
                //console.log(" In Download_Stagiaire_Conventions_PDF  res.data = " + res.data);
                if (String(res.data) === String("false")) {
                    alert("Impossible de télécharger la convocation des membres du jury (2) ");
                } else {
                    fileDownload(res.data, nom_fichier_cmd);
                    //   Getall_Editable_Document_By_Partner_By_Collection();

                    setselectionModel_columns_jury_seance([]);
                    setselected_jury_soutenance_id("");
                    setactionmass_jury_seance("");

                }
            }).catch((error) => {
                setLoading(false);
                console.error('Error:', error);
                alert(" Impossible de télécharger la convocation des membres du jury ")

            });

    }



    function Download_Jury_Soutenance_Convocation_Apprenant_PDF() {

        const stored_cookie = getCookie('tokenmysypart');

        var nom_fichier_cmd = "Convocation_Soutenance_Jury.zip";

        if (String(selected_jury_convocation_apprenant_id).trim() === "") {
            alert(" Vous devez choisir un modèle de document ");
            return;
        }


        // Recuperer la liste des soutenances selectionnées
        var tab_soutenance_id = []

        for (var i = 0; i < selectionModel_columns_jury_seance.length; i++) {
            var myid = parseInt(String(selectionModel_columns_jury_seance[i]));
            var line = mysy_events[myid];
            //console.log(" ### line = ", line)
            tab_soutenance_id.push(line.jury_soutenance_id);
        }

        //console.log(" ### tab_soutenance_id = ", tab_soutenance_id)

        var url = process.env.REACT_APP_API_URL + "myclass/api/Send_Jury_Apprenant_Soutenance_Convocation_By_PDF/" + stored_cookie + "/" + selected_id + "/" + tab_soutenance_id + "/" + selected_jury_convocation_apprenant_id;

        //console.log(" ### url = ", url);

        setLoading(true);
        axios.get(url, { responseType: 'blob', },)
            .then((res) => {
                setLoading(false);
                //console.log(" In Download_Stagiaire_Conventions_PDF  res.data = " + res.data);
                if (String(res.data) === String("false")) {
                    alert("Impossible de télécharger la convocation (2) ");
                } else {
                    fileDownload(res.data, nom_fichier_cmd);
                    //   Getall_Editable_Document_By_Partner_By_Collection();

                    setselectionModel_columns_jury_seance([]);
                    setselected_jury_soutenance_id("");
                    setactionmass_jury_seance("");

                }
            }).catch((error) => {
                setLoading(false);
                console.error('Error:', error);
                alert(" Impossible de télécharger la convocation ")

            });

    }

    const [Send_JURY_MEMBRE_Convocations_By_Email_api, setSend_JURY_MEMBRE_Convocations_By_Email_api] = useState();
    const [Send_JURY_MEMBRE_Convocations_By_Email_message, setSend_JURY_MEMBRE_Convocations_By_Email_message] = useState();
    const [Send_JURY_MEMBRE_Convocations_By_Email_result, setSend_JURY_MEMBRE_Convocations_By_Email_result] = useState();
    function Send_JURY_MEMBRE_Convocations_By_Email(event) {

        var form = new FormData();

        if (String(selected_jury_convocation_membre_id).trim() === "") {
            alert(" Vous devez choisir un modèle de document ");
            return;
        }

        const stored_cookie = getCookie('tokenmysypart');
        form.append("token", stored_cookie);
        form.append("courrier_template_id", selected_jury_convocation_membre_id);
        form.append("email_test", selected_jury_convocation_apprenant_email_test);
        form.append("email_production", selected_jury_convocation_apprenant_email_destinataire_prod);


        // pièce jointe
        form.append("file_business_object", "");
        var list_files = new FormData();

        for (let i = 0; i < tab_jury_convocation_apprenant_pieces_jointes_result.length; i++) {
            form.append('File', tab_jury_convocation_apprenant_pieces_jointes_result[i]);

        }

        // Recuperer la liste des soutenances selectionnées
        var tab_jury_id = []

        for (var i = 0; i < selectionModel_columns_jury.length; i++) {
            var myid = parseInt(String(selectionModel_columns_jury[i]));
            var line = Getall_Partner_Jury_result[myid];
            //console.log(" ### line = ", line)
            tab_jury_id.push(JSON.parse(line)._id);
        }
        form.append("tab_jury_ids", tab_jury_id);


        //form.append("File", list_files);


        var myurl = process.env.REACT_APP_API_URL + "myclass/api/Send_Jury_Membre_Convocation_By_Email/";


        //console.log(" ### myurl = ", myurl);

        setLoading(true);
        axios.post(myurl, form).then(res => {
            setLoading(false);
            // console.log(" In Send_JURY_MEMBRE_Convocations_By_Email  res.data.status = " + res.data.status);
            //console.log(" In Send_JURY_MEMBRE_Convocations_By_Email  res.data.message r_class = " + res.data.message);

            if (String(res.data.status) === String("true")) {
                setSend_JURY_MEMBRE_Convocations_By_Email_api("true");
                setSend_JURY_MEMBRE_Convocations_By_Email_result(res.data.message);


                // alert(res.data.message);
                setdisplay_alert_mysy("1");
                setalert_message(res.data.message);
                setalert_type("success");

                setselectionModel_columns_jury([]);

            }
            else {
                setSend_JURY_MEMBRE_Convocations_By_Email_api("false");
                setSend_JURY_MEMBRE_Convocations_By_Email_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('Not good man :( Send_JURY_MEMBRE_Convocations_By_Email = ', error);
            setSend_JURY_MEMBRE_Convocations_By_Email_api("false");
            alert("Impossible d'envoyer la convocation par email");
            //setmyApimyApiMessage("")
        })
    }


    const [Send_JURY_APPRENANT_Convocations_By_Email_api, setSend_JURY_APPRENANT_Convocations_By_Email_api] = useState();
    const [Send_JURY_APPRENANT_Convocations_By_Email_message, setSend_JURY_APPRENANT_Convocations_By_Email_message] = useState();
    const [Send_JURY_APPRENANT_Convocations_By_Email_result, setSend_JURY_APPRENANT_Convocations_By_Email_result] = useState();
    function Send_JURY_APPRENANT_Convocations_By_Email(event) {

        var form = new FormData();

        if (String(selected_jury_convocation_apprenant_id).trim() === "") {
            alert(" Vous devez choisir un modèle de document ");
            return;
        }


        const stored_cookie = getCookie('tokenmysypart');
        form.append("token", stored_cookie);
        form.append("jury_id", selected_id);
        form.append("courrier_template_id", selected_jury_convocation_apprenant_id);
        form.append("email_test", selected_jury_convocation_apprenant_email_test);
        form.append("email_production", selected_jury_convocation_apprenant_email_destinataire_prod);


        // pièce jointe
        form.append("file_business_object", "");
        var list_files = new FormData();

        for (let i = 0; i < tab_jury_convocation_apprenant_pieces_jointes_result.length; i++) {
            form.append('File', tab_jury_convocation_apprenant_pieces_jointes_result[i]);

        }

        // Recuperer la liste des soutenances selectionnées
        var tab_soutenance_id = []

        for (var i = 0; i < selectionModel_columns_jury_seance.length; i++) {
            var myid = parseInt(String(selectionModel_columns_jury_seance[i]));
            var line = mysy_events[myid];
            //console.log(" ### line = ", line)
            tab_soutenance_id.push(line.jury_soutenance_id);
        }
        form.append("tab_jury_soutenance_ids", tab_soutenance_id);


        //form.append("File", list_files);


        var myurl = process.env.REACT_APP_API_URL + "myclass/api/Send_Jury_Apprenant_Soutenance_Convocation_By_Email/";


        //console.log(" ### myurl = ", myurl);

        setLoading(true);
        axios.post(myurl, form).then(res => {
            setLoading(false);
            // console.log(" In Send_JURY_APPRENANT_Convocations_By_Email  res.data.status = " + res.data.status);
            //console.log(" In Send_JURY_APPRENANT_Convocations_By_Email  res.data.message r_class = " + res.data.message);

            if (String(res.data.status) === String("true")) {
                setSend_JURY_APPRENANT_Convocations_By_Email_api("true");
                setSend_JURY_APPRENANT_Convocations_By_Email_result(res.data.message);


                // alert(res.data.message);
                setdisplay_alert_mysy("1");
                setalert_message(res.data.message);
                setalert_type("success");

                setselectionModel_columns_jury_seance([]);
                setselected_jury_soutenance_id("");
                setactionmass_jury_seance("");
            }
            else {
                setSend_JURY_APPRENANT_Convocations_By_Email_api("false");
                setSend_JURY_APPRENANT_Convocations_By_Email_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('Not good man :( Send_JURY_APPRENANT_Convocations_By_Email = ', error);
            setSend_JURY_APPRENANT_Convocations_By_Email_api("false");
            alert("Impossible d'envoyer la convocation par email");
            //setmyApimyApiMessage("")
        })
    }

    const [selected_jury_convocation_membre_id, setselected_jury_convocation_membre_id] = useState("");
    const [selected_jury_convocation_membre_type, setselected_jury_convocation_membre_type] = useState("");
    const [selected_jury_convocation_membre_email_destinataire_prod, setselected_jury_convocation_membre_email_destinataire_prod] = useState("");
    const [selected_jury_convocation_membre_email_test, setselected_jury_convocation_membre_email_test] = useState("");

    const [tab_jury_convocation_membre_pieces_jointes_result, settab_jury_convocation_membre_pieces_jointes_result] = useState([]);


    const [Dialog_CONVOCATION_JURY_MEMBRE_open, setDialog_CONVOCATION_JURY_MEMBRE_open] = React.useState(false);
    const Dialog_convocation_membre_MEMBRE_handleClose = () => {
        //alert(" Utiliser le bouton 'fermer' ");
        //setOpen(false);
    };

    const Dialog_CONVOCATION_JURY_MEMBRE_handleClose_buton = () => {
        setDialog_CONVOCATION_JURY_MEMBRE_open(false);
        setselected_jury_convocation_membre_id();
        setselected_jury_convocation_membre_type("");
        setselected_jury_convocation_membre_email_destinataire_prod();
        setselected_jury_convocation_membre_email_test();

        setactionmass_ftion_val();

        settab_jury_convocation_membre_pieces_jointes_result([])
    };



    const [Dialog_JURY_INFO_open, setDialog_JURY_INFO_open] = React.useState(false);

    const Dialog_JURY_INFO_handleClose_buton = () => {
        setDialog_JURY_INFO_open(false);
    };

    const [p_detail_jury_observation, setp_detail_jury_observation] = useState("");
    const [p_detail_jury_note, setp_detail_jury_note] = useState("");
    const [p_detail_jury_validation, setp_detail_jury_validation] = useState("");
    const [selected_inscription_id_for_jury, setselected_inscription_id_for_jury] = useState("");


    return (
        <div className="jurys">
            {isLoading && <div className="loader-container">
                <div className="mysy_spinner">  <img src={img_loading_spin} />  </div>
            </div>}

            {/***  Affichage des messages d'alerte*/}
            {display_alert_mysy && String(display_alert_mysy) === "1" &&
                <Module_Alert_Confirmation alert_message={alert_message}
                    alert_type={alert_type}
                    clear_alert_message={clear_alert_message}
                    clear_alert_type={clear_alert_type}
                    clear_display_alert_mysy={clear_display_alert_mysy}
                />
            }
            {/*** FIN Affichage des messages d'alerte*/}


            {/*  Dialog pour gerer les JURY_INFO */}
            <Dialog
                open={Dialog_JURY_INFO_open}

                className="displaypartnersession"

                static
                onClose={() => null}

                PaperProps={{


                    className: classes.paper, // Apply the paper style
                    style: {
                        overflowY: 'unset',
                        position: 'absolute',
                        top: '7rem',
                        margin: "2px",
                    },
                }}
                hideBackdrop={true}
                disableScrollLock
                classes={{
                    paper: classes.dialog
                }}

                PaperComponent={PaperComponent}
                aria-labelledby="draggable-dialog-title"

            >

                <DialogTitle style={{ cursor: 'move', background: '#fff', fontFamily:'DM Sans'}} id="draggable-dialog-title">  Délibération du Jury</DialogTitle>
                <DialogContent className="DialogContent_width" style={{ "minHeight": "30rem" }}>
                    <DialogContentText>
                        {Dialog_1_message}
                    </DialogContentText>

                    <div className="session_caract_Dialog" > <b> Observation </b> <br />

                        <TextareaAutosize
                            name="detail_jury_observation"
                            id="detail_jury_observation"
                            aria-label="minimum height"
                            minRows={3}
                            maxRows={5}
                            //placeholder="Minimum 3 rows"
                            style={{
                                border: "1px solid gainsboro", width: '99%', padding: '2px',
                                maxHeight: '15rem', height: '10rem', minHeight: '10rem', marginBottom: '3rem'
                            }}
                            value={p_detail_jury_observation}
                            onChange={(e) => {
                                setp_detail_jury_observation(e.target.value);

                            }}

                        />

                    </div>

                    <div className="session_caract_Dialog" > <b> Note </b> <br />

                        <TextareaAutosize
                            name="detail_jury_note"
                            id="detail_jury_note"
                            aria-label="minimum height"
                            rows={1}

                            style={{
                                border: "1px solid gainsboro", width: '99%', padding: '2px',
                                maxHeight: '3rem', height: '3rem', minHeight: '3rem', marginBottom: '3rem'
                            }}
                            value={p_detail_jury_note}
                            onChange={(e) => {
                                setp_detail_jury_note(e.target.value);
                            }}

                        />

                    </div>

                    <div className="session_caract_Dialog" > <b> Validation </b> <br />

                        <TextareaAutosize
                            name="detail_jury_note"
                            id="detail_jury_note"
                            aria-label="minimum height"
                            rows={1}

                            style={{
                                border: "1px solid gainsboro", width: '99%', padding: '2px',
                                maxHeight: '3rem', height: '3rem', minHeight: '3rem', marginBottom: '3rem'
                            }}
                            value={p_detail_jury_validation}
                            onChange={(e) => {
                                setp_detail_jury_validation(e.target.value);
                            }}

                        />

                    </div>



                </DialogContent>

                <DialogActions>

                    <IconButton
                        autoFocus
                        onClick={Dialog_JURY_INFO_handleClose_buton}
                        color="primary"
                        className={classes.customizedButton}
                    >
                        <CancelPresentationIcon />
                    </IconButton>

                    <div className="div_row">
                        <div className="div_row_gauche">
                            <Button
                                className="bton_enreg_dialog" onClick={(e) => {
                                    //     Update_Jury_Promo_List_Inscrit();
                                    Dialog_JURY_INFO_handleClose_buton();
                                }}
                            >Mettre à jour </Button>

                        </div>


                        <div className="div_row_droite" style={{ "textAlign": 'center' }}>
                            <Button onClick={Dialog_JURY_INFO_handleClose_buton} className="bton_annule_dialog" >Fermer</Button>
                        </div>
                    </div>

                </DialogActions>

            </Dialog>
            {/* FIN  Dialog pour gerer les JURY_INFO */}



            {/*  Dialog pour gerer les CONVOCATION_JURY_MEMBRE */}
            <Dialog
                open={Dialog_CONVOCATION_JURY_MEMBRE_open}
                //  onClose={Dialog_CONVOCATION_JURY_MEMBRE_handleClose}
                //  className="displaypartnersession"

                className="displaypartnersession"

                static
                onClose={() => null}

                PaperProps={{


                    className: classes.paper, // Apply the paper style
                    style: {
                        overflowY: 'unset',
                        position: 'absolute',
                        top: '7rem',
                        margin: "2px",
                    },
                }}
                hideBackdrop={true}
                disableScrollLock
                classes={{
                    paper: classes.dialog
                }}

                PaperComponent={PaperComponent}
                aria-labelledby="draggable-dialog-title"

            >

                <DialogTitle style={{ cursor: 'move', background: '#fff', fontFamily:'DM Sans'}} id="draggable-dialog-title"> Gestion membres jury</DialogTitle>
                <DialogContent className="DialogContent_width" style={{ "minHeight": "30rem" }}>
                    <DialogContentText>
                        {Dialog_1_message}
                    </DialogContentText>


                    <div className="session_caract_Dialog" > <b> Type Document </b> <br />

                        <Autocomplete
                            disablePortal
                            sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 } }}

                            name="event_dialog_type_convention"
                            id="event_dialog_type_convention"
                            fullWidth
                            options={New_Option_Type_Document}
                            onChange={(event, value) => {
                                if (value && value.value) {
                                    setselected_jury_convocation_membre_type(value.value);
                                    Get_List_JURY_MEMBRE_Convocations(String(value.value));


                                }
                            }}
                            renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
                                inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}

                            />
                            }
                        />



                    </div>

                    {(String(selected_jury_convocation_membre_type) === "email" || String(selected_jury_convocation_membre_type) === "pdf") &&
                        <div className="session_caract_Dialog" > <b> Choisir une convocation (membre jury)</b>
                            <Autocomplete
                                disablePortal
                                name="event_dialog_version_convention"
                                id="event_dialog_version_convention"
                                fullWidth
                                //className="disabled_style enable_style"
                                options={New_Get_List_JURY_MEMBRE_Convocations_result}

                                onChange={(event, value) => {
                                    if (value && value._id) {

                                        setselected_jury_convocation_membre_id(value._id);

                                        if (String(value._id) === "default_mail") {
                                            setselected_jury_convocation_membre_type("email");
                                        }
                                        else if (String(value._id) === "default_pdf") {
                                            setselected_jury_convocation_membre_type("pdf");
                                        } else {
                                            var result2 = Get_List_JURY_MEMBRE_Convocations_result.filter((local_mymanager) => JSON.parse(local_mymanager)._id === String(value._id))


                                            setselected_jury_convocation_membre_type(JSON.parse(result2).type_doc);
                                        }
                                        settab_jury_convocation_membre_pieces_jointes_result([]);
                                    }
                                }}

                                renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option" />
                                }
                            />

                        </div>}

                    {String(selected_jury_convocation_membre_type) === "email" && <div className="session_caract_Dialog" > Type Document<br />
                        <TextField
                            sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, width: '75%' }}

                            name="event_dialog_type_convention"
                            id="event_dialog_type_convention"

                            value="email"

                        />


                        {String(selected_jury_convocation_membre_type) === "email" && <label className="bton_image_class" style={{ "width": "20%", "float": "right", "height": "3.5rem", "paddingTop": "15px" }} onClick={(e) => {

                            if (selected_jury_convocation_membre_email_test) {
                                var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
                                if (!selected_jury_convocation_membre_email_test.match(validRegex)) {
                                    alert("L'adresse email de test est invalide.");
                                    return;
                                }
                                //  Send_JURY_APPRENANT_Conventions_By_Email_Test();
                            } else {
                                alert("L'adresse email de test est invalide.");
                            }



                        }} > <FcSearch /> &nbsp; Test</label>}

                    </div>}

                    {String(selected_jury_convocation_membre_type) === "pdf" && <div className="session_caract_Dialog" > Type Document<br />
                        <TextField
                            sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 } }}

                            name="event_dialog_type_convention"
                            id="event_dialog_type_convention"

                            value="pdf"
                            fullWidth
                        />



                    </div>}


                    {String(selected_jury_convocation_membre_type) === "email" && <div className="session_caract_Dialog" >
                        <Tooltip className="tooltip_css" id="test01" style={{ "fontSize": "12px" }} />
                        <a data-tooltip-id="test01" data-tooltip-html="Pour recevoir une email de test avant de l'envoyer">
                            Adresse email de test <FcInfo /> <TextField
                                sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}

                                name="event_dialog_email_test_convention"
                                id="event_dialog_email_test_convention"

                                fullWidth

                                value={selected_jury_convocation_membre_email_test}
                                onChange={(e) => {
                                    setselected_jury_convocation_membre_email_test(e.target.value);
                                }
                                }
                            />
                        </a>

                    </div>
                    }


                    {String(selected_jury_convocation_membre_type) === "email" &&
                        String(actionmass_ftion_val) !== String("convention") && <div className="session_caract_Dialog" > Email destinaitaire
                            <TextField
                                sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}

                                name="event_dialog_email_production_convention"
                                id="event_dialog_email_production_convention"

                                fullWidth

                                value={selected_jury_convocation_membre_email_destinataire_prod}
                                onChange={(e) => {
                                    setselected_jury_convocation_membre_email_destinataire_prod(e.target.value);
                                }
                                }
                            />

                        </div>
                    }



                    {String(selected_jury_convocation_membre_type) === "email" && <div>

                        <div>
                            <div className="div_row" style={{ "border": "None" }}>
                                <hr className="hr_break" />
                            </div>

                            <div className="div_row" style={{ "border": "None", "fontSize": "22px", "fontWeight": "600", "padding": "5px" }}>
                                Pièces jointes Convention

                            </div>

                            <div className="div_row" style={{ "padding": "5px" }}>

                                <div style={{ "fontSize": "12px" }}>
                                    <label htmlFor="upload_convention_file">
                                        <input
                                            style={{ display: "none" }}
                                            id="upload_convention_file"
                                            name="upload_convention_file"
                                            type="file"
                                            onChange={sessions_file_change_1_convention}
                                        />

                                        <Fab
                                            color="secondary"
                                            size="small"
                                            component="span"
                                            aria-label="add"
                                            variant="extended"
                                        >
                                            <IoMdAddCircle /> <nav style={{ "fontSize": "12px" }}> Ajouter un fichier </nav>
                                        </Fab>

                                    </label>
                                </div>


                            </div>


                            {tab_jury_convocation_membre_pieces_jointes_result && <div className="div_row" style={{ "padding": "5px" }}>

                                <div className="div_row">
                                    Liste des pièces jointes <br />
                                    {<div className="div_row">
                                        {tab_jury_convocation_membre_pieces_jointes_result && tab_jury_convocation_membre_pieces_jointes_result.map((val) => (
                                            <div className="div_row_list_pj_convention"  >
                                                <nav style={{ "color": "orange", "cursor": "pointer" }}
                                                    onClick={(e) => {
                                                        Delete_Convention_Attached_Doc(e);
                                                    }}
                                                    name={val.name} id={val.name}> Supprimer  {val.name} </nav> <br />


                                            </div>
                                        ))}
                                    </div>}
                                </div>
                            </div>}



                        </div>
                    </div>}



                </DialogContent>

                <DialogActions>

                    <IconButton
                        autoFocus
                        onClick={Dialog_CONVOCATION_JURY_MEMBRE_handleClose_buton}
                        color="primary"
                        className={classes.customizedButton}
                    >
                        <CancelPresentationIcon />
                    </IconButton>

                    <div className="div_row">
                        <div className="div_row_gauche">
                            {String(selected_jury_convocation_membre_type) === "email" && <Button onClick={(e) => {

                                if (String(selected_jury_convocation_membre_email_test).length > 2) {
                                    // On alerte juste l'utilisateur que l'email de test n'est pas vide, juste au cas ou il aurait cliqué par erreur sur l'envoie.
                                    const response = window.confirm(" Vous allez envoyer la convention au destinaitaire final. Continuer ?");
                                    if (!response) {
                                        return;
                                    }
                                }

                                Send_JURY_MEMBRE_Convocations_By_Email();
                                Dialog_CONVOCATION_JURY_MEMBRE_handleClose_buton();

                            }}
                                className="bton_enreg_dialog">Envoyer mail </Button>}


                            {String(selected_jury_convocation_membre_type) === "pdf" &&
                                <Button className="bton_enreg_dialog" onClick={(e) => {
                                    Download_Jury_Convocation_membre_PDF();
                                    Dialog_CONVOCATION_JURY_MEMBRE_handleClose_buton();
                                }}
                                >Télécharger </Button>}

                        </div>

                        <div className="div_row_droite" style={{ "textAlign": 'center' }}>
                            <Button onClick={Dialog_CONVOCATION_JURY_MEMBRE_handleClose_buton} className="bton_annule_dialog" >Fermer</Button>
                        </div>
                    </div>

                </DialogActions>

            </Dialog>
            {/* FIN  Dialog pour gerer les CONVOCATION_JURY_MEMBRE */}



            {/*  Dialog pour gerer les CONVOCATION_JURY_APPRENANT */}
            <Dialog
                open={Dialog_CONVOCATION_JURY_APPRENANT_open}
                //  onClose={Dialog_CONVOCATION_JURY_APPRENANT_handleClose}
                //  className="displaypartnersession"

                className="displaypartnersession"

                static
                onClose={() => null}

                PaperProps={{


                    className: classes.paper, // Apply the paper style
                    style: {
                        overflowY: 'unset',
                        position: 'absolute',
                        top: '7rem',
                        margin: "2px",
                    },
                }}
                hideBackdrop={true}
                disableScrollLock
                classes={{
                    paper: classes.dialog
                }}

                PaperComponent={PaperComponent}
                aria-labelledby="draggable-dialog-title"

            >

                <DialogTitle style={{ cursor: 'move', background: '#fff', fontFamily:'DM Sans'}} id="draggable-dialog-title"> Gestion soutenance</DialogTitle>
                <DialogContent className="DialogContent_width" style={{ "minHeight": "30rem" }}>
                    <DialogContentText>
                        {Dialog_1_message}
                    </DialogContentText>


                    <div className="session_caract_Dialog" > <b> Type Document </b> <br />

                        <Autocomplete
                            disablePortal
                            sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 } }}

                            name="event_dialog_type_convention"
                            id="event_dialog_type_convention"
                            fullWidth
                            options={New_Option_Type_Document}
                            onChange={(event, value) => {
                                if (value && value.value) {
                                    setselected_jury_convocation_apprenant_type(value.value);
                                    Get_List_JURY_APPRENANT_Convocations(String(value.value));


                                }
                            }}
                            renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
                                inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}

                            />
                            }
                        />



                    </div>

                    {(String(selected_jury_convocation_apprenant_type) === "email" || String(selected_jury_convocation_apprenant_type) === "pdf") &&
                        <div className="session_caract_Dialog" > <b> Choisir une convocation </b>
                            <Autocomplete
                                disablePortal
                                name="event_dialog_version_convention"
                                id="event_dialog_version_convention"
                                fullWidth
                                //className="disabled_style enable_style"
                                options={New_Get_List_JURY_APPRENANT_Convocations_result}

                                onChange={(event, value) => {
                                    if (value && value._id) {

                                        setselected_jury_convocation_apprenant_id(value._id);

                                        if (String(value._id) === "default_mail") {
                                            setselected_jury_convocation_apprenant_type("email");
                                        }
                                        else if (String(value._id) === "default_pdf") {
                                            setselected_jury_convocation_apprenant_type("pdf");
                                        } else {
                                            var result2 = Get_List_JURY_APPRENANT_Convocations_result.filter((local_mymanager) => JSON.parse(local_mymanager)._id === String(value._id))


                                            setselected_jury_convocation_apprenant_type(JSON.parse(result2).type_doc);
                                        }
                                        settab_jury_convocation_apprenant_pieces_jointes_result([]);
                                    }
                                }}

                                renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option" />
                                }
                            />

                        </div>}

                    {String(selected_jury_convocation_apprenant_type) === "email" && <div className="session_caract_Dialog" > Type Document<br />
                        <TextField
                            sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, width: '75%' }}

                            name="event_dialog_type_convention"
                            id="event_dialog_type_convention"

                            value="email"

                        />


                        {String(selected_jury_convocation_apprenant_type) === "email" && <label className="bton_image_class" style={{ "width": "20%", "float": "right", "height": "3.5rem", "paddingTop": "15px" }} onClick={(e) => {

                            if (selected_jury_convocation_apprenant_email_test) {
                                var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
                                if (!selected_jury_convocation_apprenant_email_test.match(validRegex)) {
                                    alert("L'adresse email de test est invalide.");
                                    return;
                                }
                                //  Send_JURY_APPRENANT_Conventions_By_Email_Test();
                            } else {
                                alert("L'adresse email de test est invalide.");
                            }



                        }} > <FcSearch /> &nbsp; Test</label>}

                    </div>}

                    {String(selected_jury_convocation_apprenant_type) === "pdf" && <div className="session_caract_Dialog" > Type Document<br />
                        <TextField
                            sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 } }}

                            name="event_dialog_type_convention"
                            id="event_dialog_type_convention"

                            value="pdf"
                            fullWidth
                        />



                    </div>}


                    {String(selected_jury_convocation_apprenant_type) === "email" && <div className="session_caract_Dialog" >
                        <Tooltip className="tooltip_css" id="test01" style={{ "fontSize": "12px" }} />
                        <a data-tooltip-id="test01" data-tooltip-html="Pour recevoir une email de test avant de l'envoyer">
                            Adresse email de test <FcInfo /> <TextField
                                sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}

                                name="event_dialog_email_test_convention"
                                id="event_dialog_email_test_convention"

                                fullWidth

                                value={selected_jury_convocation_apprenant_email_test}
                                onChange={(e) => {
                                    setselected_jury_convocation_apprenant_email_test(e.target.value);
                                }
                                }
                            />
                        </a>

                    </div>
                    }


                    {String(selected_jury_convocation_apprenant_type) === "email" &&
                        String(actionmass_ftion_val) !== String("convention") && <div className="session_caract_Dialog" > Email destinaitaire
                            <TextField
                                sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}

                                name="event_dialog_email_production_convention"
                                id="event_dialog_email_production_convention"

                                fullWidth

                                value={selected_jury_convocation_apprenant_email_destinataire_prod}
                                onChange={(e) => {
                                    setselected_jury_convocation_apprenant_email_destinataire_prod(e.target.value);
                                }
                                }
                            />

                        </div>
                    }



                    {String(selected_jury_convocation_apprenant_type) === "email" && <div>

                        <div>
                            <div className="div_row" style={{ "border": "None" }}>
                                <hr className="hr_break" />
                            </div>

                            <div className="div_row" style={{ "border": "None", "fontSize": "22px", "fontWeight": "600", "padding": "5px" }}>
                                Pièces jointes Convention

                            </div>

                            <div className="div_row" style={{ "padding": "5px" }}>

                                <div style={{ "fontSize": "12px" }}>
                                    <label htmlFor="upload_convention_file">
                                        <input
                                            style={{ display: "none" }}
                                            id="upload_convention_file"
                                            name="upload_convention_file"
                                            type="file"
                                            onChange={sessions_file_change_1_convention}
                                        />

                                        <Fab
                                            color="secondary"
                                            size="small"
                                            component="span"
                                            aria-label="add"
                                            variant="extended"
                                        >
                                            <IoMdAddCircle /> <nav style={{ "fontSize": "12px" }}> Ajouter un fichier </nav>
                                        </Fab>

                                    </label>
                                </div>


                            </div>


                            {tab_jury_convocation_apprenant_pieces_jointes_result && <div className="div_row" style={{ "padding": "5px" }}>

                                <div className="div_row">
                                    Liste des pièces jointes <br />
                                    {<div className="div_row">
                                        {tab_jury_convocation_apprenant_pieces_jointes_result && tab_jury_convocation_apprenant_pieces_jointes_result.map((val) => (
                                            <div className="div_row_list_pj_convention"  >
                                                <nav style={{ "color": "orange", "cursor": "pointer" }}
                                                    onClick={(e) => {
                                                        Delete_Convention_Attached_Doc(e);
                                                    }}
                                                    name={val.name} id={val.name}> Supprimer  {val.name} </nav> <br />


                                            </div>
                                        ))}
                                    </div>}
                                </div>
                            </div>}



                        </div>
                    </div>}



                </DialogContent>

                <DialogActions>

                    <IconButton
                        autoFocus
                        onClick={Dialog_CONVOCATION_JURY_APPRENANT_handleClose_buton}
                        color="primary"
                        className={classes.customizedButton}
                    >
                        <CancelPresentationIcon />
                    </IconButton>

                    <div className="div_row">
                        <div className="div_row_gauche">
                            {String(selected_jury_convocation_apprenant_type) === "email" && <Button onClick={(e) => {

                                if (String(selected_jury_convocation_apprenant_email_test).length > 2) {
                                    // On alerte juste l'utilisateur que l'email de test n'est pas vide, juste au cas ou il aurait cliqué par erreur sur l'envoie.
                                    const response = window.confirm(" Vous allez envoyer la convention au destinaitaire final. Continuer ?");
                                    if (!response) {
                                        return;
                                    }
                                }

                                Send_JURY_APPRENANT_Convocations_By_Email();
                                Dialog_CONVOCATION_JURY_APPRENANT_handleClose_buton();

                            }}
                                className="bton_enreg_dialog">Envoyer mail </Button>}


                            {String(selected_jury_convocation_apprenant_type) === "pdf" &&
                                <Button className="bton_enreg_dialog" onClick={(e) => {
                                    Download_Jury_Soutenance_Convocation_Apprenant_PDF();
                                    Dialog_CONVOCATION_JURY_APPRENANT_handleClose_buton();
                                }}
                                >Télécharger </Button>}

                        </div>

                        <div className="div_row_droite" style={{ "textAlign": 'center' }}>
                            <Button onClick={Dialog_CONVOCATION_JURY_APPRENANT_handleClose_buton} className="bton_annule_dialog" >Fermer</Button>
                        </div>
                    </div>

                </DialogActions>

            </Dialog>
            {/* FIN  Dialog pour gerer les CONVOCATION_JURY_APPRENANT */}



            {/*** Dialog Gestion Apprenant concerné par le jury */}

            <Dialog
                open={Dialog_Jury_Apprenant_open}
                // onClose={Dialog_Jury_Apprenant_handleClose}

                className="displaypartnersession"
                static
                onClose={() => null}

                PaperProps={{


                    className: classes.paper, // Apply the paper style
                    style: {
                        overflowY: 'unset',
                        position: 'absolute',
                        top: '5rem',
                        margin: "2px",
                    },
                }}
                hideBackdrop={true}
                disableScrollLock
                classes={{
                    paper: classes.dialog
                }}

                PaperComponent={PaperComponent}
                aria-labelledby="draggable-dialog-title"
            >

                <DialogTitle style={{ cursor: 'move', fontFamily: "DM Sans", width: '50rem' }} id="draggable-dialog-title">  Ajout apprenant </DialogTitle>
                <DialogContent style={{ width: '50rem' }} >
                    <DialogContentText>

                    </DialogContentText>

                    <div className="titre1">  Créneau </div>
                    <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', flexWrap: 'wrap' }}>

                        <div style={{ width: "45%", float: "left", textAlign: "left" }}>
                            <DatePicker
                                name="event_dialog_start"
                                id="event_dialog_start"
                                selected={startDate}
                                onChange={(date) => {
                                    if (String(props.write_access) === "1" && String(p_detail_sequence_session_id) === "")
                                        return setStartDate(date);
                                }
                                }


                                className="disabled_style enable_style datepicker_complement"
                                locale='fr-FR'
                                showTimeSelect
                                timeFormat="HH:mm"
                                timeIntervals={15}
                                dateFormat="dd/MM/yyyy HH:mm"
                                is24Hour

                            />

                        </div>
                        <div style={{ width: "5%", float: "left", textAlign: "center", paddingTop: "20px", fontSize: "12px" }}>
                            Au

                        </div>


                        <div style={{ width: "45%", float: "right", textAlign: "right" }}>
                            <DatePicker
                                name="event_dialog_end"
                                id="event_dialog_end"
                                selected={endDate}

                                onChange={(date) => {
                                    if (String(props.write_access) === "1" && String(p_detail_sequence_session_id) === "")
                                        return setendDate(date);
                                }
                                }


                                className="disabled_style enable_style datepicker_complement"
                                locale='fr-FR'
                                showTimeSelect
                                timeFormat="HH:mm"
                                timeIntervals={15}
                                dateFormat="dd/MM/yyyy HH:mm"
                                is24Hour

                            />

                        </div>

                    </div>

                    <div>  &nbsp; </div>
                    <div className="titre1">  Adresse </div>

                    <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', flexWrap: 'wrap' }}>

                        <div className="session_caract"> Salle de soutenance <br />
                            <TextField
                                sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                required
                                name="detail_soutenance_salle"
                                id="detail_soutenance_salle"

                                InputLabelProps={{
                                    shrink: true,
                                }}
                                disabled={false}
                                className="disabled_style"
                                value={p_detail_soutenance_salle}
                                onChange={(e) => {
                                    setp_detail_soutenance_salle(e.target.value);

                                }
                                }

                            />

                        </div>

                        <div className="session_caract"> Adresse <br />
                            <TextField
                                sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                required
                                name="detail_soutenance_adresse"
                                id="detail_soutenance_adresse"

                                InputLabelProps={{
                                    shrink: true,
                                }}
                                disabled={false}
                                className="disabled_style"
                                value={p_detail_soutenance_adresse}
                                onChange={(e) => {
                                    setp_detail_soutenance_adresse(e.target.value);

                                }
                                }

                            />

                        </div>

                        <div className="session_caract"> CP <br />
                            <TextField
                                sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                required
                                name="detail_soutenance_code_postal"
                                id="detail_soutenance_code_postal"

                                InputLabelProps={{
                                    shrink: true,
                                }}
                                disabled={false}
                                className="disabled_style"
                                value={p_detail_soutenance_code_postal}
                                onChange={(e) => {
                                    setp_detail_soutenance_code_postal(e.target.value);

                                }
                                }

                            />

                        </div>

                        <div className="session_caract"> Ville <br />
                            <TextField
                                sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                required
                                name="detail_soutenance_ville"
                                id="detail_soutenance_ville"

                                InputLabelProps={{
                                    shrink: true,
                                }}
                                disabled={false}
                                className="disabled_style"
                                value={p_detail_soutenance_ville}
                                onChange={(e) => {
                                    setp_detail_soutenance_ville(e.target.value);

                                }
                                }

                            />

                        </div>

                        <div className="session_caract"> Pays <br />
                            <TextField
                                sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                required
                                name="detail_soutenance_pays"
                                id="detail_soutenance_pays"

                                InputLabelProps={{
                                    shrink: true,
                                }}
                                disabled={false}
                                className="disabled_style"
                                value={p_detail_soutenance_pays}
                                onChange={(e) => {
                                    setp_detail_soutenance_pays(e.target.value);

                                }
                                }

                            />

                        </div>

                    </div>



                    <div className="titre1">  Apprenants </div>


                    <div className="session_caract_Dialog" >  <b>Choisir des apprenants  </b> <br />
                        {New_Employee_Not_Member && New_Employee_Not_Member.length > 0 &&
                            <Autocomplete
                                disablePortal

                                name="filtre1_value"
                                id="filtre1_value"
                                className="disabled_style remove_border_bottom"
                                //options={New_Getall_Training_Employee_No_Filter_result}

                                options={New_Session_Inscrit}
                                //value={selected_employee_id}
                                value={tab_selected_apprenant}
                                multiple


                                onChange={(event, value) => {

                                    settab_selected_apprenant([
                                        ...fixedVal_apprenant,
                                        ...value.filter((i) => fixedVal_apprenant.indexOf(i) === -1),
                                    ]);

                                    // console.log(" ### tab_selected_apprenant = ", tab_selected_apprenant)


                                }}

                                renderInput={(params) => <TextField {...params} label="" />
                                }
                            />
                        }

                    </div>

                    <div style={{ height: 350, width: '100%', paddingRight: '5px' }}>


                        <div className="div_row" style={{ paddingRight: '10px' }}>

                            <div>
                                <div style={{ "border": "None" }}>

                                    <div style={{ height: 300, width: '100%', paddingRight: '5px' }}>

                                        &nbsp;
                                        <Box
                                            sx={{
                                                height: 500,
                                                width: '100%',
                                                paddingRight: '1px',



                                                /*"& .MuiDataGrid-virtualScrollerRenderZone": {
                                                    "& .MuiDataGrid-row": {
                                                        "&:nth-child(2n)": { backgroundColor: "rgba(235, 235, 235, .7)" }
                                                    }
                                                },*/
                                                "& .MuiDataGrid-columnHeaders": {
                                                    backgroundColor: "#c8cfd5",
                                                    color: "black",
                                                    fontSize: 14
                                                },

                                                '& .line--statut--selected': {
                                                    backgroundColor: '#FBF2EF',
                                                    color: 'black',
                                                },
                                                '& .line--statut--pair': {
                                                    backgroundColor: 'rgba(235, 235, 235, .7)',
                                                    color: 'black',
                                                },
                                                '& .line--statut--impair': {
                                                    backgroundColor: '#FFFFFF',
                                                    color: 'black',
                                                },
                                                [`& .${gridClasses.cell}`]: {
                                                    py: 1,
                                                },


                                            }}
                                        >
                                            <DataGrid
                                                // checkboxSelection 
                                                disableRowSelectionOnClick
                                                disableSelectionOnClick
                                                onSelectionModelChange={(newSelectionModel) => {
                                                    setselectionModel_jury_seance_participants(newSelectionModel);
                                                    /*if (newSelectionModel.length === 1)
                                                        handleClick_edit_employee_From_Line(newSelectionModel);*/
                                                    if (newSelectionModel.length !== 1) {
                                                        /*  setsubmenu();
                                                          setdisplay_detail_employe();
                                                          setadd_One_Employee();*/
                                                    }
                                                }}
                                                selectionModel={selectionModel_jury_seance_participants}

                                                localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
                                                rows={Get_Jury_List_Apprenant_Seance_insc_result.map((item, index) => (
                                                    {
                                                        id: index,
                                                        _id: JSON.parse(item)._id,
                                                        email: JSON.parse(item).email,
                                                        nom: JSON.parse(item).nom,
                                                        prenom: JSON.parse(item).prenom,

                                                    }
                                                ))}

                                                columns={columns_jury_seance_participant}
                                                pageSize={10}
                                                className="datagridclass"

                                                onRowDoubleClick={(newSelectionModel) => {

                                                }}

                                                rowsPerPageOptions={[10]}

                                                components={{
                                                    Toolbar: GridToolbar,
                                                }}
                                                //sx={datagridSx}
                                                getCellClassName={(params) => {

                                                }}
                                                getRowClassName={(params) => {
                                                    // Pour la gestion de la couleur de zone double cliquée
                                                    if (String(params.row.id) === String(gridline_id)) {
                                                        return 'line--statut--selected';
                                                    }
                                                    else if (parseInt(String(params.row.id)) % 2 === 0) {
                                                        return 'line--statut--pair';
                                                    }
                                                    else if (parseInt(String(params.row.id)) % 2 !== 0) {
                                                        return 'line--statut--impair';
                                                    }


                                                }}
                                                getEstimatedRowHeight={() => 200}
                                                getRowHeight={() => "auto"}
                                                sx={{
                                                    "& .MuiDataGrid-cellContent": {
                                                        minHeight: 50,

                                                    }
                                                }}

                                            />
                                        </Box>



                                        <br />

                                    </div>


                                </div>
                            </div>

                            <div className="div_row" style={{ "border": "None" }}>


                            </div>
                        </div>

                    </div>

                </DialogContent>


                <DialogActions>
                    <div className="div_row">
                        <div className="div_row_gauche">
                            {selected_agenda_id && String(selected_agenda_id).length > 5 && <Button onClick={Add_Apprenant_To_Jury} className="bton_enreg_dialog">Mise à Jour</Button>}
                            {(!selected_agenda_id || String(selected_agenda_id).length < 5) && <Button onClick={Add_Apprenant_To_Jury} className="bton_enreg_dialog">Ajouter</Button>}
                        </div>

                        <div className="div_row_droite" style={{ "textAlign": 'center' }}>
                            <Button onClick={Dialog_Jury_Apprenant_handleClose_buton} className="bton_annule_dialog" >Fermer</Button>
                        </div>



                    </div>
                    <IconButton
                        autoFocus
                        onClick={Dialog_Jury_Apprenant_handleClose_buton}
                        color="primary"
                        className={classes.customizedButton}
                    >
                        <CancelPresentationIcon />
                    </IconButton>

                </DialogActions>

            </Dialog>

            {/*** Fin  Dialog Gestion Apprenant concerné par le jury */}



            {/*** Dialog Gestion membre */}

            <Dialog
                open={Dialog_Jury_Membre_open}
                // onClose={Dialog_Jury_Membre_handleClose}

                className="displaypartnersession"
                static
                onClose={() => null}

                PaperProps={{


                    className: classes.paper, // Apply the paper style
                    style: {
                        overflowY: 'unset',
                        position: 'absolute',
                        top: '5rem',
                        margin: "2px",
                    },
                }}
                hideBackdrop={true}
                disableScrollLock
                classes={{
                    paper: classes.dialog
                }}

                PaperComponent={PaperComponent}
                aria-labelledby="draggable-dialog-title"
            >

                <DialogTitle style={{ cursor: 'move', fontFamily: "DM Sans" }} id="draggable-dialog-title">  Ajout membre </DialogTitle>
                <DialogContent className="DialogContent_width">
                    <DialogContentText>

                    </DialogContentText>



                    <div className="session_caract_Dialog" >  <b>Nouveau membre  </b> <br />
                        {New_Employee_Not_Member && New_Employee_Not_Member.length > 0 &&
                            <Autocomplete
                                disablePortal

                                name="filtre1_value"
                                id="filtre1_value"
                                className="disabled_style remove_border_bottom"
                                //options={New_Getall_Training_Employee_No_Filter_result}

                                options={New_Employee_Not_Member}
                                //value={selected_employee_id}
                                value={tab_selected_users}
                                multiple


                                onChange={(event, value) => {

                                    settab_selected_users([
                                        ...fixedVal,
                                        ...value.filter((i) => fixedVal.indexOf(i) === -1),
                                    ]);


                                }}

                                renderInput={(params) => <TextField {...params} label="Choisir  " />
                                }
                            />
                        }

                    </div>

                    <div className="div_row_dialog">
                        <div className="session_caract_Dialog" >  Rôle <br />
                            <TextField
                                //  autoFocus
                                margin="dense"
                                id="secrete_key"
                                className="disabled_style remove_border_bottom"
                                value={p_detail_member_role}
                                onChange={(e) => {
                                    setp_detail_member_role(e.target.value);

                                }
                                }
                            />
                        </div>
                    </div>


                </DialogContent>


                <DialogActions>
                    <div className="div_row">
                        <div className="div_row_gauche">

                            <Button onClick={Add_Member_To_Jury} className="bton_enreg_dialog">Ajouter</Button>
                        </div>

                        <div className="div_row_droite" style={{ "textAlign": 'center' }}>
                            <Button onClick={Dialog_Jury_Membre_handleClose_buton} className="bton_annule_dialog" >Fermer</Button>
                        </div>



                    </div>
                    <IconButton
                        autoFocus
                        onClick={Dialog_Jury_Membre_handleClose_buton}
                        color="primary"
                        className={classes.customizedButton}
                    >
                        <CancelPresentationIcon />
                    </IconButton>

                </DialogActions>

            </Dialog>

            {/*** Fin ajout  Dialog Gestion membre */}

            {/*** Dialog detail eventement */}
            <Dialog
                open={Dialog_1_open}
                //  onClose={Dialog_1_handleClose}

                className="module_agenda"
                static
                onClose={() => null}

                PaperProps={{


                    className: classes.paper, // Apply the paper style
                    style: {
                        overflowY: 'unset',
                        position: 'absolute',
                        top: '7rem',
                        margin: "2px",
                    },
                }}
                hideBackdrop={true}
                disableScrollLock
                classes={{
                    paper: classes.dialog
                }}

                PaperComponent={PaperComponent}
                aria-labelledby="draggable-dialog-title"

            >
                <DialogTitle style={{ cursor: 'move', background: '#fff', fontFamily:'DM Sans'}} id="draggable-dialog-title"> MySy Information</DialogTitle>
                <DialogContent className="DialogContent_width">
                    <DialogContentText>
                        {Dialog_1_message}
                    </DialogContentText>

                    {New_Getall_TrainingSession_result && <div className="session_caract_Dialog" >

                        <nav style={{ "float": "left", "width": "20%", "paddingTop": "15px" }}> Promotion  </nav>


                        <nav style={{ "float": "right", "width": "75%" }}>
                            <TextField
                                sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                name="event_dialog_session"
                                id="event_dialog_session"
                                fullWidth
                                value={New_Getall_TrainingSession_result.filter((data) => (data)._id === String(selected_session_id))[0].label}
                            />


                        </nav>
                    </div>}

                    {New_Option_Cible_Jury && New_Option_Cible_Jury.length > 0 && <div className="session_caract_Dialog" >

                        <nav style={{ "float": "left", "width": "20%", "paddingTop": "15px" }}> Cible  </nav>


                        <nav style={{ "float": "right", "width": "75%" }}>
                            <TextField
                                sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                name="dialog_detail_jury_cible"
                                id="dialog_detail_jury_cible"
                                fullWidth
                                value={New_Option_Cible_Jury.filter((data) => (data).id === String(selected_jury_cible))[0].label}
                            />


                        </nav>
                    </div>}


                    <div className="session_caract_Dialog" >

                        <nav style={{ "float": "left", "width": "20%", "paddingTop": "15px" }}> Unité d'enseignement  </nav>
                        <nav style={{ "float": "right", "width": "75%" }}>


                            {New_Get_List_UE_From_Session_Id_result && New_Get_List_UE_From_Session_Id_result.length > 0 &&
                                <Autocomplete
                                    disablePortal

                                    name="filtre1_unite_enseignement"
                                    id="filtre1_unite_enseignement"
                                    fullWidth
                                    //options={New_Getall_Training_Employee_No_Filter_result}
                                    value={New_Get_List_UE_From_Session_Id_result.filter((data) => (data)._id === String(jury_seance_ue_id))[0].label}
                                    options={New_Get_List_UE_From_Session_Id_result}

                                    onChange={(event, value) => {
                                        if (value._id) {
                                            setjury_seance_ue_id(value._id)
                                        } else {
                                            setjury_seance_ue_id("");
                                        }
                                    }}

                                    renderInput={(params) => <TextField {...params} label="" />
                                    }
                                />
                            }
                        </nav>

                    </div>

                    <div className="session_caract_Dialog" >

                        <nav style={{ "float": "left", "width": "20%", "paddingTop": "15px" }}> Type </nav>


                        <nav style={{ "float": "right", "width": "75%" }}>
                            <Autocomplete
                                disablePortal
                                name="event_dialog_type"
                                id="event_dialog_type"
                                value={p_detail_event_type}
                                fullWidth
                                options={New_Option_Type_Event}
                                onChange={(event, value) => {
                                    if (String(props.write_access) === "1") {

                                        if (value && value.value) {
                                            setp_detail_event_type(value.value);

                                        }
                                    }

                                }}

                                renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
                                    inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}

                                />
                                }
                            />


                        </nav>
                    </div>


                    <div className="session_caract_Dialog" > Titre
                        <TextField
                            sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}

                            name="event_dialog_title"
                            id="event_dialog_title"


                            fullWidth

                            value={p_detail_title}
                            onChange={(e) => {
                                if (String(props.write_access) === "1" && String(p_detail_sequence_session_id) === "")
                                    setp_detail_title(e.target.value);
                            }
                            }

                        />

                    </div>

                    <div className="session_caract_Dialog" > Debut
                        <DatePicker
                            name="event_dialog_start"
                            id="event_dialog_start"
                            selected={startDate}
                            onChange={(date) => {
                                if (String(props.write_access) === "1" && String(p_detail_sequence_session_id) === "")
                                    return setStartDate(date);
                            }
                            }


                            className="disabled_style session_caract_Dialog_DatePicker"
                            locale='fr-FR'
                            showTimeSelect
                            timeFormat="HH:mm"
                            timeIntervals={15}
                            dateFormat="dd/MM/yyyy HH:mm"
                            is24Hour

                        />

                    </div>


                    <div className="session_caract_Dialog" > Fin
                        <DatePicker
                            name="event_dialog_end"
                            id="event_dialog_end"
                            selected={endDate}

                            onChange={(date) => {
                                if (String(props.write_access) === "1" && String(p_detail_sequence_session_id) === "")
                                    return setendDate(date);
                            }
                            }


                            className="disabled_style session_caract_Dialog_DatePicker"
                            locale='fr-FR'
                            showTimeSelect
                            timeFormat="HH:mm"
                            timeIntervals={15}
                            dateFormat="dd/MM/yyyy HH:mm"
                            is24Hour

                        />

                    </div>

                    <div className="session_caract_Dialog_comment_2_lines" > Commentaire
                        <TextField
                            sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}

                            name="event_dialog_comment"
                            id="event_dialog_comment"

                            fullWidth

                            value={p_detail_comment}
                            onChange={(e) => {

                                // console.log(" dans comment  p_detail_sequence_session_id = ", p_detail_sequence_session_id);
                                if (String(props.write_access) === "1" && String(p_detail_sequence_session_id) === "")
                                    setp_detail_comment(e.target.value);
                            }
                            }
                            multiline
                            minRows={2}
                            maxRows={2}
                            rows={2}

                        />

                    </div>


                </DialogContent>



                <DialogActions>

                    <IconButton
                        autoFocus
                        onClick={Close_Dialog_Detail_Event_open}
                        color="primary"
                        className={classes.customizedButton}
                    >
                        <CancelPresentationIcon />
                    </IconButton>

                    <div className="div_row">
                        {String(props.write_access) === "1" && String(p_detail_sequence_session_id) === "" && <div className="div_row_gauche">
                            {p_detail_event_id && String(p_detail_event_id) !== "" && <Button onClick={Update_One_Agenda_Event} className="bton_enreg_dialog">Mettre à jour</Button>}
                            {(!p_detail_event_id || String(p_detail_event_id) === "") && <Button onClick={Update_One_Agenda_Event} className="bton_enreg_dialog">Ajouter</Button>}



                        </div>}
                        <div className="div_row_droite" style={{ "textAlign": 'center' }}>
                            <Button onClick={Close_Dialog_Detail_Event_open} className="bton_annule_dialog" >Fermer</Button>
                        </div>
                    </div>

                </DialogActions>


                {String(props.write_access) === "1" && String(p_detail_sequence_session_id) === "" && p_detail_event_id && String(p_detail_event_id) !== "" &&
                    <DialogActions>
                        <div className="div_row" style={{ "textAlign": "center" }}>
                            <Button onClick={(e) => {
                                const response = window.confirm("Confirmez-vous la suppression de l'événement ?");
                                if (!response) {
                                    return;
                                }
                                Delete_One_Agenda_Event();
                            }
                            } className="bton_supprime_dialog">Supprimer l'événement</Button>
                        </div>


                    </DialogActions>}

            </Dialog>
            {/*** FIn Dialog detail eventement */}



            <h3 style={{ fontFamily: 'DM Sans' }}> Les jurys </h3>

            <div className="div_row">
                <div className="titre1">  Utilisez les filtres !</div>
                <div className="div_row" style={{ "marginBottom": "5px" }}>
                    <div className="div_row_gauche texte_area_filter" >

                        {New_Option_Filter && New_Option_Filter.length > 0 && <Autocomplete
                            disablePortal
                            name="filtre1"
                            id="filtre1"
                            className="disabled_style"
                            value={New_Option_Filter.filter((data) => (data).value === String(p_filtre1))[0].label}
                            options={New_Option_Filter}
                            onChange={(event, value) => {
                                if (value && value.value) {
                                    setp_filtre1(value.value);

                                }

                            }}

                            renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
                                inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}

                            />
                            }
                        />}


                    </div>



                    <div className="div_row_droite texte_area_filter_value" >
                        {p_filtre1 &&
                            <TextField
                                sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                required
                                name="filtre1_value"
                                id="filtre1_value"

                                InputLabelProps={{
                                    shrink: true,
                                }}
                                disabled={false}
                                className="disabled_style"
                                value={p_filtre1_value}
                                onChange={(e) => { setp_filtre1_value(e.target.value); }}
                                InputProps={{
                                    endAdornment: (
                                        <InputAdornment position="end">
                                            <AiFillCloseCircle
                                                style={{ 'cursor': "pointer", "color": "orangered" }}
                                                onClick={(e) => {
                                                    setp_filtre1_value("");
                                                }} />
                                        </InputAdornment>
                                    ),
                                }}

                            />

                        }
                    </div>
                    {p_filtre1 && <div className='filter_bton_add'>
                        <Tooltip className="tooltip_css" id="my-tooltip01" style={{ "fontSize": "12px" }} />
                        <a data-tooltip-id="my-tooltip01" data-tooltip-html="Ajouter une nouvelle ligne de filtre">
                            &nbsp; <MdAddCircleOutline onClick={(e) => {
                                setp_filtre2("1");
                                setp_filtre2_value("");
                            }} />
                        </a>
                    </div>}
                    {p_filtre1 && <div className='filter_bton_add'>
                        <Tooltip className="tooltip_css" id="my-tooltip02" style={{ "fontSize": "12px" }} />
                        <a data-tooltip-id="my-tooltip02" data-tooltip-html="Supprimer cette ligne de filtre">
                            &nbsp; <MdRemoveCircleOutline onClick={(e) => {
                                setp_filtre1("");
                                setp_filtre1_value("");
                            }}
                            />
                        </a>
                    </div>}


                </div>

                {p_filtre2 &&
                    <div className="div_row" style={{ "marginBottom": "5px" }}>
                        <div className="div_row_gauche texte_area_filter">

                            {New_Option_Filter && New_Option_Filter.length > 0 && <Autocomplete
                                disablePortal
                                name="filtre2"
                                id="filtre2"
                                className="disabled_style"
                                value={New_Option_Filter.filter((data) => (data).value === String(p_filtre2))[0].label}
                                options={New_Option_Filter}
                                onChange={(event, value) => {
                                    if (value && value.value) {
                                        setp_filtre2(value.value);

                                    }

                                }}

                                renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
                                    inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}

                                />
                                }
                            />}

                        </div>
                        <div className="div_row_droite texte_area_filter_value" style={{ "marginTop": "0.5rem" }}>
                            {String(p_filtre2).length > 2 &&
                                <TextField
                                    sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                    required
                                    name="filtre2_value"
                                    id="filtre2_value"

                                    InputLabelProps={{
                                        shrink: true,
                                    }}
                                    disabled={false}
                                    className="disabled_style"
                                    value={p_filtre2_value}
                                    onChange={(e) => setp_filtre2_value(e.target.value)}
                                    InputProps={{
                                        endAdornment: (
                                            <InputAdornment position="end">
                                                <AiFillCloseCircle
                                                    style={{ 'cursor': "pointer", "color": "orangered" }}
                                                    onClick={(e) => {
                                                        setp_filtre2_value("");
                                                    }} />
                                            </InputAdornment>
                                        ),
                                    }}

                                />}
                        </div>

                        {String(p_filtre2).length > 2 && <div className='filter_bton_add' >
                            <Tooltip className="tooltip_css" id="my-tooltip03" style={{ "fontSize": "12px" }} />
                            <a data-tooltip-id="my-tooltip03" data-tooltip-html="Ajouter une nouvelle ligne de filtre">
                                &nbsp; <MdAddCircleOutline
                                    onClick={(e) => {
                                        setp_filtre3("1");
                                        setp_filtre3_value("");
                                    }}
                                />
                            </a>
                        </div>}

                        {String(p_filtre2).length > 2 && <div className='filter_bton_add'>
                            <Tooltip className="tooltip_css" id="my-tooltip04" style={{ "fontSize": "12px" }} />
                            <a data-tooltip-id="my-tooltip04" data-tooltip-html="Supprimer cette ligne de filtre">
                                &nbsp; <MdRemoveCircleOutline
                                    onClick={(e) => {
                                        setp_filtre2("");
                                        setp_filtre2_value("");
                                    }}
                                />
                            </a>
                        </div>}

                    </div>
                }


                {p_filtre3 &&
                    <div className="div_row" style={{ "marginBottom": "5px" }}>
                        <div className="div_row_gauche texte_area_filter">

                            {New_Option_Filter && New_Option_Filter.length > 0 && <Autocomplete
                                disablePortal
                                name="filtre3"
                                id="filtre3"
                                className="disabled_style"
                                value={New_Option_Filter.filter((data) => (data).value === String(p_filtre3))[0].label}
                                options={New_Option_Filter}
                                onChange={(event, value) => {
                                    if (value && value.value) {
                                        setp_filtre3(value.value);

                                    }

                                }}

                                renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
                                    inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}

                                />
                                }
                            />}


                        </div>
                        <div className="div_row_droite texte_area_filter_value" style={{ "marginTop": "0.5rem" }}>
                            {String(p_filtre3).length > 2 &&
                                <TextField
                                    sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                    required
                                    name="filtre3_value"
                                    id="filtre3_value"

                                    InputLabelProps={{
                                        shrink: true,
                                    }}
                                    disabled={false}
                                    className="disabled_style"
                                    value={p_filtre3_value}
                                    onChange={(e) => setp_filtre3_value(e.target.value)}
                                    InputProps={{
                                        endAdornment: (
                                            <InputAdornment position="end">
                                                <AiFillCloseCircle
                                                    style={{ 'cursor': "pointer", "color": "orangered" }}
                                                    onClick={(e) => {
                                                        setp_filtre3_value("");
                                                    }} />
                                            </InputAdornment>
                                        ),
                                    }}

                                />}
                        </div>

                        {String(p_filtre2).length > 2 && <div className='filter_bton_add' >
                            <Tooltip className="tooltip_css" id="my-tooltip03" style={{ "fontSize": "12px" }} />
                            <a data-tooltip-id="my-tooltip03" data-tooltip-html="Ajouter une nouvelle ligne de filtre">
                                &nbsp; <MdAddCircleOutline
                                    onClick={(e) => {
                                        setp_filtre4("1");
                                        setp_filtre4_value("");
                                    }}
                                />
                            </a>
                        </div>}

                        {String(p_filtre3).length > 2 && <div className='filter_bton_add'>
                            <Tooltip className="tooltip_css" id="my-tooltip05" style={{ "fontSize": "12px" }} />
                            <a data-tooltip-id="my-tooltip05" data-tooltip-html="Supprimer cette ligne de filtre">
                                &nbsp; <MdRemoveCircleOutline onClick={(e) => {
                                    setp_filtre3("");
                                    setp_filtre3_value("");
                                }} />
                            </a>
                        </div>}
                    </div>
                }


                <div className="div_row" ref={myRef_head} id="myRef_head" style={{ "border": "None", "color": "orange", "textAlign": "center" }}>

                    <div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>
                        <Button variant="contained" className="bton_enreg" onClick={Getall_Partner_Jury_With_Filter}>Rechercher
                        </Button>
                    </div>

                    <div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }}>
                        <Button variant="contained" className="bton_annule" onClick={clean_all_filters}>Annuler
                        </Button>

                    </div>

                </div>

                <br />
            </div>

            <div className="div_row" style={{ paddingRight: '10px' }}>

                <div className="session_data">
                    <div style={{ "border": "None" }}>

                        <div style={{ height: 550, width: '100%', paddingRight: '5px' }}>

                            &nbsp;
                            <Box
                                sx={{
                                    height: 500,
                                    width: '100%',
                                    paddingRight: '1px',

                                    // Gestion des cellule a distance ou presentiel
                                    '& .cell--distantiel': {
                                        backgroundColor: '#AFE1AF',
                                        color: 'black',
                                    },

                                    '& .cell--presentiel': {
                                        backgroundColor: '#AFE1AF',
                                        color: 'black',
                                    },


                                   

                                    "& .MuiDataGrid-columnHeaders": {
                                        backgroundColor: "#c8cfd5",
                                        color: "black",
                                        fontSize: 14
                                    },

                                    '& .line--statut--selected': {
                                        backgroundColor: '#FBF2EF',
                                        color: 'black',
                                    },
                                    '& .line--statut--pair': {
                                        backgroundColor: 'rgba(235, 235, 235, .7)',
                                        color: 'black',
                                    },
                                    '& .line--statut--impair': {
                                        backgroundColor: '#FFFFFF',
                                        color: 'black',
                                    },
                                    [`& .${gridClasses.cell}`]: {
                                        py: 1,
                                    },


                                }}
                            >
                                <DataGrid
                                    checkboxSelection
                                    disableSelectionOnClick

                                    components={{
                                        Toolbar: CustomToolbar
                                    }}
                                    componentsProps={{ toolbar: { data_colums: columns_jury } }}

                                    onSelectionModelChange={(newSelectionModel) => {
                                        setselectionModel_columns_jury(newSelectionModel);
                                        /*if (newSelectionModel.length === 1)
                                            handleClick_edit_employee_From_Line(newSelectionModel);*/
                                        if (newSelectionModel.length !== 1) {
                                            /*  setsubmenu();
                                              setdisplay_detail_employe();
                                              setadd_One_Employee();*/
                                        }
                                    }}
                                    selectionModel={selectionModel_columns_jury}

                                    localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
                                    rows={Getall_Partner_Jury_result.map((item, index) => (
                                        {
                                            id: index,
                                            _id: JSON.parse(item)._id,
                                            session_id: JSON.parse(item).session_id,
                                            chef_jury_id: JSON.parse(item).chef_jury_id,
                                            code: JSON.parse(item).code,
                                            email_jury: JSON.parse(item).email_jury,
                                            description: JSON.parse(item).description,
                                            chef_jury_nom_prenom: JSON.parse(item).chef_jury_nom_prenom,
                                            nb_membre: JSON.parse(item).nb_membre,
                                            ue_id: JSON.parse(item).ue_id,
                                            cible: JSON.parse(item).cible,
                                            code_session: JSON.parse(item).code_session,
                                            ue_code: JSON.parse(item).ue_code,
                                        }
                                    ))}

                                    columns={columns_jury}
                                    pageSize={10}
                                    className="datagridclass"

                                    onRowDoubleClick={(newSelectionModel) => {
                                        setsoutenance_data_edit_mode("");
                                        setsoutenance_display("");
                                        setsoutenance_data_changed("");
                                        setsubmenu_detail_seance("");
                                        setselected_jury_cible("")
                                        settab_selected_apprenant([]);
                                        setselectionModel_columns_jury_membre([]);
                                        setactionmass_jury_membre_val("");

                                        Get_List_UE_From_Session_Id(newSelectionModel.row.session_id);

                                        setselected_id(newSelectionModel.row._id);
                                        setgridline_id(newSelectionModel.row.id);
                                        setselected_session_id(newSelectionModel.row.session_id);
                                        setselected_ue_id(newSelectionModel.row.ue_id);
                                        setselected_ue_code(newSelectionModel.row.ue_code)
                                        setselected_jury_cible(newSelectionModel.row.cible);

                                        handleClick_edit_jury_From_Line(newSelectionModel.row.id);


                                    }}

                                    rowsPerPageOptions={[10]}

                                    getCellClassName={(params) => {



                                    }}
                                    getRowClassName={(params) => {
                                        // Pour la gestion de la couleur de zone double cliquée
                                        if (String(params.row.id) === String(gridline_id)) {
                                            return 'line--statut--selected';
                                        }
                                        else if (parseInt(String(params.row.id)) % 2 === 0) {
                                            return 'line--statut--pair';
                                        }
                                        else if (parseInt(String(params.row.id)) % 2 !== 0) {
                                            return 'line--statut--impair';
                                        }


                                    }}
                                    getEstimatedRowHeight={() => 200}
                                    getRowHeight={() => "auto"}
                                    sx={{
                                        "& .MuiDataGrid-cellContent": {
                                            minHeight: 50,

                                        }
                                    }}

                                />
                            </Box>
                            <br />

                        </div>

                        <div className="div_row">

                            {selectionModel_columns_jury && selectionModel_columns_jury.length >= 1 && <div className="block_en_mass">
                                <nav >Traitement en masse </nav>
                                &nbsp;
                                <Autocomplete
                                    disablePortal
                                    id="combo-box-demo"
                                    className="block_en_mass_select"

                                    options={New_Option}
                                    onChange={(event, value) => {
                                        if (value && value.value) {
                                            if (String(value.value) === "supprimer"
                                                || String(value.value) === "convocation_jury") {
                                                setactionmass_ftion_val(value.value);
                                            }
                                            else {
                                                setactionmass_ftion_val();
                                            }

                                        }

                                    }}

                                    renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
                                        inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}

                                    />
                                    }
                                />


                                {actionmass_ftion_val && String(actionmass_ftion_val) !== "supprimer" && <nav className='block_en_mass_bton_action'>
                                    <Button className="bton_enreg" style={{ "width": "90%" }} onClick={(event) => {
                                        settab_jury_convocation_membre_pieces_jointes_result([])
                                        setselected_jury_convocation_membre_type("");
                                        setselected_jury_convocation_membre_email_destinataire_prod();
                                        setselected_jury_convocation_membre_email_test();

                                        setDialog_CONVOCATION_JURY_MEMBRE_open(true);
                                    }}>
                                        <FcAcceptDatabase /> Traiter
                                    </Button>

                                </nav>}

                                {actionmass_ftion_val && String(actionmass_ftion_val) === "supprimer" && <nav className='block_en_mass_bton_action'>
                                    <Popup
                                        trigger={<Button className="bton_enreg" style={{ "width": "90%" }}>

                                            <FcAcceptDatabase /> Traiter

                                        </Button>}
                                        modal
                                        nested
                                        position="center center"
                                    >

                                        {close => (
                                            <div>
                                                <button className="gest_close" onClick={close}>
                                                    &times;
                                                </button>
                                                <div className="gest_header"> MySy Information - {actionmass_ftion_val} </div>
                                                <div className="gest_content">
                                                    {' '}
                                                    {String(actionmass_ftion_val) === "supprimer" &&
                                                        <font color="red"> Confirmer la suppression de {selectionModel_columns_jury.length} jury(s).
                                                        </font>}

                                                    {String(actionmass_ftion_val) === "convocation_apprenant" &&
                                                        <font> Envoyer la convocation aux apprenants
                                                        </font>}

                                                    {String(actionmass_ftion_val) === "convocation_jury" &&
                                                        <font> Envoyer la convocation aux membres du jury
                                                        </font>}




                                                </div>
                                                <div className="gest_actions">
                                                    <div style={{ "width": "45%", "float": "left" }}>
                                                        <button className="gest_bton_popup" onClick={(event) => {
                                                            actionmass_ftion_Traitemet();
                                                            close();
                                                        }}> Valider </button>

                                                    </div>
                                                    <div style={{ "width": "45%", "float": "right" }}>
                                                        <button
                                                            className="gest_bton_popup"
                                                            onClick={() => {
                                                                //console.log('modal closed ');
                                                                close();
                                                            }}
                                                        >
                                                            Annuler
                                                        </button>
                                                    </div>
                                                </div>
                                            </div>
                                        )}
                                    </Popup>
                                </nav>
                                }

                            </div>}
                        </div>
                    </div>
                </div>

                <div className="div_row" style={{ "border": "None" }} id="bton_gestion_grp" name="bton_gestion_grp">

                    <div className="div_row_gauche div_row_gauche_etendu" style={{ "textAlign": "left", "paddingLeft": "5px" }}>

                        &nbsp;

                        <Button variant="outlined" onClick={Ajout_1_jury}
                            className="detail_class_submenu bton_add_session"
                            id='menu_import_participant' name='menu_import_participant'>Ajout 1 Jury &nbsp;
                            <IoAddCircleOutline style={{ "fontSize": "x-large", "color": "green" }} />
                        </Button>

                    </div>
                </div>

            </div>

            <div className="div_row" ref={myRef} id="myRef"> &nbsp; </div>

            {
                selected_id && String(selected_id).length > 5 && <div className="div_row">
                    <Button variant="outlined" onClick={submenu_detail} className="detail_class_submenu" id='detail_jury' name='detail_jury'>Détail Jury</Button>
                    <Button variant="outlined" onClick={submenu_membres} className="detail_class_submenu" id='membres' name='membres'>Membres </Button>
                    <Button variant="outlined" onClick={submenu_planning} className="detail_class_submenu" id='planning' name='planning'>Soutenance </Button>
                    <Button variant="outlined" onClick={submenu_piece_jointe} className="detail_class_submenu" id='piece_jointe' name='piece_jointe'>Pièces Jointes  </Button>

                    {String(history_securite_read) === "1" && <Button variant="outlined" onClick={submenu_historique} className="detail_class_submenu" id='historique' name='historique'>Historique   </Button>}

                </div>
            }


            {
                String(submenu) === "detail_jury" && <div>

                    {String(display_jury) === "1" && String(add_one_jury) !== "1" && <div className="div_row session_data">

                        <nav style={{ "border": "None", "fontSize": "22px", "fontWeight": "600", "paddingTop": "10px", "paddingLeft": "5px" }}> Détail Jury </nav>


                        {String(equipe_data_edit_mode) !== "1" && <div>
                            <div class="separator">
                                <nav className="separator_label">
                                    Infos Générales </nav>
                            </div>

                            <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', flexWrap: 'wrap' }}>
                                <div className="session_caract"> <b> Code </b> <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_code"
                                        id="detail_code"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_code}

                                    />

                                </div>

                                <div className="session_caract"> <b> Promotion 1</b> <br />
                                    {New_Getall_TrainingSession_result && New_Getall_TrainingSession_result.length > 0 && <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_session_id"
                                        id="detail_session_id"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={New_Getall_TrainingSession_result.filter((data) => (data)._id === String(selected_session_id))[0].label}

                                    />}

                                </div>


                                <div className="session_caract"> <b> Cible 1</b> <br />
                                    {New_Option_Cible_Jury && New_Option_Cible_Jury.length > 0 && <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_jury_cible"
                                        id="detail_jury_cible"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={New_Option_Cible_Jury.filter((data) => (data).id === String(selected_jury_cible))[0].label}

                                    />}

                                </div>


                                {selected_jury_cible && New_Option_Cible_Jury &&
                                    New_Get_List_UE_From_Session_Id_result && New_Get_List_UE_From_Session_Id_result.length > 0 &&
                                    <div className="session_caract"> <b> Matière </b> <br />

                                        <TextField
                                            sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                            required
                                            name="detail_jury_matiere"
                                            id="detail_jury_matiere"

                                            InputLabelProps={{
                                                shrink: true,
                                            }}
                                            disabled={false}
                                            className="disabled_style"
                                            value={selected_ue_code}
                                        />

                                    </div>}



                                <div className="session_caract"> Description  <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_description"
                                        id="detail_description"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_description}

                                    />

                                </div>

                                <div className="session_caract"> Email Diffusion  <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_email_diffusion"
                                        id="detail_email_diffusion"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_email_jury}

                                    />

                                </div>

                                <div className="session_caract"> <b> Responsable  </b> <br />
                                    {New_Getall_Training_Employee_No_Filter_result && New_Getall_Training_Employee_No_Filter_result.length > 0 &&

                                        <TextField
                                            sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                            required
                                            name="detail_responsable"
                                            id="detail_responsable"

                                            InputLabelProps={{
                                                shrink: true,
                                            }}
                                            disabled={false}
                                            className="disabled_style"
                                            value={New_Getall_Training_Employee_No_Filter_result.filter((data) => (data)._id === String(p_detail_chef_jury_id))[0].label}

                                        />
                                    }

                                </div>




                                <div className="div_row" style={{ "border": "None" }}>
                                    &nbsp;
                                </div>
                            </div>

                            <div class="separator">
                                <nav className="separator_label">
                                    Site & Adresse  </nav>
                            </div>
                            <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', flexWrap: 'wrap' }}>

                                <div className="session_caract"> Salle <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_salle"
                                        id="detail_salle"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_salle}


                                    />

                                </div>


                                {New_Getall_Partner_Site_Formation_result && New_Getall_Partner_Site_Formation_result.length > 0 &&
                                    <div className="session_caract"> Site de formation <br />
                                        <TextField
                                            sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                            required
                                            name="detail_site_formation"
                                            id="detail_site_formation"

                                            InputLabelProps={{
                                                shrink: true,
                                            }}
                                            disabled={false}
                                            className="disabled_style"
                                            value={New_Getall_Partner_Site_Formation_result.filter((data) => (data)._id === String(p_detail_site_formation_id))[0].label}
                                        />
                                    </div>}



                                <div className="session_caract"> Adresse <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_adresse"
                                        id="detail_adresse"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_adresse}

                                    />

                                </div>

                                <div className="session_caract"> Code postal <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_code_postal"
                                        id="detail_code_postal"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_code_postal}

                                    />

                                </div>

                                <div className="session_caract"> Ville <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_ville"
                                        id="detail_ville"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_ville}

                                    />

                                </div>

                                <div className="session_caract"> Pays <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_pays"
                                        id="detail_pays"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_pays}

                                    />

                                </div>




                                <div className="div_row" style={{ "border": "None" }}>
                                    &nbsp;
                                </div>
                            </div>

                        </div>}



                        {String(equipe_data_edit_mode) === "1" && <div>
                            <div class="separator">
                                <nav className="separator_label">
                                    Infos Générales </nav>
                            </div>

                            <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', flexWrap: 'wrap' }}>
                                <div className="session_caract"> <b> Code </b> <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_code"
                                        id="detail_code"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_code}
                                        onChange={(e) => {
                                            setp_detail_code(e.target.value);
                                            setequipe_data_changed("1");

                                        }
                                        }
                                    />

                                </div>

                                {New_Getall_TrainingSession_result && <div className="session_caract"> <b> Promotion 2</b> <br />
                                    <Autocomplete
                                        disablePortal
                                        name="detail_session_id"
                                        id="detail_session_id"
                                        className="disabled_style"

                                        options={New_Getall_TrainingSession_result}
                                        value={New_Getall_TrainingSession_result.filter((data) => (data)._id === String(selected_session_id))[0].label}
                                        onChange={(event, value) => {
                                            if (value && value._id) {
                                                setselected_session_id(value._id);
                                                Get_List_UE_From_Session_Id(value._id);
                                            } else {
                                                setselected_session_id("");
                                                setNew_Get_List_UE_From_Session_Id_result([]);
                                                setGet_List_UE_From_Session_Id_result([])
                                            }

                                            setselected_jury_cible("");

                                        }}

                                        renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
                                            inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}

                                        />
                                        }
                                    />

                                </div>}

                                {New_Option_Cible_Jury && New_Option_Cible_Jury.length > 0 && <div className="session_caract"> <b> Cible 2 </b> <br />
                                    <Autocomplete
                                        disablePortal


                                        name="detail_jury_cible"
                                        id="detail_jury_cible"
                                        className="disabled_style"

                                        options={New_Option_Cible_Jury}
                                        value={New_Option_Cible_Jury.filter((data) => (data).id === String(selected_jury_cible))[0].label}
                                        onChange={(event, value) => {
                                            if (value && value.id) {
                                                setselected_jury_cible(value.id);
                                            } else {
                                                setselected_jury_cible("");
                                            }

                                            setselected_ue_id("");

                                        }}

                                        renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
                                            inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}

                                        />
                                        }
                                    />

                                </div>}


                                {selected_jury_cible && String(selected_jury_cible) === "soutenance" && New_Option_Cible_Jury &&
                                    New_Get_List_UE_From_Session_Id_result && New_Get_List_UE_From_Session_Id_result.length > 0 &&
                                    <div className="session_caract"> <b> Matière</b> <br />
                                        <Autocomplete
                                            disablePortal
                                            id="detail_jury_matiere"
                                            className="disabled_style"

                                            options={New_Get_List_UE_From_Session_Id_result}
                                            value={New_Get_List_UE_From_Session_Id_result.filter((data) => (data)._id === String(selected_ue_id))[0].label}
                                            onChange={(event, value) => {
                                                if (value && value._id) {
                                                    setselected_ue_id(value._id);
                                                } else {
                                                    setselected_ue_id("");
                                                }

                                            }}

                                            renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
                                                inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}

                                            />
                                            }
                                        />

                                    </div>}


                                <div className="session_caract"> Description  <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_description"
                                        id="detail_description"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_description}
                                        onChange={(e) => {
                                            setp_detail_description(e.target.value);
                                            setequipe_data_changed("1");

                                        }
                                        }
                                    />

                                </div>
                                <div className="session_caract"> Email Diffusion  <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_email_diffusion"
                                        id="detail_email_diffusion"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_email_jury}
                                        onChange={(e) => {
                                            setp_detail_email_jury(e.target.value);
                                            setequipe_data_changed("1");

                                        }
                                        }

                                    />

                                </div>

                                <div className="session_caract"> <b> Responsable  </b> <br />
                                    {New_Getall_Training_Employee_No_Filter_result && New_Getall_Training_Employee_No_Filter_result.length > 0 &&

                                        <Autocomplete
                                            disablePortal
                                            name="detail_responsable"
                                            id="detail_responsable"
                                            className="disabled_style"
                                            //className="disabled_style enable_style"
                                            options={New_Getall_Training_Employee_No_Filter_result}
                                            value={New_Getall_Training_Employee_No_Filter_result.filter((data) => (data)._id === String(p_detail_chef_jury_id))[0].label}
                                            onChange={(event, value) => {
                                                if (value && value._id) {
                                                    setp_detail_chef_jury_id(value._id);
                                                } else {
                                                    setp_detail_chef_jury_id("");
                                                }

                                                setequipe_data_changed("1");

                                            }}

                                            renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
                                                inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}

                                            />
                                            }
                                        />

                                    }

                                </div>


                                <div className="div_row" style={{ "border": "None" }}>
                                    &nbsp;
                                </div>

                            </div>

                            <div class="separator">
                                <nav className="separator_label">
                                    Site & Adresse  </nav>
                            </div>
                            <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', flexWrap: 'wrap' }}>

                                <div className="session_caract"> Salle <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_salle"
                                        id="detail_salle"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_salle}
                                        onChange={(e) => {
                                            setp_detail_salle(e.target.value);
                                            setequipe_data_changed("1");

                                        }
                                        }

                                    />

                                </div>

                                {New_Getall_Partner_Site_Formation_result && New_Getall_Partner_Site_Formation_result.length > 0 &&
                                    <div className="session_caract">Site de formation <br />
                                        <Autocomplete
                                            disablePortal
                                            sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 } }}

                                            name="detail_site_formation"
                                            id="detail_site_formation"
                                            className="disabled_style"
                                            options={New_Getall_Partner_Site_Formation_result}
                                            value={New_Getall_Partner_Site_Formation_result.filter((data) => (data)._id === String(p_detail_site_formation_id))[0].label}

                                            onChange={(event, value) => {

                                                if (value && value._id && String(value._id).length > 2) {
                                                    setp_detail_site_formation_id(value._id);
                                                    setp_detail_adresse(value.adr_site);
                                                    setp_detail_code_postal(value.cp_site);
                                                    setp_detail_ville(value.ville_site);
                                                    setp_detail_pays(value.pays_site);

                                                    if (document.getElementsByName("detail_adresse")[0]) {
                                                        document.getElementsByName("detail_adresse")[0].disabled = true;
                                                        document.getElementsByName("detail_adresse")[0].style.backgroundColor = "#ECEFF1";
                                                    }
                                                    if (document.getElementsByName("detail_code_postal")[0]) {
                                                        document.getElementsByName("detail_code_postal")[0].disabled = true;
                                                        document.getElementsByName("detail_code_postal")[0].style.backgroundColor = "#ECEFF1";
                                                    }
                                                    if (document.getElementsByName("detail_ville")[0]) {
                                                        document.getElementsByName("detail_ville")[0].disabled = true;
                                                        document.getElementsByName("detail_ville")[0].style.backgroundColor = "#ECEFF1";
                                                    }

                                                    if (document.getElementsByName("detail_pays")[0]) {
                                                        document.getElementsByName("detail_pays")[0].disabled = true;
                                                        document.getElementsByName("detail_pays")[0].style.backgroundColor = "#ECEFF1";
                                                    }


                                                } else {
                                                    setp_detail_site_formation_id("");
                                                    setp_detail_adresse("");
                                                    setp_detail_code_postal("");
                                                    setp_detail_ville("");
                                                    setp_detail_pays("");

                                                    if (document.getElementsByName("detail_adresse")[0]) {
                                                        document.getElementsByName("detail_adresse")[0].disabled = false;
                                                        document.getElementsByName("detail_adresse")[0].style.backgroundColor = "#FFFFFF";
                                                    }
                                                    if (document.getElementsByName("detail_code_postal")[0]) {
                                                        document.getElementsByName("detail_code_postal")[0].disabled = false;
                                                        document.getElementsByName("detail_code_postal")[0].style.backgroundColor = "#FFFFFF";
                                                    }
                                                    if (document.getElementsByName("detail_ville")[0]) {
                                                        document.getElementsByName("detail_ville")[0].disabled = false;
                                                        document.getElementsByName("detail_ville")[0].style.backgroundColor = "#FFFFFF";
                                                    }

                                                    if (document.getElementsByName("detail_pays")[0]) {
                                                        document.getElementsByName("detail_pays")[0].disabled = false;
                                                        document.getElementsByName("detail_pays")[0].style.backgroundColor = "#FFFFFF";
                                                    }
                                                }

                                            }
                                            }
                                            renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
                                                inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}

                                            />
                                            }
                                        />
                                    </div>}



                                <div className="session_caract"> Adresse <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_adresse"
                                        id="detail_adresse"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_adresse}
                                        onChange={(e) => {
                                            setp_detail_adresse(e.target.value);
                                            setequipe_data_changed("1");

                                        }
                                        }

                                    />

                                </div>

                                <div className="session_caract"> Code postal <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_code_postal"
                                        id="detail_code_postal"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_code_postal}
                                        onChange={(e) => {
                                            setp_detail_code_postal(e.target.value);
                                            setequipe_data_changed("1");

                                        }
                                        }

                                    />

                                </div>

                                <div className="session_caract"> Ville <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_ville"
                                        id="detail_ville"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_ville}
                                        onChange={(e) => {
                                            setp_detail_ville(e.target.value);
                                            setequipe_data_changed("1");

                                        }
                                        }

                                    />

                                </div>

                                <div className="session_caract"> Pays <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_pays"
                                        id="detail_pays"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_pays}
                                        onChange={(e) => {
                                            setp_detail_pays(e.target.value);
                                            setequipe_data_changed("1");

                                        }
                                        }

                                    />

                                </div>




                                <div className="div_row" style={{ "border": "None" }}>
                                    &nbsp;
                                </div>
                            </div>

                        </div>}

                        <div className="div_row" style={{ "border": "None" }}>
                            &nbsp;
                        </div>
                        <div className="div_row" style={{ "border": "None" }}>
                            {String(equipe_data_changed) === "1" && String(equipe_data_edit_mode) === "1" && <div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}>
                                /!\ Pensez à enregistrer les modifications
                            </div>}


                            <div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}>

                                {String(equipe_data_edit_mode) === "1" && <div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>

                                    <Button variant="contained" className="bton_enreg" onClick={Add_Update_Jury_Data}>Enregistrer les modifications
                                    </Button>

                                </div>}

                                {String(equipe_data_edit_mode) === "1" && <div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }} >
                                    <Button variant="contained" className="bton_annule" onClick={Annule_Jury_DetailFields}>Annuler
                                    </Button>
                                </div>}
                            </div>


                            {String(equipe_data_edit_mode) !== "1" && <div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }}>

                                <Button variant="contained" className="bton_edit" onClick={Enable_Jury_DetailFields}>Editer
                                </Button>

                            </div>}
                            <div className="div_row" style={{ "border": "None" }}>
                                &nbsp;
                            </div>
                        </div>
                    </div>}


                    {String(add_one_jury) === "1" && String(display_jury) !== "1" && <div className="div_row session_data">
                        <nav style={{ "border": "None", "fontSize": "22px", "fontWeight": "600", "paddingTop": "10px", "paddingLeft": "5px" }}>  Ajouter un jury </nav>

                        <div>
                            <div class="separator">
                                <nav className="separator_label">
                                    Infos Générales </nav>
                            </div>
                            <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', flexWrap: 'wrap' }}>
                                <div className="session_caract"> <b> Code </b> <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_code"
                                        id="detail_code"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_code}
                                        onChange={(e) => {
                                            setp_detail_code(e.target.value);

                                        }
                                        }
                                    />

                                </div>


                                {New_Getall_TrainingSession_result && <div className="session_caract"> <b> Promotion </b> <br />
                                    <Autocomplete
                                        disablePortal
                                        id="detail_session_id"
                                        className="disabled_style"

                                        options={New_Getall_TrainingSession_result}
                                        value={New_Getall_TrainingSession_result.filter((data) => (data)._id === String(selected_session_id))[0].label}
                                        onChange={(event, value) => {
                                            if (value && value._id) {
                                                setselected_session_id(value._id);
                                                Get_List_UE_From_Session_Id(value._id);
                                            } else {
                                                setselected_session_id("");
                                                setselected_session_id("");
                                                setNew_Get_List_UE_From_Session_Id_result([]);
                                                setGet_List_UE_From_Session_Id_result([])
                                            }
                                            setselected_jury_cible("");

                                        }}

                                        renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
                                            inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}

                                        />
                                        }
                                    />

                                </div>}


                                {New_Option_Cible_Jury && New_Option_Cible_Jury.length > 0 && <div className="session_caract"> <b> Cible </b> <br />
                                    <Autocomplete
                                        disablePortal
                                        id="detail_jury_cible"
                                        className="disabled_style"

                                        options={New_Option_Cible_Jury}
                                        value={New_Option_Cible_Jury.filter((data) => (data).id === String(selected_jury_cible))[0].label}
                                        onChange={(event, value) => {
                                            if (value && value.id) {
                                                setselected_jury_cible(value.id);
                                            } else {
                                                setselected_jury_cible("");
                                            }

                                            setselected_ue_id("");

                                        }}

                                        renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
                                            inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}

                                        />
                                        }
                                    />

                                </div>}



                                {selected_jury_cible && String(selected_jury_cible) === "soutenance" && New_Option_Cible_Jury &&
                                    New_Get_List_UE_From_Session_Id_result && New_Get_List_UE_From_Session_Id_result.length > 0 &&
                                    <div className="session_caract"> <b> Matière </b> <br />
                                        <Autocomplete
                                            disablePortal
                                            id="detail_jury_matiere"
                                            className="disabled_style"

                                            options={New_Get_List_UE_From_Session_Id_result}
                                            value={New_Get_List_UE_From_Session_Id_result.filter((data) => (data)._id === String(selected_ue_id))[0].label}
                                            onChange={(event, value) => {
                                                if (value && value._id) {
                                                    setselected_ue_id(value._id);
                                                } else {
                                                    setselected_ue_id("");
                                                }

                                            }}

                                            renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
                                                inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}

                                            />
                                            }
                                        />

                                    </div>}



                                <div className="session_caract"> Description  <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_description"
                                        id="detail_description"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_description}
                                        onChange={(e) => {
                                            setp_detail_description(e.target.value);

                                        }
                                        }
                                    />

                                </div>

                                <div className="session_caract"> Email Diffusion  <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_email_diffusion"
                                        id="detail_email_diffusion"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_email_jury}
                                        onChange={(e) => {
                                            setp_detail_email_jury(e.target.value);

                                        }
                                        }
                                    />

                                </div>

                                <div className="session_caract"> <b> Responsable  </b> <br />
                                    {New_Getall_Training_Employee_No_Filter_result && New_Getall_Training_Employee_No_Filter_result.length > 0 &&

                                        <Autocomplete
                                            disablePortal
                                            name="detail_responsable"
                                            id="detail_responsable"
                                            className="disabled_style"
                                            //className="disabled_style enable_style"
                                            options={New_Getall_Training_Employee_No_Filter_result}
                                            value={New_Getall_Training_Employee_No_Filter_result.filter((data) => (data)._id === String(p_detail_chef_jury_id))[0].label}
                                            onChange={(event, value) => {
                                                if (value && value._id) {
                                                    setp_detail_chef_jury_id(value._id);
                                                } else {
                                                    setp_detail_chef_jury_id("");
                                                }

                                            }}

                                            renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
                                                inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}

                                            />
                                            }
                                        />

                                    }

                                </div>

                                <div className="div_row" style={{ "border": "None" }}>
                                    &nbsp;
                                </div>

                            </div>
                            <div class="separator">
                                <nav className="separator_label">
                                    Site & Adresse  </nav>
                            </div>

                            <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', flexWrap: 'wrap' }}>

                                <div className="session_caract"> Salle <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_salle"
                                        id="detail_salle"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_salle}
                                        onChange={(e) => {
                                            setp_detail_salle(e.target.value);
                                            setequipe_data_changed("1");

                                        }
                                        }

                                    />

                                </div>

                                {New_Getall_Partner_Site_Formation_result && New_Getall_Partner_Site_Formation_result.length > 0 &&
                                    <div className="session_caract">Site de formation <br />
                                        <Autocomplete
                                            disablePortal
                                            sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 } }}

                                            name="detail_site_formation"
                                            id="detail_site_formation"
                                            className="disabled_style"
                                            options={New_Getall_Partner_Site_Formation_result}
                                            value={New_Getall_Partner_Site_Formation_result.filter((data) => (data)._id === String(p_detail_site_formation_id))[0].label}

                                            onChange={(event, value) => {

                                                if (value && value._id && String(value._id).length > 2) {
                                                    setp_detail_site_formation_id(value._id);
                                                    setp_detail_adresse(value.adr_site);
                                                    setp_detail_code_postal(value.cp_site);
                                                    setp_detail_ville(value.ville_site);
                                                    setp_detail_pays(value.pays_site);

                                                    if (document.getElementsByName("detail_adresse")[0]) {
                                                        document.getElementsByName("detail_adresse")[0].disabled = true;
                                                        document.getElementsByName("detail_adresse")[0].style.backgroundColor = "#ECEFF1";
                                                    }
                                                    if (document.getElementsByName("detail_code_postal")[0]) {
                                                        document.getElementsByName("detail_code_postal")[0].disabled = true;
                                                        document.getElementsByName("detail_code_postal")[0].style.backgroundColor = "#ECEFF1";
                                                    }
                                                    if (document.getElementsByName("detail_ville")[0]) {
                                                        document.getElementsByName("detail_ville")[0].disabled = true;
                                                        document.getElementsByName("detail_ville")[0].style.backgroundColor = "#ECEFF1";
                                                    }

                                                    if (document.getElementsByName("detail_pays")[0]) {
                                                        document.getElementsByName("detail_pays")[0].disabled = true;
                                                        document.getElementsByName("detail_pays")[0].style.backgroundColor = "#ECEFF1";
                                                    }


                                                } else {
                                                    setp_detail_site_formation_id("");
                                                    setp_detail_adresse("");
                                                    setp_detail_code_postal("");
                                                    setp_detail_ville("");
                                                    setp_detail_pays("");

                                                    if (document.getElementsByName("detail_adresse")[0]) {
                                                        document.getElementsByName("detail_adresse")[0].disabled = false;
                                                        document.getElementsByName("detail_adresse")[0].style.backgroundColor = "#FFFFFF";
                                                    }
                                                    if (document.getElementsByName("detail_code_postal")[0]) {
                                                        document.getElementsByName("detail_code_postal")[0].disabled = false;
                                                        document.getElementsByName("detail_code_postal")[0].style.backgroundColor = "#FFFFFF";
                                                    }
                                                    if (document.getElementsByName("detail_ville")[0]) {
                                                        document.getElementsByName("detail_ville")[0].disabled = false;
                                                        document.getElementsByName("detail_ville")[0].style.backgroundColor = "#FFFFFF";
                                                    }

                                                    if (document.getElementsByName("detail_pays")[0]) {
                                                        document.getElementsByName("detail_pays")[0].disabled = false;
                                                        document.getElementsByName("detail_pays")[0].style.backgroundColor = "#FFFFFF";
                                                    }
                                                }

                                            }
                                            }
                                            renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
                                                inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}

                                            />
                                            }
                                        />
                                    </div>}

                                <div className="session_caract"> Adresse <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_adresse"
                                        id="detail_adresse"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_adresse}
                                        onChange={(e) => {
                                            setp_detail_adresse(e.target.value);
                                            setequipe_data_changed("1");

                                        }
                                        }

                                    />

                                </div>

                                <div className="session_caract"> Code postal <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_code_postal"
                                        id="detail_code_postal"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_code_postal}
                                        onChange={(e) => {
                                            setp_detail_code_postal(e.target.value);
                                            setequipe_data_changed("1");
                                        }
                                        }

                                    />

                                </div>

                                <div className="session_caract"> Ville <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_ville"
                                        id="detail_ville"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_ville}
                                        onChange={(e) => {
                                            setp_detail_ville(e.target.value);
                                            setequipe_data_changed("1");
                                        }
                                        }

                                    />

                                </div>

                                <div className="session_caract"> Pays <br />
                                    <TextField
                                        sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
                                        required
                                        name="detail_pays"
                                        id="detail_pays"

                                        InputLabelProps={{
                                            shrink: true,
                                        }}
                                        disabled={false}
                                        className="disabled_style"
                                        value={p_detail_pays}
                                        onChange={(e) => {
                                            setp_detail_pays(e.target.value);
                                            setequipe_data_changed("1");

                                        }
                                        }
                                    />

                                </div>



                                <div className="div_row" style={{ "border": "None" }}>
                                    &nbsp;
                                </div>
                            </div>

                        </div>

                        <div className="div_row" style={{ "border": "None" }}>
                            &nbsp;
                        </div>
                        <div className="div_row" style={{ "border": "None" }}>

                            <div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}>

                                <div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>

                                    <Button variant="contained" className="bton_enreg" onClick={Add_Update_Jury_Data}>Enregistrer
                                    </Button>

                                </div>

                                <div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }} >
                                    <Button variant="contained" className="bton_annule" onClick={Annule_Add_One_Jury_DetailFields} >Annuler
                                    </Button>
                                </div>
                            </div>

                            <div className="div_row" style={{ "border": "None" }}>
                                &nbsp;
                            </div>
                        </div>

                    </div>}

                </div>
            }

            {
                String(submenu) === "membre" && <div className="div_row ">

                    <div className="div_row" style={{ paddingRight: '10px' }}>
                        <div className="session_data">
                            <div style={{ "border": "None" }}>

                                <nav style={{ "border": "None", "fontSize": "20px", "paddingTop": "5px", "paddingLeft": "5px" }}> Membres d'équipe </nav>

                                <div style={{ height: 650, width: '100%', paddingRight: '5px' }}>

                                    &nbsp;
                                    <Box
                                        sx={{
                                            height: 500,
                                            width: '100%',
                                            paddingRight: '1px',



                                            '& .cell--note': {
                                                backgroundColor: '#AFE1AF',
                                                color: 'red',
                                            },

                                            "& .MuiDataGrid-columnHeaders": {
                                                backgroundColor: "#c8cfd5",
                                                color: "black",
                                                fontSize: 14
                                            },

                                            '& .line--statut--selected': {
                                                backgroundColor: '#FBF2EF',
                                                color: 'black',
                                            },
                                            '& .line--statut--pair': {
                                                backgroundColor: 'rgba(235, 235, 235, .7)',
                                                color: 'black',
                                            },
                                            '& .line--statut--impair': {
                                                backgroundColor: '#FFFFFF',
                                                color: 'black',
                                            },

                                            '& .line--statut--noted_changed': {
                                                backgroundColor: '#F8F6B3',
                                                fontStyle: 'italic',
                                            },

                                            [`& .${gridClasses.cell}`]: {
                                                py: 1,
                                            },


                                        }}
                                    >
                                        <DataGrid
                                            //onCellEditCommit={OnchangeCellDataGrid}
                                            components={{
                                                Toolbar: CustomToolbar
                                            }}
                                            componentsProps={{ toolbar: { data_colums: columns_jury_membre } }}

                                            checkboxSelection
                                            disableSelectionOnClick
                                            onSelectionModelChange={(newSelectionModel) => {
                                                setselectionModel_columns_jury_membre(newSelectionModel);
                                                /*if (newSelectionModel.length === 1)
                                                    handleClick_edit_employee_From_Line(newSelectionModel);*/
                                                if (newSelectionModel.length !== 1) {
                                                    /*  setsubmenu();
                                                      setdisplay_detail_employe();
                                                      setadd_One_Employee();*/
                                                }
                                            }}
                                            selectionModel={selectionModel_columns_jury_membre}

                                            localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
                                            rows={New_Getall_Jury_Members.map((item, index) => (
                                                {
                                                    id: index,
                                                    _id: (item)._id,
                                                    nom: (item).nom,
                                                    prenom: (item).prenom,
                                                    email: (item).email,
                                                    comment: (item).comment,
                                                    civilite: (item).civilite,
                                                    leader: (item).leader,
                                                    role: (item).role,

                                                }
                                            ))}

                                            columns={columns_jury_membre}
                                            pageSize={10}
                                            className="datagridclass"

                                            onRowDoubleClick={(newSelectionModel) => {
                                                /* setselected_id(newSelectionModel.row._id);
                    
                                                 setgridline_id(newSelectionModel.row.id);
                    
                                                 handleClick_edit_evaluation_From_Line(newSelectionModel.row.id);
                                                 */


                                            }}

                                            rowsPerPageOptions={[10]}


                                            getCellClassName={(params) => {

                                                // Traitement de la cellule 'notes' 
                                                if (String(params.field) === "note") {
                                                    return 'cell--note';
                                                }

                                            }}

                                            getRowClassName={(params) => {
                                                // Pour la gestion de la couleur de zone double cliquée


                                                if (String(params.row.id) === String(gridline_jury_member_id)) {
                                                    return 'line--statut--selected';
                                                }
                                                else if (parseInt(String(params.row.id)) % 2 === 0) {
                                                    return 'line--statut--pair';
                                                }
                                                else if (parseInt(String(params.row.id)) % 2 !== 0) {
                                                    return 'line--statut--impair';
                                                }


                                            }}
                                            getEstimatedRowHeight={() => 200}
                                            getRowHeight={() => "auto"}
                                            sx={{
                                                "& .MuiDataGrid-cellContent": {
                                                    minHeight: 50,

                                                }
                                            }}

                                        />
                                    </Box>
                                    {selectionModel_columns_jury_membre && selectionModel_columns_jury_membre.length >= 1 &&
                                        <div className="div_row" style={{ "border": "none", "marginLeft": "10px" }}>
                                            <div className="block_en_mass">
                                                <nav className='traitement_mass'>Traitement en masse</nav>
                                                &nbsp;

                                                <Autocomplete
                                                    disablePortal
                                                    id="combo-box-demo"
                                                    className="block_en_mass_select"
                                                    fullWidth
                                                    options={New_Option_jury_membre}
                                                    onChange={(event, value) => {
                                                        if (value && value.value) {
                                                            if (String(value.value) === "delete_jury_membre") {
                                                                setactionmass_jury_membre_val(value.value);
                                                            }
                                                            else {
                                                                setactionmass_jury_membre_val("");
                                                            }
                                                        }
                                                        else {
                                                            setactionmass_jury_membre_val("");
                                                        }

                                                    }}

                                                    renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
                                                        inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}

                                                    />
                                                    }
                                                />
                                                &nbsp;


                                                {actionmass_jury_membre_val && String(actionmass_jury_membre_val).length > 1 && <nav className='block_en_mass_bton_action'>
                                                    <Popup
                                                        trigger={<Button className="bton_enreg" style={{ "width": "90%" }}>
                                                            <FcAcceptDatabase /> Traiter

                                                        </Button>}
                                                        modal
                                                        nested
                                                        position="center center"
                                                    >

                                                        {close => (
                                                            <div>
                                                                <button className="gest_close" onClick={close}>
                                                                    &times;
                                                                </button>
                                                                <div className="gest_header"> MySy Information </div>
                                                                <div className="gest_content">
                                                                    {' '}
                                                                    {String(actionmass_jury_membre_val) === "delete_jury_membre" &&
                                                                        <font>  Confirmer la <b> supprression des membres </b> en masse pour {selectionModel_columns_jury_membre.length} ligne(s).
                                                                        </font>}


                                                                </div>
                                                                <div className="gest_actions">
                                                                    <div style={{ "width": "45%", "float": "left" }}>
                                                                        <button className="gest_bton_popup" onClick={(event) => {
                                                                            actionmass_jury_membre_Traitemet();
                                                                            close();
                                                                        }}> Valider </button>

                                                                    </div>
                                                                    <div style={{ "width": "45%", "float": "right" }}>
                                                                        <button
                                                                            className="gest_bton_popup"
                                                                            onClick={() => {
                                                                                //console.log('modal closed ');
                                                                                close();
                                                                            }}
                                                                        >
                                                                            Annuler
                                                                        </button>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        )}
                                                    </Popup>
                                                </nav>
                                                }
                                                <br />

                                            </div>

                                        </div>}
                                    <br />


                                </div>



                                <div className="div_row"> &nbsp; </div>

                                <div className="div_row" style={{ "border": "None" }} id="bton_gestion_grp" name="bton_gestion_grp">

                                    <div className="div_row_gauche div_row_gauche_etendu" style={{ "textAlign": "left", "paddingLeft": "5px" }}>

                                        &nbsp;

                                        <Button variant="outlined" onClick={(event) => {
                                            setDialog_Jury_Membre_open(true);
                                        }}

                                            className="detail_class_submenu bton_add_session"
                                            id='menu_import_participant' name='menu_import_participant'>Ajout Membre(s) &nbsp;
                                            <IoAddCircleOutline style={{ "fontSize": "x-large", "color": "green" }} />
                                        </Button>

                                    </div>
                                </div>

                            </div>
                        </div>


                    </div>


                </div>
            }


            {
                String(submenu) === "piece_jointe" && <div className="div_row ">
                    <div className="div_row session_data">
                        <div className="div_row" style={{ "padding": "5px", 'paddingTop': '15px' }}>

                            <div style={{ "fontSize": "12px" }}>
                                <label htmlFor="upload-photo">
                                    <input
                                        style={{ display: "none" }}
                                        id="upload-photo"
                                        name="upload-photo"
                                        type="file"
                                        onChange={sessions_file_change_1}
                                    />

                                    <Fab
                                        color="secondary"
                                        size="small"
                                        component="span"
                                        aria-label="add"
                                        variant="extended"
                                    >
                                        <IoMdAddCircle /> <nav style={{ "fontSize": "12px" }}> Ajouter un fichier </nav>
                                    </Fab>

                                </label>
                            </div>
                            {file_1_name && file_1_name.name &&
                                <nav style={{ "fontSize": "12px" }}>
                                    <div className="session_caract">Nom du fichier <br />
                                        <TextField
                                            name="file_to_download_type_name"
                                            id="file_to_download_type_name"

                                            InputLabelProps={{
                                                shrink: true,
                                            }}

                                            disabled={false}
                                            className="disabled_style enable_style"
                                            value={p_detail_one_file_to_download_type_name}
                                            onChange={(e) => {
                                                setp_detail_one_file_to_download_type_name(e.target.value);

                                            }}
                                        />

                                    </div>
                                    <br />
                                    <br />
                                    Fichier : {file_1_name.name} <br /> <font style={{ "cursor": "pointer" }}
                                        onClick={Delete_file_1_name}>  Supprimer <IoIosRemoveCircleOutline />  </font>
                                </nav>}

                            {Record_All_PJ_api && String(Record_All_PJ_api) === "true" && <div className="okUpdateData"> Pièce jointe enregistrée </div>}

                            {Record_All_PJ_api && String(Record_All_PJ_api) === "false" && <div className="koUpdateData"> {Record_All_PJ_message} </div>}


                        </div>



                        {file_1_name && file_1_name.name && <div className="div_row">

                            <div className="div_row_gauche">
                                <Button variant="contained" onClick={Record_All_PJ}
                                    startIcon={<AiTwotoneSave />} className="bton_enreg">ENREGISTRER LA PIECE</Button>
                            </div>



                        </div>}

                        {Get_List_Of_All_PJ_result && <div className="div_row" style={{ "padding": "5px" }}>
                            <div className="div_row">
                                <b> Liste des pièces jointes </b> <br />
                                <div className="div_row">
                                    {Get_List_Of_All_PJ_result && Get_List_Of_All_PJ_result.map((val) => (
                                        <div className="div_row_list_pj"  >
                                            <nav name={(JSON.parse(val).file_name)}
                                                id={(JSON.parse(val).file_name)}> <i> <AttachFileIcon />{(JSON.parse(val).file_business_object)} </i> <br /><font style={{ "color": "green", "cursor": "pointer" }}
                                                    name={(JSON.parse(val).file_name)}
                                                    id={(JSON.parse(val).file_name)} onClick={Download_one_attached_document}>  Télécharger &nbsp;</font></nav>

                                            <Popup
                                                trigger={
                                                    <nav style={{ "color": "red", "cursor": "pointer" }}  > Supprimer</nav>


                                                }
                                                modal
                                                nested
                                                position="center center"
                                            >
                                                {close => (
                                                    <div>
                                                        <button className="gest_close" onClick={close}>
                                                            &times;
                                                        </button>
                                                        <div className="gest_header"> MySy Information </div>
                                                        <div className="gest_content">
                                                            {' '}

                                                            En confirmant cette opération, la pièce jointe sera <i><font color="red"> définitivement supprimée</font></i>. <br />


                                                        </div>
                                                        <div className="gest_actions">
                                                            <div style={{ "width": "45%", "float": "left" }}>
                                                                <button className="gest_bton_popup" onClick={(event) => {

                                                                    Delete_one_attached_document(event);
                                                                    close();
                                                                }}
                                                                    name={(JSON.parse(val).file_name)} id={(JSON.parse(val).file_name)}
                                                                > Valider </button>

                                                            </div>
                                                            <div style={{ "width": "45%", "float": "right" }}>
                                                                <button
                                                                    className="gest_bton_popup"
                                                                    onClick={() => {
                                                                        //console.log('modal closed ');
                                                                        close();
                                                                    }}
                                                                >
                                                                    Annuler
                                                                </button>
                                                            </div>
                                                        </div>
                                                    </div>
                                                )}
                                            </Popup>

                                        </div>
                                    ))}
                                </div>
                            </div>
                        </div>}
                    </div>
                    <div className="div_row" style={{ "border": "None" }}>
                        &nbsp;
                    </div>
                </div>
            }


            {
                String(submenu) === "historique" && <div className="div_row ">
                    <Module_Historique_Action related_collection="jury"
                        related_collection_recid={selected_id}
                        read_access={props.read_access}
                        write_access={props.write_access} />
                </div>
            }


            {
                String(submenu) === "planning" && <div className="div_row ">
                    <nav style={{ "border": "None", "fontSize": "22px", "fontWeight": "600" }}> Soutenances</nav>

                    <div style={{ "textAlign": "right", "float": "right", "width": "98%", "marginRight": "15px", paddingRight: '20px' }}>
                        Affichage : <nav className="mode_affichage" onClick={func_display_planning_view}> <FcPlanner /> planning </nav>
                        <nav className="mode_affichage" onClick={func_display_list_view}> <CiBoxList /> Liste </nav>
                    </div>

                    {String(display_view) === "planning" && <div style={{ "width": "98%", "marginLeft": "5px" }}>
                        &nbsp;

                        <FullCalendar
                            locales={allLocales}
                            locale={'fr'}
                            editable
                            selectable
                            contentHeight='auto'
                            //events={events}
                            events={mysy_events}

                            select={handleSelect_V2}
                            headerToolbar={{
                                start: "today prev next",
                                center: "title",
                                end: "dayGridMonth,timeGridWeek,timeGridDay",
                            }}
                            //eventContent={(info) => <EventItem info={info} />}
                            //plugins={[timeGridPlugin]}
                            plugins={[timeGridPlugin, daygridPlugin, interactionPlugin,]}
                            views={["dayGridMonth", "dayGridWeek", "dayGridDay"]}
                            slotMinTime={Partner_Debut_Journee}
                            slotMaxTime={Partner_Fin_Journee}
                            scrollTime='08:00'
                            displayEventEnd={true}
                            eventContent={renderEventContent}
                            eventClick={handleEventClick}
                            eventColor='#378006'
                        />
                    </div>}

                    {String(display_view) === "list" && <div style={{ "width": "98%", "marginLeft": "5px" }}>
                        &nbsp;

                        <div className="div_row">
                            <div className="session_data">
                                <div style={{ "border": "None" }}>

                                    <div style={{ height: 550, width: '100%', paddingRight: '1px' }}>
                                        &nbsp;
                                        <Box
                                            sx={{
                                                height: 500,
                                                width: '100%',
                                                paddingRight: '1px',

                                                // Gestion des cellule "statut"
                                                '& .cell--status--encours': {
                                                    backgroundColor: '#E6F7C8',
                                                    color: '#1a3e72',
                                                    fontWeight: 'light',
                                                },
                                                '& .cell--status--traite': {
                                                    backgroundColor: '#E6CEAA',
                                                    color: '#F9E79F',
                                                    fontWeight: 'light',
                                                },




                                                /*"& .MuiDataGrid-virtualScrollerRenderZone": {
                                                    "& .MuiDataGrid-row": {
                                                        "&:nth-child(2n)": { backgroundColor: "rgba(235, 235, 235, .7)" }
                                                    }
                                                },*/
                                                "& .MuiDataGrid-columnHeaders": {
                                                    backgroundColor: "#c8cfd5",
                                                    color: "black",
                                                    fontSize: 14
                                                },

                                            }}
                                        >
                                            <DataGrid
                                                disableRowSelectionOnClick
                                                disableSelectionOnClick
                                                checkboxSelection
                                                onSelectionModelChange={(newSelectionModel) => {
                                                    setselectionModel_columns_jury_seance(newSelectionModel);
                                                    /* if (newSelectionModel.length === 1)
                                                         handleClick_edit_config_From_Line(newSelectionModel);
                                                     if (newSelectionModel.length !== 1) {
                                                         setp_detail_config_valeur();
                                                         setp_detail_config_point();
                                                         setConfig_data_changed();
                                                         setconfig_data_edit_mode();
                                                         setdisplay_detail_config();
             
             
                                                     }*/
                                                }}
                                                selectionModel={selectionModel_columns_jury_seance}

                                                localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
                                                rows={mysy_events.map((item, index) => (
                                                    {
                                                        id: index,
                                                        _id: (item)._id,
                                                        event_title: (item).title,
                                                        event_start: (item).start,
                                                        event_end: (item).end,
                                                        jury_soutenance_id: (item).jury_soutenance_id,
                                                        jury_session_id: (item).jury_session_id,
                                                        convocation_apprenant_send: (item).convocation_apprenant_send,
                                                        convocation_apprenant_date_sending: (item).convocation_apprenant_date_sending,
                                                    }

                                                ))}

                                                columns={columns_jury_seance_planning}
                                                pageSize={10}
                                                className="datagridclass"

                                                onRowDoubleClick={(newSelectionModel) => {
                                                    setselected_agenda_id(newSelectionModel.row._id);
                                                    setselected_jury_soutenance_id(newSelectionModel.row.jury_soutenance_id);
                                                    setp_detail_linked_collection_recid(newSelectionModel.row.jury_session_id);
                                                    setsubmenu_detail_seance("display_jury_seance");
                                                    GetCurrentSession(newSelectionModel.row.jury_session_id);

                                                    if (String(selected_jury_cible) === "soutenance") {
                                                        Get_Jury_List_Apprenant_Soutenance(newSelectionModel.row._id, newSelectionModel.row.jury_soutenance_id);
                                                    }

                                                    if (document.getElementById('myRef_note_classemment')) {
                                                        var divh = document.getElementById('myRef_note_classemment').offsetTop;

                                                        window.scrollTo({
                                                            top: divh,
                                                            behavior: "smooth",
                                                        });
                                                    }

                                                }}

                                                rowsPerPageOptions={[10]}
                                                //disableSelectionOnClick
                                                components={{
                                                    Toolbar: GridToolbar,
                                                }}
                                                //sx={datagridSx}
                                                getCellClassName={(params) => {


                                                    //field === "order_header_status"
                                                    if (params.field === "order_header_status" && String(params.value) == "0") {
                                                        return 'cell--status--brouillon';
                                                    }

                                                    if (params.field === "order_header_status" && String(params.value) == "1") {

                                                        return 'cell--status--encours';
                                                    }

                                                    if (params.field === "order_header_status" && String(params.value) == "2") {
                                                        return 'cell--status--traite';
                                                    }

                                                    if (params.field === "order_header_status" && String(params.value) == "3") {
                                                        return 'cell--status--facture';
                                                    }

                                                }}
                                                getRowClassName={(params) => {

                                                    if (String(params.row.status) === "-1") {
                                                        return 'line--statut--annule';
                                                    }
                                                    if (String(params.row.status) === "0") {
                                                        return 'line--statut--preinscrit';
                                                    }
                                                    if (String(params.row.status) === "1") {
                                                        return 'line--statut--inscrit';
                                                    }
                                                }}


                                            />
                                        </Box>
                                        <br />

                                    </div>

                                    <div className="div_row">

                                        {selectionModel_columns_jury_seance && selectionModel_columns_jury_seance.length >= 1 && <div className="block_en_mass">
                                            <nav >Traitement en masse </nav>
                                            &nbsp;
                                            <Autocomplete
                                                disablePortal
                                                id="combo-box-demo"
                                                className="block_en_mass_select"

                                                options={New_Option_Jury_Seance}
                                                onChange={(event, value) => {
                                                    if (value && value.value) {
                                                        if (String(value.value) === "supprimer"
                                                            || String(value.value) === "convocation_apprenant"
                                                        ) {
                                                            setactionmass_jury_seance(value.value);
                                                        }
                                                        else {
                                                            setactionmass_jury_seance();
                                                        }

                                                    }

                                                }}

                                                renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
                                                    inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}

                                                />
                                                }
                                            />


                                            {actionmass_jury_seance && String(actionmass_jury_seance) === "convocation_apprenant" && <nav className='block_en_mass_bton_action'>
                                                <Button className="bton_enreg" style={{ "width": "90%" }} onClick={(event) => {
                                                    settab_jury_convocation_membre_pieces_jointes_result([])
                                                    setselected_jury_convocation_apprenant_id();
                                                    setselected_jury_convocation_apprenant_type("");
                                                    setselected_jury_convocation_apprenant_email_destinataire_prod();
                                                    setselected_jury_convocation_apprenant_email_test();


                                                    setDialog_CONVOCATION_JURY_APPRENANT_open(true);
                                                }}>
                                                    <FcAcceptDatabase /> Traiter
                                                </Button>

                                            </nav>}

                                            {actionmass_jury_seance && String(actionmass_jury_seance) === "supprimer" && <nav className='block_en_mass_bton_action'>
                                                <Popup
                                                    trigger={<Button className="bton_enreg" style={{ "width": "90%" }}>

                                                        <FcAcceptDatabase /> Traiter

                                                    </Button>}
                                                    modal
                                                    nested
                                                    position="center center"
                                                >

                                                    {close => (
                                                        <div>
                                                            <button className="gest_close" onClick={close}>
                                                                &times;
                                                            </button>
                                                            <div className="gest_header"> MySy Information  </div>
                                                            <div className="gest_content">
                                                                {' '}
                                                                {String(actionmass_ftion_val) === "supprimer" &&
                                                                    <font color="red"> Confirmer la suppression de {selectionModel_columns_jury_seance.length} Soutenance(s).
                                                                    </font>}

                                                                {String(actionmass_ftion_val) === "convocation_apprenant" &&
                                                                    <font> Envoyer la convocation aux apprenants
                                                                    </font>}

                                                            </div>
                                                            <div className="gest_actions">
                                                                <div style={{ "width": "45%", "float": "left" }}>
                                                                    <button className="gest_bton_popup" onClick={(event) => {
                                                                        func_actionmass_jury_seance();
                                                                        close();
                                                                    }}> Valider </button>

                                                                </div>
                                                                <div style={{ "width": "45%", "float": "right" }}>
                                                                    <button
                                                                        className="gest_bton_popup"
                                                                        onClick={() => {
                                                                            //console.log('modal closed ');
                                                                            close();
                                                                        }}
                                                                    >
                                                                        Annuler
                                                                    </button>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    )}
                                                </Popup>
                                            </nav>
                                            }

                                        </div>}
                                    </div>


                                </div>

                            </div>
                            <div className="div_row" style={{ "border": "None" }}>

                                <div className="div_row_gauche div_row_gauche_etendu" style={{ "textAlign": "left", "paddingLeft": "5px" }}>
                                    <Button variant="outlined"
                                        onClick={(event) => {
                                            GetListeInscrit();
                                            setGet_Jury_List_Apprenant_Seance_insc_result([]);
                                            setselected_jury_soutenance_id("new");
                                            setselected_agenda_id("new");
                                            settab_selected_apprenant([]);

                                            setp_detail_soutenance_adresse(p_detail_adresse);
                                            setp_detail_soutenance_code_postal(p_detail_code_postal);
                                            setp_detail_soutenance_ville(p_detail_ville);
                                            setp_detail_soutenance_pays(p_detail_pays);
                                            setp_detail_soutenance_salle(p_detail_salle);

                                            var current_date_add_1h = new Date();
                                            current_date_add_1h.setHours(current_date_add_1h.getHours() + 1);

                                            setStartDate(new Date());
                                            setendDate(current_date_add_1h);

                                            setDialog_Jury_Apprenant_open(true);
                                            // iiii
                                        }}
                                        className="detail_class_submenu bton_add_session"
                                        id='menu_import_participant' name='menu_import_participant'>Ajout 1 Soutenance &nbsp;
                                        <IoAddCircleOutline style={{ "fontSize": "x-large", "color": "green" }} />
                                    </Button>
                                </div>
                            </div>

                        </div>


                    </div>}
                </div>
            }

            {
                String(submenu) === "selection" && <div className="div_row session_data">

                    <Module_Jury_Selection_Apprenants related_target_collection={"groupe_inscription"}
                        related_target_collection_id={selected_id}
                        session_id={p_detail_linked_collection_recid}
                        jury_id={selected_id}
                        class_id={"p_detail_class_id"} />

                </div>
            }

            <div className="div_row" ref={myRef_note_classemment} id="myRef_note_classemment"> &nbsp;</div>
            {
                String(submenu_detail_seance) === String("display_jury_seance") && String(selected_jury_cible) === "examen"
                && GetCurrentSession_result.length > 0 &&
                <div style={{ "border": "None" }}>

                    <Module_Session_Notes_Classement
                        conntected_employee_id={props.conntected_employee_id}
                        related_collection={"session_formation"}
                        related_collection_recid={p_detail_linked_collection_recid}
                        session_class_id={JSON.parse(GetCurrentSession_result).class_id}
                        jury_cell_editable={true}
                        jury_seance_agenda_id={selected_agenda_id}
                        jury_seance_ue_id={selected_ue_id}
                        jury_id={selected_id}
                    />

                </div>
            }


            {
                String(submenu_detail_seance) === String("display_jury_seance") && String(selected_jury_cible) === "soutenance"
                && GetCurrentSession_result.length > 0 &&
                <div style={{ "border": "None", width: '100%' }}>


                    <nav style={{ "border": "None", "fontSize": "22px", "fontWeight": "600" }}> Délibération du Jury</nav>

                    {String(soutenance_data_edit_mode) !== "1" && <div>

                        <div style={{ width: "100%" }}>
                            <b> Sujet 1</b> <br />
                            <TextareaAutosize
                                name="detail_soutenance_sujet"
                                id="detail_soutenance_sujet"
                                aria-label="minimum height"
                                maxRows={10}
                                //placeholder="Minimum 3 rows"
                                style={{
                                    border: "1px solid gainsboro", width: '99%', padding: '2px',
                                    maxHeight: '15rem', height: '10rem', minHeight: '10rem', marginBottom: '3rem'
                                }}
                                value={p_detail_soutenance_sujet}

                            />

                        </div>


                        <div style={{ width: "100%" }}>
                            <b> Observation </b> <br />
                            <TextareaAutosize
                                name="detail_soutenance_observation"
                                id="detail_soutenance_observation"
                                aria-label="minimum height"

                                minRows={3}
                                maxRows={5}
                                //placeholder="Minimum 3 rows"
                                style={{
                                    border: "1px solid gainsboro", width: '99%', padding: '2px',
                                    maxHeight: '15rem', height: '5rem', minHeight: '5rem', marginBottom: '3rem'
                                }}
                                value={p_detail_soutenance_observation}

                            />


                        </div>

                        <div style={{ width: "100%" }}>
                            <b> Note </b> <br />
                            <TextareaAutosize
                                name="detail_soutenance_note"
                                id="detail_soutenance_note"
                                aria-label="minimum height"
                                rows={1}

                                style={{
                                    border: "1px solid gainsboro", width: '99%', padding: '2px',
                                    maxHeight: '3rem', height: '3rem', minHeight: '3rem', marginBottom: '3rem'
                                }}
                                value={p_detail_soutenance_note}

                            />

                        </div>

                    </div>}

                    {String(soutenance_data_edit_mode) === "1" && <div>

                        <div style={{ width: "100%" }}>
                            <b> Sujet </b> <br />
                            <TextareaAutosize
                                name="detail_soutenance_sujet"
                                id="detail_soutenance_sujet"
                                aria-label="minimum height"
                                minRows={3}
                                maxRows={4}
                                //placeholder="Minimum 3 rows"
                                style={{
                                    border: "1px solid gainsboro", width: '99%', padding: '2px',
                                    maxHeight: '15rem', height: '10rem', minHeight: '10rem', marginBottom: '3rem'
                                }}
                                value={p_detail_soutenance_sujet}
                                onChange={(e) => {
                                    setp_detail_soutenance_sujet(e.target.value);

                                }}

                            />


                        </div>


                        <div style={{ width: "100%" }}>
                            <b> Observation </b> <br />
                            <TextareaAutosize
                                name="detail_soutenance_observation"
                                id="detail_soutenance_observation"
                                aria-label="minimum height"
                                minRows={3}
                                maxRows={5}
                                //placeholder="Minimum 3 rows"
                                style={{
                                    border: "1px solid gainsboro", width: '99%', padding: '2px',
                                    maxHeight: '10rem', height: '5rem', minHeight: '5rem', marginBottom: '3rem'
                                }}
                                value={p_detail_soutenance_observation}
                                onChange={(e) => {
                                    setp_detail_soutenance_observation(e.target.value);

                                }}

                            />
                        </div>

                        <div style={{ width: "100%" }}>
                            <b> Note </b> <br />

                            <TextareaAutosize
                                name="detail_soutenance_note"
                                id="detail_soutenance_note"
                                aria-label="minimum height"
                                rows={1}

                                style={{
                                    border: "1px solid gainsboro", width: '99%', padding: '2px',
                                    maxHeight: '3rem', height: '3rem', minHeight: '3rem', marginBottom: '3rem'
                                }}
                                value={p_detail_soutenance_note}
                                onChange={(e) => {
                                    setp_detail_soutenance_note(e.target.value);
                                }}

                            />


                        </div>


                    </div>}


                    <div className="div_row" style={{ "border": "None" }}>
                        &nbsp;
                    </div>
                    {String(soutenance_data_edit_mode) === "1" && <div className="div_row" style={{ "border": "None" }}>

                        <div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}>

                            <div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>

                                <Button variant="contained" className="bton_enreg" onClick={Add_Update_Jury_Soutenance_Data}>Enregistrer
                                </Button>

                            </div>

                            <div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }} >
                                <Button variant="contained" className="bton_annule" onClick={Annule_Jury_Soutenance_DetailFields} >Annuler
                                </Button>
                            </div>
                        </div>

                        <div className="div_row" style={{ "border": "None" }}>
                            &nbsp;
                        </div>
                    </div>}

                    {String(soutenance_data_edit_mode) !== "1" && <div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }}>

                        <Button variant="contained" className="bton_edit" onClick={Enable_Jury_Soutenance_DetailFields}>Editer
                        </Button>

                    </div>}

                </div>
            }
        </div >
    );
}


export default Jury;
