<?
session_start();
include_once('includes/top.php');
include_once('opendb.php');
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
$cd=$_REQUEST['cd'];
if(strlen($user)<=0)
{
  print "<script> alert('Invalid User'); document.location='inde.php' </script>";
  return;
}

//$invno="547";
$vatorcst='VAT';
$mxjvres=mysqli_query($db,"select  distinct(code) from customer");
while ($mxjvrow=mysqli_fetch_array($mxjvres))
{
$cod=($mxjvrow[0]);
print $sql="select acname from customer where code='$cod' ";
 $sql=mysqli_query($db,"select acname from customer where code='$cod'");

$mx=mysqli_fetch_array($sql);


print $sql2="update ledger set code= '$cod' where led='$mx[0]' and grp='Sundry Debtors' ";
print '<br>'.$sql2;
mysqli_query($db,$sql2);
}




