<?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_supp_id"]))
	$idd = $_POST["mat_supp_id"]; {
	$output = array();
	$sql = $db->prepare("SELECT * FROM material_supp WHERE mat_supp_id = $idd LIMIT 1");
	$sql->execute();
	if ($sql->rowCount() > 0) {
		$row = $sql->fetch(PDO::FETCH_ASSOC);
		$output["mat_supp_id"]  = $row["mat_supp_id"];
		$output["mat_name"]    	= $row["mat_name"];
		$output["phone"]  		= $row["phone"];
		$output["phone2"]       = $row["phone2"];
		$output["address"]    	= $row["address"];
		$output["spcial"]    	= $row["spcial"];
		$output["vat_no"]    	= $row["vat_no"];
		$output["father"]    	= $row["father"];
		$output["comm"]    		= $row["comm"];
	}
	echo json_encode($output);
}
