Code Duplication    Length = 9-12 lines in 2 locations

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

@@ 1288-1299 (lines=12) @@
1285
     * @param int $editIcon
1286
     * @return array
1287
     */
1288
    public static function getTool($editIcon)
1289
    {
1290
        $course_tool_table = Database::get_course_table(TABLE_TOOL_LIST);
1291
        $editIcon = intval($editIcon);
1292
1293
        $sql = "SELECT * FROM $course_tool_table
1294
                WHERE iid = $editIcon";
1295
        $result = Database::query($sql);
1296
        $tool = Database::fetch_assoc($result, 'ASSOC');
1297
1298
        return $tool;
1299
    }
1300
1301
    /**
1302
     * @return string

main/work/work.lib.php 1 location

@@ 3736-3744 (lines=9) @@
3733
 * @param $workId
3734
 * @return mixed
3735
 */
3736
function checkExistingWorkFileName($filename, $workId)
3737
{
3738
    $work_table = Database :: get_course_table(TABLE_STUDENT_PUBLICATION);
3739
    $filename = Database::escape_string($filename);
3740
    $sql = "SELECT title FROM $work_table
3741
                        WHERE parent_id = $workId AND title = '$filename'";
3742
    $result = Database::query($sql);
3743
    return Database::fetch_assoc($result);
3744
}
3745
3746
/**
3747
 * @param array $workInfo