<div id="modificarempleado" 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 Empleado</h4>
            </div>
           <form name="modi_empleados" id="modi_empleados" method="post">
                <div class="modal-body ">
                    <div class="tabbable">
                        <ul class="nav nav-tabs">
                            <li class="active"><a href="#datos_mod" data-toggle="tab">DATOS PERSONALES </a></li>
                            <li class=""><a href="#avanzado_mod" data-toggle="tab">INFORMACIÓN LABORAL </a></li>
                            <li class=""><a href="#pago_mod" data-toggle="tab">METODO DE PAGO </a></li>
                        </ul>
                        <div class="tab-content">
                            <div id="resultados_empleado_mod"></div>
                            <div class="tab-pane active" id="datos_mod">
                                <div>
                                    <input type="hidden" value="" name="id" id="id">
                                    <label>Tipo Documento</label>
                                    <select name="tipo_doc" id="tipo_doc"  class="form-control name_list input-sm" required >
                                        <?php
                                       
                                            $datos = mysqli_query($api,"SELECT * FROM health_type_document_identifications");
                                            while( $fila = mysqli_fetch_array( $datos ) )
                                            {
                                            echo' <option value="'.$fila['id'].'">'.$fila['name'].'</option>';
                                            }
                                       
                                        ?>
                                    </select>
                                </div>

                                <div class="col-md-12" style="padding-left:0px" > <!-- /.form-group -->
                                    <label>Numero Documento</label>
                                    <div class="input-group">
                                        <input type="number" name="cc" id="cc" class="form-control input-sm" autocomplete="off"  value="" required>
                                        <span class="input-group-addon">
                                            <div id="Info"></div>
                                        </span>            
                                    </div> <!-- /.form-group -->
                                </div>    
                                <div >
                                    <label>Nombre</label>
                                    <input type="text"  name="nombre" id="nombre" class="form-control input-sm" autocomplete="off"  value="" autofocus="autofocus" required>
                                </div> <!-- /.form-group -->
                                <div class="col-md-6" style="padding-left: 0px;">
                                    <label>Primer Apellido</label>
                                    <input type="text"  name="primer_apellido" id="primer_apellido" class="form-control input-sm" autocomplete="off"  value="" autofocus="autofocus" required>
                                </div> <!-- /.form-group -->
                                <div class="col-md-6" style="padding-right: 0px;">
                                    <label>Segundo Apellido</label>
                                    <input type="text"  name="segundo_apellido" id="segundo_apellido" class="form-control input-sm" autocomplete="off"  value="" autofocus="autofocus" required>
                                </div> <!-- /.form-group -->
                                <div class="col-md-6" style="padding-left: 0px;">
                                    <label>Telefono</label>
                                    <input type="number" name="telefono" id="telefono" class="form-control input-sm" autocomplete="off" value="" autofocus="autofocus" required>
                                </div> <!-- /.form-group -->
                                <div class="col-md-6" style="padding-right: 0px;">
                                    <label>Dirección</label>
                                    <input type="text" name="direccion" id="direccion" class="form-control input-sm" autocomplete="off" value="" autofocus="autofocus" required>
                                </div> <!-- /.form-group -->
                                <div class="col-md-6" style="padding-left:0px">
                                    <label>Municipio </label>
                                    <select name="ciudad2" id="ciudad2" class="form-control name_list input-sm" required >
                                        <?php
                                        
                                            $datos1 = mysqli_query($api,"SELECT * FROM municipalities") ;
                                            while( $fila1 = mysqli_fetch_array( $datos1 ) )
                                            {
                                            echo '<option value="'.$fila1['id'].'">'.$fila1['name'].'</option>';
                                            }

                                       
                                            ?>
                                    </select>
                                </div>
                                <div class="col-md-6" style="padding-right:0px">
                                    <label>Correo</label>
                                    <input type="email" name="correo" id="correo" class="form-control input-sm" autocomplete="off" required>
                                </div> <!-- /.form-group -->
                               
                            </div><!-- /.datos -->

                            <div class="tab-pane" id="avanzado_mod"> 
                                <div class="col-md-6" style="padding-left:0px">
                                    <label>Tipo Empleado</label>
                                    <select name="tipo_trabajador" id="tipo_trabajador"  class="form-control name_list input-sm" required>
                                        <?php
                                            $datos = mysqli_query($api,"SELECT * FROM type_workers order by id asc") ;
                                            while( $fila = mysqli_fetch_array( $datos ) )
                                            {
                                            echo '<option value="'.$fila['id'].'">'.$fila['name'].'</option>';
                                            }
                                       
                                        ?>
                                    </select>
                                </div>
                                <div class="col-md-6" style="padding-right:0px">
                                    <label>Subtipo de empleado </label>
                                    <select name="subtipo_trabajador" id="subtipo_trabajador" class="form-control name_list input-sm" required >
                                        <?php
                                        
                                            $datos = mysqli_query($api,"SELECT * FROM sub_type_workers order by id asc") ;
                                            while( $fila = mysqli_fetch_array( $datos ) )
                                            {
                                            echo '<option value="'.$fila['id'].'">'.$fila['name'].'</option>';
                                            }

                                       
                                            ?>
                                    </select>
                                </div>
                                <div class="col-md-6" style="padding-left:0px">
                                    <label>Tipo de Contrato </label>
                                    <select name="tipo_contrato" id="tipo_contrato" class="form-control name_list input-sm" required >
                                        <?php
                                        
                                            $datos = mysqli_query($api,"SELECT * FROM type_contracts order by id asc") ;
                                            while( $fila = mysqli_fetch_array( $datos ) )
                                            {
                                            echo '<option value="'.$fila['id'].'">'.$fila['name'].'</option>';
                                            }
                                        ?>
                                    </select>
                                </div>
                                <div class="col-md-6" style="padding-right:0px">
                                    <label>Salario</label>
                                    <input type="number"  name="salario" id="salario" class="form-control input-sm" autocomplete="off" required>
                                </div> <!-- /.form-group -->
                                
                                <div class="col-md-6" style="padding-left:0px">
                                    <label>Salario Integral</label>
                                    <select class="form-control" name="salario_integral" id="salario_integral">
                                        <option value="TRUE">Si</option>
                                        <option value="FALSE">No</option>
                                    </select>
                                </div> <!-- /.form-group -->
                                <div class="col-md-6" style="padding-right:0px">
                                    <label>Empleado Alto Riesgo</label>
                                    <select class="form-control" name="alto_riesgo" id="alto_riesgo">
                                        <option value="TRUE">Si</option>
                                        <option value="FALSE">No</option>
                                    </select>
                                </div> <!-- /.form-group -->
                                  <div class="col-md-6" style="padding-right: 0px;">
                                    <label>Fecha de admisión</label>
                                    <input type="date" name="fecha_adminsion" id="fecha_adminsion" class="form-control input-sm" autocomplete="off" value="" autofocus="autofocus" required>
                                </div> <!-- /.form-group -->
                            </div><!-- /.opciones avanzadas-->
                             <div class="tab-pane" id="pago_mod">
                                <div >
                                    <label>Metodo de Pago</label>
                                    <select name="metodo_pago" id="metodo_pago" class="form-control name_list input-sm" required >
                                        <?php
                                        
                                            $datos = mysqli_query($api,"SELECT * FROM payment_methods order by id asc") ;
                                            while( $fila = mysqli_fetch_array( $datos ) )
                                            {
                                            echo '<option value="'.$fila['id'].'">'.$fila['name'].'</option>';
                                            }
                                        ?>
                                    </select>
                                </div> <!-- /.form-group -->
                                <div class="col-md-6" style="padding-left: 0px;">
                                    <label>Nombre de Banco</label>
                                    <input type="text"  name="banco" id="banco" class="form-control input-sm" autocomplete="off"  value="" autofocus="autofocus" required> 
                                </div> <!-- /.form-group -->
                                <div class="col-md-6" style="padding-right: 0px;">
                                    <label>Tipo de Cuenta</label>
                                <select class="form-control input-sm" name="tipo_cuenta2" id="tipo_cuenta2">
                                    <option value="AHORRO">Ahorro</option>
                                    <option value="CORRIENTE">Corriente</option>
                                </select>
                                </div> <!-- /.form-group -->
                                  <div >
                                    <label>Numero de Cuenta</label>
                                    <input type="text"  name="numero_cuenta" id="numero_cuenta" class="form-control input-sm" autocomplete="off"  value="" autofocus="autofocus" required>
                                </div> <!-- /.form-group -->
                               
                            </div><!-- /.PAGO -->
                        </div>
                   
                   
                     </div>
                      <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
                        <button type="submit" id="mod_empleado" value="mod_empleado" name="mod_empleado" class="btn btn-success" accesskey="s" title="alt + s"><i class="icon-ok"></i> Modificar</button>
                    </div>
                </div>
            </form>
                            </div>
                    </div>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</div>

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

</script>