<div id="page-wrapper">
    <div class="header">
        <h1 class="page-header">

        </h1>
        <ol class="breadcrumb">
            <li><a href="#">Receipt</a></li>
            <li class="active">Division Receipt</li>
        </ol>

    </div>
    <div id="page-inner">
 


        <div class="row">
            <div class="col-md-12">
                <!--   Kitchen Sink -->
                <div class="panel panel-default">
                    <div class="panel-heading d-flex justify-content-center">
                    Division Receipt
                    </div>
                    <div class="panel-body">

                    <div class="row">
                        <div class="col-sm-12">
                            <div class="tile">
                                <div class="tile-body" id="filter_id">

                    <table id="table_id1" class="table table-striped table-bordered" style="width:100%">
                                            <thead>
                                                <tr>
                                                    <th class="text-center">S No.</th>
                                                    <th class="text-center">Division</th>
                                                    <th class="text-center">Section</th>
                                                    <th class="text-center">Thrift</th>
                                                    <th class="text-center">Principal</th>
                                                    <th class="text-center">Interest</th>
                                                    <th class="text-center">Others</th>
                                                    <th class="text-center">Total</th>
                                                    <th class="text-center">Paid on</th>
                                                    <th class="text-center">Action</th>
                                                </tr>
                                            </thead>

                                            <tbody> 



<!-- 
$section = $div['section'];
$tot_thrift += $div['thrift_amt'];
$tot_pri += $div['loan_pri_amt'];
$tot_int += $div['loan_int_amt'];
$tot_flpri += $div['f_pri'];
$tot_flint += $div['f_int'];
$tot_ins += $div['insurance'];
$tot_others += $div['others'];
$total += $div['thrift_amt'] + $div['loan_pri_amt'] + $div['loan_int_amt'] + $div['f_pri'] + $div['f_int'] +  $div['insurance'] + $div['others'];
$paid = $div['paid_on'];
?> -->
                                            <?php $sno = 0;  ?>
                                         
                                            <?php  foreach($divsec as $div){ ?>

                                                <?php $sno = $sno + 1;   ?>
                                                    <tr>
                                                        
                                                       <td class="text-center">
                                                      <?= $sno; ?>
                                                        </td>
                                                        <td class="text-center">
                                                        <?=  $div['division'];?>
                                                        </td>
                                                         <td class="text-center">
                                                         <?= $div['section'];?>
                                                         </td>
                                                         <td class="text-center">
                                                             <?php if ( $div['thrift_amt'] != " "){ ?>
                                                         <?= $div['thrift_amt'];?>
                                                         <?php } else{ ?>
                                                            <?php echo 0; ?>
                                                            <?php } ?>
                                                         </td>
                                                         <td class="text-center">
                                                         <?php if ( $div['loan_pri_amt'] != " "){ ?>
                                                         <?=  $div['loan_pri_amt'];?>
                                                         <?php } else { ?>
                                                            <?php echo 0; ?>
                                                            <?php } ?>
                                                         </td>
                                                         <td class="text-center">
                                                         <?php if ( $div['loan_int_amt'] != " "){ ?>
                                                         <?=  $div['loan_int_amt'];?>
                                                         <?php } else { ?>
                                                            <?php echo 0; ?>
                                                            <?php } ?>
                                                         </td>
                                                         </td>
                                                         </td>
                                                         <td class="text-center">
                                                         <?php if ( $div['others'] != " "){ ?>
                                                         <?= $div['others'];?>
                                                         <?php } else { ?>
                                                            <?php echo 0; ?>
                                                            <?php } ?>
                                                         </td>
                                                         </td>
                                                         <td class="text-center">
                                                         <?= $total = $div['thrift_amt'] + $div['loan_pri_amt'] +   $div['loan_int_amt'] +$div['others'] ;?>
                                                         </td>
                                                         <td class="text-center">
                                                         <?=  $div['paid_on'];?>
                                                         </td>
                                                       
                                                        <td class="text-center">
                                                        <form method="post" action="<?php echo base_url(); ?>index.php/Demand/div_reciept" id="rec_form" enctype='multipart/form-data' target="_blank">
                                                        <input type="hidden" value="<?php echo  $div['division']; ?>" name="division">   
                                                        <input type="hidden" value="<?php echo $div['section']; ?>" name="section"> 


                                                        <input type="hidden" value="<?php echo $div['thrift_amt']; ?>" name="thrift_amt"> 
                                                        <input type="hidden" value="<?php echo $div['loan_pri_amt']; ?>" name="loan_pri_amt">   
                                                        <input type="hidden" value="<?php echo $div['loan_int_amt']; ?>" name="loan_int_amt"> 
                                                        <input type="hidden" value="<?php echo $div['others']; ?>" name="others">   



                                                        <input type="hidden" value="<?php echo $div['paid_on']; ?>" name="paidon">   
                                                        <input type="hidden" value="<?php echo $total; ?>" name="total">    
                                                        <button style="color:white;" class = 'btn btn-primary btn-xs' ><span class="fa fa-search"></span><span class="sr-only">View</span></button>
                                                        </form> 
                                                        </td>
                                                    
                                                    </tr>

                                                    <?php } ?>              
                                                      
                                                      
                                            </tbody>
                                        </table>
          </div>
          </div>
                            </div>
                        </div>
 </div>
</div>
</div>
<script src="<?php echo base_url() ?>assets/datatables/dataTables.bootstrap.js"></script>
    <script src="<?php echo base_url() ?>assets/datatables/jquery.dataTables.js"></script>
    <script src="https://cdn.datatables.net/1.10.19/js/dataTables.bootstrap4.min.js"></script>

    <!-- Custom Js -->
    <script src="<?php echo base_url(); ?>assets/js/custom-scripts.js"></script>
    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

 <script> 
$(document).ready(function() {
        //    $('#table_id1').dataTable();
});
 </script> 