Code Duplication    Length = 5-6 lines in 6 locations

main/exercise/exercise.class.php 1 location

@@ 630-634 (lines=5) @@
627
628
            $sql .= $orderCondition;
629
            $limitCondition = null;
630
            if (isset($start) && isset($limit)) {
631
                $start = intval($start);
632
                $limit = intval($limit);
633
                $limitCondition = " LIMIT $start, $limit";
634
            }
635
            $sql .= $limitCondition;
636
            $result = Database::query($sql);
637
            $questions = array();

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

@@ 3389-3393 (lines=5) @@
3386
                    $whereConditions
3387
                $orderBy
3388
                ";
3389
        if (isset($from) && isset($limit)) {
3390
            $from = intval($from);
3391
            $limit = intval($limit);
3392
            $sql .= " LIMIT $from, $limit";
3393
        }
3394
3395
        $result = Database::query($sql);
3396
@@ 6461-6466 (lines=6) @@
6458
6459
        $sql .= $order;
6460
6461
        if (isset($start) && isset($maxPerPage)) {
6462
            $start = intval($start);
6463
            $maxPerPage = intval($maxPerPage);
6464
            $limitCondition = " LIMIT $start, $maxPerPage";
6465
            $sql .= $limitCondition;
6466
        }
6467
6468
        if ($getCount) {
6469
            $result = Database::query($sql);

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

@@ 3698-3702 (lines=5) @@
3695
            return $row['count'];
3696
        }
3697
3698
        if (isset($from) && isset($limit)) {
3699
            $from = intval($from);
3700
            $limit = intval($limit);
3701
            $sql .= " LIMIT $from, $limit";
3702
        }
3703
3704
        $result = Database::query($sql);
3705
        $num_rows = Database::num_rows($result);

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

@@ 1965-1969 (lines=5) @@
1962
        }
1963
1964
        $limit_text = '';
1965
        if (isset($from) && isset($limit)) {
1966
            $from = intval($from);
1967
            $limit = intval($limit);
1968
            $limit_text = "LIMIT $from, $limit";
1969
        }
1970
1971
        if (count($relation_type) == 0) {
1972
            $where_relation_condition = '';

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

@@ 5653-5658 (lines=6) @@
5650
5651
        $sql .= $order;
5652
5653
        if (isset($start) && isset($maxPerPage)) {
5654
            $start = intval($start);
5655
            $maxPerPage = intval($maxPerPage);
5656
            $limitCondition = " LIMIT $start, $maxPerPage";
5657
            $sql .= $limitCondition;
5658
        }
5659
5660
        $result = Database::query($sql);
5661
        $sessionsCategories = array();