X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/c4ef98349e8a7a06fba91ed63e570e7b5b1bd7ae..b5fb49d03fee59d591769b0e8d25660d2bbb8e93:/lib/MECON/Dependencia.php diff --git a/lib/MECON/Dependencia.php b/lib/MECON/Dependencia.php index 572fb16..4712ef1 100644 --- a/lib/MECON/Dependencia.php +++ b/lib/MECON/Dependencia.php @@ -76,9 +76,9 @@ class MECON_Dependencia { * @return void * @access public */ - function MECON_Dependencia(&$dbh, $codep, $id = null, $database = 'CODEP') + function MECON_Dependencia(&$db, $codep, $id = null, $database = 'CODEP') { - $this->_dbh = $dbh; + $this->_db = $db; $this->_database = $database; if(!is_null($codep)) { @@ -89,7 +89,7 @@ class MECON_Dependencia { WHERE codigo_actual = '".$this->codep."' AND dependencia_esta_activa = 1"; - $result = $this->_dbh->query($sql); + $result = $this->_db->query($sql); } else { $this->dependencia_id = $id; @@ -98,7 +98,7 @@ class MECON_Dependencia { FROM ".$database.".Dependencias WHERE dependencia_id = ".$this->dependencia_id." AND dependencia_esta_activa = 1"; - $result = $this->_dbh->query($sql); + $result = $this->_db->query($sql); } if(DB::isError($result)) @@ -129,16 +129,16 @@ 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($this->_db, $row[0]); + $agentes[] = new MECON_Agente($row[0]); //Contratados $sql = "SELECT nrodoc FROM Contratados.Contratados WHERE codep = '".$this->codep."'"; - $result = $db->query($sql); + $result = $this->_db->query($sql); if(DB::isError($result)) trigger_error($result->getMessage("query mal hecho"), E_USER_ERROR); while($row = $result->fetchRow()) - $agentes[] = new MECON_Agente($this->_db, $row[0]); + $agentes[] = new MECON_Agente($row[0]); return $agentes; }