Skip to content
Snippets Groups Projects
stats.php 4.96 KiB
Newer Older
Matthieu Guffroy's avatar
Matthieu Guffroy committed
    <!-- Begin page content -->
    <div class="container">
      <div class="page-header">
        <h1>Statistiques</h1>
      </div>
cortylal's avatar
cortylal committed

        <h4>Statistiques générales : </h4>
clement's avatar
c  
clement committed
      <table class="table">
        <thead>
cortylal's avatar
cortylal committed
                <th>Nombre de clients : </th>
cortylal's avatar
cortylal committed
                <th><?php $tmp = $stats->nbClient(); $nb_formated = number_format($tmp["nb"]); echo $nb_formated; ?></th>
cortylal's avatar
cortylal committed
        </thead>
        <thead>
cortylal's avatar
cortylal committed
                <th>Nombre d'employés : </th>
cortylal's avatar
cortylal committed
                <th><?php $tmp = $stats->nbEmploye(); $nb_formated = number_format($tmp["nb"]); echo $nb_formated; ?></th>
cortylal's avatar
cortylal committed
        </thead>
        <thead>
cortylal's avatar
cortylal committed
                <th>Nombre de vétérinaires : </th>
cortylal's avatar
cortylal committed
                <th><?php $tmp = $stats->nbVeterinaire(); $nb_formated = number_format($tmp["nb"]); echo $nb_formated; ?></th>
cortylal's avatar
cortylal committed
        </thead>
        <thead>
                <th>Nombre d'animaux : </th>
cortylal's avatar
cortylal committed
                <th><?php $tmp = $stats->nbAnimaux(); $nb_formated = number_format($tmp["nb"]); echo $nb_formated; ?></th>
clement's avatar
c  
clement committed
        </thead>
cortylal's avatar
cortylal committed
        <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>
cortylal's avatar
cortylal committed
        <thead>
                <th>Facture moyenne : </th>
                <th><?php $tmp = $stats->factureMoy(); $nb_formated = number_format($tmp["value"], 2, ',', ' '); echo $nb_formated; ?></th>
        </thead>
        <thead>
                <th>Total du chiffre d'affaire : </th>
                <th><?php $tmp = $stats->totalCA(); $nb_formated = number_format($tmp["ca"], 2, ',', ' '); echo $nb_formated; ?></th>
        </thead>
clement's avatar
c  
clement committed
      </table>
cortylal's avatar
cortylal committed

cortylal's avatar
cortylal committed
      <br/>
      <hr/>
cortylal's avatar
cortylal committed
      <h4>Top 3 des meilleurs clients</h4>
cortylal's avatar
cortylal committed
      <table class="table">
cortylal's avatar
cortylal committed
        <thead>
cortylal's avatar
cortylal committed
                <th>Nom </th>
                <th>Prenom </th> 
                <th>Total dépensé </th> 
cortylal's avatar
cortylal committed
        </thead>
cortylal's avatar
cortylal committed
          <tbody>
          <?php foreach ($stats->top3Client() as $ligne): ?>
            <tr>
                <td><?php echo $ligne["nom"]; ?> </td>
                <td><?php echo $ligne["prenom"]; ?> </td>
cortylal's avatar
cortylal committed
                <td><?php echo $ligne["prix"]; ?> </td> 
cortylal's avatar
cortylal committed
            </tr>
          <?php endforeach; ?>
        </tbody>
      </table>
cortylal's avatar
cortylal committed

      <br/>
      <hr/>
      <h4>Top 3 des plus grosses factures</h4>
      <table class="table">
        <thead>
                <th>Nom </th>
                <th>Prenom </th> 
                <th>Montant de la facture </th> 
        </thead>
          <tbody>
          <?php foreach ($stats->top3Facture() as $ligne): ?>
            <tr>
                <td><?php echo $ligne["nom"]; ?> </td>
                <td><?php echo $ligne["prenom"]; ?> </td>
cortylal's avatar
cortylal committed
                <td><?php echo $ligne["prix_total"]; ?> </td> 
cortylal's avatar
cortylal committed
            </tr>
          <?php endforeach; ?>
        </tbody>
      </table>
cortylal's avatar
cortylal committed

      <br/>
      <hr/>
      <h4>Nombre d'animaux par client</h4>
      <table class="table">
        <thead>
                <th>Nom </th>
                <th>Prenom </th> 
                <th>Nombre d'animaux </th> 
        </thead>
          <tbody>
          <?php foreach ($stats->nbAnimalClient() as $ligne): ?>
            <tr>
                <td><?php echo $ligne["nom"]; ?> </td>
                <td><?php echo $ligne["prenom"]; ?> </td>
                <td><?php echo $ligne["count"]; ?> </td> 
            </tr>
          <?php endforeach; ?>
        </tbody>
      </table>

cortylal's avatar
cortylal committed
      <br/>
      <hr/>
      <h4>Top 5 des vétérinaires</h4>
      <table class="table">
        <thead>
                <th>Nom </th>
                <th>Prenom </th> 
cortylal's avatar
cortylal committed
                <th>Nombre de rendez-vous </th> 
cortylal's avatar
cortylal committed
        </thead>
          <tbody>
          <?php foreach ($stats->top5Veterinaire() as $ligne): ?>
            <tr>
                <td><?php echo $ligne["nom"]; ?> </td>
                <td><?php echo $ligne["prenom"]; ?> </td>
cortylal's avatar
cortylal committed
                <td><?php echo $ligne["count"]; ?> </td> 
cortylal's avatar
cortylal committed
            </tr>
          <?php endforeach; ?>
        </tbody>
      </table>

cortylal's avatar
cortylal committed
      <br/>
      <hr/>
      <h4>Top 10 des espèces clientes</h4>
      <table class="table">
        <thead>
                <th>Nom </th>
                <th>Nombre d'individu </th> 
        </thead>
          <tbody>
          <?php foreach ($stats->top10Espece() as $ligne): ?>
            <tr>
                <td><?php echo $ligne["nom"]; ?> </td>
                <td><?php echo $ligne["count"]; ?> </td> 
            </tr>
          <?php endforeach; ?>
        </tbody>
      </table>

      <br/>
      <hr/>
      <h4>Top 10 des races clientes</h4>
      <table class="table">
        <thead>
                <th>Nom </th>
cortylal's avatar
cortylal committed
                <th>Nombre d'individu </th> 
cortylal's avatar
cortylal committed
        </thead>
          <tbody>
cortylal's avatar
cortylal committed
          <?php foreach ($stats->top10Race() as $ligne): ?>
cortylal's avatar
cortylal committed
            <tr>
                <td><?php echo $ligne["nom"]; ?> </td>
                <td><?php echo $ligne["count"]; ?> </td> 
            </tr>
          <?php endforeach; ?>
        </tbody>
      </table>

clement's avatar
c  
clement committed
	</div>