generated from github/welcome-to-github
-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #144 from lbr38/devel
3.7.10
- Loading branch information
Showing
41 changed files
with
1,165 additions
and
979 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
www/controllers/Layout/Table/vars/stats/access.vars.inc.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
$mystats = new \Controllers\Stat(); | ||
$myrepo = new \Controllers\Repo\Repo(); | ||
$reloadableTableOffset = 0; | ||
$envId = __ACTUAL_URI__[2]; | ||
|
||
/** | ||
* Retrieve repo infos from DB | ||
*/ | ||
$myrepo->getAllById('', '', $envId); | ||
|
||
/** | ||
* Retrieve offset from cookie if exists | ||
*/ | ||
if (!empty($_COOKIE['tables/stats/access/offset']) and is_numeric($_COOKIE['tables/stats/access/offset'])) { | ||
$reloadableTableOffset = $_COOKIE['tables/stats/access/offset']; | ||
} | ||
|
||
/** | ||
* Retrieve last access logs, with offset | ||
*/ | ||
if ($myrepo->getPackageType() == 'rpm') { | ||
$reloadableTableContent = $mystats->getAccess($myrepo->getName(), '', '', $myrepo->getEnv(), true, $reloadableTableOffset); | ||
} | ||
if ($myrepo->getPackageType() == 'deb') { | ||
$reloadableTableContent = $mystats->getAccess($myrepo->getName(), $myrepo->getDist(), $myrepo->getSection(), $myrepo->getEnv(), true, $reloadableTableOffset); | ||
} | ||
|
||
/** | ||
* Retrieve last access logs, without offset, for the total count | ||
*/ | ||
if ($myrepo->getPackageType() == 'rpm') { | ||
$reloadableTableTotalItems = count($mystats->getAccess($myrepo->getName(), '', '', $myrepo->getEnv())); | ||
} | ||
if ($myrepo->getPackageType() == 'deb') { | ||
$reloadableTableTotalItems = count($mystats->getAccess($myrepo->getName(), $myrepo->getDist(), $myrepo->getSection(), $myrepo->getEnv())); | ||
} | ||
|
||
/** | ||
* Count total pages for the pagination | ||
*/ | ||
$reloadableTableTotalPages = ceil($reloadableTableTotalItems / 10); | ||
|
||
/** | ||
* Calculate current page number | ||
*/ | ||
$reloadableTableCurrentPage = ceil($reloadableTableOffset / 10) + 1; | ||
|
||
unset($myrepo, $mystats); |
Oops, something went wrong.