<?php class Branch_Master
	{
 		public function Branch_Master()  
		{
		 
		}
		   function  Branch($branchid,$BillBookType)
		   { 
		    
					global $db;
					$sql_state=DB_query("SELECT loccode,locationname FROM  locations ",$db);		
					if(!$sql_state)
					{
					   die('Error.'.DB_error_msg($db));
					}
					echo "<select name='Branch'  onchange=ShowDiv(this.value,'hid-Branchdiv','ACBillbookPayment-Branch.php?Prefix=$BillBookType') style='width:98%;' >";
					echo "<option value='000'>--Select  Branch--</option>";
					while($row_branch=DB_fetch_array($sql_state))
					{
					   $p='';
					   if($row_branch['loccode']==$branchid)
					   $p='selected';
					  echo "<option value='".$row_branch['loccode']."' $p >".$row_branch['locationname']."</option>";
					}
					echo "</select>";
			}
			
			
			
			function SiteRecord($title,$branchid,$type=''){
				global $db;
				//echo "SELECT loccode,locationname FROM  locations where CompanyId='".$_SESSION['ACGCompanyId']."' and loccode in('".$_SESSION['AssignedBranch']."') ";
					$sql_state=DB_query("SELECT loccode,locationname FROM  locations where CompanyId='".$_SESSION['ACGCompanyId']."' and loccode in('".$_SESSION['AssignedBranch']."') ",$db);		
					if(!$sql_state)
					{
					   die('Error.'.DB_error_msg($db));
					}
					echo "<select name='".$title."'   onchange=ShowDiv(this.value,'hid_leads','GetBranchWiseRecord.php?type=$type')  style='width:98%;' >";
					echo "<option value='000'>--Select  Branch--</option>";
					while($row_branch=DB_fetch_array($sql_state))
					{
					   $p='';
					   if($row_branch['loccode']==$branchid)
					   $p='selected';
					  echo "<option value='".$row_branch['loccode']."' $p >".$row_branch['locationname']."</option>";
					}
					echo "</select>";
			}
	
	}
	
	$ClassBranch=new Branch_Master();
	?>
