From 5ba804a7225b88e77a5b3440d1e6e9e7b373505b Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Thu, 3 May 2018 16:15:46 -0400 Subject: [PATCH] Check for member access access should be 40 --- models/admin/migcsa/index.php | 28 ++++++++++++++++++++++++++++ views/admin/migcsa/index.html | 2 ++ 2 files changed, 30 insertions(+) diff --git a/models/admin/migcsa/index.php b/models/admin/migcsa/index.php index 36d86df..210c762 100644 --- a/models/admin/migcsa/index.php +++ b/models/admin/migcsa/index.php @@ -140,6 +140,10 @@ class GlmMembersAdmin_migcsa_index } switch( $option ) { + case 'checkMembers': + $view = 'memberTypes'; + $response = $this->checkMembers(); + break; case 'updateEmail': $view = 'memberTypes'; $response = $this->updateCustomFieldEmails(); @@ -199,6 +203,30 @@ class GlmMembersAdmin_migcsa_index } + 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 '
$access: ' . print_r( $access, true ) . '
'; + } + return 'test';//'
$accounts: ' . print_r( $accounts, true ) . '
'; + } + public function updateCustomFieldEmails() { diff --git a/views/admin/migcsa/index.html b/views/admin/migcsa/index.html index 80e664d..3d87311 100644 --- a/views/admin/migcsa/index.html +++ b/views/admin/migcsa/index.html @@ -16,3 +16,5 @@ Archive Old Users
Update Custom field email +
+Check Member Accounts -- 2.17.1