<?php 
session_start();
include('../includes/dbcon.php');

$str=" ";

$data = array();

$edate=date("Y-m-d");
$userid=$_SESSION['hrm_id'];

if (isset($_POST['inv_no'])) {
 	$inv_no = trim($_POST['inv_no']);
 	//$loc_id=$_SESSION['loc_id'];
 //	$inv_no = 270;
 	$loc_id=1;
	        	$sqlsp=mysqli_query($con,"SELECT inv_temp_detail.*,item_master.item_name,
item_stocks.loc_qoh,
inv_temp_header.discount
 FROM inv_temp_detail
LEFT JOIN item_master ON item_master.item_id=inv_temp_detail.item_id
LEFT JOIN item_stocks ON item_stocks.item_id=inv_temp_detail.item_id AND 
item_stocks.loc_id=inv_temp_detail.loc_id
LEFT JOIN inv_temp_header ON inv_temp_header.invd_id=inv_temp_detail.invd_id where inv_temp_detail.invd_id=$inv_no and inv_temp_detail.loc_id=$loc_id order by eseq ")or die(mysqli_error($con));
	        	$count=mysqli_num_rows($sqlsp);	
	        	if ($count>0) {
	        		while($rowsp=mysqli_fetch_array($sqlsp)){			
					 $data[]=$rowsp;				
				   }	

				    echo json_encode($data);
	        	}//	if ($count>0) {
exit();
	        	 //echo 'hello';
	  


} ///// if (isset($_POST['category'])) {

?>