Skip to content
Snippets Groups Projects
Commit 2d1b2e2b authored by Imran Hussain's avatar Imran Hussain
Browse files

Write a function to work around broken msl shit

parent a297fa5b
No related branches found
No related tags found
No related merge requests found
......@@ -31,12 +31,29 @@ $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 as $typeOfMember) {
foreach ($typeOfMember["Detail_Collection"]["Detail"] as $member) {
array_push($just_members, $member["@attributes"]);
function filter_array($data){
global $just_members;
// we have more than one type of member if this is true
if (count($data[0]["Detail_Collection"]["Detail"][0]["@attributes"]) == 7){
//split them up then feed them back
foreach ($data as $membershipType){
filter_array($membershipType);
}
// we have more then 1 of the same type of member if this is true
} else if (count($data["Detail_Collection"]["Detail"][0]["@attributes"]) == 7) {
//wack them onto the used array
foreach ($data["Detail_Collection"]["Detail"] as $member) {
array_push($just_members, $member["@attributes"]);
}
// we have 1 member :(
} else if (count($data["Detail_Collection"]["Detail"]["@attributes"]) == 7) {
array_push($just_members, $data["Detail_Collection"]["Detail"]["@attributes"]);
}
}
filter_array($membership_data);
/* You can now use $just_members to probe member detials. It's an array of arrays which each contain:
* transaction_id (recepit id)
* purchaser (full name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment