<?php

$q = strtolower($_GET["q"]);
if (!$q) return;
include 'db_connect.php';

if($_GET[type]=='cashbank')
$items = mysqli_query($con,"SELECT ledger FROM ledgerreg where ledtype='CASHBANK' ");
else /*if($_GET[type]=='puracc')*/
$items = mysqli_query($con,"SELECT ledger FROM ledgerreg where ledtype='PURCHASE ACCOUNT' ");

//while($row = mysqli_fetch_array($items))
 // {
 // echo $row['value'];
 
//  }

while($row = mysqli_fetch_array($items)) {
	if (strpos(strtolower($row['ledger']), $q) !== false) {
		echo "$row[ledger]\n";
}
}
mysqli_close($con);


?>