Code Duplication    Length = 5-6 lines in 6 locations

main/exercise/exercise.class.php 1 location

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

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

@@ 3344-3348 (lines=5) @@
3341
                    $whereConditions
3342
                $orderBy
3343
                ";
3344
        if (isset($from) && isset($limit)) {
3345
            $from = intval($from);
3346
            $limit = intval($limit);
3347
            $sql .= " LIMIT $from, $limit";
3348
        }
3349
3350
        $result = Database::query($sql);
3351
@@ 6395-6400 (lines=6) @@
6392
6393
        $sql .= $order;
6394
6395
        if (isset($start) && isset($maxPerPage)) {
6396
            $start = intval($start);
6397
            $maxPerPage = intval($maxPerPage);
6398
            $limitCondition = " LIMIT $start, $maxPerPage";
6399
            $sql .= $limitCondition;
6400
        }
6401
6402
        if ($getCount) {
6403
            $result = Database::query($sql);

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

@@ 3587-3591 (lines=5) @@
3584
            return $row['count'];
3585
        }
3586
3587
        if (isset($from) && isset($limit)) {
3588
            $from = intval($from);
3589
            $limit = intval($limit);
3590
            $sql .= " LIMIT $from, $limit";
3591
        }
3592
3593
        $result = Database::query($sql);
3594
        $num_rows = Database::num_rows($result);

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

@@ 1935-1939 (lines=5) @@
1932
        }
1933
1934
        $limit_text = '';
1935
        if (isset($from) && isset($limit)) {
1936
            $from = intval($from);
1937
            $limit = intval($limit);
1938
            $limit_text = "LIMIT $from, $limit";
1939
        }
1940
1941
        if (count($relation_type) == 0) {
1942
            $where_relation_condition = '';

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

@@ 5931-5936 (lines=6) @@
5928
5929
        $sql .= $order;
5930
5931
        if (isset($start) && isset($maxPerPage)) {
5932
            $start = intval($start);
5933
            $maxPerPage = intval($maxPerPage);
5934
            $limitCondition = " LIMIT $start, $maxPerPage";
5935
            $sql .= $limitCondition;
5936
        }
5937
5938
        $result = Database::query($sql);
5939
        $sessionsCategories = array();