From c40dcd8c9d704e00d23ec93f509ebd895ae1aeb4 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Mon, 19 Mar 2018 12:55:19 -0400 Subject: [PATCH] Hide name search until it is complete Getting ready for show to client --- models/admin/billing/accounts.php | 34 +++++++++++++++++-------------- views/admin/billing/accounts.html | 12 +++++------ 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/models/admin/billing/accounts.php b/models/admin/billing/accounts.php index 54a4f4d..2196b36 100644 --- a/models/admin/billing/accounts.php +++ b/models/admin/billing/accounts.php @@ -66,7 +66,7 @@ class GlmMembersAdmin_billing_accounts extends GlmDataAccounts * * @return array Array containing status, suggested view, and any data */ - public function __construct ($wpdb, $config) + public function __construct ( $wpdb, $config ) { // Save WordPress Database object @@ -81,7 +81,7 @@ class GlmMembersAdmin_billing_accounts extends GlmDataAccounts * Note, the third parameter is a flag that indicates to the Contacts * data class that it should flag a group of fields as 'view_only'. */ - parent::__construct(false, false, true); + parent::__construct( false, false, true ); } @@ -126,7 +126,7 @@ class GlmMembersAdmin_billing_accounts extends GlmDataAccounts $filterAccounts = false; // Get any provided option - if (isset($_REQUEST['option'])) { + if ( isset( $_REQUEST['option'] ) ) { $option = $_REQUEST['option']; } @@ -140,7 +140,7 @@ class GlmMembersAdmin_billing_accounts extends GlmDataAccounts $InvoiceTypesObj = new GlmDataInvoiceTypes( $this->wpdb, $this->config ); $invoiceTypes = $InvoiceTypesObj->getList(); // Sort the types by parent child - $invoiceTypes = $InvoiceTypesObj->sortParentChild($invoiceTypes); + $invoiceTypes = $InvoiceTypesObj->sortParentChild( $invoiceTypes ); // Need to get the accounts $Accounts = new GlmDataAccounts( $this->wpdb, $this->config ); $accounts = $Accounts->getList( '', 'ref_name' ); @@ -216,7 +216,7 @@ class GlmMembersAdmin_billing_accounts extends GlmDataAccounts $view = 'editInvoice'; $InvoiceTypesObj = new GlmDataInvoiceTypes( $this->wpdb, $this->config ); $invoiceTypes = $InvoiceTypesObj->getList(); - $invoiceTypes = $InvoiceTypesObj->sortParentChild($invoiceTypes); + $invoiceTypes = $InvoiceTypesObj->sortParentChild( $invoiceTypes ); if ( isset( $invoiceTypes ) ) { foreach ( $invoiceTypes as $invoiceType ) { $invTypes[$invoiceType['id']] = array( @@ -230,7 +230,7 @@ class GlmMembersAdmin_billing_accounts extends GlmDataAccounts break; case 'edit': - $accounts = $this->editEntry($this->account_id); + $accounts = $this->editEntry( $this->account_id ); // If we have a good accounts if ($accounts['status']) { @@ -238,7 +238,7 @@ class GlmMembersAdmin_billing_accounts extends GlmDataAccounts } // If we're locked to a member as a contact user and the accounts member doesn't equal the contact member - if ($lockedToMember && $accounts['fieldData']['ref_dest_id'] != $lockedToMember) { + if ( $lockedToMember && $accounts['fieldData']['ref_dest_id'] != $lockedToMember ) { $haveTransactions = false; $accounts = false; } @@ -280,7 +280,7 @@ class GlmMembersAdmin_billing_accounts extends GlmDataAccounts // Need to remove any line items for the invoice also // $accounts = $this->deleteTransactions($this->account_id); - if ($accounts) { + if ( $accounts ) { $invoiceDeleted = true; } else { $invoiceDeleteError = true; @@ -375,6 +375,10 @@ class GlmMembersAdmin_billing_accounts extends GlmDataAccounts ) { $accounts[$filterAccounts]['selected'] = true; $where_params[] = "T.id = $filterAccounts"; + } else if ( isset( $_REQUEST['searchName'] ) + && $searchName = filter_var( $_REQUEST['searchName'], FILTER_SANITIZE_STRING ) + ) { + // $where_parems[] = "T."; } @@ -384,30 +388,30 @@ class GlmMembersAdmin_billing_accounts extends GlmDataAccounts // Get the list of accounts and determine number of accounts in list $orderBy = 'ref_name'; - $accountsResult = $this->getList($where, $orderBy, true, 'id', $start, $limit); - $totalAccounts = $this->getStats($where); + $accountsResult = $this->getList( $where, $orderBy, true, 'id', $start, $limit ); + $totalAccounts = $this->getStats( $where ); // Get paging results $numbDisplayed = $accountsResult['returned']; $lastDisplayed = $accountsResult['last']; - if ($start == 1) { + if ( $start == 1 ) { $prevStart = false; } else { $prevStart = $start - $limit; - if ($start < 1) { + if ( $start < 1 ) { $start = 1; } } - if ($accountsResult['returned'] == $limit) { + if ( $accountsResult['returned'] == $limit ) { $nextStart = $start + $limit; } // since we're doing paging, we have to break out just the accounts data $accounts = $accountsResult['list']; - if (count($accounts)>0) { + if ( count( $accounts ) > 0 ) { $haveAccounts = true; } - unset($accountsResult); + unset( $accountsResult ); // echo '
$accounts: ' . print_r( $accounts, true ) . '
'; diff --git a/views/admin/billing/accounts.html b/views/admin/billing/accounts.html index e8f9467..3561f53 100644 --- a/views/admin/billing/accounts.html +++ b/views/admin/billing/accounts.html @@ -24,12 +24,12 @@ To Date:
- - Member Account:  - - - -
+ + + + + + -- 2.17.1