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

@@ 3648-3656 (lines=9) @@
3645
 * @param $workId
3646
 * @return mixed
3647
 */
3648
function checkExistingWorkFileName($filename, $workId)
3649
{
3650
    $work_table = Database :: get_course_table(TABLE_STUDENT_PUBLICATION);
3651
    $filename = Database::escape_string($filename);
3652
    $sql = "SELECT title FROM $work_table
3653
                        WHERE parent_id = $workId AND title = '$filename'";
3654
    $result = Database::query($sql);
3655
    return Database::fetch_assoc($result);
3656
}
3657
3658
/**
3659
 * @param array $workInfo