) ";
}
- }
-
-
- // echo '<pre>$BFSelect: ' . print_r( $BFSelect, true ) . '</pre>';
- // echo '<pre>$BFHeaders: ' . print_r( $BFHeaders, true ) . '</pre>';
- // exit;
+ // Check if there is an active only filter
+ if ( isset( $_REQUEST['active_only'] ) && $active_only = filter_var( $_REQUEST['active_only'], FILTER_VALIDATE_BOOLEAN ) ) {
+ $days_after_expired = $this->config['settings']['days_after_expired'];
+ $current_date = date( 'Y-m-d' );
+ $where .= " AND T.ref_dest IN (
+ SELECT DISTINCT(ref_dest)
+ FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . "accounts
+ WHERE renewal_date IS NOT NULL
+ AND renewal_date + INTERVAL 1 YEAR + INTERVAL $days_after_expired DAY > '$current_date'
+ ) ";
+ }
- // Only return information records that are active
+ }
// Check if there is a member_type filter
if ( isset( $_REQUEST['filterMemberTypes'] ) && $memberTypeFilter = filter_var( $_REQUEST['filterMemberTypes'], FILTER_VALIDATE_INT ) ) {
</tr>
{if apply_filters( 'glm-members-billing-enabled', false )}
<tr>
- <th>Only Billing Accounts: </th>
+ <th>Billing Accounts: </th>
<td>
- <input type="checkbox" name="billing_only"><br>
+ <input type="checkbox" name="active_only">Active Only ( Not Expired ) <br>
</td>
</tr>
{/if}