<?php

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

$zdb = $_SESSION["zdbyear_$dbname"];
mysqli_select_db($conn, $zdb);

if ($_REQUEST["itflag"]) {
    $itflag = $_REQUEST["itflag"];
    
    if ($itflag == '1') {

        $mown1 = mysqli_query($conn, "SELECT * FROM `accmast` where grpcode = '010' and `itflag`='1' order by `name`") or die(mysqli_error($conn));
        echo "<option value=''></option>";

        while ($trow1 = mysqli_fetch_array($mown1)) {
            echo "<option value='$trow1[accode]'>$trow1[name]</option>";
        }
    } else {
        $mown1 = mysqli_query($conn, "SELECT * FROM `accmast` where grpcode = '010' and `itflag`!='1' order by `name`") or die(mysqli_error($conn));
        echo "<option value=''></option>";
        while ($trow1 = mysqli_fetch_array($mown1)) {
            echo "<option value='$trow1[accode]'>$trow1[name]</option>";
        }
    }
}
?>
