}
switch( $option ) {
+ case 'checkMembers':
+ $view = 'memberTypes';
+ $response = $this->checkMembers();
+ break;
case 'updateEmail':
$view = 'memberTypes';
$response = $this->updateCustomFieldEmails();
}
+ public function checkMembers()
+ {
+ // Get a list of pending or active members
+ $accounts = $this->wpdb->get_results(
+ "SELECT id,ref_dest,renewal_date
+ FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . "accounts
+ WHERE renewal_date + INTERVAL 1 YEAR + INTERVAL 30 DAY >= '2018-05-03'",
+ ARRAY_A
+ );
+ foreach ( $accounts as $account ) {
+ // Check the member to see if he has correct
+ $access = $this->wpdb->get_var(
+ $this->wpdb->prepare(
+ "SELECT access
+ FROM " . GLM_MEMBERS_CONTACTS_PLUGIN_DB_PREFIX . "contacts
+ WHERE ref_dest = %d",
+ $account['ref_dest']
+ )
+ );
+ echo '<pre>$access: ' . print_r( $access, true ) . '</pre>';
+ }
+ return 'test';//'<pre>$accounts: ' . print_r( $accounts, true ) . '</pre>';
+ }
+
public function updateCustomFieldEmails()
{
<a href="{$thisUrl}?page={$thisPage}&option=archive">Archive Old Users</a>
<br />
<a href="{$thisUrl}?page={$thisPage}&option=updateEmail">Update Custom field email</a>
+<br />
+<a href="{$thisUrl}?page={$thisPage}&option=checkMembers">Check Member Accounts</a>