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

$code = $_REQUEST['code'];


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

echo "<select>";
$gscode = mysqli_query($conn, "SELECT * from `accmast` WHERE `custcode`='$code'") or die(mysqli_error($conn));
$scode = mysqli_fetch_array($gscode);
    echo "<option value='$scode[accode]'>$scode[name]</option>";
//}
echo"</select>";

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

