<div id="nuevoempleado" 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">Registrar Empleados</h4>
            </div>
            <form name="nuevo_empleado" id="nuevo_empleado" method="post">
                <div class="modal-body ">
                    <div class="tabbable">
                        <ul class="nav nav-tabs">
                            <li class="active"><a href="#datos" data-toggle="tab">DATOS PERSONALES </a></li>
                            <li class=""><a href="#avanzado" data-toggle="tab">INFORMACI脫N LABORAL </a></li>
                            <li class=""><a href="#pago" data-toggle="tab">METODO DE PAGO </a></li>
                        </ul>
                        <div class="tab-content">
                            <div id="resultados_cliente"></div>
                            <div class="tab-pane active" id="datos">
                                <div>

                                    <label>Tipo Documento</label>
                                    
                                    <select name="emp_tipo_doc" id="emp_tipo_doc"  class="form-control name_list input-sm" required >
                                        <?php
                                       
                                            $datos = mysqli_query($api,"SELECT * FROM health_type_document_identifications where id") ;
                                            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="empl_cc" id="empl_cc" class="form-control input-sm" autocomplete="off"  value="" required>
                                        <span class="input-group-addon">
                                            <div id="info_emp"></div>
                                        </span>            
                                    </div> <!-- /.form-group -->
                                </div>    
                                <div >
                                    <label>Nombre</label>
                                    <input type="text"  name="emp_nombre" id="emp_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="emp_primer_apellido" id="emp_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="emp_segundo_apellido" id="emp_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="emp_telefono" id="emp_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="emp_direccion" id="emp_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>
                                    <section id="intro">
                                        <select name="emp_municipio" id="emp_municipio" class="form-control name_list input-sm" required>
                                            <option value=""> - </option>
                                            <?php
                                                $datos = mysqli_query($api,"SELECT * FROM municipalities order by name asc") ;
                                                while( $fila = mysqli_fetch_array( $datos ) )
                                                {
                                                echo '<option value="'.$fila['id'].'">'.$fila['name'].'</option>';
                                                }
                                            ?>
                                        </select>
                                    </section>
                                </div>
                                <div class="col-md-6" style="padding-right:0px">
                                    <label>Correo</label>
                                    <input type="email" name="emp_correo" id="emp_correo" class="form-control input-sm" autocomplete="off" required>
                                </div> <!-- /.form-group -->
                               
                            </div><!-- /.datos -->

                            <div class="tab-pane" id="avanzado"> 
                                <div class="col-md-6" style="padding-left:0px">
                                    <label>Tipo Empleado</label>
                                    <select name="emp_tipo_trabajador" id="emp_tipo_trabajador"  class="form-control name_list input-sm">
                                        <?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="emp_subtipo_trabajador" id="emp_subtipo_trabajador" class="form-control name_list input-sm">
                                        <?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="emp_tipo_contrato" id="emp_tipo_contrato" class="form-control name_list input-sm" >
                                        <?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="emp_salario" id="emp_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="emp_salario_integral" id="emp_salario_integral" >
                                        <option value="true">Si</option>
                                        <option value="false" selected>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="emp_alto_riesgo" id="emp_alto_riesgo">
                                        <option value="true">Si</option>
                                        <option value="false" selected>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="emp_fecha_adminsion" id="emp_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">
                                <div >
                                    <label>Metodo de Pago</label>
                                    <select name="emp_metodo_pago" id="emp_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="emp_banco" id="emp_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" name="tipo_cuenta" id="tipo_cuenta">

                                        <option value="AHORRO">Ahorro</option>
                                        <option value="CORRIENTE">Corriente</option>
                                    </select>
                                </div> <!-- /.form-group -->
                                  <div >
                                    <label>Numero de Cuenta</label>
                                    <input type="text"  name="emp_numero_cuenta" id="emp_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="btn_empleado" value="btn_empleado" name="btn_empleado" class="btn btn-success" accesskey="s" title="alt + s"><i class="icon-ok"></i> Registrar</button>
                    </div>
                </div>
            </form>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div>

<script type="text/javascript">
    function showContent() {
        element = document.getElementById("content");
        clie_credito = document.getElementById("clie_credito");
        if (clie_credito.checked) {
            element.style.display='block';
        }
        else {
            element.style.display='none';
        }
    }
    function fAgrega()
      {
        document.getElementById("clie_disponible").value = document.getElementById("clie_cupo_credito").value;
      }

function xxxOnChange(sel) {
      if (sel.value=="1"){
           divC = document.getElementById("1");
           divC.style.display = "";
           divT = document.getElementById("0");
           divT.style.display = "none";
      }else  {
           divC = document.getElementById("1");
           divC.style.display="none";

           divT = document.getElementById("0");
           divT.style.display = "";
      }
}

$(document).ready(function() {  
  $('#empl_cc').blur(function(){
    $('#info_emp').html('<img src="img/loader.gif" alt="" height="15px"  />').fadeOut(1000);
    var empl_cc = $(this).val();    
    var dataString = 'empl_cc='+empl_cc;
    
    $.ajax({
            type: "POST",
            url: "php_empleados/verificar_empleado.php",
            data: dataString,
            success: function(data) {
        $('#info_emp').fadeIn(800).html(data);
        //alert(data);
            }
        });
    });              
});  

 
</script>