- if (!is_a($res, 'PEAR_Error')) {
- $val = $res->fetchRow();
- $parent_id = $val['parent_id'];
- if ($parent_id) {
- // Get parent group name.
- $sql = "select name from tt_groups where org_id = $this->org_id and id = $parent_id and status = 1";
- $res = $mdb2->query($sql);
- if (!is_a($res, 'PEAR_Error')) {
- $val = $res->fetchRow();
- $groups[] = array('id'=>$parent_id,'name'=>$val['name']);
- }
- }
- }
- }
-
- // Add current group.
- $groups[] = array('id'=>$selected_group_id,'name'=>$selected_group_name);