diff --git a/class/stats.php b/class/stats.php index 91a28dc5f5ef7f53a735f95bd5eb38ce141a8d36..3a480cfa6d700de007c837ab35f2afd232a53bbe 100644 --- a/class/stats.php +++ b/class/stats.php @@ -161,7 +161,7 @@ class Stats LIMIT 5" ); // on prépare notre requête $requete_prepare->execute(); - $ligne = $requete_prepare->fetch(PDO::FETCH_ASSOC); + $ligne = $requete_prepare->fetchAll(PDO::FETCH_ASSOC); return $ligne; } diff --git a/view/stats.php b/view/stats.php index 13642dfe737b7e4635892d969045f8d28a471005..6547cd185ffea12c8d49ad3b489c22e492107314 100644 --- a/view/stats.php +++ b/view/stats.php @@ -103,14 +103,14 @@ <thead> <th>Nom </th> <th>Prenom </th> - <th>Montant de la facture </th> + <th>Nombre de rendez-vous </th> </thead> <tbody> <?php foreach ($stats->top5Veterinaire() as $ligne): ?> <tr> <td><?php echo $ligne["nom"]; ?> </td> <td><?php echo $ligne["prenom"]; ?> </td> - <td><?php echo $ligne["c"]; ?> </td> + <td><?php echo $ligne["count"]; ?> </td> </tr> <?php endforeach; ?> </tbody>