|
|
@@ -42,12 +42,12 @@ $this->title = 'Statistiques produits' ; |
|
|
|
$this->params['breadcrumbs'][] = 'Statistiques produits'; |
|
|
|
|
|
|
|
?> |
|
|
|
<div class="stats-produits"> |
|
|
|
<div class="stats-products"> |
|
|
|
|
|
|
|
<h1>Statistiques produits <?= $year ?> |
|
|
|
<div id="nav-year"> |
|
|
|
<a class="btn btn-default" href="<?= Yii::$app->urlManager->createUrl(['stats/produits','year' => $year - 1]); ?>">< <?= ($year - 1) ?></a> |
|
|
|
<a class="btn btn-default" href="<?= Yii::$app->urlManager->createUrl(['stats/produits','year' => $year + 1]); ?>"><?= ($year + 1) ?> ></a> |
|
|
|
<a class="btn btn-default" href="<?= Yii::$app->urlManager->createUrl(['stats/products','year' => $year - 1]); ?>">< <?= ($year - 1) ?></a> |
|
|
|
<a class="btn btn-default" href="<?= Yii::$app->urlManager->createUrl(['stats/products','year' => $year + 1]); ?>"><?= ($year + 1) ?> ></a> |
|
|
|
</div> |
|
|
|
</h1> |
|
|
|
|
|
|
@@ -55,12 +55,12 @@ $this->params['breadcrumbs'][] = 'Statistiques produits'; |
|
|
|
<div class="alert alert-warning">Aucune statistique disponible pour cette période</div> |
|
|
|
<?php else: ?> |
|
|
|
|
|
|
|
<table id="table-stats-produits" class="table table-bordered table-hover header-fixed"> |
|
|
|
<table id="table-stats-products" class="table table-bordered table-hover header-fixed"> |
|
|
|
<thead> |
|
|
|
<tr class="mois"> |
|
|
|
<th></th> |
|
|
|
<?php foreach($arr_mois as $m): ?> |
|
|
|
<th colspan="2"><?= $m; ?></th> |
|
|
|
<?php foreach($monthArray as $month): ?> |
|
|
|
<th colspan="2"><?= $month; ?></th> |
|
|
|
<?php endforeach; ?> |
|
|
|
</tr> |
|
|
|
<tr class="sub-head"> |
|
|
@@ -72,64 +72,63 @@ $this->params['breadcrumbs'][] = 'Statistiques produits'; |
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
<tbody> |
|
|
|
<?php foreach($produits as $produit_current): ?> |
|
|
|
<?php foreach($productsArray as $currentProduct): ?> |
|
|
|
<tr> |
|
|
|
<td class="nom"><?= Html::encode($produit_current['nom']) ?></td> |
|
|
|
<?php foreach($arr_produits as $mois => $arr_produit_mois): |
|
|
|
$find_max = false ; |
|
|
|
$find_commandes = false ; |
|
|
|
<td class="name"><?= Html::encode($currentProduct['name']) ?></td> |
|
|
|
<?php foreach($dataProducts as $month => $productsMonthArray): |
|
|
|
$findMax = false ; |
|
|
|
$findOrders = false ; |
|
|
|
?> |
|
|
|
|
|
|
|
<?php if($mois != StatsController::TOTAUX): ?> |
|
|
|
<?php if($month != StatsController::TOTALS): ?> |
|
|
|
|
|
|
|
<!-- max --> |
|
|
|
<?php foreach($arr_produit_mois['max'] as $produit): |
|
|
|
$tooltip = 'data-toggle="tooltip" data-placement="top" data-original-title="'.Html::encode($produit_current['nom']).' / '.$arr_mois[$mois - 1] .' '. $year.' / Maximum"' ; |
|
|
|
<?php foreach($productsMonthArray['max'] as $product): |
|
|
|
$tooltip = 'data-toggle="tooltip" data-placement="top" data-original-title="'.Html::encode($currentProduct['name']).' / '.$monthArray[$month - 1] .' '. $year.' / Maximum"' ; |
|
|
|
?> |
|
|
|
<?php if($produit['nom'] == $produit_current['nom']): |
|
|
|
$find_max = true ; |
|
|
|
<?php if($product['name'] == $currentProduct['name']): |
|
|
|
$findMax = true ; |
|
|
|
?> |
|
|
|
<td class="align-center"> |
|
|
|
<div <?= $tooltip; ?>><?= $produit['total'] ?></div> |
|
|
|
<div <?= $tooltip; ?>><?= $product['total'] ?></div> |
|
|
|
</td> |
|
|
|
<?php endif; ?> |
|
|
|
<?php endforeach; ?> |
|
|
|
<?php if(!$find_max): ?><td class="align-center"><div <?= $tooltip; ?>>0</div></td><?php endif; ?> |
|
|
|
<?php if(!$findMax): ?><td class="align-center"><div <?= $tooltip; ?>>0</div></td><?php endif; ?> |
|
|
|
|
|
|
|
<!-- commandes --> |
|
|
|
<?php foreach($arr_produit_mois['commandes'] as $produit): |
|
|
|
$tooltip = 'data-toggle="tooltip" data-placement="top" data-original-title="'.Html::encode($produit_current['nom']).' / '. $arr_mois[$mois - 1] . ' '. $year .' / Commandés"' ; |
|
|
|
<?php foreach($productsMonthArray['orders'] as $product): |
|
|
|
$tooltip = 'data-toggle="tooltip" data-placement="top" data-original-title="'.Html::encode($currentProduct['name']).' / '. $monthArray[$month - 1] . ' '. $year .' / Commandés"' ; |
|
|
|
?> |
|
|
|
<?php if($produit['nom'] == $produit_current['nom']): |
|
|
|
$find_commandes = true ; |
|
|
|
<?php if($product['name'] == $currentProduct['name']): |
|
|
|
$findOrders = true ; |
|
|
|
?> |
|
|
|
<td class="align-center"> |
|
|
|
<div <?= $tooltip ?> ><?= $produit['total'] ?></div> |
|
|
|
<div <?= $tooltip ?> ><?= $product['total'] ?></div> |
|
|
|
</td> |
|
|
|
<?php endif; ?> |
|
|
|
<?php endforeach; ?> |
|
|
|
<?php if(!$find_commandes): ?><td class="align-center"><div <?= $tooltip ?> >0</div></td><?php endif; ?> |
|
|
|
<?php if(!$findOrders): ?><td class="align-center"><div <?= $tooltip ?> >0</div></td><?php endif; ?> |
|
|
|
|
|
|
|
|
|
|
|
<?php else: ?> |
|
|
|
<!-- totaux max --> |
|
|
|
<?php foreach($arr_produits[StatsController::TOTAUX]['max'] as $nom_produit => $total_max): |
|
|
|
$tooltip = 'data-toggle="tooltip" data-placement="top" data-original-title="'.Html::encode($produit_current['nom']).' / Total '. $year .' / Maximums"' ; |
|
|
|
<?php foreach($productsArray[StatsController::TOTALS]['max'] as $productName => $totalMax): |
|
|
|
$tooltip = 'data-toggle="tooltip" data-placement="top" data-original-title="'.Html::encode($currentProduct['name']).' / Total '. $year .' / Maximums"' ; |
|
|
|
?> |
|
|
|
<?php if($nom_produit == $produit_current['nom']): ?> |
|
|
|
<?php if($productName == $currentProduct['name']): ?> |
|
|
|
<td class="align-center"> |
|
|
|
<div <?= $tooltip ?> ><?= $total_max ?></div> |
|
|
|
<div <?= $tooltip ?> ><?= $totalMax ?></div> |
|
|
|
</td> |
|
|
|
<?php endif; ?> |
|
|
|
<?php endforeach; ?> |
|
|
|
|
|
|
|
<!-- totaux commandés --> |
|
|
|
<?php foreach($arr_produits[StatsController::TOTAUX]['commandes'] as $nom_produit => $total_commandes): |
|
|
|
$tooltip = 'data-toggle="tooltip" data-placement="top" data-original-title="'.Html::encode($produit_current['nom']).' / Total '. $year .' / Commandés"' ; |
|
|
|
<?php foreach($productsArray[StatsController::TOTALS]['orders'] as $productName => $totalOrders): |
|
|
|
$tooltip = 'data-toggle="tooltip" data-placement="top" data-original-title="'.Html::encode($currentProduct['name']).' / Total '. $year .' / Commandés"' ; |
|
|
|
?> |
|
|
|
<?php if($nom_produit == $produit_current['nom']): ?> |
|
|
|
<?php if($productName == $currentProduct['name']): ?> |
|
|
|
<td class="align-center"> |
|
|
|
<div <?= $tooltip ?> ><?= $total_commandes ?></div> |
|
|
|
<div <?= $tooltip ?> ><?= $totalOrders ?></div> |
|
|
|
</td> |
|
|
|
<?php endif; ?> |
|
|
|
<?php endforeach; ?> |