From 48f6a63fd222658005dc1e8a3fdc7328c37b69c6 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Fri, 16 Mar 2018 12:36:17 -0400 Subject: [PATCH] Add total count to account list page. Adding the getStats to get total number of accounts. --- models/admin/billing/accounts.php | 5 ++++- views/admin/billing/accounts.html | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/models/admin/billing/accounts.php b/models/admin/billing/accounts.php index f81ad90..2041607 100644 --- a/models/admin/billing/accounts.php +++ b/models/admin/billing/accounts.php @@ -121,6 +121,7 @@ class GlmMembersAdmin_billing_accounts extends GlmDataAccounts $toDate = ''; $annFromDate = ''; $annToDate = ''; + $totalAccounts = false; // Get any provided option if (isset($_REQUEST['option'])) { @@ -371,8 +372,9 @@ class GlmMembersAdmin_billing_accounts extends GlmDataAccounts $where = implode( ' AND ', $where_params ); // Get the list of accounts and determine number of accounts in list - $orderBy = 'ref_name'; + $orderBy = 'ref_name'; $accountsResult = $this->getList($where, $orderBy, true, 'id', $start, $limit); + $totalAccounts = $this->getStats(); // Get paging results $numbDisplayed = $accountsResult['returned']; @@ -432,6 +434,7 @@ class GlmMembersAdmin_billing_accounts extends GlmDataAccounts 'toDate' => $toDate, 'annFromDate' => $annFromDate, 'annToDate' => $annToDate, + 'totalAccounts' => $totalAccounts, ); // Return status, any suggested view, and any data to controller diff --git a/views/admin/billing/accounts.html b/views/admin/billing/accounts.html index 715c57c..1f3fcf9 100644 --- a/views/admin/billing/accounts.html +++ b/views/admin/billing/accounts.html @@ -30,6 +30,8 @@
+

Total found: {$totalAccounts}

+ {if $paging} @@ -68,6 +70,7 @@ + {if $paging} -- 2.17.1