Skip to content
Snippets Groups Projects
Commit af0081dc authored by Matthieu Guffroy's avatar Matthieu Guffroy
Browse files

Merge branch 'master' of gitlab.utc.fr:nf17-camp-p14/clivi

parents 8c322b76 5514c16c
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,19 @@ class Prestation extends Objet
protected $description;
protected $type;
protected $prix;
public $_specialFields = array(
"description" => array(
"i" => 3
),
"type" => array(
"i" => 2
)
"id" => array(
"i" => 1
)
"prix" => array(
"i" => 4
));
public function id()
{
......
......@@ -9,10 +9,22 @@ class Rdv extends Objet
protected $duree;
public $_specialFields = array(
"employe" => array(
"t" => "ForeignField"
"t" => "ForeignField",
"i" => 2
),
"animal" => array(
"t" => "ForeignField"
"t" => "ForeignField",
"i" => 3
)
"id" => array(
"i" => 1
)
"date" => array(
"i" => 4
)
"duree" => array(
"i" => 5
));
......
......@@ -59,7 +59,7 @@ class Stats
LIMIT 3" ); // 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;
}
......
......@@ -9,18 +9,26 @@
<th>Facture moyenne : </th>
<th><?php $tmp = $stats->factureMoy(); $nb_formated = number_format($tmp["value"], 2, ',', ' '); echo $nb_formated; ?></th>
</thead>
<tbody>
<tr>
<td>Nombre moyen d'animal par client : </td>
<td><?php $tmp = $stats->nbAnimalMoyClient(); $nb_formated = number_format($tmp["value"], 2, ',', ' '); echo $nb_formated; ?></td>
</tr>
</tbody>
<thead>
<th>Nombre moyen d'animal par client : </th>
<th><?php $tmp = $stats->nbAnimalMoyClient(); $nb_formated = number_format($tmp["value"], 2, ',', ' '); echo $nb_formated; ?></th>
</thead>
</table>
<table class="table">
<caption> <th> Top 3 des plus gros client : </th> </caption>
<thead>
<th><?php print_r($stats->top3Client()); ?></th>
<th>Nom </th>
<th>Prenom </th>
<th>Total dépensé </th>
</thead>
</table>
<tbody>
<?php foreach ($stats->top3Client() as $ligne): ?>
<tr>
<td><?php echo $ligne["nom"]; ?> </td>
<td><?php echo $ligne["prenom"]; ?> </td>
<td><?php echo $ligne["prix"]; ?> </td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment