+
+ // getOrgKey obtains organization key from the database.
+ private function getOrgKey() {
+ global $user;
+ $mdb2 = getConnection();
+
+ $org_id = $user->org_id;
+ $sql = "select group_key from tt_groups where id = $org_id and status = 1";
+ $res = $mdb2->query($sql);
+ $val = $res->fetchRow();
+ return $val['group_key'];
+ }
+
+ // getGrtoupKey obtains group key from the database.
+ private function getGroupKey() {
+ global $user;
+ $mdb2 = getConnection();
+
+ $group_id = $user->getGroup();
+ $org_id = $user->org_id;
+
+ $sql = "select group_key from tt_groups where id = $group_id and org_id = $org_id and status = 1";
+ $res = $mdb2->query($sql);
+ $val = $res->fetchRow();
+ return $val['group_key'];
+ }