<?php
session_start();
include "../conexion.php";
$comd_id=$_GET['comd_id'];
$id=$_GET['comd_id']; 

$sql4=mysqli_query($con, "SELECT * from seriales_compra where  compra_detalle_comd_id='$comd_id'  ");
$result4 = mysqli_num_rows($sql4);
if($result4>0)
{
    while ($row4=mysqli_fetch_array($sql4))
    { ?>
        <div class="input-group">
            <input type="text" class="form-control input-sm" name="serial[]" value="<?php  echo $row4['ser_codigo']; ?>"   readonly>
            <span class="input-group-addon">
                 <a href="#" id="ser-<?php echo $row4["ser_id"];?>"type='button' title="Eliminar" ><i class="btn-icon-only icon-remove"></i></a>
            </span> 
            <span class="input-group-addon">
                <a href="php_etiquetas/plantilla_serial_compra.php?ser_codigo_com=<?php echo $row4['ser_codigo'];?>"  target="_blank" title="Imprimir Serial" ><i class="btn-icon-only icon-print"></i></a>
            </span>           
        </div> <!-- /.form-group -->
        </br>
<script>
    $("#ser-"+<?php echo $row4["ser_id"];?>).click(function(e){
    e.preventDefault();
    p = confirm("Estas seguro de eliminar?");
    if(p){
    $.get("php_compras/eliminar_serial_m.php","ser_id="+<?php echo $row4["ser_id"];?>,
    function(data){
    loadserial();
    loadserial3();
    });
    }
    });
</script>
<?php } } ?>

<div style="float: right;">
    <a href="php_etiquetas/plantilla_serial_compra.php?comd_id=<?php echo $comd_id; ?>" target="_blank" title="Imprimir Seriales" class="btn btn-info" >
    <span class="btn-icon-only icon-print"></span>Imprimir Seriales</a>
</div>