<?php 
if($_REQUEST['action']=='del')
{
  $sql_delete="delete from account_fund_receipt where id='".$_REQUEST['id']."'";
  $result_category=DB_query($sql_delete,$db);

 $sql_delete1="delete from account_fund_receipt_dtls where fund_receipt_dtls_id='".$_REQUEST['id']."'";
  $result_category1=DB_query($sql_delete1,$db);


  $s->pageLocation("index.php?route=fund_receipt_index".$rurl);
}

?>
<link rel="stylesheet" href="css/new_mxerp.css">
<div class="body_contain">
<div class="tab_div">
<h1>Fund Receipt/Transfer</h1>
 <p align="left"><a href="index.php?route=fund_receipt&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>"><input type='button' value='Add New' class="search" /></a></p>
<table width="100%" border="1" cellspacing="0" cellpadding="3" style="border:#808080 1px solid; border-collapse:collapse;">
   <tr>
   <th width="5%">S.No.</th>
   <th>Branch</th>
   <th width="15%">Voucher No.</th>
   <th width="8%">Voucher Date</th>
   <th width="12%">Budget No.</th>
   <th width="8%">Budget Date</th>
   <th width="8%">Action</th>
   <th width="5%" style="text-align:center;">Edit</th>
   <th width="5%" style="text-align:center;">Delete</th>
   </tr>
   <?php 
      // LIMIT $startpoint,$perpage
   $GetRecord = "Select * from account_fund_receipt order by id";
   $ResultData = DB_query($GetRecord,$db);
   $i=1;
   if(DB_num_rows($ResultData)==0)
   echo "<td>--No Record--</td>";   
   while($RowData = DB_fetch_array($ResultData))
   {
   ?>
 <tr bgcolor="#FFFFFF">
 <td><?php echo $i; ?></td>
 <td><?php echo $s->getField('locations','loccode',$RowData['branch'],'locationname');?></td>
 <td><?php echo $RowData['voucher_no'];?></td>
 <td><?php echo date('d/m/Y',strtotime($RowData['voucher_date']));?></td>
 <td><?php echo $s->getField('account_budget_entry','id',$RowData['budget_id'],'budget_no'); ?></td>
 <td><?php echo date('d/m/Y',strtotime($RowData['budget_date'])); ?></td>
 <td><?php 
      if($RowData['type']=='Receipt')
       {
        ?>
      <a href="index.php?route=Account/ACBillbookPayment_fund&id=<?php echo $RowData['id'].$url; ?>&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&type=Fund&VPrefix=3">Bank Receipt</a>
        <?php } else if($RowData['type']=='Payment') { ?>
           <a href="index.php?route=Account/ACBillbookPayment_fund&id=<?php echo $RowData['id'].$url; ?>&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&type=Fund&VPrefix=4">Bank Payment</a>
        <?php } ?>
  </td>   
  <td style="text-align:center;"><a href="index.php?route=fund_receipt_edit&id=<?php echo $RowData['id'].$url; ?>&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&action=edit"><img src="images/icon-edit.png"  width="15" height="15" title="Edit Document" /></a></td>
  <td style="text-align:center;"><a href="index.php?route=fund_receipt_index&action=del&id=<?php echo $RowData['id'].$url;; ?>&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>" onclick="return confirm('Do You Want To Delete This Record')"><img src="images/Icon_Delete.png" width="15" height="15" title="Delete Document" /></a></td> 
   </tr> 
  <?php $i++;} ?>  
</table>
</div>
</div>