Code Duplication    Length = 9-12 lines in 2 locations

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

@@ 1349-1360 (lines=12) @@
1346
     * @param int $editIcon
1347
     * @return array
1348
     */
1349
    public static function getTool($editIcon)
1350
    {
1351
        $course_tool_table = Database::get_course_table(TABLE_TOOL_LIST);
1352
        $editIcon = intval($editIcon);
1353
1354
        $sql = "SELECT * FROM $course_tool_table
1355
                WHERE iid = $editIcon";
1356
        $result = Database::query($sql);
1357
        $tool = Database::fetch_assoc($result, 'ASSOC');
1358
1359
        return $tool;
1360
    }
1361
1362
    /**
1363
     * @return string

main/work/work.lib.php 1 location

@@ 3604-3612 (lines=9) @@
3601
 * @param $workId
3602
 * @return mixed
3603
 */
3604
function checkExistingWorkFileName($filename, $workId)
3605
{
3606
    $work_table = Database :: get_course_table(TABLE_STUDENT_PUBLICATION);
3607
    $filename = Database::escape_string($filename);
3608
    $sql = "SELECT title FROM $work_table
3609
                        WHERE parent_id = $workId AND title = '$filename' AND active = 1";
3610
    $result = Database::query($sql);
3611
    return Database::fetch_assoc($result);
3612
}
3613
3614
/**
3615
 * @param array $workInfo