$importResults = false;
$totalImports = false;
$numberProcessed = false;
+ $totalMembers = false;
// echo '<pre>Config: ' . print_r( $this->config, true ) . '</pre>';
// General settings are always stored in a record with ID=1.
'totalImports' => $totalImports,
'numberProcessed' => $numberProcessed,
'start' => ( isset( $start ) ? $start : false ),
+ 'totalMembers' => $totalMembers,
);
// Return status, suggested view, and data to controller
LEFT OUTER JOIN members.payment_types PT ON ( MA.payment_type = PT.id )
WHERE PT.name != ''
AND PT.name IS NOT NULL
- AND M.member_id IN ( SELECT DISTINCT member_id FROM members.billing where transaction_date >= '01/01/2018' )
+ -- AND M.member_id IN ( SELECT DISTINCT member_id FROM members.billing where transaction_date >= '01/01/2017' )
";
// Get total number of members.
";
$totalStmt = $dbh->query( $sql );
$totalMembers = $totalStmt->fetchColumn();
-$importResults .= 'Total Members: ' . $totalMembers . "<br>";
// return false;
M.mailing_address,M.mailing_city_id,M.mailing_state_id,M.mailing_zip,
M.street,M.city_id,M.state_id,M.zip,M.region
$fromWhere
-ORDER BY M.member_id";
-
-//LIMIT 10
-//OFFSET $start";
+ORDER BY M.member_id
+LIMIT 10
+OFFSET $start";
$stmt = $dbh->query( $sql );
$members = $stmt->fetchAll();
$numberMembers = count( $members );
if ( $start === 0 ) {
// Clear the invoices,line_items and transactions
+ // $this->wpdb->query( "DELETE FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . "accounts" );
// $this->wpdb->query( "DELETE FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . "invoices" );
// $this->wpdb->query( "DELETE FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . "line_items" );
// $this->wpdb->query( "DELETE FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . "transactions" );
+ // $this->wpdb->query( "DELETE FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . "payments" );
+ // $this->wpdb->query( "DELETE FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . "invoice_payments" );
}
$getState = $dbh->prepare(
foreach ( $members as $member ) {
- $importResults .= '<pre>$member: ' . print_r( $member, true ) . '</pre>';
+ // $importResults .= '<pre>$member: ' . print_r( $member, true ) . '</pre>';
// Get the new id of member (old_member_id).
$newMemberId = $this->wpdb->get_var(
$member['member_id']
)
);
- $importResults .= '<pre>$newMemberId: ' . print_r( $newMemberId, true ) . '</pre>';
+ // $importResults .= '<pre>$newMemberId: ' . print_r( $newMemberId, true ) . '</pre>';
if ( $newMemberId ) {
'%s', // billing_county
);
- $importResults .= '<pre>$accountData: ' . print_r( $accountData, true ) . '</pre>';
+ // $importResults .= '<pre>$accountData: ' . print_r( $accountData, true ) . '</pre>';
// Check if member has an account.
$accountId = $this->wpdb->get_var(
$newMemberId
)
);
- $importResults .= '<pre>$accountId: ' . print_r( $accountId, true ) . '</pre>';
+ // $importResults .= '<pre>$accountId: ' . print_r( $accountId, true ) . '</pre>';
// If not create one.
if ( !$accountId ) {
} else {
// Else update account.
- $this->wpdb->update(
- GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . 'accounts',
- $accountData,
- array( 'id' => $accountId ),
- $accountDataFormat,
- array( '%d' )
- );
+ // $this->wpdb->update(
+ // GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . 'accounts',
+ // $accountData,
+ // array( 'id' => $accountId ),
+ // $accountDataFormat,
+ // array( '%d' )
+ // );
}