<?php

require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include('includes/function.php');

$zdb = $_SESSION["zdbyear_" . $dbname];
mysqli_select_db($conn, $zdb);
$admin = $_SESSION["admin_" . $dbname];

if (isset($_REQUEST[prodgrp])) {
    $prodgrp = $_REQUEST[prodgrp];

    $getm = mysqli_query($conn, "SELECT hsncode,gstperc FROM `prodgrp` WHERE `code` = '$prodgrp'")or die(mysqli_error($conn));
    $m = mysqli_fetch_array($getm);

    $hsncode = $m[hsncode];
    $gstperc = $m[gstperc];

    $rows = array();


    $rows = array('hsncode' => "$hsncode",
        'gstperc' => "$gstperc"
    );
    header("Content-type: application\json");
    echo json_encode($rows);
}