From 5679dfd03c9761283e3a36d6d09798aaa334e1e9 Mon Sep 17 00:00:00 2001 From: Denise sur Lya Date: Sun, 14 Jun 2020 23:20:48 +0200 Subject: =?UTF-8?q?Cr=C3=A9ation=20du=20d=C3=A9p=C3=B4t,=20site=20=C3=A0?= =?UTF-8?q?=20peu=20pr=C3=A8s=20fonctionnel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/base.html | 24 ++++++++++++++++++++++++ static/outilspage.js | 25 +++++++++++++++++++++++++ static/requetes.js | 35 +++++++++++++++++++++++++++++++++++ static/style.css | 16 ++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 static/base.html create mode 100644 static/outilspage.js create mode 100644 static/requetes.js create mode 100644 static/style.css (limited to 'static') diff --git a/static/base.html b/static/base.html new file mode 100644 index 0000000..287f714 --- /dev/null +++ b/static/base.html @@ -0,0 +1,24 @@ + + + + + + Courbe de poids OMS + + + + +

Courbe de poids OMS

+ + +
+ {% block contenu %}{% endblock %} + +
+ + + + + diff --git a/static/outilspage.js b/static/outilspage.js new file mode 100644 index 0000000..de87963 --- /dev/null +++ b/static/outilspage.js @@ -0,0 +1,25 @@ +// fonctions générales pour la page + +function ajoutelignes() +{ + // va ajouter 3 lignes au tableau de données + var table = document.getElementById("donneespoids") + var nbligne = table.children[0].childElementCount ; + // les données étant numérotées à partir de 0 on pourra commencer à partir de nbligne -1 + // car il faut éliminer la ligne de header. + + var nbajout = 3 ; + for(var i=nbligne-1; i' ; + celldate.innerHTML = '' ; + cellpoids.innerHTML = '' ; + + } + +} diff --git a/static/requetes.js b/static/requetes.js new file mode 100644 index 0000000..41fd850 --- /dev/null +++ b/static/requetes.js @@ -0,0 +1,35 @@ + +function appelle_image() +{ + + var formData = new FormData( document.getElementById("donnees_enfant") ); + + var requete = new XMLHttpRequest(); + requete.onreadystatechange = function() + { + if (this.readyState == 4 && this.status == 200) { + document.getElementById('courbe').src = 'data:image/png;base64,'+(this.response); + document.getElementById('sectioncourbe').style.display = "block"; + } + } + requete.open("POST","courbe/b64",true) + requete.send(formData) +} + +function exporte_donnees() +{ + var formData = new FormData( document.getElementById("donnees_enfant") ); + + var requete = new XMLHttpRequest(); + requete.onreadystatechange = function() + { + if (this.readyState == 4 && this.status == 200) { + document.getElementById('export').innerHTML = this.responseText; + document.getElementById('sectionexport').style.display = "block"; + } + } + requete.open("POST","export_donnees",true) + requete.send(formData) + + +} diff --git a/static/style.css b/static/style.css new file mode 100644 index 0000000..58ddc3b --- /dev/null +++ b/static/style.css @@ -0,0 +1,16 @@ +body { + background-color:#CCCCCC; +} + +#sectioncourbe { + display: none; +} + +#sectionexport { + display: none; +} + +#export { + width: 25em; + height: 20em; +} -- cgit v1.2.3