<?php 
session_start();
require_once ("../conexion.php");
require_once('../include/sesiones.php'); 
$pen_id=$_GET['pen_id'];

         ?>
<div class="alert alert-info alert-dismissable"><strong>Efectivo</strong></div>

 <table class="table table-bordered table-hover table-striped" id="datos" style="font-size: 9pt;">
    <tr>
        <th>ABONO</th>
        <th>MEDIO PAGO</th>
        <th width="5%"></th>
    </tr>
    <?php
        $abon=mysqli_query($con, "SELECT * from pedido_abono_temp where pedido_pen_id='$pen_id' and medio_pago='Efectivo' ") or die(mysqli_error($con));
        while( $res=mysqli_fetch_array($abon)) {
        $ped_abo_id=$res['ped_abo_id'];
        $ped_abono=$res['ped_abono'];
        $forma_pago=$res['forma_pago'];
         ?>
    <tr>

        <td><?php echo number_format($ped_abono) ?></td>
        <td><?php echo ucfirst($forma_pago) ?></td>
         
        <td> 
            <a href="#" id="eliminar-<?php echo $ped_abo_id ?>" class="btn btn-xs btn-danger"> <i class="btn-icon-only icon-remove"></i></a>
            <script>
                $("#eliminar-"+<?php echo $ped_abo_id ?>).click(function(e){
                e.preventDefault();
                p = confirm("Desea eliminar el Abono?");
                if(p){
                  $.get("./php_pedidos/eliminar_abono.php","ped_abo_id="+<?php echo $ped_abo_id ?>,function(data){
                    $('#tabla_detalle').modal('hide');
                    $('body').removeClass('modal-open');
                    $('.modal-backdrop').remove();
                    loadTablaabonar();
                    loadabonos();
                    loadtabladetalle();
                    });
                }
              });
            </script>
        </td>
       
    </tr>
     <?php } ?>


</table>