Code Duplication    Length = 10-13 lines in 2 locations

main/newscorm/learnpath.class.php 1 location

@@ 7039-7048 (lines=10) @@
7036
7037
        if ($id != 0 && is_array($extra_info)) {
7038
            $item_title = stripslashes($extra_info['title']);
7039
        } elseif (is_numeric($extra_info)) {
7040
            $sql = "SELECT thread_title as title FROM $tbl_forum
7041
                    WHERE c_id = $course_id AND thread_id = " . $extra_info;
7042
7043
            $result = Database::query($sql);
7044
            $row = Database :: fetch_array($result);
7045
7046
            $item_title = $row['title'];
7047
            $item_description = '';
7048
        } else {
7049
            $item_title = '';
7050
            $item_description = '';
7051
        }

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

@@ 5855-5867 (lines=13) @@
5852
    			$sql = "SELECT thematic_id FROM $table_tool
5853
    			        WHERE c_id = $course_id AND id = $ref";
5854
    			$rs_thematic  = Database::query($sql);
5855
    			if (Database::num_rows($rs_thematic)) {
5856
    				$row_thematic = Database::fetch_array($rs_thematic);
5857
    				$thematic_id = $row_thematic['thematic_id'];
5858
5859
                    $sql = "SELECT session.id, session.name, user.username
5860
                            FROM $tbl_thematic t, $table_session session, $table_user user
5861
                            WHERE
5862
                              t.c_id = $course_id AND
5863
                              t.session_id = session.id AND
5864
                              session.id_coach = user.user_id AND
5865
                              t.id = $thematic_id";
5866
    				$recorset = Database::query($sql);
5867
    			}
5868
    		} else {
5869
                $sql = "SELECT session.id, session.name, user.username
5870
                          FROM $table_tool tool, $table_session session, $table_user user