<?php

require_once("../config/configDB.php"); 

//$result = mysqli_query($conn,"SELECT productname   FROM product_master WHERE id='".$_GET['pid']."' and flag='1' ");

$result = mysqli_query($conn,"SELECT sh.id as saleBillNo,sh.invoice_no as invoice_no,sh.tamount  FROM purchaseheader as sh     
WHERE sh.id='".$_GET['pid']."' and sh.status='' ");

$res = array(); 
		
while($row = mysqli_fetch_array($result)){
		
	array_push($res, array(
		"invoice_no"=>$row['invoice_no']
        	) 
 		);
 	}
 	echo json_encode($res);

?>