Update name search on the account list page.
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 19 Mar 2018 17:06:29 +0000 (13:06 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 19 Mar 2018 17:06:29 +0000 (13:06 -0400)
Now will search text string in member name.

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

index 2196b36..7e9e581 100644 (file)
@@ -124,6 +124,7 @@ class GlmMembersAdmin_billing_accounts extends GlmDataAccounts
         $totalAccounts       = false;
         $allAccounts         = false;
         $filterAccounts      = false;
+        $searchName          = false;
 
         // Get any provided option
         if ( isset( $_REQUEST['option'] ) ) {
@@ -378,7 +379,7 @@ class GlmMembersAdmin_billing_accounts extends GlmDataAccounts
             } else if ( isset( $_REQUEST['searchName'] )
                 && $searchName = filter_var( $_REQUEST['searchName'], FILTER_SANITIZE_STRING )
             ) {
-                // $where_parems[] = "T.";
+                $where_params[] = "T.ref_name like '%" . esc_sql( $searchName ) . "%'";
             }
 
 
@@ -452,6 +453,7 @@ class GlmMembersAdmin_billing_accounts extends GlmDataAccounts
             'totalAccounts'       => $totalAccounts,
             'allAccounts'         => $allAccounts,
             'filterAccounts'      => $filterAccounts,
+            'searchName'          => $searchName,
         );
 
         // Return status, any suggested view, and any data to controller
index 3561f53..77aa3d5 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="{if $searchName}{$searchName}{/if}" />
+            </span>
+            <br>
             <span class="glm-nowrap">
                 <input type="submit" value="Submit">
             </span>