In my view file i am generating a table as following
<?php
foreach ($accounts as $row) {
echo '<tr>';
echo '<td>' . $row['id'] . '</td>';
echo '<td>' . $row['total_online_sale'] . '</td>';
echo '<td>' . $row['product_price'] . '</td>';
echo '<td>' . $row['discount'] . '</td>';
}
?>
I want to generate sum values of those columns in a row surrounded by <tfoot> tag.
I don't want to do this operations in model. how should I do it?