From 4ddfc272e5be30934d4f63cdda4b5e4e06fc3924 Mon Sep 17 00:00:00 2001
From: rahassou
Date: Fri, 16 Dec 2022 19:24:35 +0100
Subject: [PATCH] =?UTF-8?q?next=20et=20previous=20page=20liste=20prive,=20?=
=?UTF-8?q?r=C3=A9glages=20bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/controller/CtrlUtilisateur.php | 13 +++++++++++++
src/controller/FrontControleur.php | 3 +++
src/modele/MdlVisiteur.php | 2 +-
src/modele/gateway/ListeGateway.php | 2 +-
src/vue/html/PageListePrive.php | 26 +++++++++++++++-----------
src/vue/html/PageListePublic.php | 3 ---
6 files changed, 33 insertions(+), 16 deletions(-)
diff --git a/src/controller/CtrlUtilisateur.php b/src/controller/CtrlUtilisateur.php
index 764ed13..9da2ecf 100755
--- a/src/controller/CtrlUtilisateur.php
+++ b/src/controller/CtrlUtilisateur.php
@@ -214,6 +214,19 @@ class CtrlUtilisateur {
}
+
+ public function listePrécédente(array $dVueErreur){
+ if($_COOKIE['pageUser'] > 1){
+ setcookie('pageUser', $_COOKIE['pageUser'] - 1, time() + 24*3600);
+ }
+ $this->ConsulterListePrive($dVueErreur);
+ }
+
+ public function listeSuivante(array $dVueErreur){
+ setcookie('pageUser', $_COOKIE['pageUser'] + 1, time() + 24*3600);
+ $this->ConsulterListePrive($dVueErreur);
+ }
+
}//fin class
?>
diff --git a/src/controller/FrontControleur.php b/src/controller/FrontControleur.php
index 4f69961..18e429d 100755
--- a/src/controller/FrontControleur.php
+++ b/src/controller/FrontControleur.php
@@ -7,6 +7,9 @@ class FrontControleur {
if(!isset($_COOKIE['page'])){
setcookie('page', 1, time() + 24*3600);
}
+ if(!isset($_COOKIE['pageUser'])){
+ setcookie('pageUser', 1, time() + 24*3600);
+ }
try {
$string_actor=' ';
diff --git a/src/modele/MdlVisiteur.php b/src/modele/MdlVisiteur.php
index 68e347c..3e542c6 100755
--- a/src/modele/MdlVisiteur.php
+++ b/src/modele/MdlVisiteur.php
@@ -74,7 +74,7 @@ public static function RecupererListePublic(){
$nom=$_POST['nom-ajout-liste'];
$description=$_POST['description-ajout-liste'];
Validation::val_form_add($nom,$description,$dVueErreur);
- $listGtw->Ajouter($nom, $description,1, null);
+ $listGtw->Ajouter($nom, $description,1, 1);
}
public function check(){
diff --git a/src/modele/gateway/ListeGateway.php b/src/modele/gateway/ListeGateway.php
index 3fb6ed8..677fb49 100755
--- a/src/modele/gateway/ListeGateway.php
+++ b/src/modele/gateway/ListeGateway.php
@@ -18,7 +18,7 @@ class ListeGateway{
}
public function Editer(string $id, string $nom, string $description){
- $query='UPDATE ToDoList_Liste SET nom=:nom AND description=:description WHERE id=:id;';
+ $query='UPDATE ToDoList_Liste SET nom=:nom, description=:description WHERE id=:id;';
$this->con->executeQuery($query, array(
'nom' => array($nom, PDO::PARAM_STR),
'id' => array($id,PDO::PARAM_INT),
diff --git a/src/vue/html/PageListePrive.php b/src/vue/html/PageListePrive.php
index 13da8de..8563d49 100644
--- a/src/vue/html/PageListePrive.php
+++ b/src/vue/html/PageListePrive.php
@@ -1,13 +1,14 @@
-
+
Home Page
+
@@ -98,7 +99,7 @@
= $liste->getDescription()?>
-
= $liste->getDateCreation()?> : = $liste->getIdUtilisateur()?>
+ = $liste->getDateCreation()?> by = $_SESSION['pseudo'] ?>
@@ -198,17 +199,17 @@
}
$total = $total + 1;
?>
-
+
- = $tache->getNom() ?> : = $tache->getDescription() ?>
-
-
+
@@ -238,12 +239,15 @@
?>
+
+ Page n°
+
@@ -336,4 +340,4 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/vue/html/PageListePublic.php b/src/vue/html/PageListePublic.php
index 4ae3aaa..a96003e 100755
--- a/src/vue/html/PageListePublic.php
+++ b/src/vue/html/PageListePublic.php
@@ -191,9 +191,6 @@
-
-
-