<?
session_start();
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='inde.php'; </script>";
 return;
}
include_once('opendb.php');
$query="select * from customer";
$res=mysqli_query($db,$query);
while($row=mysqli_fetch_array($res))
{
	$ledvl=$row[acname];
	$b='';
	for($c=0;$c<=strlen($ledvl);$c++)
	{
		
		$a=substr($ledvl,$c,1);
		if(($a>=' ')&&($a<='~'))
		{
                      if(($a==' ')&&($d==' '))
                      {
                        echo "doublespace found";
                        echo "<br>";
                      }
                      else
                      {
			$b=$b.$a;
                      }
		}

                $d=$a;
	}

        $query="update customer set acname='$b' where acname='$ledvl'";
        mysqli_query($db,$query);
	echo $query;
	echo "<br>";
	
}
?>