Update how to get member list for coupon edit page
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 26 Jan 2016 21:06:56 +0000 (16:06 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 26 Jan 2016 21:06:56 +0000 (16:06 -0500)
Also update how it is getting the member info record that is active when
it needs it for printing the coupons.

controllers/front.php
index.php
models/coupon.php

index 9db5425..3519b1f 100644 (file)
@@ -151,7 +151,8 @@ class glm_coupon_front
               SELECT m.member_name, addr1,c.name as city,state,zip
                 FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "member_info m
                      LEFT OUTER JOIN " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "cities c ON (c.id = m.city)
-               WHERE m.id = {$id}";
+               WHERE m.member = {$id}
+                AND m.status = 10";
             $results = $wpdb->get_results($sql, ARRAY_A);
             if ($results[0]) {
                 $address = array();
index 0a49362..8072f19 100644 (file)
--- a/index.php
+++ b/index.php
@@ -2,7 +2,7 @@
 /**
  * Plugin Name: Gaslight Media Coupons
  * Description: Coupon Application for Gaslight Media Clients.
- * Version: 0.1.0 Beta
+ * Version: 0.1.1 Beta
  * Author: Steve Sutton
  * Author URI: http://www.gaslightmedia.com
  * License: All right reserved
index a3708aa..092eeb2 100644 (file)
@@ -234,10 +234,9 @@ class glm_coupons_coupon
             return false;
         } else {
             $sql = "
-              SELECT id,member_name as name
-                FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "member_info
-               WHERE status = 10
-            ORDER BY member_name";
+              SELECT id,name
+                FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "members
+            ORDER BY name";
             $results = $wpdb->get_results($sql, ARRAY_A);
             foreach ($results as $row) {
                  $members[] = $row;