<?php
	$str1  = "";
	

	$qry = "SELECT distinct customer_name from lms_customerbill where company_id= '".$_SESSION["cCompany_id"]."' ";
	
	$result = dbQuery($qry);
	if(dbRows($result) > 0){	
		while($record = dbArray($result)){
			$str1 .= "['".$record['customer_name']."'],";	
		}
	}
	
	
	$str2  = "";
	

	$qry = "SELECT * from lms_customer where company_id= '".$_SESSION["cCompany_id"]."' ";
	
	$result = dbQuery($qry);
	if(dbRows($result) > 0){	
		while($record = dbArray($result)){
			$str2 .= "['".$record['customer_id']."','".$record['customer_orgname']."'],";	
		}
	}
	
	$str3 = "";	
	$sql = "SELECT DISTINCT bankname FROM lms_custinvoicereceipt WHERE bankname != '' ORDER BY bankname ASC";
	$result = dbQuery($sql);
	if(dbRows($result) > 0){	
		while($record = dbArray($result)){
			$str3 .= "['".$record['bankname']."'],";	
		}
	}
	
	$str4 = "";	
	$sql = "SELECT DISTINCT product_name FROM csc_customer WHERE 1=1";
	$result = dbQuery($sql);
	if(dbRows($result) > 0){	
		while($record = dbArray($result)){
			$str4 .= "['".$record['product_name']."'],";	
		}
	}
	
	
	// ------------------------------end-----------------------------------
	
	
	$str1 = substr($str1, 0, strlen($str1)-1);
	$str2 = substr($str2, 0, strlen($str2)-1);
	$str3 = substr($str3, 0, strlen($str3)-1);
	$str4 = substr($str4, 0, strlen($str4)-1);
	
	
?>
<script type="text/javascript" language="javascript">
	Ext.namespace('Ext.combo');
	Ext.combo.customer = [<?php echo $str1; ?>];
	Ext.combo.cust = [<?php echo $str2; ?>];
	Ext.combo.bankname = [<?php echo $str3; ?>];
	Ext.combo.product = [<?php echo $str4; ?>];
	
	
</script>
