Code Duplication    Length = 10-13 lines in 2 locations

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

@@ 5894-5906 (lines=13) @@
5891
    			$sql = "SELECT thematic_id FROM $table_tool
5892
    			        WHERE c_id = $course_id AND id = $ref";
5893
    			$rs_thematic  = Database::query($sql);
5894
    			if (Database::num_rows($rs_thematic)) {
5895
    				$row_thematic = Database::fetch_array($rs_thematic);
5896
    				$thematic_id = $row_thematic['thematic_id'];
5897
5898
                    $sql = "SELECT session.id, session.name, user.username
5899
                            FROM $tbl_thematic t, $table_session session, $table_user user
5900
                            WHERE
5901
                              t.c_id = $course_id AND
5902
                              t.session_id = session.id AND
5903
                              session.id_coach = user.user_id AND
5904
                              t.id = $thematic_id";
5905
    				$recorset = Database::query($sql);
5906
    			}
5907
    		} else {
5908
                $sql = "SELECT session.id, session.name, user.username
5909
                          FROM $table_tool tool, $table_session session, $table_user user

main/newscorm/learnpath.class.php 1 location

@@ 7048-7057 (lines=10) @@
7045
7046
        if ($id != 0 && is_array($extra_info)) {
7047
            $item_title = stripslashes($extra_info['title']);
7048
        } elseif (is_numeric($extra_info)) {
7049
            $sql = "SELECT thread_title as title FROM $tbl_forum
7050
                    WHERE c_id = $course_id AND thread_id = " . $extra_info;
7051
7052
            $result = Database::query($sql);
7053
            $row = Database :: fetch_array($result);
7054
7055
            $item_title = $row['title'];
7056
            $item_description = '';
7057
        } else {
7058
            $item_title = '';
7059
            $item_description = '';
7060
        }