<?php
require_once __DIR__."/allfunctions.php";


	$con = mysqli_connect(get_dbserver(),get_dbuser(),get_dbpassword(),get_dbname());
	$echo="";

	$soldto = $_GET['soldto'];
	//$lvl = $_GET['lvl'];
	$lvl = "lev2";
	$agentname = getRecord('name','test','id='.$soldto);
	//echo $agentname;
	if($soldto!="")
  {

		$agentnamelevel1 = GetAgentLevelFromParent($agentname,"lev1");
		$agentnamelevel2 = GetAgentLevelFromParent($agentname,"lev2");
		$agentnamelevel3 = GetAgentLevelFromParent($agentname,"lev3");
		$agentnamelevel4 = GetAgentLevelFromParent($agentname,"lev4");
		$agentnamelevel5 = GetAgentLevelFromParent($agentname,"lev5");
		$agentnamelevel6 = GetAgentLevelFromParent($agentname,"lev6");
		$agentnamelevel7 = GetAgentLevelFromParent($agentname,"lev7");
	/*	echo $agentnamelevel1;
		echo $agentnamelevel2;
		echo $agentnamelevel3;
		echo $agentnamelevel4;
		echo $agentnamelevel5;
*/
		if(!empty($agentnamelevel1))
		{
			//echo "Level 1". $agentnamelevel1;
			echo "Level 0,0";
		}
		elseif(!empty($agentnamelevel2))
		{
			//echo "Level 2". $agentnamelevel2;
			echo "Level 1,50";
		}
		elseif(!empty($agentnamelevel3))
		{
			//echo "Level 3". $agentnamelevel3;
			echo "Level 2,20";
		}
		elseif(!empty($agentnamelevel4))
		{
			//echo "Level 4". $agentnamelevel4;
			echo "Level 3,15";
		}
		elseif(!empty($agentnamelevel5))
		{
			//echo "Level 5". $agentnamelevel5;
			echo "Level 4,10";
		}
		elseif(!empty($agentnamelevel6))
		{
			//echo "Level 5". $agentnamelevel5;
			echo "Level 5,5";
		}
		elseif(!empty($agentnamelevel7))
		{
			//echo "Level 5". $agentnamelevel5;
			echo "Level 6,6";
		}

	//	if($agentnamelevel1)

	}
	//echo $agentnamelevel1;
?>
