Incam_Intranet/busqueda_empleado_multiple.php

66 lines
1.6 KiB
PHP
Raw Normal View History

<?php
include("seguridad.php");
include("functions.php");
// S<>lo los administradores y rrhh pueden buscar
if(!$usuario->tieneRol("1")
&& !$usuario->tieneRol("4")){
header("Location: aplicacion.php?e=permiso");
exit;
}
include_once("html/cabecera.php");
/* BUSQUEDA.PHP */
include_once("Objects/HTML.php");
$html = new HTML($locale);
echo $html->menuEmpleados();
?>
<h2><?php echo $locale['817']; ?></h2>
<?php
$where = "";
$tabla = "";
include_once("Objects/ListaEmpleados.php");
// Agregamos el estado de los pedidos que queremos mostrar
if(($_GET['byEstado']!="") && ($_GET['byEstado']!="0")){
$tipoPedidos=$_GET['byEstado'];
$whereTipo=" and estado=".$tipoPedidos;
} else {
$tipoPedidos="0";
$whereTipo="";
}
// Variables por si es una ordenacion
$order_by="";
if($_GET["order"]!=""){
$order_by = " ORDER by ".stripinput($_GET["order"])." ".$_GET["modo"];
}
if($_GET['reutilizar']=="si"){
$listaEmpleados = unserialize($_SESSION["ultimaBusquedaEmpleados"]);
// creamos el nuevo objeto con el orden
$sql=$listaEmpleados->getSQL();
$listaEmpleados=new ListaEmpleados($usuario,$order_by,$sql,$tipoPedidos);
}else{
// Recuperamos todos los valores
include_once("campos_persona.php");
// Construimos la sql
$condicion = "usuarios.tipo = 'usuario',";
include_once("busqueda_personas_multiple.php");
$listaEmpleados=new ListaEmpleados($usuario,$order_by,$consulta,$tipoPedidos);
}
$s = serialize($listaEmpleados);
$_SESSION["ultimaBusquedaEmpleados"]=$s;
$variablesExtra="reutilizar=si";
include_once("ver_lista_empleados.php");
include_once("html/pie.php");
?>