Commit d9fd9ce50562424aa6db325637d1e2df61c98ab4
1 parent
29257441
-Total for statistics
Showing
1 changed file
with
17 additions
and
1 deletions
Show diff stats
views/statistics/index.php
@@ -140,7 +140,15 @@ JS; | @@ -140,7 +140,15 @@ JS; | ||
140 | <td><b>Уникальных товаров, шт.</b></td> | 140 | <td><b>Уникальных товаров, шт.</b></td> |
141 | </tr> | 141 | </tr> |
142 | <?php | 142 | <?php |
143 | + $total_count = 0; | ||
144 | + $total_sum = 0; | ||
145 | + $total_products = 0; | ||
146 | + $total_unique = 0; | ||
143 | foreach ($labelStatistics as $name => $statistic) { | 147 | foreach ($labelStatistics as $name => $statistic) { |
148 | + $total_count += $statistic[ 'count' ]; | ||
149 | + $total_sum += $statistic[ 'sum' ]; | ||
150 | + $total_products += $statistic[ 'products' ]; | ||
151 | + $total_unique += $statistic[ 'unique' ]; | ||
144 | echo Html::tag( | 152 | echo Html::tag( |
145 | 'tr', | 153 | 'tr', |
146 | Html::tag('td', $name) . Html::tag('td', $statistic[ 'count' ]) . Html::tag( | 154 | Html::tag('td', $name) . Html::tag('td', $statistic[ 'count' ]) . Html::tag( |
@@ -148,7 +156,15 @@ JS; | @@ -148,7 +156,15 @@ JS; | ||
148 | $statistic[ 'sum' ] | 156 | $statistic[ 'sum' ] |
149 | ) . Html::tag('td', $statistic[ 'products' ]) . Html::tag('td', $statistic[ 'unique' ]) | 157 | ) . Html::tag('td', $statistic[ 'products' ]) . Html::tag('td', $statistic[ 'unique' ]) |
150 | ); | 158 | ); |
151 | - } ?> | 159 | + } |
160 | + ?> | ||
161 | + <tr> | ||
162 | + <td><b>Всего</b></td> | ||
163 | + <td><b><?=$total_count?></b></td> | ||
164 | + <td><b><?=$total_sum?></b></td> | ||
165 | + <td><b><?=$total_products?></b></td> | ||
166 | + <td><b><?=$total_unique?></b></td> | ||
167 | + </tr> | ||
152 | </table> | 168 | </table> |
153 | </div><!-- /.box-body --> | 169 | </div><!-- /.box-body --> |
154 | 170 |