Code Duplication    Length = 10-13 lines in 2 locations

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

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

main/newscorm/learnpath.class.php 1 location

@@ 7021-7030 (lines=10) @@
7018
7019
        if ($id != 0 && is_array($extra_info)) {
7020
            $item_title = stripslashes($extra_info['title']);
7021
        } elseif (is_numeric($extra_info)) {
7022
            $sql = "SELECT thread_title as title FROM $tbl_forum
7023
                    WHERE c_id = $course_id AND thread_id = " . $extra_info;
7024
7025
            $result = Database::query($sql);
7026
            $row = Database :: fetch_array($result);
7027
7028
            $item_title = $row['title'];
7029
            $item_description = '';
7030
        } else {
7031
            $item_title = '';
7032
            $item_description = '';
7033
        }