<?php

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

$zdb = $_SESSION["zdbyear_" . $dbname];
$zroot = $_SESSION["zdir"];
$compcd = $_SESSION["comp_" . $dbname];

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

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

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

    $mgstper = $m[per];
//    browse($mgstper);
    $rows = array();


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