<?php
ob_start();
include("../connect.php");
if(isset($_POST['distributor_id']))
{ 
    $d_id = $_POST['distributor_id']; 
	$response['Customers']=array();
	$res = mysqli_query($con,"SELECT * FROM `tbl_master_customer` where distributor_id='$d_id'");
	$row=mysqli_num_rows($res);
	if($row>0)
	{	 
       while($row=mysqli_fetch_array($res))
	   {  
          $Customers['customer_id'] = $row['customer_id'];
		  $Customers['customer_name'] = $row['customer_name'];
		  $Customers['email_address'] = $row['email_address'];
		  $Customers['password'] = $row['password'];
		  $Customers['customer_phone'] = $row['customer_phone'];
		  $Customers['customer_address'] = $row['customer_address'];
		  $Customers['zipcode'] = $row['zipcode'];
		  $Customers['status'] = $row['status'];
       
          array_push($response['Customers'],$Customers);		  
	   }

	   $response['success']=1;
	   $response['details']="Customer Detail Fetched Succesfully";  
	}
    else
	{
		$response['success']=0;
		$response['details']="Customer Detail Not Available...!!";
	} 
}
else
{	
	$response['success']=0;
	$response['details']="Required fields missing";
}
echo json_encode($response);
?> 