Hide name search until it is complete
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 19 Mar 2018 16:55:19 +0000 (12:55 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 19 Mar 2018 16:55:19 +0000 (12:55 -0400)
Getting ready for show to client

models/admin/billing/accounts.php
views/admin/billing/accounts.html

index 54a4f4d..2196b36 100644 (file)
@@ -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 '<pre>$accounts: ' . print_r( $accounts, true ) . '</pre>';
 
index e8f9467..3561f53 100644 (file)
                 <b>To Date: </b><input type="text" name="annToDate" value="{$annToDate}" class="glm-form-text-input-short glm-date-input">
             </span>
             <br>
-            <span class="glm-nowrap">
-                <b>Member Account:&nbsp;</b>
-                <input id="member-account" type="hidden" name="filterAccounts" value="{$filterAccounts}">
-                <input id="account_name" name="searchName" value="" />
-            </span>
-            <br>
+            <!-- <span class="glm-nowrap"> -->
+            <!--     <b>Member Account:&nbsp;</b> -->
+            <!--     <input id="member-account" type="hidden" name="filterAccounts" value="{$filterAccounts}"> -->
+            <!--     <input id="account_name" name="searchName" value="" /> -->
+            <!-- </span> -->
+            <!-- <br> -->
             <span class="glm-nowrap">
                 <input type="submit" value="Submit">
             </span>