<?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 from accmast where accode > 50") or die(mysqli_error($conn));
$ctr = 51;
while ($fetchquery = mysqli_fetch_array($getquery)) {
    $ctr++;

    $accode = $fetchquery[accode];


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