<?php

	include $_SERVER['DOCUMENT_ROOT'] . "/dbase/dbaseconnection.php";
    include $_SERVER['DOCUMENT_ROOT'] . "/functions/functions.php";
    include $_SERVER['DOCUMENT_ROOT'] . "/functions/mlmfunctions.php";

    /*$sp='RL20180100001';
    computematrixbonus($sp);
    $userid=7;
    setparentid($sp,$userid)*/


    /*function get_all_children2($parentid,$grand_child=false){
    	$child_result=mysql_query("SELECT * FROM mlmmembers WHERE parentid=".$parentid);

    	if(mysql_num_rows($child_result)>0){
    		?>
    			<ul>
    				<?php
    					while($rows=mysql_fetch_array($child_result)){
    						?>
    						<li class="collapsed"><?php echo $rows['username'];?>
    						<?php get_all_children($rows['userid'],true);?> 
						</li>
						<?php
    					}
    				?>
    			</ul>
    		<?php
    	}
    }*/

?>

<!DOCTYPE html>
<html>
<head>
	<title>Family Tree</title>
    <!--<link rel="stylesheet" href="/css/styles.css"/>
    <link rel="stylesheet" href="/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="/css/jquery.jOrgChart.css"/>
    <link rel="stylesheet" href="/jquery-ui/jquery-ui.min.css"/>
    <link rel="stylesheet" href="/css/custom.css"/>-->
</head>
<style type="text/css">
	


</style>
<body style="background: #ccc;">
	

        <?php
            $result=mysql_query("SELECT * FROM mlmmembers WHERE parentid=1");

            if(mysql_num_rows($result)>0){
                while($rows=mysql_fetch_array($result)){
                    ?>                        
                        <li>
                            
                            <?php 
                                $userid=$rows['userid'];
                                $currentstage=currentstage($userid);
                                $memberdepth=memberdepth($userid);

                            ?>

                            <?php echo $rows['username'] . "(". $currentstage . ")" . "(". $memberdepth . ")";?>
                            <?php get_all_children($userid);?>
                       
                        </li>
                    <?php
                }
            }
        ?>
       
    
    
   
	
    <!--<script type="text/javascript" src="/js/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="/jquery-ui/jquery-ui.min.js"></script>
    <script type="text/javascript" src="/js/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src='/js/mlm.js'> </script>
    <script type="text/javascript" src="/js/jquery.jOrgChart.js"></script>-->
    <script>
        
    </script>
</body>
</html>