...
 
Commits (2)
......@@ -51,7 +51,14 @@
else{
for (var i =0; i < racine.length; i++){
$('#personnerow').append(
'<tr><td>'+racine[i].id+'</td><td>'+racine[i].nom+'</td><td>'+racine[i].prenom+'</td><td>'+racine[i].lieu+'</td><td>'+'</td></tr>'
// '<tr><td>'+racine[i].id+'</td><td>'+racine[i].nom+'</td><td>'+racine[i].prenom+'</td><td>'+racine[i].lieu+'</td><td>'+'</td></tr>'
'<tr><td>'+racine[i].id+'</td><td>'+
racine[i].nom+'</td><td>'+
racine[i].prenom+'</td><td>'+
racine[i].lieu+'</td><td>'+
racine[i].heure+'</td><td>'+
racine[i].mac+'</td><td>'+
'</td></tr>'
); // fin append
} // for
} // if
......@@ -251,13 +258,14 @@
<div class="table-responsive">
<table class="table table-striped table-sm">
<thead>
<tr> <th COLSPAN=3></th> <th COLSPAN=2>Inscription</th></tr>
<tr> <th COLSPAN=3></th> <th COLSPAN=3>Inscription</th></tr>
<tr>
<th>#</th>
<th>Nom</th>
<th>Prénom</th>
<th>Lieu</th>
<th>Heure</th>
<th>SafetyBox Mac</th>
</tr>
</thead>
......
......@@ -29,6 +29,10 @@ if ( isset($_POST['action']))
{
getNumPersonne($conn);
}
elseif ($_POST['action'] == "cleanTable")
{
cleanTable($conn);
}
}
......@@ -66,14 +70,20 @@ function getEveryBodyrowtab($conn) {
}
}
echo json_encode($resultats);
// $json = '{"resultat": ['; // Open JSON
// foreach ($conn->query($sql) as $index => $row) {
// if($index != 0){$json.=",";}
// $json.='{"id": "'.$row['id'].'" ,"nom" : "'.$row['nom'].'","prenom" : "'.$row['prenom'].'","desc" : "'.$row['description'].'","lieu" : "'.$row['lieu'].'", "heure" : "'.$row['heure'].'"}';
// }
// $json.=']}';
// echo $json;
}
function cleanTable($conn){
// sql to delete a record
// Clean your sql table
$sql = "DELETE * FROM personne";
// use exec() because no results are returned
$conn->exec($sql);
// echo "Record deleted successfully";
// }
// catch(PDOException $e)
// {
// echo $sql . "<br>" . $e->getMessage();
// }
}
?>