From 8b720c5fd0046c34364cc84f695a7cfaa4f2de9a Mon Sep 17 00:00:00 2001
From: Imran Hussain <imranh@sucs.org>
Date: Mon, 3 Oct 2016 16:31:19 +0100
Subject: [PATCH] fix suapi

---
 lib/suapiv2.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/suapiv2.php b/lib/suapiv2.php
index 4bf5db8..b11c5fb 100644
--- a/lib/suapiv2.php
+++ b/lib/suapiv2.php
@@ -31,8 +31,10 @@ $membership_data = $formated_raw_data["table1"]["table1_Product_Collection"]["ta
 
 // make a new array that just contains *every* member no matter what they bought
 $just_members = array();
-foreach ($membership_data["Detail_Collection"]["Detail"] as $member) {
-    array_push($just_members, $member["@attributes"]);
+foreach ($membership_data as $typeOfMember) {
+	foreach ($typeOfMember["Detail_Collection"]["Detail"] as $member) {
+		array_push($just_members, $member["@attributes"]);
+	}
 }
 
 /* You can now use $just_members to probe member detials. It's an array of arrays which each contain:
-- 
GitLab