X-Git-Url: https://git.llucax.com/mecon/intranet.git/blobdiff_plain/2fc4db529e70c3b58c9658b30c712c3e5ba2acda..19062a773ac6436434e7539c1e43fd911f15733c:/sistema/local_lib/Servicios/Agenda.php?ds=sidebyside diff --git a/sistema/local_lib/Servicios/Agenda.php b/sistema/local_lib/Servicios/Agenda.php index f2a4bb9..9587c46 100644 --- a/sistema/local_lib/Servicios/Agenda.php +++ b/sistema/local_lib/Servicios/Agenda.php @@ -2,16 +2,16 @@ // vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4: // +--------------------------------------------------------------------+ // | Ministerio de Economía | -// | Intranet | +// | Intranet | // +--------------------------------------------------------------------+ -// | This file is part of Intranet. | +// | This file is part of Intranet. | // | | -// | Intranet is free software; you can redistribute it and/or modify | +// | Intranet is free software; you can redistribute it and/or modify | // | it under the terms of the GNU General Public License as published | // | by the Free Software Foundation; either version 2 of the License, | // | or (at your option) any later version. | // | | -// | Intranet is distributed in the hope that it will be useful, but | +// | Intranet is distributed in the hope that it will be useful, but | // | WITHOUT ANY WARRANTY; without even the implied warranty of | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | // | General Public License for more details. | @@ -27,9 +27,6 @@ // $Id$ // - - - // +X2C Class 174 :Servicios_Agenda /** * Clase para el manejo de la agenda en la cual se muestran la informacion de los internos de los diferentes edificios. @@ -267,7 +264,8 @@ class Servicios_Agenda { edificios.cod_edificio=internos.cod_edif '; $sql.=($this->_interno) ? ' AND interno = '.$this->_interno:''; - $sql.=($this->_codep) ? ' AND internos.codep = '.$this->_codep:''; + $sql.=($this->_codep) ? ' AND internos.codep = + \''.$this->_codep.'\'':''; $sql.=($this->_edificio) ? ' AND internos.cod_edif = '.$this->_edificio:''; $sql.=($this->_piso) ? ' AND piso = '.$this->_piso:''; $sql.=($this->_oficina) ? ' AND oficina = '.$this->_oficina:''; @@ -279,14 +277,15 @@ class Servicios_Agenda { } } if ($this->_dependencia && $this->_dependencia != '--Ingrese una palabra clave--') { - $dep = split('/ /',$this->_dependencia); + $dep = split(' ', $this->_dependencia); foreach ($dep as $d) { + $d = trim($d); $sql.= " AND dependencia LIKE '%$d%'"; } } $sql.=($this->_ordenar) ? ' order by '.$this->_ordenar :''; - + $dbh = $this->_db->prepare($sql); $res = $this->_db->execute($dbh);