<div id="modificar_ser" class="modal fade" tabindex="-1" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title">Modificar</h4>
            </div>
            <div class="modal-body ">
                <form id="modificar_servicio" method="post"  >
                    <div id="resultados_servi"></div>
                    <label>Codigo</label>
                    <input type="hidden" name="id" id="id" class="form-control input-sm" autocomplete="off"  value="" >
                    <input type="text" name="referencia" id="referencia" class="form-control input-sm" autocomplete="off"  value="" >
                    <label>Servicio</label>
                    <input type="text"  name="nombre" id="nombre" class="form-control input-sm" autocomplete="off"  value="">
                    <label>Categorias</label>
                        <section id="intro" >
                            <select name="art_familia" id="art_familia" class="form-control input-sm">
                                 <?php
                                $datos = mysqli_query($con,"SELECT * FROM familias WHERE fam_id='$familias_fam_id' ") ;
                                while( $fila = mysqli_fetch_array( $datos ) )
                                {
                                echo' <option value="'.$fila['fam_id'].'">'.$fila['fam_nombre'].'</option>';
                                }
                                $datos = mysqli_query($con,"SELECT * FROM familias WHERE empresa='$empresa' and fam_id<>'$familias_fam_id' order by fam_nombre asc") ;
                                while( $fila = mysqli_fetch_array( $datos ) )
                                {
                                echo' <option value="'.$fila['fam_id'].'">'.$fila['fam_nombre'].'</option>';
                                }
                                ?>
                            </select>
                        </section>
                        <?php if ($negocio_neg_id==3 or $negocio_neg_id=='2'){?> 
                            <label>Ubicación</label>
                                <select name="ubicacion" id="ubicacion" class="form-control input-sm" required>
                                <?php
                                    $result_1 = mysqli_query($con,"SELECT * FROM ubicacion WHERE empresa='$empresa' and sucursal='$sucursal'");  
                                    while ($row_1=mysqli_fetch_array($result_1)) 
                                    {   
                                      echo "<option value='".$row_1['ubi_id']."' >".$row_1['ubi_nombre']."</option>"; 
                                    }  
                                    ?>
                                </select>
                            <?php } else { ?>
                            <input type="hidden" name="ubicacion" id="ubicacion" class="form-control input-sm" value="1">
                        <?php } ?>
                    <label>Precio Costo </label>
                    <input type="number" name="costo" id="costo" class="form-control input-sm" autocomplete="off"  value="" >
                    <label>Impuesto</label>
                    <select name="iva" id="iva" class="form-control input-sm" required >
                        <?php
                            $datos=mysqli_query($con,"SELECT * FROM iva where empresa='$empresa'") ;
                            while($fila=mysqli_fetch_array($datos ))
                            {
                                echo' <option value="'.$fila['iva_porcentaje'].'" select>'.$fila['iva_nombre'].'</option>';
                            }
                        ?>
                    </select> 
                        
                    <label>Precio Venta</label>
                    <input type="number" name="pvp" id="pvp" class="form-control input-sm" autocomplete="off" value="" >
                    <label>Comision de venta %</label>
                    <input type="number" step="0.02" name="comision" id="comision" class="form-control input-sm" value="">
                    </br>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
                        <button id="modificar_ser" type="submit" class="btn btn-success">Modificar </button> 
                    </div>
                </form>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div>

<script>
$( "#modificar_servicio" ).submit(function( event ) {
    $('#modificar_ser').attr("disabled", true);
    var parametros = $(this).serialize();
    $.ajax({
        type: "POST",
        url: "php_servicios/editar_servicio.php",
        data: parametros,
      
        beforeSend: function(objeto){
         $('#resultados_servi').html('<center><img src="./img/ajax-loader.gif"> CARGANDO...</center>');
        },
        success: function(datos){
        $("#resultados_servi").html(datos);
        $('#modificar_ser').attr("disabled", false);
        load(1);
        }
    });
event.preventDefault();
})
</script>