<?php
if(!isset($_SESSION)) {  session_start(); }
	ob_start();
if(!isset($_SESSION["user_id"])){header("location:../logout.php");}
	include "../actions/dbPDO.php";
if(isset($_POST["mat_in_id"]))
$idd = $_POST["mat_in_id"] ;
{
	$output = array();
	$sql = $db->prepare("SELECT * FROM material_in WHERE mat_in_id = $idd LIMIT 1");
	$sql->execute();
  if($sql->rowCount()>0){$row = $sql->fetch(PDO::FETCH_ASSOC);
		$output["mat_in_id"]   			= $row["mat_in_id"];
		$output["invoice_no"]    		= $row["invoice_no"];
    	$output["mat_supp_id"]  		= $row["mat_supp_id"];
	  	$output["mat_invoice_date"] 	= $row["mat_invoice_date"];
		$output["store_id"]    			= $row["store_id"];
    	$output["net_cost"]    			= $row["net_cost"];
		$output["comm"]    				= $row["comm"];
		$output["date_in"]    			= $row["date_in"];
		$output["father"]    			= $row["father"];
		$output["vat"]    				= $row["vat"];
		$output["vat_out"]    			= $row["vat_out"];
		 }
	echo json_encode($output);
}
?>
