import React, {Component} from "react"; import {Link} from "react-router-dom"; import './Style.css' import ScoNavBar from "./ScoNavBar"; import SearchStudent from './SearchStudent' import {Accordion, Card, Button} from 'react-bootstrap' import {getJson} from "./Request"; /** Page de choix du semestre */ class Scolarite extends Component { constructor(props) { super(props); this.state = { semestres: [], students: [], toast: false }; this.dismissToast = this.dismissToast.bind(this); } componentWillMount() { this.getData() } /** * Recupère la liste des semestres depuis l'API */ getData () { let dept = window.location.href.split('/')[7] let BASE_URL = window.$api_url getJson(BASE_URL + dept + '/Scolarite/Notes/formsemestre_list?format=json') .then(res => { this.setState({ semestres: res.data }); }) } dismissToast = () => this.setState({toast: false}) render() { return (

Scolarité

Semestres en cours
{this.state.semestres.map((sem, index) => { if (sem.etat === "1") { return (

{sem.titre} [{sem.modalite}]

Semestre {sem.semestre_id} - Année {sem.anneescolaire} [{sem.date_debut} - {sem.date_fin}]

) } })}
Semestres passés {this.state.semestres.map((sem, index) => { if (sem.etat !== "1") { return (

{sem.titre} [{sem.modalite}]

Semestre {sem.semestre_id} - Année {sem.anneescolaire} [{sem.date_debut} - {sem.date_fin}]

) } })}
Recherche étudiant
); } } export default Scolarite;