29 lines
604 B
PHP
29 lines
604 B
PHP
<?php
|
|
|
|
namespace ppa\Controller;
|
|
|
|
use ppa\Model\NotesModel;
|
|
use ppa\Library\View;
|
|
|
|
class NotesController
|
|
{
|
|
private $notesModel;
|
|
protected $view;
|
|
|
|
public function __construct($view)
|
|
{
|
|
$this->notesModel = new NotesModel();
|
|
$this->view = $view;
|
|
}
|
|
|
|
public function showNotes()
|
|
{
|
|
$sortBy = $_GET['sort_by'] ?? 'updated_at';
|
|
$sortOrder = strtoupper($_GET['sort_order'] ?? 'DESC');
|
|
|
|
$this->view->setVars([
|
|
"notes" => $this->notesModel->selectNotesForUser(2, $sortBy, $sortOrder) //$_SESSION['user_id']
|
|
]);
|
|
}
|
|
|
|
} |