<?php $PageSecurity = 3;
 include('includes/Class_BankCheckIssueDetails.php');
	include('includes/AccountGroupMaster_Class.php');
 
	$modid=$_REQUEST['modid'];
	$frmid=$_REQUEST['frmid'];
	$rurl="&modid=".$modid."&frmid=".$frmid;
	 
	
 include ('includes/session.inc');
  include ('includes/function_lib.php');
 global $db;
 
   echo '<link href="'.$rootpath. '/css/'. $_SESSION['Theme'] .'/default.css" rel="stylesheet" type="text/css" />';
   $BillBookType=  $s->getField('voucher_master','VoucherType',$_REQUEST['VPrefix'],'VPrefix');
?>
<link rel="stylesheet" href="css/new_mxerp.css">
<div class="body_contain">
<div class="tab_div">
<table width="100%" border="1" cellpadding="3" cellspacing="0" style="border:#808080 1px solid; border-collapse:collapse;">
  <tr>
    <th width="3%">S. No.</th>
    <th>Bank Name</th>
    <th width="9%">Issue Date</th>
    <th width="10%">Check No.</th>
    <th width="8%">Status</th> 
    <th width="9%">Used Date</th>
	  <th width="22%">Party Name</th>
  </tr>
  <?php $j=1; $k=1;
 // echo "select *  from receiptbankcheckissue where id='".$_REQUEST['id']."' ";
    $ResultData=DB_query("select *  from receiptbankcheckissue where id='".$_REQUEST['id']."' ",$db);
    while($RowData = DB_fetch_array($ResultData))
   { 
	 
	  $arr=$RowData['checkno_from'];
	  
	 for($j=1,$i=$arr;$i<=$RowData['checkno_to'];$i++,$j++){
	 
	  if($i%2==0)
     $bgcolor="#e4e4e4";
	 else 
	 $bgcolor="#FFFFFF";
	 ?>
	 
  <tr bgcolor="<?php echo $bgcolor;?>">
    <td><?php echo $j ?></td>
    <td><?php 
	echo $s->getField('accountledger','AccountsID',$RowData['ledger_id'],'AccountName');;?> </td>
    <td><?php echo ConvertSQLDate($RowData['issue_date']) ?></td>
    <td><?php echo  $i; ?></td>
    <td><?php   $statusdate=$P->Status_BankCheckIssueDetails($i);
	if($statusdate!='')
	echo "Used";
	//	echo $s->getField('account_book','AccountsID',$RowData['ledger_id'],'AccountName'); 
 	  ?></td>
    <td><?php 
 if($statusdate!='')
 echo ConvertSQLDate($statusdate) ?></td>
    <td><?php   	
  $partyid=$P->PartyBankCheckIssueDetails($i,$RowData['ledger_id']);
  echo $s->getField('accountledger','AccountsID',$partyid,'AccountName');  ?></td>
  </tr>
  <?php }  
  }
  ?>
</table>
</div>
</div>