<?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[party])) {
    $party = $_REQUEST[party];

    $getm = mysqli_query($conn, "SELECT `gstno`,`mobile`, `add1`, `add2`, `add3`, `transporter` FROM `accmast` WHERE `accode`='$party' and grpcode = '010'")or die(mysqli_error($conn));
    $m = mysqli_fetch_array($getm);

    $gstno = $m['gstno'];
    $mobile = $m['mobile'];
    $transporter = $m['transporter'];
    $address = $m['add1'].$m['add2'].$m['add3'];
    $row = array('gstno'=>$gstno,'mobile'=>$mobile, 'add'=>$address, 'transporter'=>$transporter);
    header("Content-type: application\json");
    echo json_encode($row);
}