import React, {Component} from "react"; import '../Style.css' import {getJson} from "../Request"; /** Page d'accueil de la gestion du semestre */ class Accueil extends Component { constructor(props) { super(props); this.state = { semestre: {}, }; } componentWillMount() { this.getData() } /** * Recupère les données du semestre selectionné depuis l'API */ getData() { let dept = window.location.href.split('/')[7] let sem = window.location.href.split('/')[9] let BASE_URL = window.$api_url getJson(BASE_URL + dept + '/Scolarite/Notes/formsemestre_list?format=json&formsemestre_id=' + sem) .then(res => { this.setState({ semestre: res.data[0]}); }); } render() { return (

{this.state.semestre.titre}
Semestre {this.state.semestre.semestre_id} en {this.state.semestre.modalite}
(Responsable: {this.state.semestre.responsables})

) } } export default Accueil