You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.4 KiB
PHP

<?php
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
?>
<div class="card-deck">
<div class="card bg-indigo text-light">
<div class="card-body">
<h4 class="card-title"><?php $Strings->get("Families") ?></h4>
<h1><i class="fas fa-fw fa-users"></i> <?php echo $database->count('families'); ?></h1>
</div>
<div class="card-footer">
<a href="app.php?page=families" class="text-light"><i class="fas fa-arrow-right"></i> <?php $Strings->get("View Families"); ?></a>
</div>
</div>
<div class="card bg-green text-light">
<div class="card-body">
<h4 class="card-title"><?php $Strings->get("Recent Payments") ?></h4>
<h1><i class="fas fa-fw fa-dollar-sign"></i> <?php
$amounts = $database->select("payments", "amount", ["AND" => ["paid" => 1, "date[>]" => date("Y-m-d H:i:s", strtotime("-30 days"))]]);
$total = 0.0;
foreach ($amounts as $amt) {
$total += $amt;
}
echo number_format($total, 2);
?></h1>
</div>
<div class="card-footer">
<a href="app.php?page=payments" class="text-light"><i class="fas fa-arrow-right"></i> <?php $Strings->get("View Payments"); ?></a>
</div>
</div>
</div>