// 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. |
// $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.
$consulta = 'select cod_edificio, desc_edificio from agenda.edificios where cod_edificio <> 13 order by desc_edificio';
$dbh = $db->prepare($consulta);
$res = $db->execute($dbh);
+ if (PEAR::isError($res)) {
+ return $res;
+ }
while ($re = $res->fetchrow(DB_FETCHMODE_ASSOC)) {
$rta[$re['cod_edificio']] = $re['desc_edificio'];
}
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:'';
}
}
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);