<?php 
$PageSecurity = 11;
include('includes/session.inc');
include('includes/function_lib.php');
global $db;

 
$data='';
$data.="<option value='0'>Select<option>";
if($_REQUEST['site']!='0')
{
$acc_data1=DB_query("select * from accountledger left join accountledger_dtls on accountledger.AccountsID=accountledger_dtls.accountledger_id where find_in_Set('".$_REQUEST['site']."',site) group by AccountsID order by AccountName",$db);
}
else
{
	$acc_data1=DB_query("select * from accountledger left join accountledger_dtls on accountledger.AccountsID=accountledger_dtls.accountledger_id group by AccountsID order by AccountName",$db);
}

while($r=DB_fetch_array($acc_data1))
{
$data.="<option value=".$r['AccountsID'].">".$r['AccountName']."</option>";

}

echo $data;
?>

