summaryrefslogtreecommitdiff
path: root/pages/money.inc
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-01-25 21:29:24 +0100
committerMinteck <contact@minteck.org>2023-01-25 21:29:24 +0100
commit9b2f05228357a34a3c0f2950782835dfeb35086e (patch)
tree5a13df212ad9c22e3af921017950cb6d617d3a37 /pages/money.inc
parent78003af142c7c851ee14dbafecaa47954e07a8c2 (diff)
downloadpluralconnect-9b2f05228357a34a3c0f2950782835dfeb35086e.tar.gz
pluralconnect-9b2f05228357a34a3c0f2950782835dfeb35086e.tar.bz2
pluralconnect-9b2f05228357a34a3c0f2950782835dfeb35086e.zip
Updated 3 files and added 2 files (automated)
Diffstat (limited to 'pages/money.inc')
-rw-r--r--pages/money.inc24
1 files changed, 20 insertions, 4 deletions
diff --git a/pages/money.inc b/pages/money.inc
index 9c98613..609ff6c 100644
--- a/pages/money.inc
+++ b/pages/money.inc
@@ -249,7 +249,15 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
<hr>
- <h4>Cloudburst System</h4>
+ <h4>Cloudburst System (<?php
+
+ $allAccounts = array_reduce(array_map(function ($i) {
+ return calculateFullAmount($i, true, true);
+ }, array_values(array_filter($accounts, function ($i) { return $i["owner"] === "cloudburst"; }))), function ($a, $b) {
+ return $a + $b;
+ });
+
+ ?>£<?= number_format($allAccounts, 2, '.', ',') ?>)</h4>
<div style="display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 20px;">
<?php foreach ($accounts as $index => $account): if ($account["owner"] === "cloudburst"): ?>
<a style="color: white; text-decoration: none;" href="/-/money/<?= $account["_name"] ?>">
@@ -257,7 +265,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
<div class="card-body">
<h4 class="card-title"><?= $account["currency"] === "gbp" ? "£" : "€" ?><?= calculateFullAmount($account); ?></h4>
<?= $account["name"] ?><?php if ($account["default"]): ?> <span class="badge bg-success rounded-pill">Default</span><?php endif; ?><?php if (isset($account["interests"])): ?> · <?= $account["interests"] * 100 ?>% interests<?php endif; ?>
- <?php if (isset($account["max"])): ?><br><span class="text-muted">Max balance: <?= $account["currency"] === "gbp" ? "£" : "€" ?><?= number_format($account["max"], 2, '.', ',') ?> (<?= round((calculateFullAmount($account, true) / $account["max"]) * 100, 2) ?>% used)</span><?php endif; ?>
+ <?php if (isset($account["max"])): ?><br><span class="text-muted">Max balance: <?= $account["currency"] === "gbp" ? "£" : "€" ?><?= number_format($account["max"], 2, '.', ',') ?> (<?= round((calculateFullAmount($account, true) / $account["max"]) * 100, 2) ?>% used)</span><?php else: ?><br><span class="text-muted">No maximum balance</span><?php endif; ?>
</div>
</div>
</a>
@@ -335,7 +343,15 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
})
</script>
- <h4 style="margin-top: 20px;">Raindrops System</h4>
+ <h4 style="margin-top: 20px;">Raindrops System (<?php
+
+ $allAccounts = array_reduce(array_map(function ($i) {
+ return calculateFullAmount($i, true);
+ }, array_values(array_filter($accounts, function ($i) { return $i["owner"] === "raindrops"; }))), function ($a, $b) {
+ return $a + $b;
+ });
+
+ ?>€<?= number_format($allAccounts, 2, '.', ',') ?>)</h4>
<div style="display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 20px;">
<?php foreach ($accounts as $index => $account): if ($account["owner"] === "raindrops"): ?>
<a style="color: white; text-decoration: none;" href="/-/money/<?= $account["_name"] ?>">
@@ -343,7 +359,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
<div class="card-body">
<h4 class="card-title"><?= $account["currency"] === "gbp" ? "£" : "€" ?><?= calculateFullAmount($account); ?></h4>
<?= $account["name"] ?><?php if ($account["default"]): ?> <span class="badge bg-success rounded-pill">Default</span><?php endif; ?><?php if (isset($account["interests"])): ?> · <?= $account["interests"] * 100 ?>% interests<?php endif; ?>
- <?php if (isset($account["max"])): ?><br><span class="text-muted">Max balance: <?= $account["currency"] === "gbp" ? "£" : "€" ?><?= number_format($account["max"], 2, '.', ',') ?> (<?= round((calculateFullAmount($account, true) / $account["max"]) * 100, 2) ?>% used)</span><?php endif; ?>
+ <?php if (isset($account["max"])): ?><br><span class="text-muted">Max balance: <?= $account["currency"] === "gbp" ? "£" : "€" ?><?= number_format($account["max"], 2, '.', ',') ?> (<?= round((calculateFullAmount($account, true) / $account["max"]) * 100, 2) ?>% used)</span><?php else: ?><br><span class="text-muted">No maximum balance</span><?php endif; ?>
</div>
</div>
</a>