X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/d99c50b3117c0fd51cb5ce7e6fc33c60c5006bac..06cd54ffd3f4a2641a10db316fb08d42c3b8b5ea:/lib/MECON/Dependencia.php?ds=sidebyside diff --git a/lib/MECON/Dependencia.php b/lib/MECON/Dependencia.php index 65b64da..6b01f1f 100644 --- a/lib/MECON/Dependencia.php +++ b/lib/MECON/Dependencia.php @@ -129,7 +129,7 @@ class MECON_Dependencia { if(DB::isError($result)) trigger_error($result->getMessage("query mal hecho"), E_USER_ERROR); while($row = $result->fetchRow()) - $agentes[] = new MECON_Agente($row[0]); + $agentes[$row[0]] = new MECON_Agente($this->_db, $row[0]); //Contratados $sql = "SELECT nrodoc FROM Contratados.Contratados @@ -138,7 +138,7 @@ class MECON_Dependencia { if(DB::isError($result)) trigger_error($result->getMessage("query mal hecho"), E_USER_ERROR); while($row = $result->fetchRow()) - $agentes[] = new MECON_Agente($row[0]); + $agentes[$row[0]] = new MECON_Agente($this->_db, $row[0]); return $agentes; } @@ -150,8 +150,9 @@ class MECON_Dependencia { */ function getDependencias() { + $base = (isset($this->_database))? $this->_database : "CODEP"; $sql = "SELECT codigo_actual - FROM ".$this->_database.".Dependencias + FROM ".$base.".Dependencias WHERE dependencia_esta_activa = 1"; $result = $this->_db->query($sql); if(DB::isError($result))