<?php class BankCheckIssueDetails
	{
	   
		public function BankCheckIssueDetails()  
		{
		 
		}
public  function  Status_BankCheckIssueDetails($chkno)
  { 
global $db;
$sql_state=DB_query("SELECT A.banks_checkno as CHKNO,A.banks_checkdate as CHKDATE  from account_book A ,account_book_details B where A.id=B.account_bookid and A.banks_checkno   ='".$chkno."'   ",$db);		
					if(!$sql_state)
					{
					   die('Error.'.DB_error_msg($db));
					}
					
					while($row_branch=DB_fetch_array($sql_state))
					{
					   return($row_branch['CHKDATE']);
 					}
					
		 
	
	}
	
	
public  function  PartyBankCheckIssueDetails($chkno,$lid)
  { 
global $db;
 $sql_state=DB_query("SELECT *  from account_book A ,account_book_details B where A.id=B.account_bookid and A.banks_checkno   ='".$chkno."'  and B.ledgerid    != '".$lid."'",$db);		
					if(!$sql_state)
					{
					   die('Error.'.DB_error_msg($db));
					}
					
					while($row_branch=DB_fetch_array($sql_state))
					{
					   return($row_branch['ledgerid']);
 					}
					
 	}
	
//*****************************
public  function  LastBankCheck($lid)
  { 
global $db;

 $sql_state=DB_query("SELECT A.banks_checkno as BANKCHK  from account_book A ,account_book_details B where A.id=B.account_bookid and  B.ledgerid='".$lid."' order by A.id desc limit 1",$db);		
					if(!$sql_state)
					{
					   die('Error.'.DB_error_msg($db));
					}
					
					while($row_branch=DB_fetch_array($sql_state))
					{
					   return($row_branch['BANKCHK']);
 					}
					
 	}	
	}
	$P=new BankCheckIssueDetails();
	?>
