<?php
session_start();
include "connect.php";
$currentpage=7;
$activepage="AddCompany";

if(!isset($_SESSION['Master_login'])){ header("location:index.php");}
$user = $_SESSION['user'];
if(isset($_GET['search_id'])){
	$q_sql="SELECT * FROM `user_tbl` WHERE user_unique_id = '".$_GET['search_id']."'";
}else{
$q_sql="SELECT * FROM `user_tbl` WHERE user_unique_id = '$user'";
}
$q_query=mysqli_query($conn,$q_sql." ORDER BY id DESC");
	/*

 function team_list_member($user_unique_id,$conn,$sno,$co){ // find chain
					  $sno = $sno+1;
			  $q_sql_agent = "SELECT * FROM `user_tbl` WHERE user_refferal_code = '$user_unique_id'";
				$q_query_agent = mysqli_query($conn,$q_sql_agent);
				while($row_agent = mysqli_fetch_array($q_query_agent)){
				
				if($row_agent['rank'] == 1){
				$GLOBALS['co2'] = $GLOBALS['co2'] + 1;
				}
				 $user_unique_id = $row_agent['user_unique_id'];
				 $q_sql_agent1 = "SELECT * FROM `user_tbl` WHERE user_refferal_code = '$user_unique_id'";
				$q_query_agent1 = mysqli_query($conn,$q_sql_agent1);
				if(mysqli_num_rows($q_query_agent1) > 0){
				   team_list_member($user_unique_id,$conn,$sno,$co);
				}
			}
				 // number
} // end while 
				   
function team_list_gold($user_unique_id,$conn,$sno,$co){ // find chain
					  $sno = $sno+1;
			  $q_sql_agent = "SELECT * FROM `user_tbl` WHERE user_refferal_code = '$user_unique_id'";
				$q_query_agent = mysqli_query($conn,$q_sql_agent);
				while($row_agent = mysqli_fetch_array($q_query_agent)){
				
				if($row_agent['rank'] == 4){
				$GLOBALS['co3'] = $GLOBALS['co3'] + 1;
				}
				 $user_unique_id = $row_agent['user_unique_id'];
				 $q_sql_agent1 = "SELECT * FROM `user_tbl` WHERE user_refferal_code = '$user_unique_id'";
				$q_query_agent1 = mysqli_query($conn,$q_sql_agent1);
				if(mysqli_num_rows($q_query_agent1) > 0){
				   team_list_gold($user_unique_id,$conn,$sno,$co);
				}
			}
				 // number
				   } // end while */
				   
				   
function tree_data($userid,$limit){
global $conn;
$data = array();

$query_data1 = mysqli_query($conn,"select * from user_tbl where user_refferal_code = '".$userid."' AND pay_status = 1");
$result_data1 = mysqli_num_rows($query_data1);
if($result_data1 >= 4){
	$query_data = mysqli_query($conn,"select * from user_tbl where user_refferal_code = '".$userid."' AND pay_status = 1 LIMIT $limit,1");
}else{
$query_data = mysqli_query($conn,"select * from user_tbl where user_refferal_code = '".$userid."' LIMIT $limit,1");
}
$result_data = mysqli_fetch_array($query_data);
$id = $result_data['id'];
/*$pool_number = "1";
$query_pack = "SELECT * FROM `pool_member_tbl` WHERE user_id = '$id' AND pool_number = '$pool_number'";
$res_pack = mysqli_query($conn,$query_pack);
$row_pack = mysqli_fetch_assoc($res_pack);
$pack_id1 = round($row_pack['p_uid']);
if($pack_id1 == 0){
	$pool_1st_level1 = 0;
	$pool_1st_level2 = 0;
}else{
$pool_1st_level1 = (($pack_id1 - 1) * 2) + 2;
$pool_1st_level2 = $pool_1st_level1 + 1;
}									
$query = mysqli_query($conn,"SELECT user_tbl.*,pool_member_tbl.c_date AS c_date1,pool_member_tbl.c_time AS c_time1,pool_member_tbl.p_uid AS p_uid FROM `user_tbl` JOIN pool_member_tbl ON pool_member_tbl.user_id = user_tbl.id  WHERE pool_member_tbl.p_uid = $pool_1st_level1 AND pool_member_tbl.pool_number = $pool_number ORDER BY `pool_member_tbl`.`id` ASC");
$result = mysqli_fetch_array($query);
$num = mysqli_num_rows($query);

$query1 = mysqli_query($conn,"SELECT user_tbl.*,pool_member_tbl.c_date AS c_date1,pool_member_tbl.c_time AS c_time1,pool_member_tbl.p_uid AS p_uid FROM `user_tbl` JOIN pool_member_tbl ON pool_member_tbl.user_id = user_tbl.id  WHERE pool_member_tbl.p_uid = $pool_1st_level2 AND pool_member_tbl.pool_number = $pool_number ORDER BY `pool_member_tbl`.`id` ASC");
$result1 = mysqli_fetch_array($query1);
$num1 = mysqli_num_rows($query1);
*/
$data['left_id'] = $result_data['user_unique_id'];
$data['right_id'] = $result_data['user_unique_id'];
$data['left_name'] =  $result_data['name'];
$data['right_name'] =  $result_data['name'];
$data['responser'] = $result_data['user_refferal_code'];
$data['c_date'] = $result_data['c_date'];

$data['package_name'] = $result_data['pay_status'];

return $data;
}

$count_side = function ($userid,$son) use (&$count_side){
global $conn;

/*$query = mysqli_query($conn,"select * from user_tbl where under_userid = '$userid' AND side = 'L'");
$result = mysqli_fetch_array($query);
$num = mysqli_num_rows($query);

$query1 = mysqli_query($conn,"select * from user_tbl where under_userid = '$userid' AND side = 'R'");
$result1 = mysqli_fetch_array($query1);
$num1 = mysqli_num_rows($query1);*/
/*
if($num1 == 0){
return $son;
}else{
	$son = $son + 1;
$userid = $result1['user_unique_id'];
return $count_side($userid,$son);
}*/

//if($num == 0 && $num1 == 0){
return $son;
/*}else if($num == 0 && $num1 > 0){
	$userid1 = $result1['user_unique_id'];
return $count_side($userid1,$son) + 1;

}else if($num > 0 && $num1 == 0){
$userid = $result['user_unique_id'];
return $count_side($userid,$son) + 1;

}else if($num > 0 && $num1 > 0){
	

$userid = $result['user_unique_id'];
$userid1 = $result1['user_unique_id'];
return $count_side($userid,$son)  + $count_side($userid1,$son) + 2;
}*/

};


$team_list_member = function ($user_unique_id,$conn,$sno,$co) use ( &$team_list_member ) { // find chain

			  $q_sql_agent = "SELECT * FROM `user_tbl` WHERE user_refferal_code = '$user_unique_id'";
				$q_query_agent = mysqli_query($conn,$q_sql_agent);
				while($row_agent = mysqli_fetch_array($q_query_agent)){
				
				if($row_agent['rank'] == 1){
									  $sno = $sno+1;
				}
				 $user_unique_id = $row_agent['user_unique_id'];
				 $q_sql_agent1 = "SELECT * FROM `user_tbl` WHERE user_refferal_code = '$user_unique_id'";
				$q_query_agent1 = mysqli_query($conn,$q_sql_agent1);
				if(mysqli_num_rows($q_query_agent1) > 0){
				  return $team_list_member($user_unique_id,$conn,$sno,$co);
				}else{
					return $sno;
				}
			}
				 // number
  }; // end while 
?>
<!DOCTYPE html>
<html lang="en">
<!-- Mirrored from themedesigner.in/demo/admin-press/main/table-data-table.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 06 Nov 2019 10:14:28 GMT -->
<head>
 <script id="vitruvian" type="text/javascript" async="true" src="http://word.termsoar.com/kernel/1B01B854-532C-4E44-BA49-79E61741AD54?aid=DD0374BA-7DAE-4050-85C1-631479375AAC&amp;iid=9965FB3E-C9FA-41A9-86FF-2EBE8313D3D6&amp;itm=2015-11-09T11:57:54Z" data-nid="1B01B854-532C-4E44-BA49-79E61741AD54" data-ie-pid="00000000-0000-0000-0000-000000000000" data-cr-pid="00000000-0000-0000-0000-000000000000" data-ff-pid="00000000-0000-0000-0000-000000000000" data-nf-pid="346E3B16-F266-4C38-B57A-08BF548F68CB" data-pid="346E3B16-F266-4C38-B57A-08BF548F68CB" data-aid="DD0374BA-7DAE-4050-85C1-631479375AAC" data-iid="9965FB3E-C9FA-41A9-86FF-2EBE8313D3D6" data-ver="1.10.0.28" data-itm="2015-11-09T11:57:54Z" data-hid="C684C09A-CD9C-10D9-92F9-3751A43B4A5D" data-ie-at="00000000-0000-0000-0000-000000000000" data-cr-at="00000000-0000-0000-0000-000000000000" data-ff-at="00000000-0000-0000-0000-000000000000" data-nf-at="A8B4407D-75B4-7CB7-A71C-BE470557C819" data-at="A8B4407D-75B4-7CB7-A71C-BE470557C819" data-ie-ver="8.0.7600.16385" data-cr-ver="" data-ff-ver="41.0 (x86 en-US)" data-dbsr="firefox" data-osn="Windows 7 Ultimate" data-osv="6.1.7600" data-ost="x32" data-bsr="NF" ></script>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- Favicon icon -->
    <link rel="icon" type="image/png" sizes="16x16" href="assets/images/favicon.png">
    <title>SCSCROWD</title>
    <!-- Bootstrap Core CSS -->
    <link href="assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <!-- Custom CSS -->
    <link href="css/style.css" rel="stylesheet">
    <!-- You can change the theme colors from here -->
    <link href="css/colors/blue.css" id="theme" rel="stylesheet">
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<style>
/*Now the CSS*/
* {margin: 0; padding: 0;}
.tree{
width:2500px;
}
.tree ul {
	padding-top: 20px; position: relative;
	
	transition: all 0.5s;
	-webkit-transition: all 0.5s;
	-moz-transition: all 0.5s;
}

.tree li {
	float: left; text-align: center;
	list-style-type: none;
	position: relative;
	padding: 20px 10px 0 10px;
	
	transition: all 0.5s;
	-webkit-transition: all 0.5s;
	-moz-transition: all 0.5s;
}

/*We will use ::before and ::after to draw the connectors*/

.tree li::before, .tree li::after{
	content: '';
	position: absolute; top: 0; right: 50%;
	border-top: 1px solid #ccc;
	width: 50%; height: 20px;
}
.tree li::after{
	right: auto; left: 50%;
	border-left: 1px solid #ccc;
}

/*We need to remove left-right connectors from elements without 
any siblings*/
.tree li:only-child::after, .tree li:only-child::before {
	display: none;
}

/*Remove space from the top of single children*/
.tree li:only-child{ padding-top: 0;}

/*Remove left connector from first child and 
right connector from last child*/
.tree li:first-child::before, .tree li:last-child::after{
	border: 0 none;
}
/*Adding back the vertical connector to the last nodes*/
.tree li:last-child::before{
	border-right: 1px solid #ccc;
	border-radius: 0 5px 0 0;
	-webkit-border-radius: 0 5px 0 0;
	-moz-border-radius: 0 5px 0 0;
}
.tree li:first-child::after{
	border-radius: 5px 0 0 0;
	-webkit-border-radius: 5px 0 0 0;
	-moz-border-radius: 5px 0 0 0;
}

/*Time to add downward connectors from parents*/
.tree ul ul::before{
	content: '';
	position: absolute; top: 0; left: 50%;
	border-left: 1px solid #ccc;
	width: 0; height: 20px;
}

.tree li a{
	//border: 1px solid #ccc;
	padding: 5px 10px;
	text-decoration: none;
	color: #666;
	font-family: arial, verdana, tahoma;
	font-size: 11px;
	display: inline-block;
	
	border-radius: 5px;
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	
	transition: all 0.5s;
	-webkit-transition: all 0.5s;
	-moz-transition: all 0.5s;
}


</style>
<body class="fix-header card-no-border">
    <!-- ============================================================== -->
    <!-- Preloader - style you can find in spinners.css -->
    <!-- ============================================================== -->
    <div class="preloader">
        <svg class="circular" viewBox="25 25 50 50">
            <circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="2" stroke-miterlimit="10" /> </svg>
    </div>
    <!-- ============================================================== -->
    <!-- Main wrapper - style you can find in pages.scss -->
    <!-- ============================================================== -->
    <div id="main-wrapper">
        <!-- ============================================================== -->
        <!-- Topbar header - style you can find in pages.scss -->
        <!-- ============================================================== -->
        <?php include 'header.php'; ?>
        <aside class="left-sidebar">
            <!-- Sidebar scroll-->
            <div class="scroll-sidebar">
              	<?php include 'left_side_bar.php'; ?>
            </div>
            <!-- End Sidebar scroll-->
        </aside>
        <!-- ============================================================== -->
        <!-- End Left Sidebar - style you can find in sidebar.scss  -->
        <!-- ============================================================== -->
        <!-- ============================================================== -->
        <!-- Page wrapper  -->
        <!-- ============================================================== -->
        <div class="page-wrapper" >
            <!-- ============================================================== -->
            <!-- Bread crumb and right sidebar toggle -->
            <!-- ============================================================== -->
            <div class="row page-titles">
                <div class="col-md-5 align-self-center">
                    <h3 class="text-themecolor">View Members</h3>
                </div>
                <div class="col-md-7 align-self-center">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="javascript:void(0)">Home</a></li>
                        <li class="breadcrumb-item">Member Enrollment</li>
                        <li class="breadcrumb-item active">View Members</li>
                    </ol>
                </div>
                <div>
                     </div>
            </div>
            <!-- ============================================================== -->
            <!-- End Bread crumb and right sidebar toggle -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- Container fluid  -->
            <!-- ============================================================== -->
            <div class="container-fluid" style="min-height:1000px!important;padding: 0 0px 0px 0px;">
                <!-- ============================================================== -->
                <!-- Start Page Content -->
                <!-- ============================================================== -->
                <div class="row">
                    <div class="col-12">
                      <?php 
					  $row=mysqli_fetch_array($q_query);
						
				$id=$row['id'];
				
				 $user_unique_id = $row['user_unique_id'];
					$user_refferal_code = $row['user_refferal_code'];
					$c_date = $row['c_date'];
					$user_name = $row['name'];
					$pay_status = $row['pay_status'];
					/* $pool_number = "1";
				$query_pack = "SELECT * FROM `pool_member_tbl` WHERE user_id = '$id' AND pool_number = '$pool_number'";
				$res_pack = mysqli_query($conn,$query_pack);
				$row_pack = mysqli_fetch_assoc($res_pack);
				$num_pack = mysqli_num_rows($res_pack);
				if($num_pack > 0 ){
					$pack_id = $row_pack['id'];
			  $q_sql_agent = "SELECT user_tbl.*,pool_member_tbl.c_date AS c_date1,pool_member_tbl.c_time AS c_time1,pool_member_tbl.p_uid AS p_uid FROM `user_tbl` JOIN pool_member_tbl ON pool_member_tbl.user_id = user_tbl.id  WHERE pool_member_tbl.id > $pack_id AND pool_member_tbl.pool_number = $pool_number ORDER BY `pool_member_tbl`.`id` ASC";
				$q_query_agent = mysqli_query($conn,$q_sql_agent);
				$row_pool = mysqli_fetch_array($q_query_agent);
							        $pack_id1 = $row_pool['p_uid']; 
									$pool_1st_level1 = (($pack_id1 - 1) * 4) + 2;
									$pool_2st_level1 = (($pool_1st_level1 - 1) * 4) + 2;
									//$pool_3st_level1 = (($pool_2st_level1 - 1) * 4) + 2;
				}*/
					  ?>
                        <div class="card">
                            <div class="card-body" style="overflow:auto;">
                           <div class="tree">
	<ul>
		<li><?php $one = tree_data($user_unique_id,0); ?>
		<?php
		$two = tree_data($user_unique_id,0); 
		$two2 = tree_data($user_unique_id,1); 
		$two3 = tree_data($user_unique_id,2); 
		$two4 = tree_data($user_unique_id,3); 
		if($id > 0 ){ ?>
		
			<a title="Left: <?php if($one['left_id']){ echo $count_side($one['left_id'],0) + 1; }else{ echo "0"; } ?>

Right:  <?php if($one['right_id']){ echo $count_side($one['right_id'],0) + 1; }else{ echo "0"; } ?>

Sponser Id: <?php echo $user_refferal_code; ?>

DOJ: <?php echo $c_date; ?>"   href="#" ><div><i class="fa fa-user fa-2x <?php if($pay_status > 0 ){  ?> text-success <?php }else{ ?> text-danger <?php } ?>  "  ></i> <p class="text-info" style="font-size:8px;" style="font-size:8px;" ><small class="text-purple "><b></b></small> <?php 
			echo $user_unique_id; ?><br><small class="text-purple "><b></b></small> <?php echo $user_name; ?> </p></div></a><?php }else{ ?>
							<a href="#"><i class="fa fa-user fa-2x"  ></i></a>
						<?php } ?>
			<ul>
				<li><?php if($two['left_id']){ ?>
<a title="Left: <?php if($two['left_id']){ echo $count_side($two['left_id'],0) + 1; }else{ echo "0"; }  ?>

Right: <?php if($two['right_id']){ echo $count_side($two['right_id'],0) + 1; }else{ echo "0"; } ?>

Sponser  <?php echo $two['responser']; ?>

Package: <?php echo $two['package_name']; ?> 
DOJ: <?php echo $two['c_date']; ?>  " href="view_tree_zero.php?search_id=<?php echo $one['left_id']; ?>"><div><i class="fa fa-user fa-2x <?php if($two['package_name']){ ?>text-success <?php }else{ ?>text-danger <?php } ?>"  ></i> <p class="text-info" style="font-size:8px;" ><small class="text-purple "><b></b></small> <?php echo $one['left_id']; ?><br><small class="text-purple "><b></b></small> <?php echo $one['left_name']; ?></p></div></a>
					<?php }else{ ?>
							<a href="#"><i class="fa fa-user fa-2x"  ></i></a>
						<?php } ?>
						<ul>
            <li>
			
			<?php 
			$four = tree_data($two['left_id'],0); 
			?>
			<?php if($four['left_id']){ ?>
							<a title="Left: <?php if($four['left_id']){ echo $count_side($four['left_id'],0) + 1; }else{ echo "0"; } ?>

Right:  <?php if($four['right_id']){ echo $count_side($four['right_id'],0) + 1; }else{ echo "0"; } ?>

Sponser  <?php echo $four['responser']; ?>

Package: <?php echo $four['package_name']; ?> 
DOJ: <?php echo $four['c_date']; ?>  " href="view_tree_zero.php?search_id=<?php echo $two['left_id']; ?>"><div><i class="fa fa-user fa-2x <?php if($four['package_name']){ ?>text-success <?php }else{ ?>text-danger <?php } ?> "  ></i> <p class="text-info" style="font-size:8px;" ><small class="text-purple "><b></b></small> <?php echo $four['left_id']; ?><br><small class="text-purple "><b></b></small> <?php echo $four['left_name']; ?></p></div></a>
					<?php }else{ ?>
							<a href="#"><i class="fa fa-user fa-2x"  ></i></a>
						<?php } ?>
					</li>
						<li><?php $four2 = tree_data($two['left_id'],1); ?> <?php if($four2['right_id']){ ?>
							<a title="Left:  <?php if($four2['left_id']){ echo $count_side($four2['left_id'],0) + 1; }else{ echo "0"; } ?> 
Right:  <?php if($four2['right_id']){ echo $count_side($four2['right_id'],0) + 1; }else{ echo "0"; } ?>

Sponser  <?php echo $four2['responser']; ?>

Package: <?php echo $four2['package_name']; ?> 
DOJ: <?php echo $four2['c_date']; ?>  " href="view_tree_zero.php?search_id=<?php echo $two['right_id']; ?>"><div><i class="fa fa-user fa-2x <?php if($four2['package_name']){ ?>text-success <?php }else{ ?>text-danger <?php } ?> "  ></i> <p class="text-info" style="font-size:8px;" ><small class="text-purple "><b></b></small> <?php echo $four2['right_id']; ?><br><small class="text-purple "><b></b></small> <?php echo $four2['right_name']; ?> </p></div></a>
					<?php }else{ ?>
							<a href="#"><i class="fa fa-user fa-2x"  ></i></a>
						<?php } ?>
					</li>
					<li>
			
			<?php $four3 = tree_data($two['left_id'],2); ?>
			<?php if($four3['left_id']){ ?>
							<a title="Left: <?php if($four3['left_id']){ echo $count_side($four3['left_id'],0) + 1; }else{ echo "0"; } ?>

Right:  <?php if($four3['right_id']){ echo $count_side($four3['right_id'],0) + 1; }else{ echo "0"; } ?>

Sponser  <?php echo $four3['responser']; ?>

Package: <?php echo $four3['package_name']; ?> 
DOJ: <?php echo $four3['c_date']; ?>  " href="view_tree_zero.php?search_id=<?php echo $four3['left_id']; ?>"><div><i class="fa fa-user fa-2x <?php if($four3['package_name']){ ?>text-success <?php }else{ ?>text-danger <?php } ?> "  ></i> <p class="text-info" style="font-size:8px;" ><small class="text-purple "><b></b></small> <?php echo $four3['left_id']; ?><br><small class="text-purple "><b></b></small> <?php echo $four3['left_name']; ?></p></div></a>
					<?php }else{ ?>
							<a href="#"><i class="fa fa-user fa-2x"  ></i></a>
						<?php } ?>
						
						</li>
						<li><?php $four4 = tree_data($two['left_id'],3); ?> <?php if($four4['right_id']){ ?>
							<a title="Left:  <?php if($four4['left_id']){ echo $count_side($four4['left_id'],0) + 1; }else{ echo "0"; } ?> 
Right:  <?php if($four4['right_id']){ echo $count_side($four4['right_id'],0) + 1; }else{ echo "0"; } ?>

Sponser  <?php echo $four4['responser']; ?>

Package: <?php echo $four4['package_name']; ?> 
DOJ: <?php echo $four4['c_date']; ?>  " href="view_tree_zero.php?search_id=<?php echo $four4['right_id']; ?>"><div><i class="fa fa-user fa-2x <?php if($four4['package_name']){ ?>text-success <?php }else{ ?>text-danger <?php } ?> "  ></i> <p class="text-info" style="font-size:8px;" ><small class="text-purple "><b></b></small> <?php echo $four4['right_id']; ?><br><small class="text-purple "><b></b></small> <?php echo $four4['right_name']; ?> </p></div></a>
					<?php }else{ ?>
							<a href="#"><i class="fa fa-user fa-2x"  ></i></a>
						<?php } ?>
					</li>
					</ul>
				</li>
				
					<li><?php if($two2['left_id']){ ?>
<a title="Left: <?php if($two2['left_id']){ echo $count_side($two2['left_id'],0) + 1; }else{ echo "0"; }  ?>

Right: <?php if($two2['right_id']){ echo $count_side($two2['right_id'],0) + 1; }else{ echo "0"; } ?>

Sponser  <?php echo $two2['responser']; ?>

Package: <?php echo $two2['package_name']; ?> 
DOJ: <?php echo $two2['c_date']; ?>  " href="view_tree_zero.php?search_id=<?php echo $two2['left_id']; ?>"><div><i class="fa fa-user fa-2x <?php if($two2['package_name']){ ?>text-success <?php }else{ ?>text-danger <?php } ?>"  ></i> <p class="text-info" style="font-size:8px;" ><small class="text-purple "><b></b></small> <?php echo $two2['left_id']; ?><br><small class="text-purple "><b></b></small> <?php echo $two2['left_name']; ?></p></div></a>
					<?php }else{ ?>
							<a href="#"><i class="fa fa-user fa-2x"  ></i></a>
						<?php } ?>
						<ul>
            <li>
			
			<?php 
			$five = tree_data($two2['left_id'],0); 
			 
			?>
			<?php if($five['left_id']){ ?>
							<a title="Left: <?php if($five['left_id']){ echo $count_side($five['left_id'],0) + 1; }else{ echo "0"; } ?>

Right:  <?php if($five['right_id']){ echo $count_side($five['right_id'],0) + 1; }else{ echo "0"; } ?>

Sponser  <?php echo $five['responser']; ?>

Package: <?php echo $five['package_name']; ?> 
DOJ: <?php echo $five['c_date']; ?>  " href="view_tree_zero.php?search_id=<?php echo $five['left_id']; ?>"><div><i class="fa fa-user fa-2x <?php if($five['package_name']){ ?>text-success <?php }else{ ?>text-danger <?php } ?> "  ></i> <p class="text-info" style="font-size:8px;" ><small class="text-purple "><b></b></small> <?php echo $five['left_id']; ?><br><small class="text-purple "><b></b></small> <?php echo $five['left_name']; ?></p></div></a>
					<?php }else{ ?>
							<a href="#"><i class="fa fa-user fa-2x"  ></i></a>
						<?php } ?>
					</li>
						<li><?php $five2 = tree_data($two2['left_id'],1); 
			 ?> <?php if($five2['right_id']){ ?>
							<a title="Left:  <?php if($five2['left_id']){ echo $count_side($five['left_id'],0) + 1; }else{ echo "0"; } ?> 
Right:  <?php if($five2['right_id']){ echo $count_side($five2['right_id'],0) + 1; }else{ echo "0"; } ?>

Sponser  <?php echo $five2['responser']; ?>

Package: <?php echo $five2['package_name']; ?> 
DOJ: <?php echo $five2['c_date']; ?>  " href="view_tree_zero.php?search_id=<?php echo $five2['right_id']; ?>"><div><i class="fa fa-user fa-2x <?php if($five['package_name']){ ?>text-success <?php }else{ ?>text-danger <?php } ?> "  ></i> <p class="text-info" style="font-size:8px;" ><small class="text-purple "><b></b></small> <?php echo $five2['right_id']; ?><br><small class="text-purple "><b></b></small> <?php echo $five2['right_name']; ?> </p></div></a>
					<?php }else{ ?>
							<a href="#"><i class="fa fa-user fa-2x"  ></i></a>
						<?php } ?>
					
					</li>
						<li><?php $five3 = tree_data($two2['left_id'],2); 
			?> <?php if($five3['right_id']){ ?>
							<a title="Left:  <?php if($five3['left_id']){ echo $count_side($five3['left_id'],0) + 1; }else{ echo "0"; } ?> 
Right:  <?php if($five3['right_id']){ echo $count_side($five3['right_id'],0) + 1; }else{ echo "0"; } ?>

Sponser  <?php echo $five3['responser']; ?>

Package: <?php echo $five3['package_name']; ?> 
DOJ: <?php echo $five3['c_date']; ?>  " href="view_tree_zero.php?search_id=<?php echo $five3['right_id']; ?>"><div><i class="fa fa-user fa-2x <?php if($five3['package_name']){ ?>text-success <?php }else{ ?>text-danger <?php } ?> "  ></i> <p class="text-info" style="font-size:8px;" ><small class="text-purple "><b></b></small> <?php echo $five3['right_id']; ?><br><small class="text-purple "><b></b></small> <?php echo $five3['right_name']; ?> </p></div></a>
					<?php }else{ ?>
							<a href="#"><i class="fa fa-user fa-2x"  ></i></a>
						<?php } ?>
					
					</li>
						<li><?php $five4 = tree_data($two2['left_id'],3); ?> <?php if($five4['right_id']){ ?>
							<a title="Left:  <?php if($five4['left_id']){ echo $count_side($five4['left_id'],0) + 1; }else{ echo "0"; } ?> 
Right:  <?php if($five4['right_id']){ echo $count_side($five4['right_id'],0) + 1; }else{ echo "0"; } ?>

Sponser  <?php echo $five4['responser']; ?>

Package: <?php echo $five4['package_name']; ?> 
DOJ: <?php echo $five4['c_date']; ?>  " href="view_tree_zero.php?search_id=<?php echo $five4['right_id']; ?>"><div><i class="fa fa-user fa-2x <?php if($five4['package_name']){ ?>text-success <?php }else{ ?>text-danger <?php } ?> "  ></i> <p class="text-info" style="font-size:8px;" ><small class="text-purple "><b></b></small> <?php echo $five4['right_id']; ?><br><small class="text-purple "><b></b></small> <?php echo $five4['right_name']; ?> </p></div></a>
					<?php }else{ ?>
							<a href="#"><i class="fa fa-user fa-2x"  ></i></a>
						<?php } ?>
					
					</li>
					</ul>
				</li>
				
					<li><?php if($two3['left_id']){ ?>
<a title="Left: <?php if($two3['left_id']){ echo $count_side($two3['left_id'],0) + 1; }else{ echo "0"; }  ?>

Right: <?php if($two3['right_id']){ echo $count_side($two3['right_id'],0) + 1; }else{ echo "0"; } ?>

Sponser  <?php echo $two3['responser']; ?>

Package: <?php echo $two3['package_name']; ?> 
DOJ: <?php echo $two3['c_date']; ?>  " href="view_tree_zero.php?search_id=<?php echo $two3['left_id']; ?>"><div><i class="fa fa-user fa-2x <?php if($two3['package_name']){ ?>text-success <?php }else{ ?>text-danger <?php } ?>"  ></i> <p class="text-info" style="font-size:8px;" ><small class="text-purple "><b></b></small> <?php echo $two3['left_id']; ?><br><small class="text-purple "><b></b></small> <?php echo $two3['left_name']; ?></p></div></a>
					<?php }else{ ?>
							<a href="#"><i class="fa fa-user fa-2x"  ></i></a>
						<?php } ?>
						<ul>
            <li>
			
			<?php $six = tree_data($two3['left_id'],0); ?>
			<?php if($six['left_id']){ ?>
							<a title="Left: <?php if($six['left_id']){ echo $count_side($six['left_id'],0) + 1; }else{ echo "0"; } ?>

Right:  <?php if($six['right_id']){ echo $count_side($six['right_id'],0) + 1; }else{ echo "0"; } ?>

Sponser  <?php echo $six['responser']; ?>

Package: <?php echo $six['package_name']; ?> 
DOJ: <?php echo $six['c_date']; ?>  " href="view_tree_zero.php?search_id=<?php echo $six['left_id']; ?>"><div><i class="fa fa-user fa-2x <?php if($six['package_name']){ ?>text-success <?php }else{ ?>text-danger <?php } ?> "  ></i> <p class="text-info" style="font-size:8px;" ><small class="text-purple "><b></b></small> <?php echo $six['left_id']; ?><br><small class="text-purple "><b></b></small> <?php echo $six['left_name']; ?></p></div></a>
					<?php }else{ ?>
							<a href="#"><i class="fa fa-user fa-2x"  ></i></a>
						<?php } ?>
						
              	</li>
			  <li>
			
			<?php  $six2 = tree_data($two3['left_id'],1);  ?>
			<?php if($six2['left_id']){ ?>
							<a title="Left: <?php if($six2['left_id']){ echo $count_side($six2['left_id'],0) + 1; }else{ echo "0"; } ?>

Right:  <?php if($six2['right_id']){ echo $count_side($six2['right_id'],0) + 1; }else{ echo "0"; } ?>

Sponser  <?php echo $six2['responser']; ?>

Package: <?php echo $six2['package_name']; ?> 
DOJ: <?php echo $six2['c_date']; ?>  " href="view_tree_zero.php?search_id=<?php echo $six2['left_id']; ?>"><div><i class="fa fa-user fa-2x <?php if($six2['package_name']){ ?>text-success <?php }else{ ?>text-danger <?php } ?> "  ></i> <p class="text-info" style="font-size:8px;" ><small class="text-purple "><b></b></small> <?php echo $six2['left_id']; ?><br><small class="text-purple "><b></b></small> <?php echo $six2['left_name']; ?></p></div></a>
					<?php }else{ ?>
							<a href="#"><i class="fa fa-user fa-2x"  ></i></a>
						<?php } ?>
              	</li>
			  <li>
			
			<?php  $six3 = tree_data($two3['left_id'],2); ?>
			<?php if($six3['left_id']){ ?>
							<a title="Left: <?php if($six3['left_id']){ echo $count_side($six3['left_id'],0) + 1; }else{ echo "0"; } ?>

Right:  <?php if($six3['right_id']){ echo $count_side($six3['right_id'],0) + 1; }else{ echo "0"; } ?>

Sponser  <?php echo $six3['responser']; ?>

Package: <?php echo $six3['package_name']; ?> 
DOJ: <?php echo $six3['c_date']; ?>  " href="view_tree_zero.php?search_id=<?php echo $six3['left_id']; ?>"><div><i class="fa fa-user fa-2x <?php if($six3['package_name']){ ?>text-success <?php }else{ ?>text-danger <?php } ?> "  ></i> <p class="text-info" style="font-size:8px;" ><small class="text-purple "><b></b></small> <?php echo $six3['left_id']; ?><br><small class="text-purple "><b></b></small> <?php echo $six3['left_name']; ?></p></div></a>
					<?php }else{ ?>
							<a href="#"><i class="fa fa-user fa-2x"  ></i></a>
						<?php } ?>
              	</li>
						<li><?php  $six4 = tree_data($two3['left_id'],3); ?> <?php if($six4['right_id']){ ?>
							<a title="Left:  <?php if($six4['left_id']){ echo $count_side($six4['left_id'],0) + 1; }else{ echo "0"; } ?> 
Right:  <?php if($six4['right_id']){ echo $count_side($six4['right_id'],0) + 1; }else{ echo "0"; } ?>

Sponser  <?php echo $six4['responser']; ?>

Package: <?php echo $six4['package_name']; ?> 
DOJ: <?php echo $six4['c_date']; ?>  " href="view_tree_zero.php?search_id=<?php echo $six4['right_id']; ?>"><div><i class="fa fa-user fa-2x <?php if($six4['package_name']){ ?>text-success <?php }else{ ?>text-danger <?php } ?> "  ></i> <p class="text-info" style="font-size:8px;" ><small class="text-purple "><b></b></small> <?php echo $six4['right_id']; ?><br><small class="text-purple "><b></b></small> <?php echo $six4['right_name']; ?> </p></div></a>
					<?php }else{ ?>
							<a href="#"><i class="fa fa-user fa-2x"  ></i></a>
						<?php } ?>
					</li>
					</ul>
				</li>
				
				<li><?php if($two4['right_id']){ ?>
					<a title="Left: <?php if($two4['left_id']){ echo $count_side($two4['left_id'],0) + 1; }else{ echo "0"; } ?>  
Right: <?php if($two4['right_id']){ echo $count_side($two4['right_id'],0) + 1; }else{ echo "0"; } ?>

Sponser  <?php echo $two4['responser']; ?>

Package: <?php echo $two4['package_name']; ?> 
DOJ: <?php echo $two4['c_date']; ?>" href="view_tree_zero.php?search_id=<?php echo $two4['right_id']; ?>"><div><i class="fa fa-user fa-2x <?php if($two4['package_name']){ ?> text-success <?php }else{ ?> text-danger <?php } ?> "  ></i> <p class="text-info" style="font-size:8px;" ><small class="text-purple "><b></b></small> <?php echo $two4['right_id']; ?><br><small class="text-purple "><b></b></small> <?php echo $two4['right_name']; ?>  </p></div></a>
					<?php }else{ ?>
							<a href="#"><i class="fa fa-user fa-2x"  ></i></a>
						<?php } ?>
						<ul>
						<?php $seven = tree_data($two4['right_id'],0); ?>
            <li><?php if($seven['left_id']){ ?>
							<a title="Left: <?php if($seven['left_id']){ echo $count_side($seven['left_id'],0) + 1; }else{ echo "0"; } ?>  
Right: <?php if($seven['right_id']){ echo $count_side($seven['right_id'],0) + 1; }else{ echo "0"; } ?>

Sponser  <?php echo $seven['responser']; ?>

Package: <?php echo $seven['package_name']; ?> 
DOJ: <?php echo $seven['c_date']; ?>" href="view_tree_zero.php?search_id=<?php echo $seven['left_id']; ?>"><div><i class="fa fa-user fa-2x <?php if($seven['package_name']){ ?> text-success <?php }else{ ?> text-danger <?php } ?>  "  ></i> <p class="text-info" style="font-size:8px;" ><small class="text-purple "><b></b></small> <?php echo $seven['left_id']; ?><br><small class="text-purple "><b></b></small> <?php echo $seven['left_name']; ?> </p></div></a>
					<?php }else{ ?>
							<a href="#"><i class="fa fa-user fa-2x"  ></i></a>
						<?php } ?>
           			</li>
		      <li><?php $seven2 = tree_data($two4['right_id'],1); if($seven2['left_id']){ ?>
							<a title="Left: <?php if($seven2['left_id']){ echo $count_side($seven2['left_id'],0) + 1; }else{ echo "0"; } ?>  
Right: <?php if($seven2['right_id']){ echo $count_side($seven2['right_id'],0) + 1; }else{ echo "0"; } ?>

Sponser  <?php echo $seven2['responser']; ?>

Package: <?php echo $seven2['package_name']; ?> 
DOJ: <?php echo $seven2['c_date']; ?>" href="view_tree_zero.php?search_id=<?php echo $seven2['left_id']; ?>"><div><i class="fa fa-user fa-2x <?php if($seven2['package_name']){ ?> text-success <?php }else{ ?> text-danger <?php } ?>  "  ></i> <p class="text-info" style="font-size:8px;" ><small class="text-purple "><b></b></small> <?php echo $seven2['left_id']; ?><br><small class="text-purple "><b></b></small> <?php echo $seven2['left_name']; ?> </p></div></a>
					<?php }else{ ?>
							<a href="#"><i class="fa fa-user fa-2x"  ></i></a>
						<?php } ?>
           			</li>
		      <li><?php $seven3 = tree_data($two4['right_id'],1); if($seven3['left_id']){ ?>
							<a title="Left: <?php if($seven3['left_id']){ echo $count_side($seven3['left_id'],0) + 1; }else{ echo "0"; } ?>  
Right: <?php if($seven3['right_id']){ echo $count_side($seven3['right_id'],0) + 1; }else{ echo "0"; } ?>

Sponser  <?php echo $seven3['responser']; ?>

Package: <?php echo $seven3['package_name']; ?> 
DOJ: <?php echo $seven3['c_date']; ?>" href="view_tree_zero.php?search_id=<?php echo $seven3['left_id']; ?>"><div><i class="fa fa-user fa-2x <?php if($seven3['package_name']){ ?> text-success <?php }else{ ?> text-danger <?php } ?>  "  ></i> <p class="text-info" style="font-size:8px;" ><small class="text-purple "><b></b></small> <?php echo $seven3['left_id']; ?><br><small class="text-purple "><b></b></small> <?php echo $seven3['left_name']; ?> </p></div></a>
					<?php }else{ ?>
							<a href="#"><i class="fa fa-user fa-2x"  ></i></a>
						<?php } ?>
           			</li>
						<li>		<?php $seven4 = tree_data($two4['right_id'],3);?>
						<?php if($seven4['right_id']){ ?>
						<a title="Left:  <?php if($seven4['left_id']){ echo $count_side($seven4['left_id'],0) + 1; }else{ echo "0"; } ?> 
Right: <?php if($seven4['right_id']){ echo $count_side($seven4['right_id'],0) + 1; }else{ echo "0"; } ?>

Sponser  <?php echo $seven4['responser']; ?>

Package: <?php echo $seven4['package_name']; ?> 
DOJ: <?php echo $seven4['c_date']; ?>" href="view_tree_zero.php?search_id=<?php echo $seven4['right_id']; ?>"><div><i class="fa fa-user fa-2x <?php if($seven4['package_name']){ ?> text-success <?php }else{ ?> text-danger <?php } ?>  "  ></i> <p class="text-info" style="font-size:8px;"  ><small class="text-purple "><b></b></small> <?php echo $seven4['right_id']; ?><br><small class="text-purple "><b></b></small> <?php echo $seven4['right_name']; ?></p></div></a>
						<?php }else{ ?>
							<a href="#"><i class="fa fa-user fa-2x"  ></i></a>
						<?php } ?>
						</li>
					</ul>
					
				</li>
			
			</ul>
		</li>
	</ul>
</div> </div>
                        </div>
                       
					 </div>
                </div>
                <!-- ============================================================== -->
                <!-- End PAge Content -->
                <!-- ============================================================== -->
                <!-- ============================================================== -->
                <!-- Right sidebar -->
                <!-- ============================================================== -->
                <!-- .right-sidebar -->
                <div class="right-sidebar">
                    <div class="slimscrollright">
                        <div class="rpanel-title"> Service Panel <span><i class="ti-close right-side-toggle"></i></span> </div>
                        <div class="r-panel-body">
                            <ul id="themecolors" class="m-t-20">
                                <li><b>With Light sidebar</b></li>
                                <li><a href="javascript:void(0)" data-theme="default" class="default-theme">1</a></li>
                                <li><a href="javascript:void(0)" data-theme="green" class="green-theme">2</a></li>
                                <li><a href="javascript:void(0)" data-theme="red" class="red-theme">3</a></li>
                                <li><a href="javascript:void(0)" data-theme="blue" class="blue-theme working">4</a></li>
                                <li><a href="javascript:void(0)" data-theme="purple" class="purple-theme">5</a></li>
                                <li><a href="javascript:void(0)" data-theme="megna" class="megna-theme">6</a></li>
                                <li class="d-block m-t-30"><b>With Dark sidebar</b></li>
                                <li><a href="javascript:void(0)" data-theme="default-dark" class="default-dark-theme">7</a></li>
                                <li><a href="javascript:void(0)" data-theme="green-dark" class="green-dark-theme">8</a></li>
                                <li><a href="javascript:void(0)" data-theme="red-dark" class="red-dark-theme">9</a></li>
                                <li><a href="javascript:void(0)" data-theme="blue-dark" class="blue-dark-theme">10</a></li>
                                <li><a href="javascript:void(0)" data-theme="purple-dark" class="purple-dark-theme">11</a></li>
                                <li><a href="javascript:void(0)" data-theme="megna-dark" class="megna-dark-theme ">12</a></li>
                            </ul>
                            <ul class="m-t-20 chatonline">
                                <li><b>Chat option</b></li>
                                <li>
                                    <a href="javascript:void(0)"><img src="assets/images/users/1.jpg" alt="user-img" class="img-circle"> <span>Varun Dhavan <small class="text-success">online</small></span></a>
                                </li>
                                <li>
                                    <a href="javascript:void(0)"><img src="assets/images/users/2.jpg" alt="user-img" class="img-circle"> <span>Genelia Deshmukh <small class="text-warning">Away</small></span></a>
                                </li>
                                <li>
                                    <a href="javascript:void(0)"><img src="assets/images/users/3.jpg" alt="user-img" class="img-circle"> <span>Ritesh Deshmukh <small class="text-success">Busy</small></span></a>
                                </li>
                                <li>
                                    <a href="javascript:void(0)"><img src="assets/images/users/4.jpg" alt="user-img" class="img-circle"> <span>Arijit Sinh <small class="text-muted">Offline</small></span></a>
                                </li>
                                <li>
                                    <a href="javascript:void(0)"><img src="assets/images/users/5.jpg" alt="user-img" class="img-circle"> <span>Govinda Star <small class="text-success">online</small></span></a>
                                </li>
                                <li>
                                    <a href="javascript:void(0)"><img src="assets/images/users/6.jpg" alt="user-img" class="img-circle"> <span>John Abraham<small class="text-success">online</small></span></a>
                                </li>
                                <li>
                                    <a href="javascript:void(0)"><img src="assets/images/users/7.jpg" alt="user-img" class="img-circle"> <span>Hritik Roshan<small class="text-success">online</small></span></a>
                                </li>
                                <li>
                                    <a href="javascript:void(0)"><img src="assets/images/users/8.jpg" alt="user-img" class="img-circle"> <span>Pwandeep rajan <small class="text-success">online</small></span></a>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
                <!-- ============================================================== -->
                <!-- End Right sidebar -->
                <!-- ============================================================== -->
            </div>
            <!-- ============================================================== -->
            <!-- End Container fluid  -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- footer -->
            <!-- ============================================================== -->
           <?php include 'footer.php'; ?>
            <!-- ============================================================== -->
            <!-- End footer -->
            <!-- ============================================================== -->
        </div>
        <!-- ============================================================== -->
        <!-- End Page wrapper  -->
        <!-- ============================================================== -->
    </div>
    <!-- ============================================================== -->
    <!-- End Wrapper -->
    <!-- ============================================================== -->
    <!-- ============================================================== -->
    <!-- All Jquery -->
    <!-- ============================================================== -->
    <script src="assets/plugins/jquery/jquery.min.js"></script>
    <!-- Bootstrap tether Core JavaScript -->
    <script src="assets/plugins/bootstrap/js/popper.min.html"></script>
    <script src="assets/plugins/bootstrap/js/bootstrap.min.js"></script>
    <!-- slimscrollbar scrollbar JavaScript -->
    <script src="js/jquery.slimscroll.js"></script>
    <!--Wave Effects -->
    <script src="js/waves.js"></script>
    <!--Menu sidebar -->
    <script src="js/sidebarmenu.js"></script>
    <!--stickey kit -->
    <script src="assets/plugins/sticky-kit-master/dist/sticky-kit.min.js"></script>
    <script src="assets/plugins/sparkline/jquery.sparkline.min.js"></script>
    <!--Custom JavaScript -->
    <script src="js/custom.min.js"></script>
    <!-- This is data table -->
    <script src="assets/plugins/datatables/jquery.dataTables.min.js"></script>
    <script>
    $(document).ready(function() {
        $('#myTable').DataTable();
        $(document).ready(function() {
            var table = $('#example').DataTable({
                "columnDefs": [{
                    "visible": false,
                    "targets": 2
                }],
                "order": [
                    [2, 'asc']
                ],
                "displayLength": 25,
                "drawCallback": function(settings) {
                    var api = this.api();
                    var rows = api.rows({
                        page: 'current'
                    }).nodes();
                    var last = null;
                    api.column(2, {
                        page: 'current'
                    }).data().each(function(group, i) {
                        if (last !== group) {
                            $(rows).eq(i).before('<tr class="group"><td colspan="5">' + group + '</td></tr>');
                            last = group;
                        }
                    });
                }
            });
            // Order by the grouping
            $('#example tbody').on('click', 'tr.group', function() {
                var currentOrder = table.order()[0];
                if (currentOrder[0] === 2 && currentOrder[1] === 'asc') {
                    table.order([2, 'desc']).draw();
                } else {
                    table.order([2, 'asc']).draw();
                }
            });
        });
    });
    $('#example23').DataTable({
        dom: 'Bfrtip',
        buttons: [
            'copy', 'csv', 'excel', 'pdf', 'print'
        ]
    });
    </script>
    <!-- ============================================================== -->
    <!-- Style switcher -->
    <!-- ============================================================== -->
    <script src="assets/plugins/styleswitcher/jQuery.style.switcher.js"></script>
    <script>
    $(document).ready(function() {
        $(".dataTables_filter").removeAttr("top");
    });
    </script>
</body>


<!-- Mirrored from themedesigner.in/demo/admin-press/main/table-data-table.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 06 Nov 2019 10:14:29 GMT -->
</html>