function recalculate_savings($logged_user) { foreach (savings_operations($logged_user) as $o) { $amount_out += $o['amount']; } mysql_query("UPDATE savings SET amount_out=" . $amount_out . " WHERE us_id=" . $logged_user); }
</div> </section> <section class="rounded-corners add-opacity bg-white"> <strong style="font-size:0.8em;">Historia wszystkich operacji w ramach oszczędności</strong><br /> <span style="font-size:0.8em;" class="gray">Tu możesz usunąć operację jeżeli dane zostały błędnie wprowadzone</span> <table class="operations"> <tr> <th style="width:150px;">Data</th> <th style="width:200px;">Kwota</th> <th style="width:520px;">Cel</th> <th style="width:50px;"></th> </tr> <?php foreach (savings_operations($logged_user) as $o) { ?> <tr> <td style="text-align:center;"><?php echo date("d-m-Y", strtotime($o['when_created'])); ?> </td> <td style="text-align:right; padding-right:20px;"> <?php echo '<span class="red">-' . number_format($o["amount"], $decimals = 2, $dec_point = ".", $thousands_sep = "") . ' PLN</span>'; ?> </td> <td style="padding-left:20px;"> <?php if ($o['category_id']) { echo print_category($o['category_id']);