Se modifica la select de lista de ofertas para hacer join con pedido y usarios y sacar las descripciones y así poder ordenar por solicitud y candidato en dicha lista de ofertas
git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_Intranet/trunk@144 e2b1556b-49f8-d141-9351-52d6861a72d9
This commit is contained in:
parent
2e8eab5911
commit
cd1e1edf5c
@ -41,7 +41,14 @@ class ListaOfertas {
|
|||||||
function getOfertas() {
|
function getOfertas() {
|
||||||
// sacado de http://patrickallaert.blogspot.com/2007/09/building-dynamic-sql-queries-elegant.html
|
// sacado de http://patrickallaert.blogspot.com/2007/09/building-dynamic-sql-queries-elegant.html
|
||||||
|
|
||||||
$consulta = "SELECT * FROM candidato_pedido";
|
// $consulta = "SELECT * FROM candidato_pedido";
|
||||||
|
$consulta = "SELECT
|
||||||
|
candidato_pedido.`oid`, candidato_pedido.`referencia`, candidato_pedido.`candidato`, CONCAT(usuarios.nombre, ' ', usuarios.apellidos) as nombre_candidato, candidato_pedido.`pedido`, pedidos.nombre as nombre_solicitud,
|
||||||
|
candidato_pedido.`afinidad`, candidato_pedido.`estado`, candidato_pedido.`RRHH`, candidato_pedido.`fecha`,
|
||||||
|
candidato_pedido.`obsGerente`, candidato_pedido.`obsRRHH`, candidato_pedido.`gerente`, candidato_pedido.`salario_ofertado`
|
||||||
|
FROM candidato_pedido
|
||||||
|
LEFT JOIN usuarios on usuarios.oid = candidato_pedido.candidato
|
||||||
|
LEFT JOIN pedidos on pedidos.oid = candidato_pedido.pedido";
|
||||||
|
|
||||||
if (count($this->condiciones)) {
|
if (count($this->condiciones)) {
|
||||||
$consulta .= ' WHERE ' . implode(' AND ', $this->condiciones);
|
$consulta .= ' WHERE ' . implode(' AND ', $this->condiciones);
|
||||||
@ -53,6 +60,7 @@ class ListaOfertas {
|
|||||||
|
|
||||||
$bd = new BD();
|
$bd = new BD();
|
||||||
$resultado = $bd->execQuery($consulta);
|
$resultado = $bd->execQuery($consulta);
|
||||||
|
|
||||||
// Procesamos las ofertas.
|
// Procesamos las ofertas.
|
||||||
if (mysql_num_rows($resultado) == 0) {
|
if (mysql_num_rows($resultado) == 0) {
|
||||||
$this->ofertas = array();
|
$this->ofertas = array();
|
||||||
|
|||||||
@ -77,7 +77,7 @@ echo "<table width=\"100%\"> ";
|
|||||||
echo "<tr class=\"encabezado\">";
|
echo "<tr class=\"encabezado\">";
|
||||||
echo " <td align=\"center\" colspan=\"3\">" . $locale['2014'] . "</td>";
|
echo " <td align=\"center\" colspan=\"3\">" . $locale['2014'] . "</td>";
|
||||||
// denominacion
|
// denominacion
|
||||||
$orderView = "denominacion";
|
$orderView = "referencia";
|
||||||
echo " <td align=\"center\">" . $locale['1042'].":" . "<br />" .
|
echo " <td align=\"center\">" . $locale['1042'].":" . "<br />" .
|
||||||
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=asc" . $variablesExtra . "\" ><img src=\"css/asc.png\" /></a>" .
|
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=asc" . $variablesExtra . "\" ><img src=\"css/asc.png\" /></a>" .
|
||||||
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=desc" . $variablesExtra . "\" ><img src=\"css/desc.png\" /></a></td>";
|
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=desc" . $variablesExtra . "\" ><img src=\"css/desc.png\" /></a></td>";
|
||||||
@ -92,12 +92,12 @@ echo " <td align=\"center\">" . $locale['1102'] . "<br />" .
|
|||||||
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=asc" . $variablesExtra . "\" ><img src=\"css/asc.png\" /></a>" .
|
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=asc" . $variablesExtra . "\" ><img src=\"css/asc.png\" /></a>" .
|
||||||
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=desc" . $variablesExtra . "\" ><img src=\"css/desc.png\" /></a></td>";
|
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=desc" . $variablesExtra . "\" ><img src=\"css/desc.png\" /></a></td>";
|
||||||
// solicitud
|
// solicitud
|
||||||
$orderView = "solicitud";
|
$orderView = "nombre_solicitud";
|
||||||
echo " <td align=\"center\">" . $locale['278'].":" . "<br />" .
|
echo " <td align=\"center\">" . $locale['278'].":" . "<br />" .
|
||||||
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=asc" . $variablesExtra . "\" ><img src=\"css/asc.png\" /></a>" .
|
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=asc" . $variablesExtra . "\" ><img src=\"css/asc.png\" /></a>" .
|
||||||
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=desc" . $variablesExtra . "\" ><img src=\"css/desc.png\" /></a></td>";
|
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=desc" . $variablesExtra . "\" ><img src=\"css/desc.png\" /></a></td>";
|
||||||
// Cliente
|
// Candidato
|
||||||
$orderView = "candidato";
|
$orderView = "nombre_candidato";
|
||||||
echo " <td align=\"center\">" . $locale['704'].":" . "<br />" .
|
echo " <td align=\"center\">" . $locale['704'].":" . "<br />" .
|
||||||
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=asc" . $variablesExtra . "\" ><img src=\"css/asc.png\" /></a>" .
|
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=asc" . $variablesExtra . "\" ><img src=\"css/asc.png\" /></a>" .
|
||||||
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=desc" . $variablesExtra . "\" ><img src=\"css/desc.png\" /></a></td>";
|
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=desc" . $variablesExtra . "\" ><img src=\"css/desc.png\" /></a></td>";
|
||||||
@ -178,7 +178,7 @@ if (count($listadeOfertas) == 0) {
|
|||||||
if ($variablesExtra != "") {
|
if ($variablesExtra != "") {
|
||||||
$variablesExtra = "&" . $variablesExtra;
|
$variablesExtra = "&" . $variablesExtra;
|
||||||
}
|
}
|
||||||
$variables = "byEstado=" . $tipoOfertas . "order=" . $_GET["order"] . "&modo=" . $_GET["modo"] . $variablesExtra;
|
$variables = "byEstado=" . $tipoOfertas . "&order=" . $_GET["order"] . "&modo=" . $_GET["modo"] . $variablesExtra;
|
||||||
echo $html->paginacion($numPaginas, $pagLista, $destinoURL, $variables, "pagLista");
|
echo $html->paginacion($numPaginas, $pagLista, $destinoURL, $variables, "pagLista");
|
||||||
} else {
|
} else {
|
||||||
$variables = "byEstado=" . $tipoOfertas . $variablesExtra;
|
$variables = "byEstado=" . $tipoOfertas . $variablesExtra;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user