<?php
include("../connection.php");
include("../user.php");

	$quantitys = $_REQUEST['quantity'];
	
	$from_location = $_REQUEST['from_location'];
	$item_search = $_REQUEST['item_search'];
	
		//list($a, $b) = explode('/', $item_search);
 
$check_status=mysqli_query($con,"SELECT * FROM item_master WHERE location='$from_location' and id='$item_search' and status=0"); 
$counts_row=mysqli_num_rows($check_status);
if($counts_row)
{
$sql=mysqli_fetch_array(mysqli_query($con,"SELECT * FROM item_master WHERE location='$from_location' and id='$item_search' and status=0")); 
		$data = $sql['quantity'];
		if($data >= $quantitys)
		{
			echo 0;
		}
		else
		{
			echo 1;
		}
}
else
{
	echo 2;
}
?>