<?php
include "../actions/dbPDO.php";
if(isset($_POST["line_id"]))
$idd = $_POST["line_id"] ;
{
	$output = array();
	$sql = $db->prepare("SELECT items_line.* , items.item_name FROM items_line , items
		WHERE items_line.item_id = items.item_id
		AND line_id = $idd LIMIT 1");
	$sql->execute();
  if($sql->rowCount()>0){$row = $sql->fetch(PDO::FETCH_ASSOC);
		$output["line_id"]   		= $row["line_id"];
		$output["mat_in_id"]    = $row["mat_in_id"];
    $output["item_id"]  		= $row["item_id"];
	  $output["tot_price"]    = $row["tot_price"];
		$output["qty"]    			= $row["qty"];
    $output["unit"]    			= $row["unit"];
		$output["unit_price"]   = $row["unit_price"];
		$output["location"]    	= $row["location"];
		$output["comm"]    			= $row["comm"];
		$output["outt"]    			= $row["outt"];
		$output["item_name"]    = $row["item_name"];
		 }
	echo json_encode($output);
}
?>
