* @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)) {
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;
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))
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;
}