| @@ 396-407 (lines=12) @@ | ||
| 393 | * @param int/string $id The id (an integer number) of the corresponding database record. |
|
| 394 | * @return array/bool Returns the requested data as an array or FALSE on failure. |
|
| 395 | */ |
|
| 396 | public static function get_course_request_info($id) |
|
| 397 | { |
|
| 398 | $id = (int)$id; |
|
| 399 | $sql = "SELECT * |
|
| 400 | FROM ".Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST)." |
|
| 401 | WHERE id = ".$id; |
|
| 402 | $result = Database::query($sql); |
|
| 403 | if (Database::num_rows($result) > 0) { |
|
| 404 | return Database::fetch_array($result); |
|
| 405 | } |
|
| 406 | return false; |
|
| 407 | } |
|
| 408 | ||
| 409 | /** |
|
| 410 | * Gets the code of a given course request using its database id as an access key. |
|
| @@ 2310-2319 (lines=10) @@ | ||
| 2307 | /** |
|
| 2308 | * Check availability of a survey code |
|
| 2309 | */ |
|
| 2310 | public function is_survey_code_available($survey_code) |
|
| 2311 | { |
|
| 2312 | $table_sur = Database :: get_course_table(TABLE_SURVEY); |
|
| 2313 | $sql = "SELECT * FROM $table_sur |
|
| 2314 | WHERE |
|
| 2315 | c_id = ".$this->destination_course_id." AND |
|
| 2316 | code='".self::DBUTF8escapestring($survey_code)."'"; |
|
| 2317 | $result = Database::query($sql); |
|
| 2318 | if (Database::num_rows($result) > 0) return false; else return true; |
|
| 2319 | } |
|
| 2320 | ||
| 2321 | /** |
|
| 2322 | * Restore survey-questions |
|