Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sucs-site
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andrew Price
sucs-site
Commits
2d1b2e2b
Commit
2d1b2e2b
authored
8 years ago
by
Imran Hussain
Browse files
Options
Downloads
Patches
Plain Diff
Write a function to work around broken msl shit
parent
a297fa5b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/suapiv2.php
+20
-3
20 additions, 3 deletions
lib/suapiv2.php
with
20 additions
and
3 deletions
lib/suapiv2.php
+
20
−
3
View file @
2d1b2e2b
...
...
@@ -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)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment