<?php
require('../config/dbcon.php');
if (isset($_POST["id"])) {
	$output = array();
	$query = "SELECT * FROM supplier_mst WHERE id =" . $_POST["id"] . "";
	if (mysqli_query($connect, $query)) {
		$result = mysqli_query($connect, $query);
		while ($row = mysqli_fetch_array($result)) {
			$output['acc_type'] = $row["acc_type"];
			$output['supplier_code'] = $row["supplier_code"];
			$output['supplier_name'] = $row["supplier_name"];
			$output['supplier_address_one'] = $row["supplier_address_one"];
			$output['supplier_address_two'] = $row["supplier_address_two"];
			$output['supplier_address_three'] = $row["supplier_address_three"];
			$output['supplier_place'] = $row["supplier_place"];
			$output['supplier_pin_code'] = $row["supplier_pin_code"];
			$output['supplier_st_code'] = $row["supplier_st_code"];
			$output['supplier_st_name'] = $row["supplier_st_name"];
			$output['cont_person'] = $row["cont_person"];
			$output['supplier_phone'] = $row["supplier_phone"];
			$output['supplier_mobile'] = $row["supplier_mobile"];
			$output['supplier_email'] = $row["supplier_email"];
			$output['supplier_gstno'] = $row["supplier_gstno"];
			$output['supplier_pan_no'] = $row["supplier_pan_no"];
			$output['supplier_aadhar_no'] = $row["supplier_aadhar_no"];
			$output['tax_code'] = $row["tax_code"];
			$output['opening'] = $row["opening"];
			$output['debit'] = $row["debit"];
			$output['credit'] = $row["credit"];
			$output['clbalance'] = $row["clbalance"];
			$output['transporter_name'] = $row["transporter_name"];
			$output['bankname'] = $row["bankname"];
			$output['bankaccno'] = $row["bankaccno"];
			$output['bankaccname'] = $row["bankaccname"];
			$output['ifsccode'] = $row["ifsccode"];
			$output['due_days'] = $row["due_days"];
			$output['remarks'] = $row["remarks"];
		}
		echo json_encode($output);
	}
}
