<?
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 where length(code)<=9");
while ($mxjvrow=mysqli_fetch_array($mxjvres))
{
$cod=($mxjvrow[0]);
//print $sql="select * from customer where code='$cod' ";
    
      $cc=substr($cod,-10);
	$cc=substr('0000000000'.$cc,-10);
	print $cc;
	
print $sql2="update customer set code= '$cc' where code='$cod'";
print '<br>'.$sql2;
mysqli_query($db,$sql2);
}




