<?php
	include'connection.php';
	$userid = $_GET['userId'];
	$parentId = $_GET['parentId'];
	
	$reParent=mysqli_query($con,"select * from user where Userid='$parentId'");
	if($dataParent=mysqli_fetch_array($reParent))
	{
		
		if($userid==$parentId || $userid==$dataParent['Parent1'] || $userid==$dataParent['Parent2'] || $userid==$dataParent['Parent3'] || $userid==$dataParent['Parent4'] || $userid==$dataParent['Parent5'] || $userid==$dataParent['Parent6'] || $userid==$dataParent['Parent7'] || $userid==$dataParent['Parent8'] || $userid==$dataParent['Parent9'])
		{
			
			echo "<p style='color:green;'>".$dataParent['Name']."</p>";
		}
		else
		{
			echo "<p style='color:red;'>Parent Id Is Not Available In Your Downline!</p>";
		}
	}
	else
	{
		echo "<p style='color:red;'>Parent Id Is Not Available !</p>";
	}

?>