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

@@ 7056-7065 (lines=10) @@
7053
7054
        if ($id != 0 && is_array($extra_info)) {
7055
            $item_title = stripslashes($extra_info['title']);
7056
        } elseif (is_numeric($extra_info)) {
7057
            $sql = "SELECT thread_title as title FROM $tbl_forum
7058
                    WHERE c_id = $course_id AND thread_id = " . $extra_info;
7059
7060
            $result = Database::query($sql);
7061
            $row = Database :: fetch_array($result);
7062
7063
            $item_title = $row['title'];
7064
            $item_description = '';
7065
        } else {
7066
            $item_title = '';
7067
            $item_description = '';
7068
        }