| @@ 29-45 (lines=17) @@ | ||
| 26 | * @author isaac flores paz |
|
| 27 | * @return array |
|
| 28 | */ |
|
| 29 | public static function show_list_type_friends() |
|
| 30 | { |
|
| 31 | $friend_relation_list = array(); |
|
| 32 | $table = Database::get_main_table(TABLE_MAIN_USER_FRIEND_RELATION_TYPE); |
|
| 33 | $sql = 'SELECT id, title FROM '.$table.' |
|
| 34 | WHERE id<>6 |
|
| 35 | ORDER BY id ASC'; |
|
| 36 | $result = Database::query($sql); |
|
| 37 | while ($row = Database::fetch_array($result, 'ASSOC')) { |
|
| 38 | $friend_relation_list[] = $row; |
|
| 39 | } |
|
| 40 | $count_list = count($friend_relation_list); |
|
| 41 | if ($count_list == 0) { |
|
| 42 | $friend_relation_list[] = get_lang('Unknown'); |
|
| 43 | } else { |
|
| 44 | return $friend_relation_list; |
|
| 45 | } |
|
| 46 | } |
|
| 47 | ||
| 48 | /** |
|
| @@ 4228-4243 (lines=16) @@ | ||
| 4225 | * @param int Drh id |
|
| 4226 | * @return array Student list |
|
| 4227 | */ |
|
| 4228 | public static function get_student_followed_by_drh($hr_dept_id) |
|
| 4229 | { |
|
| 4230 | $hr_dept_id = intval($hr_dept_id); |
|
| 4231 | $a_students = array(); |
|
| 4232 | $tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
|
| 4233 | ||
| 4234 | $sql = 'SELECT DISTINCT user_id FROM '.$tbl_user.' as user |
|
| 4235 | WHERE hr_dept_id='.$hr_dept_id; |
|
| 4236 | $rs = Database::query($sql); |
|
| 4237 | ||
| 4238 | while ($user = Database::fetch_array($rs)) { |
|
| 4239 | $a_students[$user['user_id']] = $user['user_id']; |
|
| 4240 | } |
|
| 4241 | ||
| 4242 | return $a_students; |
|
| 4243 | } |
|
| 4244 | ||
| 4245 | ||
| 4246 | ||