padre = $dbdata['id_padre']; $this->tabla = $dbdata['tabla']; $this->nombre = $dbdata['nombre']; $this->id = $dbdata['id']; $this->link = $dbdata['link']; $this->db = $dbdata['db']; $dat = $this->BuscarHijos(0); parent::HTML_Arbol($dat, $imagen); } function BuscarHijos($id) { $sql = "SELECT $this->nombre, $this->id FROM $this->tabla "; if(!is_null$this->padre) $sql .= "WHERE $this->padre = '$id'"; $result = $this->db->query($sql); if(DB::isError($result)) die($result->getMessage()); $dat = array(); while($row = $result->fetchRow()) { $titulo = $row[0]; $id = $row[1]; $dat[] = array( 'titulo'=> $titulo, 'link' => $this->link.$id, 'sub' => $this->BuscarHijos($id) ); } return $dat; } } ?>