Tareas #708 En la búsqueda de candidato, pedir un campo cuando se intruduce un texto en 'Datos'

git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_Intranet/trunk@106 e2b1556b-49f8-d141-9351-52d6861a72d9
This commit is contained in:
roberto 2011-08-16 10:17:24 +00:00
parent 368f8f935c
commit ad52331af2
5 changed files with 81 additions and 64 deletions

View File

@ -13,60 +13,12 @@ include_once("html/cabecera.php");
include_once("Objects/HTML.php");
$html=new HTML($locale);
echo $html->menuCandidatos();
$errores = "";
include_once("Objects/ListaCandidatos.php");
$listaCandidatos=new ListaCandidatos($usuario,"","","10");
$resultado=$listaCandidatos->getCamposBusqueda();
?>
<form name="buscador" method="post" action="buscar_candidato.php"><br>
<h2><?php echo $locale['820']; ?></h2>
<div class="encabezado"><?php echo $locale['Candidato007']; ?></div>
<table align="center" width="100%" border="0">
<tr>
<td width="10%">
Palabra: <br><input type="text" name="palabra">
</td>
<td width="90%">
>Buscar en: <br><select multiple name="campo[]" id="campo" size="10">
<?php
while($row = mysql_fetch_row($resultado)) {
?>
<option value="<?php echo $row[0]; ?>"><?php echo $row[0]; ?></option>
<?php
}
?>
</select>
</td>
</tr></table>
<div class="encabezado"><?php echo $locale['Capacidades004']; ?></div>
<table align="center" width="100%" border="0">
<tr>
<td width="20%">
<?php
echo $locale['121']. "<br>";
echo $html->listaSelect("perfil","oid","id","id_perfil_tecnico",array("",$locale['ns']),$_POST['id_perfil_tecnico'],true,true,"15");
?>
</td>
<td width="20%">
<?php
echo $locale['122'].'<br>';
echo $html->listaSelect("tecnologia","oid","id","tecnologias",array("",$locale['ns']),$_POST['tecnologias'],true,true,"15");
?>
</td>
<td width="60%">
<?php
echo $locale['Capacidades002_0'].'<br>';
echo $html->listaSelect("perfil_funcional","oid","id","id_perfil_funcional",array("",$locale['ns']),$_POST['id_perfil_funcional'],true,true,"15");
?>
</td>
</tr>
</table>
<br>
<input type="submit" value="Buscar" name="buscar">
</form>
<?php
////////////////////////////
// Proceso del Formulario
@ -77,6 +29,7 @@ if(isset($_POST['buscar'])) {
$campos=$_POST['campo'];
$whereCampos="";
$tablas = "usuarios";
foreach($campos as $campo)
if ($campo != "") {
if ($whereCampos != "") {
@ -84,6 +37,9 @@ if(isset($_POST['buscar'])) {
}
$whereCampos = $whereCampos . "usuarios.". $campo ." like '%". $palabra ."%'";
}
if (($palabra != "") && ($whereCampos == "")) {
$errores = $locale['01903'];
}
$SemaforoPerfilTec = false;
$perfiles_tec = $_POST["id_perfil_tecnico"];
@ -130,24 +86,82 @@ if(isset($_POST['buscar'])) {
$whereTecnologias = $whereTecnologias . "(capacidades_perfil_tecnologias.id_tecnologia = ". $tecnologia ." and capacidades_perfil_tecnologias.id_capacidad = capacidades3.id and capacidades3.id_usuario = usuarios.oid)";
}
if ($errores == "") {
$query = "SELECT distinct usuarios.* from ". $tablas ." where (usuarios.tipo = 'candidato')";
if ($whereCampos != "")
$query = $query . " and (". $whereCampos .")";
if ($wherePerfilesTec != "")
$query = $query . " and (". $wherePerfilesTec .")";
if ($wherePerfilesFun != "")
$query = $query . " and (". $wherePerfilesFun .")";
if ($whereTecnologias != "")
$query = $query . " and (". $whereTecnologias .")";
$query = "SELECT distinct usuarios.* from ". $tablas ." where (usuarios.tipo = 'candidato')";
if ($whereCampos != "")
$query = $query . " and (". $whereCampos .")";
if ($wherePerfilesTec != "")
$query = $query . " and (". $wherePerfilesTec .")";
if ($wherePerfilesFun != "")
$query = $query . " and (". $wherePerfilesFun .")";
if ($whereTecnologias != "")
$query = $query . " and (". $whereTecnologias .")";
//echo $query;
$listaCandidatos=new ListaCandidatos($usuario,"",$query,"");
}
}
?>
//echo $query;
<form name="buscador" method="post" action="buscar_candidato.php"><br>
<h2><?php echo $locale['820']; ?></h2>
$listaCandidatos=new ListaCandidatos($usuario,"",$query,"");
<?php
if($errores!=""){
// Mostramos el mensaje
echo "<div class=\"aviso error\">".$errores."</div>";
}
?>
include_once("ver_lista_candidatos.php");
<div class="encabezado"><?php echo $locale['Candidato007']; ?></div>
<table align="center" width="100%" border="0">
<tr>
<td width="10%">
<?php echo $locale['01901']; ?> <br><input type="text" name="palabra">
</td>
<td width="90%">
<?php echo $locale['01902']; ?> <br><select multiple name="campo[]" id="campo" size="10">
<?php
while($row = mysql_fetch_row($resultado)) {
?>
<option value="<?php echo $row[0]; ?>"><?php echo $row[0]; ?></option>
<?php
}
?>
</select>
</td>
</tr></table>
<div class="encabezado"><?php echo $locale['Capacidades004']; ?></div>
<table align="center" width="100%" border="0">
<tr>
<td width="20%">
<?php
echo $locale['202']. "<br>";
echo $html->listaSelect("perfil","oid","id","id_perfil_tecnico",array("",$locale['ns']),$_POST['id_perfil_tecnico'],true,true,"15");
?>
</td>
<td width="20%">
<?php
echo $locale['203'].'<br>';
echo $html->listaSelect("tecnologia","oid","id","tecnologias",array("",$locale['ns']),$_POST['tecnologias'],true,true,"15");
?>
</td>
<td width="60%">
<?php
echo $locale['202_2'].'<br>';
echo $html->listaSelect("perfil_funcional","oid","id","id_perfil_funcional",array("",$locale['ns']),$_POST['id_perfil_funcional'],true,true,"15");
?>
</td>
</tr>
</table>
<br>
<input type="submit" value="Buscar" name="buscar">
</form>
<?php
if(count($listaCandidatos)==0)
include_once("ver_lista_candidatos.php");
include_once("html/pie.php");
}
?>

View File

@ -877,6 +877,9 @@ $locale['1902'] = "Desde";
$locale['1903'] = "Hasta";
$locale['1904'] = "Todos los empleados";
$locale['1905'] = "Extenxi&oacute;n";
$locale['01901'] = "Palabra";
$locale['01902'] = "Buscar en";
$locale['01903'] = "Debe elegir, al menos, un campo en el que buscar la palabra";
//Informes:
$locale['2000'] = "Lista de informes";

BIN
src/imagenes/498_150.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
src/imagenes/498_250.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
src/imagenes/498_tmp.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 KiB