<?php
session_start();
include "../conexion.php";
$vent_id=$_GET['vent_id']; 
$id=$_GET['vent_id']; 
?>
<table class="table table-striped table-bordered" style="font-size: 9pt;">
    <tr>
        <th><center>SERIAL</center></th>
        <th width="5%"> 
            <a data-idd="<?php echo $id;?>" data-toggle="modal" class="btn btn-nuevo_ser btn-xs btn-success" title="Nuevo"> <i class="btn-icon-only icon-plus"></i></a>
        </th>
    </tr>
    <?php
        $can1=mysqli_query($con,"SELECT * from seriales_temp where venta_detalle_temp_vent_id='$vent_id'") or die(mysqli_error($con)); 
        while ($roww=mysqli_fetch_array($can1))
        {
    ?>
    <tr>
        <td>  
            <center><input type="hidden" name="comt_id" id="comt_id" value="<?php echo $roww['ser_codigo'];?>" class="form-control name_list"><?php echo $roww['ser_codigo'];?></center>
        </td>
        <td>
            <a href="#" id="ser-<?php echo $roww["ser_id"];?>" title="Eliminar" class="btn btn-xs btn-danger"> <i class="btn-icon-only icon-remove"></i></a>
            <script>
                $("#ser-"+<?php echo $roww["ser_id"];?>).click(function(e){
                    e.preventDefault();
                    p = confirm("Estas seguro de eliminar?");
                    if(p){
                    $.get("php_facturar/eliminar_serial.php","ser_id="+<?php echo $roww["ser_id"];?>,
                    function(data){
                    loadserial();
                    loadbotones();
                    loadTabla();
                    });
                  }
                });
            </script>
        </td>
    </tr>
    <?php } ?>   
</table>

<script>
    $(".btn-nuevo_ser").click(function(){
     id = $(this).data("idd");
      $.get("./php_facturar/form_serial_nuevo.php","id="+id,function(data){
       $("#form-n_serial").html(data);
     });
      $('#n_serial').modal('show');
    });
 </script> 