<?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;


if (isset($_REQUEST["custcode"])) {
    $custcode = $_REQUEST['custcode'];
//    browse($custcode);
 

    $query = "SELECT accode,name,custcode FROM `accmast` WHERE custcode ='$custcode' ";
    $result = mysqli_query($conn, $query)or die(mysqli_error($conn));

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