<?php
require('../config/dbcon.php');
if (isset($_POST["id"])) {
	$output = array();
	$query = "SELECT * FROM item_mst WHERE id =" . $_POST["id"] . "";
	if (mysqli_query($connect, $query)) {
		$result = mysqli_query($connect, $query);
		while ($row = mysqli_fetch_array($result)) {
			$output['partno'] = $row["partno"];
			$output['description_one'] = $row["description_one"];
			$output['description_two'] = $row["description_two"];
			$output['hsn_code'] = $row["hsn_code"];
			$output['list'] = $row["list"];
			$output['moq'] = $row["moq"];
			$output['boxqty'] = $row["boxqty"];
			$output['cost'] = $row["cost"];
			$output['disc_per'] = $row["disc_per"];
			$output['disc_amt'] = $row["disc_amt"];
			$output['mrp'] = $row["mrp"];
			$output['sgst_per'] = $row["sgst_per"];
			$output['sgst_amt'] = $row["sgst_amt"];
			$output['cgst_per'] = $row["cgst_per"];
			$output['cgst_amt'] = $row["cgst_amt"];
			$output['igst_per'] = $row["igst_per"];
			$output['igst_amt'] = $row["igst_amt"];
			$output['op_stk'] = $row["op_stk"];
			$output['stk_qty'] = $row["stk_qty"];
			$output['stk_val'] = $row["stk_val"];
			$output['unit'] = $row["unit"];
			$output['ly_sales'] = $row["ly_sales"];
			$output['cy_sales'] = $row["cy_sales"];
			$output['pending'] = $row["pending"];
			$output['dispatch1'] = $row["dispatch1"];
			$output['min_qty'] = $row["min_qty"];
			$output['max_qty'] = $row["max_qty"];
			$output['reord_qty'] = $row["reord_qty"];
			$output['segment'] = $row["segment"];
			$output['remarks'] = $row["remarks"];
			$output['rec_qty'] = $row["rec_qty"];
			$output['bal_qty'] = $row["bal_qty"];
		}
		echo json_encode($output);
	}
}
