Code Duplication    Length = 5-6 lines in 6 locations

main/exercise/exercise.class.php 1 location

@@ 603-607 (lines=5) @@
600
601
            $limitCondition = null;
602
603
            if (isset($start) && isset($limit)) {
604
                $start = intval($start);
605
                $limit = intval($limit);
606
                $limitCondition = " LIMIT $start, $limit";
607
            }
608
            $sql .= $limitCondition;
609
            $result = Database::query($sql);
610
            $questions = array();

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

@@ 1921-1925 (lines=5) @@
1918
        }
1919
1920
        $limit_text = '';
1921
        if (isset($from) && isset($limit)) {
1922
            $from = intval($from);
1923
            $limit = intval($limit);
1924
            $limit_text = "LIMIT $from, $limit";
1925
        }
1926
1927
        if (count($relation_type) == 0) {
1928
            $where_relation_condition = '';

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

@@ 3501-3505 (lines=5) @@
3498
            return $row['count'];
3499
        }
3500
3501
        if (isset($from) && isset($limit)) {
3502
            $from = intval($from);
3503
            $limit = intval($limit);
3504
            $sql .= " LIMIT $from, $limit";
3505
        }
3506
3507
        $result = Database::query($sql);
3508
        $num_rows = Database::num_rows($result);

main/inc/lib/course.lib.php 2 locations

@@ 3326-3330 (lines=5) @@
3323
                    $whereConditions
3324
                $orderBy
3325
                ";
3326
        if (isset($from) && isset($limit)) {
3327
            $from = intval($from);
3328
            $limit = intval($limit);
3329
            $sql .= " LIMIT $from, $limit";
3330
        }
3331
3332
        $result = Database::query($sql);
3333
@@ 6211-6216 (lines=6) @@
6208
6209
        $sql .= $order;
6210
6211
        if (isset($start) && isset($maxPerPage)) {
6212
            $start = intval($start);
6213
            $maxPerPage = intval($maxPerPage);
6214
            $limitCondition = " LIMIT $start, $maxPerPage";
6215
            $sql .= $limitCondition;
6216
        }
6217
6218
        if ($getCount) {
6219
            $result = Database::query($sql);

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

@@ 5870-5875 (lines=6) @@
5867
5868
        $sql .= $order;
5869
5870
        if (isset($start) && isset($maxPerPage)) {
5871
            $start = intval($start);
5872
            $maxPerPage = intval($maxPerPage);
5873
            $limitCondition = " LIMIT $start, $maxPerPage";
5874
            $sql .= $limitCondition;
5875
        }
5876
5877
        $result = Database::query($sql);
5878
        $sessionsCategories = array();