<?php $PageSecurity = 11;
include('./includes/session.inc');
include('./includes/function_lib.php');
include('./includes/SQL_CommonFunctions.inc');
include('./includes/Class_BankCheckIssueDetails.php');
 //echo $_GET['q'] .$_GET['led'];
// echo "select *  from receiptbankcheckissue where ledger_id='".$_GET['q']."' ";
$ResultData=DB_query("select *  from receiptbankcheckissue where ledger_id='".$_GET['q']."' ",$db);
 while($RowData = DB_fetch_array($ResultData))
   { 
	   $arr=$RowData['checkno_from'];
   }
    
   if($P->LastBankCheck($_GET['q'])==0)
    $banks_checkno=$arr;
	else	
	  $banks_checkno=$arr+1;
$banks_checkdate=ConvertSQLDate(date('Y-m-d'));
    $UnderGroup=$s->getField('accountledger','AccountsID',$_GET['q'],'UnderGroup');
	
	function CategoryShow($pcode, $PcateID, $dashVal)
	{
	      global $db;
		  static $i=0;;
	 
	        $sqlCate = "select * from accountgroupmaster  where  GroupId = '".$PcateID."'";
			$rsCate  = DB_query($sqlCate,$db);	
			if(DB_num_rows($rsCate)>0)
			{
			while($rowCate = DB_fetch_array($rsCate))
			{ 
			
			if($rowCate['PcateID']==0)
			 { 
			   return $rowCate['GroupName'];
			 }
			 $r=CategoryShow($pcode,$rowCate['MainGroupId'], $dashVal );  
 		    }}
 	}
	
	
	
	
	
	 $sqlCate = "select * from  accountgroupmaster  where GroupId='".$UnderGroup."' ";
		$rsCate  = DB_query($sqlCate,$db);
		if(DB_num_rows($rsCate)>0)
		{
			while($rowCate =DB_fetch_array($rsCate))
			{
			   if($rowCate['MainGroupId']!=0)
   				$GroupName= CategoryShow($pcode, $rowCate['MainGroupId'], $dashVal );
				
 			}
		}
	//echo $GroupName;
	if($GroupName=='CASH' || $GroupName=='BANK'){
   ?><div id='hid-Bankdetails'>
	<fieldset>
	<legend> Bank CheckDetails</legend>
 	<table width="100%" cellpadding="0" cellspacing="0" border="0">	 
 	<tr>
    <td>Check NO</td>
    <td><input type="text" name="banks_checkno"  id='banks_checkno' value="<?php echo $banks_checkno; ?>"   /></td>
    <td>Check Date</td>
    <td><input type="text" name="banks_checkdate" id="banks_checkdate" class="datepicker" value="<?php echo $banks_checkdate; ?>" /></td>   

    <td>Received From</td>
    <td><input type="text" name="banks_receivedfrom" id="banks_receivedfrom" class="datepicker" value="<?php echo $banks_receivedfrom; ?>" /></td>   
  </tr>
 	<tr>
 	  <td>Favouring name</td>
 	  <td><input type="text" name="favouring_name" id="favouring_name"  value="<?php echo $favouring_name; ?>" /></td>
 	  <td>cross inst</td>
 	  <td><input type="text" name="cross_inst" id="cross_inst"  value="<?php echo $cross_inst; ?>" /></td>
 	  <td>&nbsp;</td>
 	  <td>&nbsp;</td>
 	  </tr>
  </table>
  </fieldset></div><?php }?>