MMCT TEAM
Server IP : 2a02:4780:11:1359:0:1d43:a566:2  /  Your IP : 216.73.216.199
Web Server : LiteSpeed
System : Linux in-mum-web1259.main-hosting.eu 4.18.0-553.37.1.lve.el8.x86_64 #1 SMP Mon Feb 10 22:45:17 UTC 2025 x86_64
User : u490972518 ( 490972518)
PHP Version : 5.6.40
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF
Directory (0755) :  /home/u490972518/domains/shivbalika.in/public_html/sale/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u490972518/domains/shivbalika.in/public_html/sale/tree.php
<?php
include('php-includes/connect.php');
include('php-includes/check-login.php');
$userid = $_SESSION['userid'];
$search = $userid;
?>
<?php
function tree_data($userid){
global $con;
$data = array();
$query = mysqli_query($con,"select * from tree where userid='$userid'");
$result = mysqli_fetch_array($query);
$data['left'] = $result['left'];
$data['right'] = $result['right'];
$data['leftcount'] = $result['leftcount'];
$data['rightcount'] = $result['rightcount'];
return $data;
}
?>
<?php 
if(isset($_GET['search-id'])){
$search_id = mysqli_real_escape_string($con,$_GET['search-id']);
if($search_id!=""){
$query_check = mysqli_query($con,"select * from user where email='$search_id'");
if(mysqli_num_rows($query_check)>0){
$search = $search_id;
}
else{
echo '<script>alert("Access Denied");window.location.assign("tree.php");</script>';
}
}
else{
echo '<script>alert("Access Denied");window.location.assign("tree.php");</script>';
} 
}
?>
<?php
	$sel="select * from tree where userid='$search_id' ";
			$res=mysqli_query($con,$sel);
			$row=mysqli_fetch_array($res,MYSQLI_BOTH);
			$userleft=$row["left"];
			$userright=$row["right"];
			
			$allleftusers=array($userleft);
			$allrightusers=array($userright);
			
			function printleft($user_id)
			{
				global $allleftusers;
				global $con;
				
				$sel1="select * from tree where userid='$user_id' ";
				$res1=mysqli_query($con,$sel1);
				$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
				
				$userleft1=$row1["left"];
				$userright1=$row1["right"];
				
				if($userleft1!="")
				{
					array_push($allleftusers,$userleft1);
				}
				if($userright1!="")
				{
					array_push($allleftusers,$userright1);
				}
				
				if(checkuser($userleft1))
				{
					printleft($userleft1);
				}				
				if(checkuser($userright1))
				{
					printleft($userright1);
				}
				
			}
			function printright($user_id)
			{
				global $allrightusers;
				global $con;
				$sel1="select * from tree where userid='$user_id' ";
				$res1=mysqli_query($con,$sel1);
				$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
				
				$userleft1=$row1["left"];
				$userright1=$row1["right"];
				
				if($userleft1!="")
				{
					array_push($allrightusers,$userleft1);
				}
				if($userright1!="")
				{
					array_push($allrightusers,$userright1);
				}
				
				if(checkuser($userleft1))
				{
					printright($userleft1);
				}
				
				if(checkuser($userright1))
				{
					printright($userright1);
				}
				
			}
			function checkleft($user_id)
			{
				global $con;
				$sel1="select * from tree where userid='$user_id' ";
				$res1=mysqli_query($con,$sel1);
				$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
				if($row1["left"]=="" || $row1["left"]==NULL || $row1["left"]=="NULL")
				{
					return false;
				}
				else
				{
					return true;
				}
			}
			function checkright($user_id)
			{
				global $con;
				$sel1="select * from tree where userid='$user_id' ";
				$res1=mysqli_query($con,$sel1);
				$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
				if($row1["right"]=="" || $row1["right"]==NULL || $row1["right"]=="NULL")
				{
					return false;
				}
				else
				{
					return true;
				}
			}
			
			function checkuser($user_id)
			{
				global $con;
				$sel1="select * from tree where userid='$user_id' ";
				$res1=mysqli_query($con,$sel1);
				$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
				if($row1["right"]=="" && $row1["left"]=="")
				{
					return false;
				}
				else
				{
					return true;
				}
			}
			
			
			printleft($userleft);
			printright($userright);
			
			$countleft=count($allleftusers);
			$countright=count($allrightusers);
			
			
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Mlml Website - Tree</title>
<!-- Bootstrap Core CSS -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- MetisMenu CSS -->
<link href="vendor/metisMenu/metisMenu.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="dist/css/sb-admin-2.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="wrapper">
<!-- Navigation -->
<?PHP include("link/header.php")?>
<link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="jq/jquery.dataTables.min.css" type="text/css" rel="stylesheet"/>
<link href="jq/buttons.dataTables.min.css" type="text/css" rel="stylesheet"/>
  <link href="/your-path-to-fontawesome/css/fontawesome.css" rel="stylesheet">
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.4.1.min.js"></script>
<script src="jq/jquery.dataTables.min.js"></script>
<script src="jq/dataTables.buttons.min.js"></script>
<script src="jq/buttons.flash.min.js"></script>
<script src="jq/jszip.min.js"></script>
<script src="jq/pdfmake.min.js"></script>
<script src="jq/vfs_fonts.js"></script>
<script src="jq/buttons.html5.min.js"></script>
<script src="jq/buttons.print.min.js"></script>
<!-- Page Content -->
<div id="page-wrapper" style="background-color: white;background-repeat: no-repeat;background-position: center;background-size:200px">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">My Tree</h1>
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.row -->
<div class="row">
<div class="col-lg-12">
<div class="table-responsive">
<table class="table" align="center" border="0" style="text-align:center">
<tr height="150">
<?php
$data = tree_data($search);
?>
<td><?php echo $countleft ; ?></td>
<?php 
$sel3="select * from user where email='$search'";
$res3=mysqli_query($con,$sel3);
$row3=mysqli_fetch_array($res3,MYSQLI_BOTH);
$show=$row3['name'];
$amount3=$row3['amount'];
//echo $show

?>
<td colspan="2"><span style="color:red"><?php echo 'Joining'.' = '. $amount3;?></span><i class="fa fa-user fa-4x" style="color:#1430B1"></i><span><?php if($amount3!='0'){echo '<i class="fa fa-check-square-o" style="color:green;font-size:30px;font-weight:bold"></i>';} else {echo '<i class="fa fa-close" style="color:red;font-size:30px;font-weight:bold"></i>';}?></span><p><?php echo $search.'('.$show.')'; ?></p></td>
<td><?php echo $countright; ?></td>
</tr>
<tr height="150">
<?php
$first_left_user = $data['left'];
$first_right_user = $data['right'];
?>
<?php 
if($first_left_user!=""){
?>
<?php 
$sel31="select * from user where email='$first_left_user'";
$res31=mysqli_query($con,$sel31);
$row31=mysqli_fetch_array($res31,MYSQLI_BOTH);
$show1=$row31['name'];
$amount31=$row31['amount'];
//echo $show1

?>
<td colspan="2"><span style="color:red"><?php echo 'Joining'.' = '. $amount31;?></span><a href="tree.php?search-id=<?php echo $first_left_user ?>"><i class="fa fa-user fa-4x" style="color:#D520BE"></i><span><?php if($amount31!='0'){echo '<i class="fa fa-check-square-o" style="color:green;font-size:30px;font-weight:bold"></i>';} else {echo '<i class="fa fa-close" style="color:red;font-size:30px;font-weight:bold"></i>';}?></span><p><?php echo $first_left_user.'('.$show1.')'; ?></p></a></td>
<?php 
}
else{
?>
<td colspan="2"><i class="fa fa-user fa-4x" style="color:#D520BE"></i><p><?php echo $first_left_user; ?></p></td>
<?php
}
?>
<?php 
if($first_right_user!=""){
?>
<?php 
$sel311="select * from user where email='$first_right_user'";
$res311=mysqli_query($con,$sel311);
$row311=mysqli_fetch_array($res311,MYSQLI_BOTH);
$show11=$row311['name'];
$amount311=$row311['amount'];
//echo $show1

?>
<td colspan="2"><span style="color:red"><?php echo 'Joining'.' = '. $amount311;?></span><a href="tree.php?search-id=<?php echo $first_right_user ?>"><i class="fa fa-user fa-4x" style="color:#D520BE"></i><span><?php if($amount311!='0'){echo '<i class="fa fa-check-square-o" style="color:green;font-size:30px;font-weight:bold"></i>';} else {echo '<i class="fa fa-close" style="color:red;font-size:30px;font-weight:bold"></i>';}?></span><p><?php echo $first_right_user.'('.$show11.')'; ?></p></a></td>
<?php 
}
else{
?>
<td colspan="2"><i class="fa fa-user fa-4x" style="color:#D520BE"></i><p><?php echo $first_right_user ; ?></p></td>
<?php
}
?>
</tr>
<tr height="150">
<?php 
$data_first_left_user = tree_data($first_left_user);
$second_left_user = $data_first_left_user['left'];
$second_right_user = $data_first_left_user['right'];

$data_first_right_user = tree_data($first_right_user);
$third_left_user = $data_first_right_user['left'];
$thidr_right_user = $data_first_right_user['right'];
?>
<?php 
if($second_left_user!=""){
?>
<?php 
$sel41="select * from user where email='$second_left_user'";
$res41=mysqli_query($con,$sel41);
$row41=mysqli_fetch_array($res41,MYSQLI_BOTH);
$show41=$row41['name'];
$amount41=$row41['amount'];
//echo $show1

?>
<td><span style="color:red"><?php echo 'Joining'.' = '. $amount41;?></span><a href="tree.php?search-id=<?php echo $second_left_user ?>"><i class="fa fa-user fa-4x" style="color:#361515"></i><span><?php if($amount41!='0'){echo '<i class="fa fa-check-square-o" style="color:green;font-size:30px;font-weight:bold"></i>';} else {echo '<i class="fa fa-close" style="color:red;font-size:30px;font-weight:bold"></i>';}?></span><p><?php echo $second_left_user .'('.$show41.')';?></p></a></td>
<?php 
}
else{
?>
<td><i class="fa fa-user fa-4x" style="color:#361515"></i></td>
<?php
}
?>
<?php 
if($second_right_user!=""){
?>
<?php 
$sel411="select * from user where email='$second_right_user'";
$res411=mysqli_query($con,$sel411);
$row411=mysqli_fetch_array($res411,MYSQLI_BOTH);
$show411=$row411['name'];
$amount411=$row411['amount'];
//echo $show1

?>
<td><span style="color:red"><?php echo 'Joining'.' = '. $amount411;?></span><a href="tree.php?search-id=<?php echo $second_right_user ?>"><i class="fa fa-user fa-4x" style="color:#361515"></i><span><?php if($amount411!='0'){echo '<i class="fa fa-check-square-o" style="color:green;font-size:30px;font-weight:bold"></i>';} else {echo '<i class="fa fa-close" style="color:red;font-size:30px;font-weight:bold"></i>';}?></span><p><?php echo $second_right_user.'('.$show411.')'; ?></p></a></td>
<?php 
}
else{
?>
<td><i class="fa fa-user fa-4x" style="color:#361515"></i></td>
<?php
}
?>
<?php 
if($third_left_user!=""){
?>
<?php 
$sel51="select * from user where email='$third_left_user'";
$res51=mysqli_query($con,$sel51);
$row51=mysqli_fetch_array($res51,MYSQLI_BOTH);
$show51=$row51['name'];
$amount51=$row51['amount'];
//echo $show1

?>
<td><span style="color:red"><?php echo 'Joining'.' = '. $amount51;?></span><a href="tree.php?search-id=<?php echo $third_left_user ?>"><i class="fa fa-user fa-4x" style="color:#361515"></i><span><?php if($amount51!='0'){echo '<i class="fa fa-check-square-o" style="color:green;font-size:30px;font-weight:bold"></i>';} else {echo '<i class="fa fa-close" style="color:red;font-size:30px;font-weight:bold"></i>';}?></span><p><?php echo $third_left_user.'('.$show51.')'; ?></p></a></td>
<?php 
}
else{
?>
<td><i class="fa fa-user fa-4x" style="color:#361515"></i></td>
<?php
}
?>
<?php 
if($thidr_right_user!=""){
?>

<?php 
$sel511="select * from user where email='$thidr_right_user'";
$res511=mysqli_query($con,$sel511);
$row511=mysqli_fetch_array($res511,MYSQLI_BOTH);
$show511=$row511['name'];
$amount511=$row511['amount'];
//echo $show1

?>
<td><span style="color:red"><?php echo 'Joining'.' = '. $amount511;?></span><a href="tree.php?search-id=<?php echo $thidr_right_user ?>"><i class="fa fa-user fa-4x" style="color:#361515"></i><span><?php if($amount511!='0'){echo '<i class="fa fa-check-square-o" style="color:green;font-size:30px;font-weight:bold"></i>';} else {echo '<i class="fa fa-close" style="color:red;font-size:30px;font-weight:bold"></i>';}?></span><p><?php echo $thidr_right_user .'('.$show511.')';?></p></a></td>
<?php 
}
else{
?>
<td><i class="fa fa-user fa-4x" style="color:#361515"></i></td>
<?php
}
?>
</tr>
</table>
</div>
</div>
</div>
</div>
<!-- /.container-fluid -->
</div>
<!-- /#page-wrapper -->
</div>
<!-- /#wrapper -->
<!-- jQuery -->
<script src="js/bootstrap.js"></script>
<script src="js/jquery.dcjqaccordion.2.7.js"></script>
<script src="js/scripts.js"></script>
<script src="js/jquery.slimscroll.js"></script>
<script src="js/jquery.nicescroll.js"></script>
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="js/flot-chart/excanvas.min.js"></script><![endif]-->
<script src="js/jquery.scrollTo.js"></script>
</body>
</html>

MMCT - 2023