<?php
include_once "../header.php";
include_once("../php/config.php");
$id_prestamo =$_GET["id_prestamo"];
$id_cuota =$_GET["id_cuota"];

$sql= mysql_query("select * from cuotas where  id_prestamo='$id_prestamo' and balance>1") or die(mysql_error());


?>
<style>
th{
	font-size:18px;
	
}
td{
	font-size:16px
}
</style>
<div class="container">
<div class="table-responsive">
                    <table class="table table-striped table-hover" data-page-length='8'>
                       
                            <th># Prestamo</th>
                             <th>Numero</th>
                            <th>Vencimiento</th>
                              
                                <th>Capital</th>
                                <th>Interes</th>
                                <th>Balance</th>
                           
                        
                            <th>Accion</th>
                        
                        <tbody>
                                        <?php while($r=mysql_fetch_array($sql)){
                                          $id_cuota=$r["id"]; 
                                          $id_prestamo=$r["id_prestamo"]; 
                                          $c++;
                                          $balance+=$r["balance"];
                                
                                          $balance_capital+=$r["balance_capital"];
                                          $balance_interes+=$r["balance_interes"];
                                         
                                          
                                          
                                          
                                          
                                                        ?>
                            <tr>
                                <td><?php echo $r["id_prestamo"]?></td>
                                <td><?php echo $r["numero"]?></td>
                                <td><?php echo fecha($r["vence"])?></td>
                                
                            
                              
                                <td><?php echo decimal($r["balance_capital"])?></td>
                                <td><?php echo decimal($r["balance_interes"])?></td>
                                  <td><?php echo decimal($r["balance"])?></td>
                               
                                <td><?php echo "<a href='get_cuota.php?id=$id_cuota' class='btn btn-success'><i class='fa fa-edit'></i>  Abonar </a>"?>
								<?php echo "<a href='editar_cuota.php?id=$id_cuota' class='btn btn-danger'><i class='fa fa-cash'></i>  Descuento </a>"?>
                                                        <?php }?>
                        </tbody>
                        <tfoot>
                             <th>Cant. cuotas</th>
                             <th>Capital </th>
                             <th>Interes </th>
                            <th>Balance</th>
                            
                          
                            <tr>
                                 <td><?php echo decimal($c)?></td>
                                  <td><?php echo decimal($balance_capital)?></td>
                                   <td><?php echo decimal($balance_interes)?></td>
                                <td><?php echo "<b class='text-primary'>".decimal($balance)."</b>"?></td>
                               
                                 
                               
                            </tr>
                        </tfoot>
                    </table>
                </div>
</div>

<?php


include_once "../footer.php";


?>
