mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-21 17:06:28 +02:00
On passe au nouveau système de framework !
This commit is contained in:
parent
8b61ea0a9a
commit
0f47389ae1
13 changed files with 408 additions and 432 deletions
|
@ -24,21 +24,20 @@
|
|||
|
||||
/**
|
||||
* Cette fonction retourne tous les événements, sous forme d'un tableau permettant l'administration de ces événements
|
||||
* @param int $page : La page à consulter. Par défaut 0
|
||||
* @return void;
|
||||
*/
|
||||
public function showAll()
|
||||
public function showAll($page = 0)
|
||||
{
|
||||
//Creation de l'object de base de données
|
||||
global $db;
|
||||
|
||||
|
||||
$page = (int)(isset($_GET['page']) ? $_GET['page'] : 0);
|
||||
|
||||
$page = (int)($page < 0 ? $page = 0 : $page);
|
||||
$limit = 25;
|
||||
$offset = $limit * $page;
|
||||
|
||||
|
||||
//Récupération des évènements triés par date, du plus récent au plus ancien, par paquets de $limit, en ignorant les $offset premiers
|
||||
$events = $db->getAll('events', 'at', true, $limit, $offset);
|
||||
$events = $db->getFromTableWhere('events', [], 'at', true, $limit, $offset);
|
||||
|
||||
$this->render('events', array(
|
||||
'events' => $events,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue