Skip to content
Snippets Groups Projects
Commit 8e3b7de0 authored by clement's avatar clement
Browse files

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

parents bdfc1845 bf661c94
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,10 @@ class DateField extends Field
}
public function show() {
return $this->value;
$year = substr($this->value, 0, 4);
$month = substr($this->value, 5, 2);
$day = substr($this->value, 8, 2);
$html = $day.'-'.$month.'-'.$year;
return $html;
}
}
......@@ -10,6 +10,10 @@ class LigneFacture extends Objet
protected $quantite;
protected $remise;
public static function dbName() {
return "lignefacture";
}
public function id()
{
return $this->id;
......
......@@ -83,7 +83,8 @@ class Objet
public function insert()
{
$dbName = self::dbName();
$class = get_called_class();
$dbName = $class::dbName();
$bdd = new Db();
$values = array();
......@@ -162,4 +163,4 @@ class Objet
public function getList($title, $id=null) {
return new ListView(get_called_class(), $title, $id);
}
}
\ No newline at end of file
}
......@@ -33,7 +33,7 @@ class Stats
$bdd = new Db();
$requete_prepare = $bdd->db->prepare(" SELECT COUNT(*) AS nb
FROM animaux" ); // on prépare notre requête
FROM animal" ); // on prépare notre requête
$requete_prepare->execute();
$ligne = $requete_prepare->fetch(PDO::FETCH_ASSOC);
......
......@@ -7,20 +7,20 @@
<h4>Statistiques générales : </h4>
<table class="table">
<thead>
<th>Nombre de client : </th>
<th>Nombre de clients : </th>
<th><?php $tmp = $stats->nbClient(); $nb_formated = number_format($tmp["nb"]); echo $nb_formated; ?></th>
</thead>
<thead>
<th>Nombre d'employé' : </th>
<th><?php $tmp = $stats->nbEmploye(); $nb_formated = number_format($tmp["nb"], 2, ',', ' '); echo $nb_formated; ?></th>
<th>Nombre d'employés : </th>
<th><?php $tmp = $stats->nbEmploye(); $nb_formated = number_format($tmp["nb"]); echo $nb_formated; ?></th>
</thead>
<thead>
<th>Nombre de vétérinaire' : </th>
<th><?php $tmp = $stats->nbVeterinaire(); $nb_formated = number_format($tmp["nb"], 2, ',', ' '); echo $nb_formated; ?></th>
<th>Nombre de vétérinaires : </th>
<th><?php $tmp = $stats->nbVeterinaire(); $nb_formated = number_format($tmp["nb"]); echo $nb_formated; ?></th>
</thead>
<thead>
<th>Nombre d'animaux : </th>
<th><?php $tmp = $stats->nbAnimaux(); $nb_formated = number_format($tmp["nb"], 2, ',', ' '); echo $nb_formated; ?></th>
<th><?php $tmp = $stats->nbAnimaux(); $nb_formated = number_format($tmp["nb"]); echo $nb_formated; ?></th>
</thead>
<thead>
<th>Nombre moyen d'animal par client : </th>
......@@ -96,4 +96,24 @@
</tbody>
</table>
<br/>
<hr/>
<h4>Top 5 des vétérinaires</h4>
<table class="table">
<thead>
<th>Nom </th>
<th>Prenom </th>
<th>Montant de la facture </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>
</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