<!--onLoad="window.print()"-->

<body  onLoad="window.print()">
<?php $this->load->view("common/header"); ?>
<style type="text/css">

.report_view_th{
	color:#000 !important;
	font-size:12px;	
}
.table-responsive td{
	font-size:13px;
	background-color:#fff !important;
}


h4{
	font-size:13px;
}
body{
	background-color:#fff !important;
}


mark { 

    background-color: red;

    color: black;

}

</style>
<div class="panel panel-default" style="margin-left:15px; margin-right:15px; margin-top:15px;margin-bottom:20px;">
<div class="" id="printableArea">
<div class="modal-body">
<div style="top:2px;" class="panel-tools open">
  <button data-toggle="dropdown" class="btn btn-blue dropdown-toggle" onClick="window.print()"> <i class="fa fa-print"></i> </button>
  <button class="btn btn-blue dropdown-toggle" data-toggle="dropdown" id="excel"> <i class="fa fa-fw" aria-hidden="true" title="Copy to use file-excel-o"></i> </button>
</div>
<div class="row">
  <div class="col-xs-12 text-center">
    <?php $this->load->view("common/report_header.php"); ?>
  </div>
  <!--col-xs-12--> 
  
</div>
<!--row-->

<div style="margin-bottom:15px; " class="row">
  <div class="col-xs-12 pull-left">
    <h4 style="margin-top:10px;">Report : Loan Report</h4>
    <p> Date : <?php echo display_date_time_format(date("Y-m-d H:i:s")); ?> </p>
    <p> Route :
      <?php if(isset($route_name)){echo $route_name;} ?>
    </p>
    </p>
    </p>
  </div>
</div>
<div class="table-responsive">

  <table class="table table-bordered " id="warehouse_table">
                <thead>
                  <tr>
                    <th>Loan Ref.no</th>
                    <th>Customer</th>
                    
                    <th>Loan Date</th>
                    <th>Closed Date</th>
                   <!-- <th></th>-->
                    <th>Terms</th>
                    <th>Loan Amount</th>
                    
                    
                    <th>Term Amount</th>
                    <th>Loan Arrears</th>
                    <th>Total Paid</th>
                    <th>Total Due</th>
                   <!-- <th>Total Loan Amount</th>-->
                    <th>Address</th>
                    <th>TP Number</th>
                  </tr>
                </thead>
                <tbody>
                
                
                <?php if($data_array){ foreach($data_array as $row){?>
                
                <tr>
                <td> <?php echo $row['loan_ref'];?></td>
                <td> <?php echo $row['cus_name'];?></td>
                <td> <?php echo $row['loan_date'];?></td>
                <td> <?php echo $row['close_status'];?></td>
                <?php /*?><td> <?php echo $row['pTname'];?></td><?php */?>
                <td> <?php echo $row['loan_no_of_terms'];?></td>
                <td> <?php echo $row['loan_tot_amount'];?></td>
                <td> <?php echo $row['loan_term_amount'];?></td>
                <td> <?php echo $row['oustanding_value'];?></td>
                <td> <?php echo $row['paid_loan_only'];?></td>
                <td> <?php echo $row['loan_balance'];?></td>
                <?php /*?><td> <?php echo $row['t_loan_amount'];?></td><?php */?>
                 <td> <?php echo $row['cus_address'];?></td>
                 <td> <?php echo $row['cus_mobile'];?></td>
                
                </tr>
                <?php } } ?>
                </tbody>
                
                <tfoot>
                 <!-- <tr>
                    <th>Loan Ref.no</th>
                    <th>Customer</th>
                   
                    <th>Loan Date</th>
                    <th>Closed Date</th>
                    <th></th>
                    <th>Terms</th>
                    <th>Loan Amount</th>
                    
                    
                    <th>Term Amount</th>
                    <th>Loan Arrears</th>
                    <th>Total Paid</th>
                    <th>Total Due</th>
                    <th>Total Loan Amount</th>
                    <th>Address</th>
                    <th>TP Number</th>
                  </tr>-->
                </tfoot>
              </table>
</div>
<div class="row">
  <div class="col-xs-12"> </div>
  <div class="col-xs-5 pull-right">
    <div class="well-sm">
      <p> Created by: <?php echo $this->session->userdata('ss_user_first_name'); ?> (<?php echo $this->session->userdata('ss_user_group_name'); ?>)</p>
      <p> Date: <?php echo display_date_time_format(date("Y-m-d H:i:s")); ?> </p>
    </div>
  </div>
</div>
</div>
</div>
</div>
<?php $this->load->view("common/footer"); ?>
<!--/.col-md-12--> 

<script>


$(function(){
    $('#excel').click(function(){
        var url='data:application/vnd.ms-excel,' + encodeURIComponent($('#printableArea').html()) 
        location.href=url
        return false
    })
})
</script>
</body>
