Commit be77a7fb authored by Liang Wu's avatar Liang Wu

joli truc

parent 9e5ac5ed
No preview for this file type
<section>
<canvas id="myChart"></canvas>
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0"></script>
<script>
Chart.defaults.global.title.display = true;
Chart.defaults.global.title.text = "Consommation de calories";
</script>
<script>
var ctx = document.getElementById('myChart').getContext('2d');
var chart = new Chart(ctx, {
// The type of chart we want to create
type: 'line',
// The data for our dataset
data: {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [{
label: 'My First dataset',
backgroundColor: 'rgb(255, 99, 132)',
borderColor: 'rgb(255, 99, 132)',
data: [0, 10, 5, 2, 20, 30, 45]
}]
},
// Configuration options go here
options: {}
});
</script>
</section>
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
box-sizing: border-box; box-sizing: border-box;
} }
html { html {
font-family: sans-serif; font-family: sans-serif;
line-height: 1.15; line-height: 1.15;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require_once('template_header.php'); require_once('template_header.php');
require_once('template_menu.php'); require_once('template_menu.php');
$currentPageId='home'; $currentPageId='accueil';
if(isset($_GET['page'])){ if(isset($_GET['page'])){
$currentPageId=$_GET['page']; $currentPageId=$_GET['page'];
} }
...@@ -33,6 +33,7 @@ if(isset($_GET['page'])){ ...@@ -33,6 +33,7 @@ if(isset($_GET['page'])){
</div> </div>
</header> </header>
<?php <?php
renderMenuToHTML($currentPageId); renderMenuToHTML($currentPageId);
?> ?>
......
...@@ -4,17 +4,26 @@ require_once('template_header.php'); ...@@ -4,17 +4,26 @@ require_once('template_header.php');
<main role="main" class="container starter-template"> <main role="main" class="container starter-template">
<div class="row"> <div class="login_style" style="width:400px;
<div class="col"> margin:0 auto;
margin-top:10%;">
<!-- where prompt / messages will appear --> <!-- where prompt / messages will appear -->
<div id="response"></div> <div id="response"></div>
<h1 style="width: 38%;
margin: 0 auto;
padding-bottom: 10px;
text-align:center;">Connexion</h1>
<div> <div>
<form id="login_form" method="POST"> <form id="login_form" style="width:100%;
padding: 30px;
border: 1px solid #f1f1f1;
background: #fff;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);" method="POST">
<table> <table>
<tr> <tr>
<th>Login :</th> <th>Identifiant :</th>
<td><input type="text" id ='login' name="login"></td> <td><input type="text" id ='login' name="login"></td>
</tr> </tr>
<tr> <tr>
...@@ -23,16 +32,11 @@ require_once('template_header.php'); ...@@ -23,16 +32,11 @@ require_once('template_header.php');
</tr> </tr>
<tr> <tr>
<th></th> <th></th>
<td><input type="submit" value="Se connecter..." /></td> <td><input type="submit" value="Se connecter" /></td>
</tr>
<tr>
<a href="signup.php">S'inscrire</a>
</tr> </tr>
</table> </table>
</form> </form>
</div> </div>
</div>
</div> </div>
</main> </main>
...@@ -66,6 +70,7 @@ $(document).ready(function() { ...@@ -66,6 +70,7 @@ $(document).ready(function() {
sessionStorage.setItem('para', ac_log.login); sessionStorage.setItem('para', ac_log.login);
window.location="home.php"; window.location="home.php";
}, },
error: function(xhr, resp, text){ error: function(xhr, resp, text){
// on error, tell the user login has failed & empty the input boxes // on error, tell the user login has failed & empty the input boxes
...@@ -77,3 +82,10 @@ $(document).ready(function() { ...@@ -77,3 +82,10 @@ $(document).ready(function() {
}); });
</script> </script>
</body>
<footer>
<div style="text-align:center">
<a href="signup.php">S'inscrire</a>
</div>
</footer>
<section>
<form id="info_form" action=".php" method="GET">
<table>
<tr>
<th>Login :</th>
<td><input type="text" name="login"></td>
</tr>
<tr>
<th>Tranche d'âge :</th>
<td>
<label> Moins de 40 ans
<input type="radio" name="radioAge" value="<40">
</label><br>
<label> Moins de 50 ans
<input type="radio" name="radioAge" value="<60">
</label><br>
<label> 60 ans et plus
<input type="radio" name="radioAge" value="60+">
</label>
</td>
</tr>
<tr>
<th>Sexe :</th>
<td>
<label> Homme
<input type="radio" name="radioSexe" value="<40">
</label><br>
<label> Femme
<input type="radio" name="radioSexe" value="<60">
</label></td>
</tr>
<tr>
<th>Niveau de pratique sportive :</th>
<td>
<label> Bas
<input type="radio" name="radioSport" value="<40">
</label><br>
<label> Moyen
<input type="radio" name="radioSport" value="<60">
</label><br>
<label> Elevé
<input type="radio" name="radioSport" value="60+">
</label>
</td>
</tr>
<tr>
<td><input type="submit" name="Valider"></td>
</tr>
</table>
</form>
<h2> Nom </h2>
<img src="logo.png" alt="" height="90px" width="150px"/>
</section>
</body>
</html>
\ No newline at end of file
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
table = $('#tbody_info'); table = $('#tbody_info');
table.html(''); table.html('');
table.append('<tr><td>'+data.id+'</td><td>'+data.login+'</td><td>'+data.password+'</td><td>'+data.pseudo+'</td><td>'+data.age+'</td><td>'+data.poids+'</td><td>'+data.taille+'</td><td>'+data.sexe+'</td><td>'+data.niveaudusport+'</td><td>'+data.icalories+'</td></tr>'); table.append('<tr><td>'+data.id+'</td><td>'+data.login+'</td><td>'+data.password+'</td><td>'+data.pseudo+'</td><td>'+data.age+'</td><td>'+data.poids+'</td><td>'+data.taille+'</td><td>'+data.sexe+'</td><td>'+data.niveaudusport+'</td><td>'+data.icalories+'</td></tr>');
sessionStorage.setItem('copieid', data.id);
}); });
}); });
......
...@@ -2,21 +2,26 @@ ...@@ -2,21 +2,26 @@
require_once('template_header.php'); require_once('template_header.php');
?> ?>
<section> <section style="width:400px;
margin:0 auto;
<div><a href="index.php">Se connecter</a></div> ">
</section> <h1 style="width: 38%;
margin: 0 auto;
<section> padding-bottom: 10px;
">Inscription</h1>
<!-- 'create identite' html form --> <!-- 'create identite' html form -->
<form id="form_signup" method="POST" > <form id="form_signup" method="POST" style="width:100%;
padding: 30px;
border: 1px solid #f1f1f1;
background: #fff;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);">
<div> <div>
<label>Login</label> <label>Identifiant</label>
<input type='text' id='login' name='login' class="form-control" required /> <input type='text' id='login' name='login' class="form-control" required />
</div> </div>
<div> <div>
<label>Password</label> <label>Mot de passe</label>
<input type='text' id='password' name='password' class="form-control" required /> <input type='text' id='password' name='password' class="form-control" required />
</div> </div>
...@@ -97,4 +102,10 @@ $(document).ready( function($) { ...@@ -97,4 +102,10 @@ $(document).ready( function($) {
</section> </section>
</body>
<footer>
<div style="text-align:center">
<a href="index.php">Se connecter</a>
</div>
</footer>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// un tableau qui d\'efinit la structure du site // un tableau qui d\'efinit la structure du site
$mymenu = array( $mymenu = array(
// idPage titre // idPage titre
'home' => array( 'Accueil' ), 'accueil' => array( 'Accueil' ),
'profil_affichage' => array( 'Profil' ), 'profil_affichage' => array( 'Profil' ),
'aliments' => array('Aliments'), 'aliments' => array('Aliments'),
'journal' => array('Journal') 'journal' => array('Journal')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment