<?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];
$success = false;
$fseries = $_SESSION["series_" . $dbname];


if (isset($_REQUEST["party"])) {
    $party = $_REQUEST['party'];
    
    $query = "SELECT transporter,mobile FROM `accmast` WHERE accode='$party'";

    $result = mysqli_query($conn, $query)or die(mysqli_error($conn));

    $rows = array();
    $ctr = 0;
    $r = mysqli_fetch_assoc($result);
    
    $rows = array('success' => true,
        'transporter' => "$r[transporter]",
        'mobile' => "$r[mobile]");
    header("Content-type: application\json");
    echo json_encode($rows);
}