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' class Scolarite extends Component { constructor(props) { super(props); this.state = { semestres: [], students: [], toast: false }; this.dismissToast = this.dismissToast.bind(this); this.getData = this.getData.bind(this); } componentWillMount() { let dept = window.location.href.split('/')[6] let BASE_URL = window.$api_url fetch(BASE_URL + dept + '/Scolarite/Notes/formsemestre_list?format=json', { method: 'GET', verify: false, credentials: 'include', }) .then(response => response.json().then(data => ({ data: data, status: response.status }) ).then(res => { this.setState({ semestres: res.data }); })); } getData () { return this.state.semestres } 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;