<?php $PageSecurity = 11;
include('includes/session.inc');
include('includes/function_lib.php');
include('includes/SQL_CommonFunctions.inc');
include('includes/Class_BankCheckIssueDetails.php');
 $searchwords=$_REQUEST['searchWord'];
 $undergroup=str_replace('\\', "", $_REQUEST['undergroup1']);

$test=$_REQUEST['site'];
$searchwords;
		//echo $ledger_id;

		 $query="SELECT AccountsID,AccountName  FROM accountledger  WHERE ";
		
	
		if($searchwords!='' && $undergroup!='' ){
		$query .= " ledgertype $undergroup
		and AccountName like '%".$searchwords."%'  ORDER BY AccountName ASC" ;   	
		//$result_ledger = DB_query("SELECT AccountsID,AccountName  FROM accountledger  WHERE ledgertype in($ledgertype)",$db);   			
		}
		else if($searchwords=='' && $undergroup!='' )
		{
         $query .= " ledgertype $undergroup	 ORDER BY AccountName ASC" ; 
		}
	   else if($undergroup=='' && $searchwords!='' ){

		$query .= " AccountName like '%".$searchwords."%'   ORDER BY AccountName ASC";
		}
		
		
		
		
	
	
		$result_ledger = DB_query($query,$db); 
		
		?>
		
			
			<?php 			
 			while($myrow_ledger = DB_fetch_row($result_ledger))
			{
			  $p='';
			  if($myrow_ledger[0]==$ledger_id)
			  $p="selected";
			?>
			<option value="<?php echo $myrow_ledger[0]; ?>"<?php echo $p; ?>><?php echo $myrow_ledger[1]; ?></option>
			<?php }?>
				

    