diff options
Diffstat (limited to 'static')
-rw-r--r-- | static/base.html | 24 | ||||
-rw-r--r-- | static/outilspage.js | 25 | ||||
-rw-r--r-- | static/requetes.js | 35 | ||||
-rw-r--r-- | static/style.css | 16 |
4 files changed, 100 insertions, 0 deletions
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 @@ | |||
1 | <!DOCTYPE html> | ||
2 | |||
3 | <html lang="fr"> | ||
4 | <head> | ||
5 | <meta charset="UTF-8" > | ||
6 | <title>Courbe de poids OMS</title> | ||
7 | |||
8 | </head> | ||
9 | |||
10 | <body> | ||
11 | <h1>Courbe de poids OMS</h1> | ||
12 | |||
13 | |||
14 | <div id="content"> | ||
15 | {% block contenu %}{% endblock %} | ||
16 | |||
17 | </div> | ||
18 | |||
19 | <nav><a href="/">Accueil et saisie des données</a> | | ||
20 | <a href="/apropos">À propos</a> | | ||
21 | </nav> | ||
22 | |||
23 | </body> | ||
24 | </html> | ||
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 @@ | |||
1 | // fonctions générales pour la page | ||
2 | |||
3 | function ajoutelignes() | ||
4 | { | ||
5 | // va ajouter 3 lignes au tableau de données | ||
6 | var table = document.getElementById("donneespoids") | ||
7 | var nbligne = table.children[0].childElementCount ; | ||
8 | // les données étant numérotées à partir de 0 on pourra commencer à partir de nbligne -1 | ||
9 | // car il faut éliminer la ligne de header. | ||
10 | |||
11 | var nbajout = 3 ; | ||
12 | for(var i=nbligne-1; i<nbligne+nbajout-1; i++) | ||
13 | { | ||
14 | var ligne = table.insertRow(i+1); | ||
15 | var cellage = ligne.insertCell(0); | ||
16 | var celldate = ligne.insertCell(1); | ||
17 | var cellpoids = ligne.insertCell(2); | ||
18 | |||
19 | cellage.innerHTML = '<input type="text" name="age_'+i+'">' ; | ||
20 | celldate.innerHTML = '<input type="date" name="date_'+i+'">' ; | ||
21 | cellpoids.innerHTML = '<input type="text" name="poids_'+i+'">' ; | ||
22 | |||
23 | } | ||
24 | |||
25 | } | ||
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 @@ | |||
1 | |||
2 | function appelle_image() | ||
3 | { | ||
4 | |||
5 | var formData = new FormData( document.getElementById("donnees_enfant") ); | ||
6 | |||
7 | var requete = new XMLHttpRequest(); | ||
8 | requete.onreadystatechange = function() | ||
9 | { | ||
10 | if (this.readyState == 4 && this.status == 200) { | ||
11 | document.getElementById('courbe').src = 'data:image/png;base64,'+(this.response); | ||
12 | document.getElementById('sectioncourbe').style.display = "block"; | ||
13 | } | ||
14 | } | ||
15 | requete.open("POST","courbe/b64",true) | ||
16 | requete.send(formData) | ||
17 | } | ||
18 | |||
19 | function exporte_donnees() | ||
20 | { | ||
21 | var formData = new FormData( document.getElementById("donnees_enfant") ); | ||
22 | |||
23 | var requete = new XMLHttpRequest(); | ||
24 | requete.onreadystatechange = function() | ||
25 | { | ||
26 | if (this.readyState == 4 && this.status == 200) { | ||
27 | document.getElementById('export').innerHTML = this.responseText; | ||
28 | document.getElementById('sectionexport').style.display = "block"; | ||
29 | } | ||
30 | } | ||
31 | requete.open("POST","export_donnees",true) | ||
32 | requete.send(formData) | ||
33 | |||
34 | |||
35 | } | ||
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 @@ | |||
1 | body { | ||
2 | background-color:#CCCCCC; | ||
3 | } | ||
4 | |||
5 | #sectioncourbe { | ||
6 | display: none; | ||
7 | } | ||
8 | |||
9 | #sectionexport { | ||
10 | display: none; | ||
11 | } | ||
12 | |||
13 | #export { | ||
14 | width: 25em; | ||
15 | height: 20em; | ||
16 | } | ||