Poder buscar por idioma y por rango salarial minimo
git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_Intranet/trunk@152 e2b1556b-49f8-d141-9351-52d6861a72d9
This commit is contained in:
parent
efb54e33ab
commit
62f10c084f
@ -90,38 +90,46 @@ if ((isset($_POST['buscar'])) || (isset($_GET['byEstado']))) {
|
||||
$salario_busqueda_max=$_POST['salario_busqueda_max'];
|
||||
//VALIDAMOS QUE LOS VALORES SELECCIONADOS SE CORRESPONDAN A NUMÉRICOS Y QUE EL MIN SEA MENOR QUE EL MAX
|
||||
$resul;
|
||||
$valor;
|
||||
$valor_minimo="";
|
||||
$valor_maximo="";
|
||||
$bdconsulta=new BD();
|
||||
|
||||
$sql = "SELECT nombre from salario where (id = ". $salario_busqueda_min .")";
|
||||
$resul = $bdconsulta->execQuery($sql);
|
||||
while($fila = mysql_fetch_array($resul)) {
|
||||
$valor = str_replace(".", "", $fila["nombre"]);
|
||||
if (is_numeric($valor)) {
|
||||
$tablas .= ", salario salario1";
|
||||
$whereSalario = "((replace(replace(salario1.nombre, ',', '' ) , '.', '' ) >= ". $valor . ") and (salario1.id = usuarios.salario_min))";
|
||||
}
|
||||
else {
|
||||
$errores[]="2";
|
||||
$error .= $locale['01904']."<br />";
|
||||
}
|
||||
$valor_minimo = str_replace(".", "", $fila["nombre"]);
|
||||
}
|
||||
|
||||
$sql = "SELECT nombre from salario where (id = ". $salario_busqueda_max .")";
|
||||
$resul = $bdconsulta->execQuery($sql);
|
||||
while($fila = mysql_fetch_array($resul)) {
|
||||
$valor = str_replace(".", "", $fila["nombre"]);
|
||||
if (is_numeric($valor)) {
|
||||
$tablas .= ", salario salario2";
|
||||
if ($whereSalario != "") {
|
||||
$whereSalario = $whereSalario . " and ";
|
||||
}
|
||||
$whereSalario .= "((replace(replace(salario1.nombre, ',', '' ) , '.', '' ) <= ". $valor . ") and (salario2.id = usuarios.salario_max))";
|
||||
}
|
||||
else {
|
||||
$errores[]="2";
|
||||
$error .= $locale['01904']."<br />";
|
||||
}
|
||||
$valor_maximo = str_replace(".", "", $fila["nombre"]);
|
||||
}
|
||||
|
||||
|
||||
if (($valor_minimo!="")) {
|
||||
if (is_numeric($valor_minimo)) {
|
||||
$tablas .= ", salario salario1";
|
||||
$whereSalario = "((replace(replace(salario1.nombre, ',', '' ) , '.', '' ) >= ". $valor_minimo . ") and (salario1.id = usuarios.salario_min))";
|
||||
}
|
||||
else {
|
||||
$errores[]="2";
|
||||
$error .= $locale['01904']."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
if (($valor_maximo!="")) {
|
||||
if (is_numeric($valor_maximo) && ($valor_minimo <= $valor_maximo)) {
|
||||
$tablas .= ", salario salario2";
|
||||
if ($whereSalario != "") {
|
||||
$whereSalario = $whereSalario . " and ";
|
||||
}
|
||||
$whereSalario .= "((replace(replace(salario1.nombre, ',', '' ) , '.', '' ) <= ". $valor_maximo . ") and (salario2.id = usuarios.salario_max))";
|
||||
}
|
||||
else {
|
||||
$errores[]="2";
|
||||
$error .= $locale['01904']."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
$SemaforoPerfilTec = false;
|
||||
$perfiles_tec = $_POST["id_perfil_tecnico"];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user