$mdb2 = getConnection();
$sql = "select id, name, created, lang from tt_groups".
- " where status = 1 and org_id is NULL order by id desc";
+ " where status = 1 and org_id is NULL or org_id = id order by id desc";
$res = $mdb2->query($sql);
$result = array();
if (!is_a($res, 'PEAR_Error')) {
}
return false;
}
+
+ // The getGroupName function returns group name.
+ static function getGroupName($group_id) {
+ $mdb2 = getConnection();
+
+ $sql = "select name from tt_groups where id = $group_id and (status = 1 or status = 0)";
+ $res = $mdb2->query($sql);
+
+ if (!is_a($res, 'PEAR_Error')) {
+ $val = $res->fetchRow();
+ return $val['name'];
+ }
+ return false;
+ }
}