From: Steve Sutton Date: Fri, 16 Mar 2018 16:36:17 +0000 (-0400) Subject: Add total count to account list page. X-Git-Tag: v1.0.0^2~135 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=48f6a63fd222658005dc1e8a3fdc7328c37b69c6;p=WP-Plugins%2Fglm-member-db-billing.git Add total count to account list page. Adding the getStats to get total number of accounts. --- 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}