Code Duplication    Length = 10-13 lines in 3 locations

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

@@ 6655-6667 (lines=13) @@
6652
                $sql = "SELECT thematic_id FROM $table_tool
6653
                        WHERE c_id = $course_id AND id = $ref";
6654
                $rs_thematic  = Database::query($sql);
6655
                if (Database::num_rows($rs_thematic)) {
6656
                    $row_thematic = Database::fetch_array($rs_thematic);
6657
                    $thematic_id = $row_thematic['thematic_id'];
6658
6659
                    $sql = "SELECT session.id, session.name, user.username
6660
                            FROM $tbl_thematic t, $table_session session, $table_user user
6661
                            WHERE
6662
                              t.c_id = $course_id AND
6663
                              t.session_id = session.id AND
6664
                              session.id_coach = user.user_id AND
6665
                              t.id = $thematic_id";
6666
                    $recorset = Database::query($sql);
6667
                }
6668
            } else {
6669
                $sql = "SELECT session.id, session.name, user.username
6670
                          FROM $table_tool tool, $table_session session, $table_user user

main/lp/learnpath.class.php 2 locations

@@ 7541-7550 (lines=10) @@
7538
7539
        if ($id != 0 && is_array($extra_info)) {
7540
            $item_title = stripslashes($extra_info['title']);
7541
        } elseif (is_numeric($extra_info)) {
7542
            $sql = "SELECT thread_title as title FROM $tbl_forum
7543
                    WHERE c_id = $course_id AND thread_id = ".$extra_info;
7544
7545
            $result = Database::query($sql);
7546
            $row = Database::fetch_array($result);
7547
7548
            $item_title = $row['title'];
7549
            $item_description = '';
7550
        } else {
7551
            $item_title = '';
7552
            $item_description = '';
7553
        }
@@ 8599-8609 (lines=11) @@
8596
        if ($id != 0 && is_array($extra_info)) {
8597
            $item_title = stripslashes($extra_info['title']);
8598
            $item_description = stripslashes($extra_info['description']);
8599
        } elseif (is_numeric($extra_info)) {
8600
            $extra_info = intval($extra_info);
8601
            $sql = "SELECT title, description
8602
                    FROM $tbl_publication
8603
                    WHERE c_id = $course_id AND id = ".$extra_info;
8604
8605
            $result = Database::query($sql);
8606
            $row = Database::fetch_array($result);
8607
8608
            $item_title = $row['title'];
8609
        } else {
8610
            $item_title = get_lang('Student_publication');
8611
        }
8612