43 lines
1.2 KiB
JavaScript
43 lines
1.2 KiB
JavaScript
import React, {Component} from "react";
|
|
import '../Style.css'
|
|
|
|
class Acceuil extends Component {
|
|
constructor(props) {
|
|
super(props);
|
|
this.state = {
|
|
semestre: {},
|
|
students: [],
|
|
};
|
|
}
|
|
|
|
componentWillMount() {
|
|
let dept = window.location.href.split('/')[3]
|
|
let sem = window.location.href.split('/')[5]
|
|
let BASE_URL = window.$api_url
|
|
fetch(BASE_URL + dept +
|
|
'/Scolarite/Notes/formsemestre_list?format=json&formsemestre_id=' + sem, {
|
|
method: 'GET',
|
|
verify: false,
|
|
credentials: 'include',
|
|
})
|
|
.then(response =>
|
|
response.json().then(data => ({
|
|
data: data,
|
|
})
|
|
).then(res => {
|
|
this.setState({ semestre: res.data[0]});
|
|
}));
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<div className="wrapper">
|
|
<h1 id="pageTitle">{this.state.semestre.titre}<br/>
|
|
Semestre {this.state.semestre.semestre_id} en {this.state.semestre.modalite}<br/>
|
|
(Responsable: {this.state.semestre.responsables})</h1>
|
|
</div>
|
|
)
|
|
}
|
|
}
|
|
|
|
export default Acceuil |