<?php
    include'connection.php';
    include'functions.php';
    include'time.php';

    if($_GET['parentId'])
    {
        $parentId = $_GET['parentId'];
        $parentName = getName($parentId);
        if(empty($parentName))
        {
            echo "<b style='color:red'>User Not Found !</b>";
        }
        else
        {
            $place = checkPlace($parentId);
            if($place=="PNA")
            {
                echo "<b style='color:red'>Place Not Available, Please use Another Userid !</b>";
            }
            else
            {
                echo "<b style='color:green'>".$parentName."</b>";
            }
        }
    }
    
    if($_GET['sponsorId'])
    {
        $sponsorId = $_GET['sponsorId'];
        $sponsorName = getName($sponsorId);
        if(empty($sponsorName))
        {
            echo "<b style='color:red'>User Not Found !</b>";
        }
        else
        {
            echo "<b style='color:green'>".$sponsorName."</b>";
        }
        
    }

?>