Reverse checking in a geneology using php

I am making commission based level software. I mean it is like distributorship. If ’A’ joins the system as distributor and joins three members (B,C,D) to the system then he should get extra 5% for every sales happening under him or under B, C, D. If suppose B also introduces three members( E, F, G) to the system under him then the 5% of every sales happening under B has to go to ‘B’ not to ‘A’. How can I write a coding for this in php? Here whenever a new member comes he has to check who is the one above him who is having the qualification and the 5% has to be given immediately to him automatically. Please help me in this problem.

I’m assuming this is a homework assignment.

Do you have to have a database to keep track of it, or is it all suppose to be done in arrays?

Without knowing the specifics - it’s hard to tell what your instructor is looking for.

What that is is a multi-level marketing application otherwise known as MLM

AKA Pyramid marketing scheme. Still sounds like homework though. If it wasn’t homework, I would have the person that is signing people up to have a unique id that they give to new suckers, I mean distributors. The new signee then inputs the persons code and the program looks up the id and then links it to the person they are under.

Oh and only a single datatable would be needed.

Here’s a good example of a pyramid …errr I mean distribution system - http://www.amway.com/ ;D

So many of them…

Herbalife
Nuskin
Monavie
Isagenix

Just about every vitamin nutrition company.

Lets not forget the latest scam…uh I mean business opportunity, Thrive. They get you to commit to a lease or purchase of a high end luxury car and IF you sell $12,000.00 of their product they will give you $800 for only that month toward the payment other wise you make the payments. About a 6.5% commission on 12G in sales.

Sponsor our Newsletter | Privacy Policy | Terms of Service