<?php
include ('../include/cache.php'); 
include "../conexion.php";

$cot_id=$_GET['id']; 

?>
<div class="modal-body" style="padding-left:10px;">
    <div id="resultados_mod"></div> 
    <form role="form" id="editar" >      
        <div class="col-md-12">
        <?php
           $can1=mysqli_query($con,"SELECT * from dis_cotizacion_detalle_temp where cott_id ='$cot_id'") or die(mysqli_error($con)); 
           while ($row1=mysqli_fetch_array($can1)){ 

            $cott_id =$row1['cott_id'];
            $cott_art_id=$row1['cott_art_id'];

            ?>
            <input type="hidden" name="cott_id" value="<?php echo $cott_id ?>">
            <input type="hidden" name="cott_art_id" value="<?php echo $cott_art_id ?>">
            <input class="form-control" title="Editar" type="text" name="cott_nombre" id="cott_nombre" value="<?php echo $row1['cott_nombre']; ?>" >
             <?php } ?>
            
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
            <button type="submit" id="modi" class="btn btn-primary">Modificar</button>
        </div>
    </form>
    </div>  
</div>
<script>
$( "#editar" ).submit(function( event ) {
$('#modi').attr("disabled", true);
var parametros = $(this).serialize();
$.ajax({
    type: "POST",
    url: "php_cotizacion/editar_descripcion.php",
    data: parametros,
        beforeSend: function(objeto){
        $('#resultados_sab').html('<center><img src="./img/ajax-loader.gif"> CARGANDO...</center>');
        },
    success: function(datos){
    $("#resultados_mod").html(datos);
    $('#modi').attr("disabled", false);
    $('#descripcion_art_Modal').modal('hide');
    $('body').removeClass('modal-open');
    $('.modal-backdrop').remove();
    loadTabla();
    }
});
event.preventDefault();
})
</script>