This commit is contained in:
Felix Ivo
2025-06-16 13:56:04 +02:00
3 changed files with 67 additions and 11 deletions

View File

@@ -2,28 +2,31 @@
namespace ppa\Controller;
use ppa\Model\NotesModel;
use ppa\Model\UserModel;
use ppa\Library\View;
class NotesController
class UserController
{
private $notesModel;
private $userModel;
protected $view;
public function __construct($view)
{
$this->notesModel = new NotesModel();
$this->userModel = new UserModel();
$this->view = $view;
}
public function showNotes()
public function loginUser()
{
echo "test";
//verifyLogin($_POST['username'] ?? '', $_POST['password'] ?? '')
}
public function showUserLoginForm()
{
$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']
]);
}
}