X-Git-Url: https://git.llucax.com/mecon/intranet.git/blobdiff_plain/e0e275daf3624e7c6bfce0eb27717d14572273ce..19062a773ac6436434e7539c1e43fd911f15733c:/sistema/local_lib/Servicios/Agenda.php diff --git a/sistema/local_lib/Servicios/Agenda.php b/sistema/local_lib/Servicios/Agenda.php index 93edb97..9587c46 100644 --- a/sistema/local_lib/Servicios/Agenda.php +++ b/sistema/local_lib/Servicios/Agenda.php @@ -264,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:''; @@ -276,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);