<?php
include('connect.php');

error_reporting(0);
//echo '<option value="0">HII</option>';
if(isset($_POST["councellorid"]) && !empty($_POST["councellorid"])){
    //Get all state data
$umid=$_POST["councellorid"];
	$eve="SELECT * FROM res_user_master WHERE utype = 'agent' and uagentcounsellorid=". $umid;
	
    $re = mysqli_query($conn, $eve);
	//echo '<option value="0">'.$eve.'</option>';
    //Count total number of rows
	echo '<option value="0">Direct</option>';
    if(mysqli_num_rows($re) > 0)
	{
		
        while($rt = mysqli_fetch_assoc($re)){ 
            echo '<option value="'.$rt['umid'].'">'.$rt['ufullname'].'</option>';
			
        }
    }else{
        echo '<option value="0">No Data Found1</option>'; 
    }
}else{
	echo '<option value="0">Select </option>';
}
?>