Merge branch 'master' of /home/ek/sf-site
This commit is contained in:
30
index.php
30
index.php
@@ -222,6 +222,27 @@ if ($res = $DB->query(kl_str_sql("select * from builds where chan=!s $where orde
|
||||
|
||||
$nrBuilds = count($builds);
|
||||
|
||||
if ($res = $DB->query(kl_str_sql("select count(*) from builds where chan=!s", $chan))) {
|
||||
if ($row = $DB->fetchRow($res)) {
|
||||
$total = (int)$row[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$nextLink = "#";
|
||||
$prevLink = "#";
|
||||
|
||||
if ($page > 0) $prevLink = "?page=" . ($page - 1);
|
||||
if ($page < (int)($total / $pageSize)) $nextLink = "?page=" . ($page + 1);
|
||||
|
||||
$paginator .= '<a href="' . $prevLink . '"><Previous</a>';
|
||||
|
||||
$paginator .= " Page " . ($page + 1) . " of " . ceil($total / $pageSize) . " ";
|
||||
|
||||
$paginator .= '<a href="' . $nextLink . '">Next></a>';
|
||||
|
||||
print $paginator;
|
||||
|
||||
if ($nrBuilds) {
|
||||
print '<table class="build-list">';
|
||||
|
||||
@@ -235,14 +256,7 @@ if ($nrBuilds) {
|
||||
|
||||
}
|
||||
|
||||
print "<br/>\n";
|
||||
|
||||
if ($page > 0) {
|
||||
print '<a href="?page=' . ($page - 1) . '"><< Previous</a>  ';
|
||||
}
|
||||
|
||||
print '<a href="?page=' . ($page + 1) . '">Next >></a>';
|
||||
|
||||
print "<br/>\n" . $paginator;
|
||||
|
||||
|
||||
Layout::footer();
|
||||
|
||||
Reference in New Issue
Block a user