* Plugin Name: GLM Members Database Leads
* Plugin URI: http://www.gaslightmedia.com/
* Description: Gaslight Media Members Database.
- * Version: 1.0.0
+ * Version: 1.0.1
* Author: Gaslight Media
* Author URI: http://www.gaslightmedia.com/
* License: GPL2
* @package glmMembersDatabaseLeadsAddOn
* @author Chuck Scott <cscott@gaslightmedia.com>
* @license http://www.gaslightmedia.com Gaslightmedia
- * @version 1.0.0
+ * @version 1.0.1
*/
/*
* so that we're sure the other add-ons see an up to date
* version from this plugin.
*/
-define('GLM_MEMBERS_LEADS_PLUGIN_VERSION', '1.0.0');
+define('GLM_MEMBERS_LEADS_PLUGIN_VERSION', '1.0.1');
define('GLM_MEMBERS_LEADS_PLUGIN_DB_VERSION', '0.0.7');
// This is the minimum version of the GLM Members DB plugin require for this plugin.
switch ( $option ) {
case 'csv':
$sql = "
- SELECT T.*
- FROM " . GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . "lead_entry T
+ SELECT T.*,L.email
+ FROM " . GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . "lead_entry T,
+ " . GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . "leads L
WHERE $where
+ AND T.lead_id = L.id
ORDER BY $order";
$leads = $this->wpdb->get_results( $sql, ARRAY_A );
break;
if ( isset( $leads ) && is_array( $leads ) && !empty( $leads ) ) {
$lead_counter = 0;
foreach ( $leads as $entry_id => $lead ) {
+ $source_name = $this->wpdb->get_var(
+ $this->wpdb->prepare(
+ "SELECT title
+ FROM " . GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . "sources
+ WHERE id = %d",
+ $lead['source_id']
+ )
+ );
$out = array(
'fname' => $lead['fname'],
'lname' => $lead['lname'],
- 'email' => $lead['lead_id']['name'],
+ 'email' => $lead['email'],
'addr1' => $lead['addr1'],
'addr2' => $lead['addr2'],
'city' => $lead['city'],
'phone2' => $lead['phone2'],
'fax' => $lead['fax'],
'date_submitted' => $lead['date_submitted'],
- 'source' => $lead['source_id']['name'],
+ 'source' => $source_name,
);
// Add fields for group names
if ( $groups ) {