| @@ 421-433 (lines=13) @@ | ||
| 418 | * Get platform language ID |
|
| 419 | * @return int The platform language ID |
|
| 420 | */ |
|
| 421 | public static function get_platform_language_id() |
|
| 422 | { |
|
| 423 | $name = api_get_setting('platformLanguage'); |
|
| 424 | $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE); |
|
| 425 | $sql = "SELECT id FROM $tbl_admin_languages WHERE english_name ='$name'"; |
|
| 426 | $res = Database::query($sql); |
|
| 427 | if (Database::num_rows($res) < 1) { |
|
| 428 | return false; |
|
| 429 | } |
|
| 430 | $row = Database::fetch_array($res); |
|
| 431 | ||
| 432 | return $row['id']; |
|
| 433 | } |
|
| 434 | ||
| 435 | /** |
|
| 436 | * Get parent language path (or null if no parent) |
|
| @@ 209-221 (lines=13) @@ | ||
| 206 | * @param int $career_id |
|
| 207 | * @return bool |
|
| 208 | */ |
|
| 209 | public function get_status($career_id) |
|
| 210 | { |
|
| 211 | $TBL_CAREER = Database::get_main_table(TABLE_CAREER); |
|
| 212 | $career_id = intval($career_id); |
|
| 213 | $sql = "SELECT status FROM $TBL_CAREER WHERE id = '$career_id'"; |
|
| 214 | $result = Database::query($sql); |
|
| 215 | if (Database::num_rows($result) > 0) { |
|
| 216 | $data = Database::fetch_array($result); |
|
| 217 | return $data['status']; |
|
| 218 | } else { |
|
| 219 | return false; |
|
| 220 | } |
|
| 221 | } |
|
| 222 | ||
| 223 | /** |
|
| 224 | * @param array $params |
|
| @@ 3014-3028 (lines=15) @@ | ||
| 3011 | * @param string session category ID |
|
| 3012 | * @return mixed false if the session category does not exist, array if the session category exists |
|
| 3013 | */ |
|
| 3014 | public static function get_session_category($id) |
|
| 3015 | { |
|
| 3016 | $tbl_session_category = Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY); |
|
| 3017 | $id = intval($id); |
|
| 3018 | $sql = "SELECT id, name, date_start, date_end |
|
| 3019 | FROM $tbl_session_category |
|
| 3020 | WHERE id= $id"; |
|
| 3021 | $result = Database::query($sql); |
|
| 3022 | $num = Database::num_rows($result); |
|
| 3023 | if ($num > 0) { |
|
| 3024 | return Database::fetch_array($result); |
|
| 3025 | } else { |
|
| 3026 | return false; |
|
| 3027 | } |
|
| 3028 | } |
|
| 3029 | ||
| 3030 | /** |
|
| 3031 | * Get all session categories (filter by access_url_id) |
|