Skip to content

Commit

Permalink
pagination_class.php removed (integrated with openchecker_classes.php)
Browse files Browse the repository at this point in the history
  • Loading branch information
kojoty committed Mar 27, 2019
1 parent e26ce6e commit 62da603
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 34 deletions.
33 changes: 33 additions & 0 deletions modules/openchecker/openchecker_classes.php
Original file line number Diff line number Diff line change
Expand Up @@ -461,3 +461,36 @@ public function Finalize() {
}

}

class Pagination
{

var $data;

function Paginate($values, $per_page)
{
$total_values = count($values);

if (isset($_GET['page'])) {
$current_page = $_GET['page'];
} else {
$current_page = 1;
}
$counts = ceil($total_values / $per_page);
$param1 = ($current_page - 1) * $per_page;
$this->data = array_slice($values, $param1, $per_page);

$numbers = array();
for ($x = 1; $x <= $counts; $x++) {
$numbers[] = $x;
}
return $numbers;
}

function fetchResult()
{
return $this->data;
}

}

33 changes: 0 additions & 33 deletions modules/openchecker/pagination_class.php

This file was deleted.

1 change: 0 additions & 1 deletion openchecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

//prepare the templates and include all neccessary
require_once (__DIR__.'/lib/common.inc.php');
require_once (__DIR__.'/modules/openchecker/pagination_class.php');
require_once (__DIR__.'/modules/openchecker/openchecker_classes.php');

if ($usr == false) {
Expand Down

0 comments on commit 62da603

Please sign in to comment.