<?php

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

$zdb = $_SESSION["zdbyear_" . $dbname];
$zyear = right($zdb, 4);
$mfrdate = getzdates($zyear, 'S');
$mtodate = getzdates($zyear, 'E');


mysqli_select_db($conn, $zdb);

$getquery = mysqli_query($conn, "select accode,custcode from accmast where grpcode = '010'") or die(mysqli_error($conn));
$ctr = 51;
while ($fetchquery = mysqli_fetch_array($getquery)) {
    $ctr++;

    $custcode = $fetchquery['custcode'];
    $accode = $fetchquery['accode'];


    mysqli_query($conn, "UPDATE `partysub` SET `accode`='$accode' where `code` = '$custcode' ") or die(mysqli_error($conn));
}
?>
