<?
session_start();
include("opendb.php");
include("test.php");
$q = strtolower($_GET["q"]);

$re=mysqli_query($db,"select * from ledger where grp != 'Cash in hand' and grp!='Sundry Debtors' and brcode='$brcode' order by led");

$re1=mysqli_query($db,"select distinct led from ledger where grp ='Sundry Debtors' order by led");

while($row=mysqli_fetch_array($re))
{

 if (strpos(strtolower($row['led']), $q) !== false) {

   echo $row['led']."\n";		

 } 

}

while($row1=mysqli_fetch_array($re1))
{
 if (strpos(strtolower($row1['led']), $q) !== false) {

   echo $row1['led']."\n";		

 } 

}



?>
