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

$code = $_REQUEST['custcode'];
$sname = $_REQUEST['school'];

        $gcode = mysqli_query($conn, "SELECT name,custcode FROM `accmast` where grpcode = '010' AND name = '$sname'")or die(mysqli_error($conn));
        $gname = mysqli_fetch_array($gcode);
        Echo "<option value='$gname[custcode]'>$gname[name]</option>";


        $getcode = mysqli_query($conn, "SELECT name,custcode FROM `accmast` where grpcode = '010' accode = '$code'")or die(mysqli_error($conn));
        while ($scode = mysqli_fetch_array($getcode)) {
            Echo "<option value='$scode[custcode]'>$scode[name]</option>";
        }

