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

$str=" ";

$data = array();

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

if (isset($_POST['item_id'])) {
 	$item_id = trim($_POST['item_id']);
 	$loc_id = trim($_POST['loc_id']);
 	

	        	$sqlsp=mysqli_query($con,"SELECT view_item_master.*,item_stocks.loc_qoh FROM view_item_master
LEFT JOIN item_stocks ON view_item_master.item_id=item_stocks.item_id AND item_stocks.loc_id=$loc_id where view_item_master.item_id=$item_id ")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();
	        
	        


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

?>