MLM Questions please?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



MLM Questions please?
 
Can someone please help me out to find solution to the site that involves referral as explain below:
 
The script I have design is only for one stage referral as I need to find solution on how this could best be done on either 3*3 matrixes or 5*5 matrixes.
 
Detail explanation please:
 
The whole PHP script I need to achieve this should look like a tree diagram otherwise (three by four matrixes) that involves say 5 levels of contacts to reach the 5th level. 
 





 
Level of contacts
 


5


4


3


2


1


0
 
 
The zero (o) level of contact is the ground state where participant register their membership and can invite maximum of 5 other contacts to participate to promote their interest via email. 
Example: Assuming James register his membership and occupy the zero position and then invite five contacts say A,B,C,D.E to build his downline.
 
Assuming 100% participation (It is possible that all 5 may not register their invitation)  and that all invitees register their membership, the new members will occupy the zero position and each would promote James to level one.
At level 1 James will have 5 contacts, let call these 1st degree promotions. 
 
If A, B, C, D,E invite 5 contacts each, assuming 100% participation or less, each of  A, B.C.D.E will be promoted to level 1 by their respective 5 contacts for each of them, 1st degree promotions for each of them.
 
Now, James will be promoted to level 2 by contact of A, B, C, D, E, meaning that James will be promoted to level 2 by 25 contacts. Let call these 2nd degree promotions for James.
 
If all the 1st degree promoters of A,B,C,D,E invite five contacts each, assuming 100% participation or less, A, B, C, D,E will be promoted to level 2 by a total of 25 new contacts .
 
And James will be promoted to level 3 by 125 contacts, 3rd degree promotion for James.
 
Assuming 100% participation continue at level 4 James will be promoted by 625 participant , 4th Degree promotion for James all things be constant for others participant at all level.
 
At level 5 James will now be promoted by 3125 participant and then leave the scheme at this level. 
 
 
 
 
 
The table would look like this assuming 100% participations:
 
Table 1





Level

Participants

Promotions


5

P

3125


4

Z

625


3

Y

125


2

X

25


1

A

5


0

James

0
 
 
 
We would also have the statistics table for each member that displays numbers of promoters at each level at a particular time. Assuming registration of new members will not be done at the same time. 
 
And members should also access these pages by simply login using their username. 
 
Table 2





E.g. Statistic Level for James

Numbers of promoters


5

[X5]


4

[X4]


3

[X3]


2

[X2]


1

[X1]


Total

[total]
 
Where X1, X2, X3, X4, X5 are the numbers of promoters at each stage, a click on any of the [X] should display certain information (say their full name and country of the contacts e.t.c) of the promotion at each stage. 
 
My analysis:
 
Four tables (Just suggestion it can be change as guideline how to do this is welcome):
 
The 1st table will register participating members and the PHP script here should check that member is not register twice on the basis of their email unique. 
The sign up form (signup.php) for new members:
 
<?php
              
              if(isset($_GET[ref]))
              $refid=$_GET[ref];
              else
             { $refid=admin;}
                        if(isset($_POST[Submit]))
                        {
                        include("connect.php");
                         $name=mysql_real_escape_string($_POST[name]);
                        $email=mysql_real_escape_string($_POST[email]);
                        $password=mysql_real_escape_string($_POST[password]);
                        $password2=mysql_real_escape_string($_POST[password2]);
                        $actkey = mt_rand(1, 5000).'kg78dzet899dd';
        $act = sha1($actkey);
                        $ip = $_SERVER['REMOTE_ADDR'];
                        $mailcheck=mysql_query("SELECT email FROM members WHERE email='$email'");
                        
                        $msg="<font color=red><strong><blockquote>The following error(s) occured in your signing up.
Please go over the form to correct the affected field(s):</blockquote></strong></font>";
 
if(mysql_num_rows($mailcheck)>0){
$msg=$msg."<ul><li><font color=red>Email address already used.</font></li></ul>";
$fstatus= "NOTOK";}
if (empty($email)){
$msg=$msg."<ul><li><font color=red>You didn't enter your email address.</font></li></ul>";
$fstatus= "NOTOK";}
if($fstatus=="NOTOK"){ 
echo "<center>$msg</center>";}
else
{
$ins=mysql_query("insert into members(name,email,pass,confirm1,confirm2,refid,upcode,date1,date2,date3,actkey,ip)VALUES('$name','$email','$password',0,0,'$refid','0',CURDATE(),CURDATE(),CURDATE(),'$act','$ip')"); 
if(!$ins)
{echo "Error: ".mysql_error();}
$message="Hi $name\n\nThank you for your interest in our site.\nYou will need to confirm your registration by clicking the following link:\n\n
http://www.mysite.com /confirm.php?ackey=$act \n\nThank you\nThe Admin Team";
 
mail($email," CONFIRMATION",$message,"From:no-reply@xxxxxxxxxx");
echo "<font color=green>Thanks for your interest in our site, your welcome gift and confirmation link has been sent to your email address <b>$email</b>, you will need 
to check and click on the link to confirm your membership.</font>";  
}
mysql_close($con);
}
?>
 
 
The 2nd table should be for register members to invite their contact. The PHP script is the simple message PHP script, and once the number of invitee from a single member reach 5 that members cannot invite any more members’ registration of participating members will be done against their invitee at level 1.
 
 
Friend Invitation Form-sends link to 5 friends: 
 
<?php
              if (!empty($_POST[Submit]))
{
include("connect.php");
$email=$_SESSION['xyz'];
$yname=$_POST[yname];
$fr1=$_POST[fr1];
$fr2=$_POST[fr2];
$fr3=$_POST[fr3];
$fr4=$_POST[fr4];
$fr5=$_POST[fr5];
 
$messg="Hello friend,\n\nJoin our membership site by clicking this link :\n http://www.mysite.com/signup.php?ref=$email ";
 mail($fr1,"Important Message from your friend $yname",$messg,"From:$email"); 
mail($fr2,"Important Message from your friend $yname",$messg,"From:$email");
mail($fr3,"Important Message from your friend $yname",$messg,"From:$email");
 
mail($fr4,"Important Message from your friend $yname",$messg,"From:$email");
 
mail($fr5,"Important Message from your friend $yname",$messg,"From:$email");
 
echo "<font color=blue><b>Your link has been sent to the specified email addreses,you can send more by using the form again. Thank you.</b></font>";
 
 
}            
  ?>
 
 
The 3rd table should be table 1 above and the PHP script should run the query that would show the movement of participant up the tree from level 1 to level 5 as one move from level one to level 5. I’m bit finding it hard to put this PHP script together 
 
The 4th table should be table 2 above the statistics tables for each member that displaying numbers of promoters at each level. Even if participation is not 100% . I’m bit finding it hard to put this PHP script together 
 
 
 
If my request disturbs this forum please bear with me as I am curios to get this straight even as I am gradually improving on PHP script writing. Waiting to find and answer and guide to my request.
 
 
Gab
 


      

[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux