next et previous page liste prive, réglages bug

modif
Rayhân HASSOU 2 years ago
parent b7cf2744b8
commit 4ddfc272e5

@ -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 }//fin class
?> ?>

@ -7,6 +7,9 @@ class FrontControleur {
if(!isset($_COOKIE['page'])){ if(!isset($_COOKIE['page'])){
setcookie('page', 1, time() + 24*3600); setcookie('page', 1, time() + 24*3600);
} }
if(!isset($_COOKIE['pageUser'])){
setcookie('pageUser', 1, time() + 24*3600);
}
try { try {
$string_actor=' '; $string_actor=' ';

@ -74,7 +74,7 @@ public static function RecupererListePublic(){
$nom=$_POST['nom-ajout-liste']; $nom=$_POST['nom-ajout-liste'];
$description=$_POST['description-ajout-liste']; $description=$_POST['description-ajout-liste'];
Validation::val_form_add($nom,$description,$dVueErreur); Validation::val_form_add($nom,$description,$dVueErreur);
$listGtw->Ajouter($nom, $description,1, null); $listGtw->Ajouter($nom, $description,1, 1);
} }
public function check(){ public function check(){

@ -18,7 +18,7 @@ class ListeGateway{
} }
public function Editer(string $id, string $nom, string $description){ 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( $this->con->executeQuery($query, array(
'nom' => array($nom, PDO::PARAM_STR), 'nom' => array($nom, PDO::PARAM_STR),
'id' => array($id,PDO::PARAM_INT), 'id' => array($id,PDO::PARAM_INT),

@ -1,13 +1,14 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<link rel="shortcut icon" href="./vue/Images/c.gif" type="../Images/gif"> <link rel="shortcut icon" href="./vue/Images/gif.gif" type="../Images/gif">
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>Home Page</title> <title>Home Page</title>
<!-- CSS only --> <!-- CSS only -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https:/stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" href="https:/stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="./vue/css/task.css">
<!-- JavaScript Bundle with Popper --> <!-- JavaScript Bundle with Popper -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script> <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
@ -98,7 +99,7 @@
</span> </span>
</p> </p>
<p><span class="h5 me-2"><?= $liste->getDescription()?></span> <p><span class="h5 me-2"><?= $liste->getDescription()?></span>
<p class="text-muted pb-2"><?= $liste->getDateCreation()?> : <?= $liste->getIdUtilisateur()?></p> <p class="text-muted pb-2"><?= $liste->getDateCreation()?> by <strong><?= $_SESSION['pseudo'] ?></strong> </p>
</div> </div>
@ -200,15 +201,15 @@
?> ?>
<li class="list-group-item border-0 d-flex align-items-center ps-0"> <li class="list-group-item border-0 d-flex align-items-center ps-0">
<form name="action" action="index.php?action=checkPrive" method="POST"> <form name="action" action="index.php?action=checkPrive" method="POST">
<input class="form-check-input me-3" type="checkbox" onChange="submit();" <input class="form-check-input me-3" id="task-<?= $tache->getId() ?>" type="checkbox" onChange="submit();"
<?php if($tache->getEstValide() == 1) echo "checked" ?>> <?php if($tache->getEstValide() == 1) echo "checked" ?>>
<label for="task-<?= $tache->getId() ?>"> <?= $tache->getNom() ?> : <?= $tache->getDescription() ?></label>
<input type="hidden" name="idTache" value="<?= $tache->getId() ?>" > <input type="hidden" name="idTache" value="<?= $tache->getId() ?>" >
</form> </form>
<?= $tache->getNom() ?> : <?= $tache->getDescription() ?>
<a href="index.php?action=SupprimerTachePrive&idTache=<?= $tache->getId() ?>"> <a href="index.php?action=SupprimerTachePrive&idTache=<?= $tache->getId() ?>">
<button class="btn btn-default"> <button class="btn btn-default">
<img src="./vue/Images/trash.png" width="18" /> <img src="./vue/Images/trash2.png" width="20" />
</button> </button>
</a> </a>
</li> </li>
@ -238,12 +239,15 @@
?> ?>
<nav aria-label="Page navigation example"> <nav aria-label="Page navigation example">
<center>
<p>Page n°<?php echo $_COOKIE['page'] ?></p>
</center>
<ul class="pagination justify-content-center"> <ul class="pagination justify-content-center">
<li class="page-item"> <li class="page-item">
<a class="page-link" href="#">Previous</a> <a class="page-link" href="previousPage">Previous</a>
</li> </li>
<li class="page-item"> <li class="page-item">
<a class="page-link" href="#">Next</a> <a class="page-link" href="nextPage">Next</a>
</li> </li>
</ul> </ul>
</nav> </nav>

@ -191,9 +191,6 @@
<img src="./vue/Images/trash2.png" width="20" /> <img src="./vue/Images/trash2.png" width="20" />
</button> </button>
</a> </a>
<button type="submit" class="btn btn-default">
<img src="./vue/Images/edit.png" width="18" />
</button>
</li> </li>
<?php <?php
} }

Loading…
Cancel
Save