Code Duplication    Length = 10-12 lines in 2 locations

main/inc/lib/course_request.lib.php 1 location

@@ 396-407 (lines=12) @@
393
     * @param integer $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.

main/coursecopy/classes/CourseRestorer.class.php 1 location

@@ 2374-2383 (lines=10) @@
2371
	 * Check availability of a survey code
2372
	 * @param string $survey_code
2373
	 */
2374
    public function is_survey_code_available($survey_code)
2375
    {
2376
		$table_sur = Database :: get_course_table(TABLE_SURVEY);
2377
		$sql = "SELECT * FROM $table_sur
2378
		        WHERE
2379
		            c_id = ".$this->destination_course_id." AND
2380
		            code='".self::DBUTF8escapestring($survey_code)."'";
2381
		$result = Database::query($sql);
2382
		if (Database::num_rows($result) > 0) return false; else return true;
2383
	}
2384
2385
	/**
2386
	 * Restore survey-questions