Compare commits

...

1 Commits

Author SHA1 Message Date
Rayhân HASSOU 32a95fe4c2 ajout liste prive
2 years ago

@ -16,6 +16,4 @@ RewriteRule ^VueListePublic$ index.php?action=redirectionListePublic [L]
RewriteRule ^logout$ index.php?action=logout [L]
RewriteRule ^MonProfil$ index.php?action=redirectionProfil [L]
RewriteRule ^supprimerCompte$ index.php?action=supprimerCompte [L]
RewriteRule ^previousPage$ index.php?action=pagePrécédente [L]
RewriteRule ^nextPage$ index.php?action=pageSuivante [L]
RewriteRule ^Users$ index.php?action=voirUser [L]
RewriteRule ^listePrive$ index.php?action=listePrive [L]

@ -12,6 +12,7 @@ $dsn='mysql:host=londres.uca.local;dbname=dbemkartal1';
$vues['erreur']='vue/html/erreur.php';
$vues['inscription']='vue/html/inscription.php';
$vues['listPublic']='vue/html/PageListePublic.php';
$vues['listPrive']='vue/html/PageListePrive.php';
$vues['login']='vue/html/login.php';
$vues['NavBar']='vue/html/NavBar.php';
$vues['profil']='vue/html/profil.php';

@ -32,11 +32,35 @@ class CtrlUtilisateur {
case "supprimerCompte":
$this->supprimerCompte($dVueErreur);
break;
case "modifMdp":
$this->changerMotDePasse($dVueErreur);
case "listePrive":
$this->ConsulterListePrive($dVueErreur);
break;
case "SupprimerTachePrive":
$this->SupprimerTachePrive($dVueErreur);
break;
case "AjouterTachePrive":
$this->AjouterTachePrive($dVueErreur);
break;
case "ModifierListePrive":
$this->ModifierListePrive($dVueErreur);
break;
case "checkPrive":
$this->checkPrive($dVueErreur);
break;
case "AjouterListePrive":
$this->AjouterListePrive($dVueErreur);
break;
case "SupprimerListePrive":
$this->SupprimerListePrive($dVueErreur);
break;
default:
$dVueErreur[] = "Erreur d'appel php";
require ($rep.$vues['erreur']);
@ -46,13 +70,13 @@ class CtrlUtilisateur {
} catch (PDOException $e)
{
//si erreur BD, pas le cas ici
$dVueErreur[] = "Erreur BD!!! ";
$dVueEreur[] = "Erreur BD!!! ";
require ($rep.$vues['erreur']);
}
catch (Exception $e2)
{
$dVueErreur[] = "Erreur inattendue!!! ";
$dVueEreur[] = "Erreur inattendue!!! ";
require ($rep.$vues['erreur']);
}
@ -61,13 +85,6 @@ class CtrlUtilisateur {
exit(0);
}//fin constructeur
function ConsulterListePublic(array $dVueErreur) {
global $rep,$vues;
$listes = MdlVisiteur::RecupererListePublic();
$taches = MdlVisiteur::RecupererTache();
$action=NULL;
require ($rep.$vues['listPublic']);
}
function SeDeconnecter(array $dVueErreur){
global $rep,$vues;
@ -80,32 +97,97 @@ class CtrlUtilisateur {
global $rep,$vues;
$action=NULL;
$user=MdlUtilisateur::isConnected();
$nombreListe=MdlUtilisateur::recupererNombreDeListe();
require ($rep.$vues['profil']);
}
function supprimerCompte(array $dVueErreur){
global $rep,$vues;
$action=NULL;
MdlUtilisateur::suppressionUtilisateur();
$user=MdlUtilisateur::suppressionUtilisateur();
require ($rep.$vues['login']);
}
function changerMotDePasse(array $dVueErreur){
function ConsulterListePrive(array $dVueErreur) {
global $rep,$vues;
$listesPrive = MdlUtilisateur::RecupererListePrive();
$taches = MdlVisiteur::RecupererTache();
$action=NULL;
require ($rep.$vues['listPrive']);
}
function SupprimerTachePrive(array $dVueErreur){
global $rep,$vues;
$tache = MdlVisiteur::SupprimerTache();
$this->ConsulterListePrive($dVueErreur);
}
function SupprimerListePrive(array $dVueErreur){
global $rep,$vues;
$liste = MdlVisiteur::SupprimerListe();
$this->ConsulterListePrive($dVueErreur);
}
public function AjouterTachePrive(array $dVueErreur){
global $rep,$vues;
try{
MdlUtilisateur::changerMotDePasse();
$tache = MdlVisiteur::AjouterTache($dVueErreur);
$this->ConsulterListePrive($dVueErreur);
}
catch (Exception $e)
{
$ErreurLog=$e->getMessage();
$listesPrive= MdlUtilisateur::RecupererListePrive();
$taches = MdlVisiteur::RecupererTache();
$action=NULL;
require ($rep.$vues['login']);
}
catch(Exception $e)
require ($rep.$vues['listPrive']);
}
}
public function ModifierListePrive(array $dVueErreur){
global $rep,$vues;
try{
$tache = MdlVisiteur::ModifierListe($dVueErreurs);
$this->ConsulterListePrive($dVueErreur);
}
catch (Exception $e)
{
$dVueErreur[] = $e->getMessage();
require ($rep.$vues['erreur']);
$ErreurLog=$e->getMessage();
$listesPrive= MdlUtilisateur::RecupererListePrive();
$taches = MdlVisiteur::RecupererTache();
$action=NULL;
require ($rep.$vues['listPublic']);
}
}
public function checkPrive()
{
global $rep,$vues;
$tache = MdlVisiteur::check();
$this->ConsulterListePrive($dVueErreur);
}
public function AjouterListePrive(array $dVueErreur){
global $rep,$vues;
try{
$tache = MdlUtilisateur::AjouterListePrive($dVueErreur);
$this->ConsulterListePrive($dVueErreur);
}
catch (Exception $e)
{
$ErreurLog=$e->getMessage();
$listes = MdlUtilisateur::RecupererListePrive();
$taches = MdlVisiteur::RecupererTache();
$action=NULL;
require ($rep.$vues['listPrive']);
}
}
}//fin class
?>

@ -60,17 +60,9 @@ class CtrlVisiteur {
case "ModifierListe":
$this->ModifierListe($dVueErreur);
break;
case "pagePrécédente":
$this->listePrécédente($dVueErreur);
break;
case "pageSuivante":
$this->listeSuivante($dVueErreur);
break;
case "check":
$this->check($dVueErreur);
$this->check();
break;
//mauvaise action
@ -153,18 +145,38 @@ class CtrlVisiteur {
}
function SupprimerTache(array $dVueErreur){
global $rep,$vues;
$tache = MdlVisiteur::SupprimerTache();
$this->ConsulterListePublic($dVueErreur);
$listes = MdlVisiteur::RecupererListePublic();
$taches = MdlVisiteur::RecupererTache();
$action=NULL;
require ($rep.$vues['listPublic']);
}
function SupprimerListe(array $dVueErreur){
global $rep,$vues;
$liste = MdlVisiteur::SupprimerListe();
$this->ConsulterListePublic($dVueErreur);
$listes = MdlVisiteur::RecupererListePublic();
$taches = MdlVisiteur::RecupererTache();
$action=NULL;
require ($rep.$vues['listPublic']);
}
public function AjouterTache(array $dVueErreur){
$tache = MdlVisiteur::AjouterTache();
$this->ConsulterListePublic($dVueErreur);
global $rep,$vues;
try{
$tache = MdlVisiteur::AjouterTache($dVueErreur);
$this->ConsulterListePublic($dVueErreur);
}
catch (Exception $e)
{
$ErreurLog=$e->getMessage();
$listes = MdlVisiteur::RecupererListePublic();
$taches = MdlVisiteur::RecupererTache();
$action=NULL;
require ($rep.$vues['listPublic']);
}
}
public function AjouterListePublic(array $dVueErreur){
@ -182,32 +194,36 @@ class CtrlVisiteur {
$action=NULL;
require ($rep.$vues['listPublic']);
}
}
public function ModifierListe(array $dVueErreur){
$tache = MdlVisiteur::ModifierListe();
$this->ConsulterListePublic($dVueErreur);
global $rep,$vues;
try{
$tache = MdlVisiteur::ModifierListe($dVueErreurs);
$this->ConsulterListePublic($dVueErreur);
}
catch (Exception $e)
{
$ErreurLog=$e->getMessage();
$listes = MdlVisiteur::RecupererListePublic();
$taches = MdlVisiteur::RecupererTache();
$action=NULL;
require ($rep.$vues['listPublic']);
}
}
public function check(array $dVueErreur)
public function check()
{
global $rep,$vues;
$tache = MdlVisiteur::check();
$this->ConsulterListePublic($dVueErreur);
}
public function listePrécédente(array $dVueErreur){
if($_COOKIE['page']>1){
setcookie('page', $_COOKIE['page'] - 1, time() + 24*3600);
}
$this->ConsulterListePublic($dVueErreur);
}
public function listeSuivante(array $dVueErreur){
setcookie('page', $_COOKIE['page'] + 1, time() + 24*3600);
$this->ConsulterListePublic($dVueErreur);
$listes = MdlVisiteur::RecupererListePublic();
$taches = MdlVisiteur::RecupererTache();
$action=NULL;
require ($rep.$vues['listPublic']);
}
}//fin class
?>

@ -1,18 +1,14 @@
<?php
class FrontControleur {
function __construct(){
global $rep,$vues;
session_start();
if(!isset($_COOKIE['page'])){
setcookie('page', 1, time() + 24*3600);
}
try {
$string_actor=' ';
$listeActions=array(
'Utilisateur' => array('logout','redirectionProfil','supprimerCompte','modifMdp'),
'Admin' => array('voirUser')
'Utilisateur' => array('logout','redirectionProfil','supprimerCompte', 'listePrive','AjouterListePrive', 'SupprimerListePrive', 'AjouterTachePrive', 'ModifierListePrive', 'SupprimerTachePrive'),
'Admin' => array()
);
//On récupère l'action

@ -3,81 +3,66 @@
class MdlUtilisateur
{
public function __construct(){
public function __construct(){
}
}
public function connection(){
$gtw=new UtilisateurGateway();
$mail=Validation::cleanMail($_POST['mail']);
$mdp=$_POST['password'];
$gtw=new UtilisateurGateway();
$mail=Validation::cleanMail($_POST['mail']);
$mdp=$_POST['password'];
$verif_pass=$gtw->getCredentials($mail);
if(password_verify($mdp,$verif_pass)){
if(password_verify($mdp,$verif_pass)){
$userCurrent=$gtw->RechercheUtilisateurViaEmail($mail);
$_SESSION['role']='user';
$_SESSION['id']=$userCurrent->getId();
$_SESSION['id']=$userCurrent->getId();
$_SESSION['nom']=$userCurrent->getNom();
$_SESSION['prenom']=$userCurrent->getPrenom();
$_SESSION['pseudo']=$userCurrent->getPseudo();
$_SESSION['email']=$userCurrent->getMail();
return $userCurrent;
}
else throw new Exception('Mot de passe incorrect*');
}
}
else throw new Exception('Mot de passe incorrect*');
}
public function isConnected(){
if(isset($_SESSION['id']) && isset($_SESSION['role']) && $_SESSION['role']=='user') {
if(isset($_SESSION['id']) && isset($_SESSION['role'])) {
$id=Validation::cleanInt($_SESSION['id']);
$nom=Validation::cleanString($_SESSION['nom']);
$prenom=Validation::cleanString($_SESSION['prenom']);
$pseudo=Validation::cleanPseudo($_SESSION['pseudo']);
$pseudo=Validation::cleanString($_SESSION['pseudo']);
$email=Validation::cleanMail($_SESSION['email']);
return new Utilisateur($id,$nom,$prenom,$pseudo,$email);
}
else return null;
}
public static function déconnexion(){
session_unset();
session_destroy();
$_SESSION = array();
}
public static function recupererNombreDeListe(){
$listeGtw = new ListeGateway();
$id = Validation::cleanInt($_SESSION['id']);
return $listeGtw->CountListe(intval($id));
}
public static function suppressionUtilisateur(){
public function suppressionUtilisateur(){
$userGtw = new UtilisateurGateway();
$id=Validation::cleanInt($_SESSION['id']);
$userGtw->SupprimerUtilisateur(intval($id));
MdlUtilisateur::déconnexion();
}
public static function changerMotDePasse(){
$userGtw = new UtilisateurGateway();
$id=Validation::cleanInt($_SESSION['id']);
$mail=Validation::cleanMail($_SESSION['email']);
$mdp=$_POST['passwordCurrent'];
$newMdp=$_POST['newPassword'];
$verif_pass=$userGtw->getCredentials($mail);
if(password_verify($mdp,$verif_pass)){
if($newMdp == $_POST['confirmNewPassword']){
if (!preg_match('/^.{5,}$/', $mdp)) {
throw new Exception("Mot de passe trop faible. Veuillez recommencer !");
}
else {
$userGtw->modifMdp($id, password_hash($newMdp, PASSWORD_DEFAULT));
}
}
else throw new Exception("Erreur lors de la confirmation du mot de passe.");
}
else throw new Exception("Mot de passe Incorrect");
public function AjouterListePrive(&$dVueErreur){
$taskGtw = new ListeGateway();
$nom=$_POST['nom-ajout-liste'];
$description=$_POST['description-ajout-liste'];
$idCreateur =Validation::cleanInt($_SESSION['id']);
Validation::val_form_add($nom,$description,$dVueErreur);
$taskGtw->Ajouter($nom, $description,0, $idCreateur);
}
public static function RecupererListePrive(){
$userGtw = new ListeGateway();
return $userGtw->getListePrive(0,10);
}
}

@ -3,11 +3,11 @@
class MdlVisiteur
{
public function __construct(){
public function __construct(){
}
}
public static function CreerUtilisateur(&$dVueErreur){
public static function CreerUtilisateur(&$dVueErreur){
$userGtw = new UtilisateurGateway();
Validation::val_form_user($_POST["nom-Form"],$_POST["prenom-Form"],$_POST["pseudo-Form"],$_POST["password"],$_POST["mail"],$dVueErreur);
$userGtw->isExisteViaMail($_POST["mail"]);
@ -18,10 +18,7 @@ class MdlVisiteur
public static function RecupererListePublic(){
$userGtw = new ListeGateway();
if(isset($_COOKIE['page']))
return $userGtw->getListePublic(($_COOKIE['page']-1)*10,10);
else
return $userGtw->getListePublic(1,10);
return $userGtw->getListePublic(0,10);
}
public static function RecupererTache(){
@ -43,7 +40,7 @@ class MdlVisiteur
$userGtw->Supprimer($id);
}
public function AjouterTache(){
public function AjouterTache(&$dVueErreur){
$taskGtw = new TacheGateway();
$id = $_POST['idListe'];
$nom = $_POST['nom-ajout'];
@ -52,11 +49,12 @@ class MdlVisiteur
$taskGtw->AjouterTache($nom, $description,false,$id);
}
public function ModifierListe(){
public function ModifierListe(&$dVueErreur){
$userGtw = new ListeGateway();
$id = $_POST['idListe'];
$nom = $_POST['nom-modif-liste'];
$description = $_POST['description-modif-liste'];
$nom = Validation::cleanText($_POST['nom-modif-liste']);
$description = Validation::cleanText($_POST['description-modif-liste']);
if($description == NULL){
$userGtw->EditerNom($id, $nom);
}
@ -69,11 +67,11 @@ class MdlVisiteur
}
public function AjouterListePublic(&$dVueErreur){
$listGtw = new ListeGateway();
$taskGtw = new ListeGateway();
$nom=$_POST['nom-ajout-liste'];
$description=$_POST['description-ajout-liste'];
Validation::val_form_add($nom,$description,$dVueErreur);
$listGtw->Ajouter($nom, $description,1, true);
$taskGtw->Ajouter($nom, $description,1, null);
}
public function check(){

@ -1,40 +1,35 @@
<?php
class ListeGateway{
private $con;
private $con;
public function __construct(){
public function __construct(){
global $dsn,$user,$pass;
$this->con=new Connection($dsn,$user,$pass);
}
public function Ajouter(string $nom, string $description, bool $estPublic, string $createur){
$query='INSERT INTO ToDoList_Liste(nom, description, dateCreation,estPublic, idUtilisateur) VALUES(:nom,:description,CURRENT_DATE, :estPublic, :createur);';
$query='INSERT INTO ToDoList_Liste(nom, description, dateCreation,estPublic, idUtilisateur) VALUES(:nom,:description,CURRENT_DATE, :estPublic, :createur);';
$this->con->executeQuery($query, array(
'nom' => array($nom, PDO::PARAM_STR),
'description' => array($description, PDO::PARAM_STR),
'estPublic' => array($estPublic, PDO::PARAM_INT),
'createur' => array($createur, PDO::PARAM_STR),
));
'nom' => array($nom, PDO::PARAM_STR),
'description' => array($description, PDO::PARAM_STR),
'estPublic' => array($estPublic, PDO::PARAM_INT),
'createur' => array($createur, PDO::PARAM_STR),
));
}
public function Editer(string $id, string $nom, string $description){
$query='UPDATE ToDoList_Liste SET nom=:nom AND description=:description WHERE id=:id;';
$this->con->executeQuery($query, array(
'nom' => array($nom, PDO::PARAM_STR),
'id' => array($id,PDO::PARAM_INT),
'description' => array($description, PDO::PARAM_STR))
$query='UPDATE ToDoList_Liste SET nom=:nom, description=:description WHERE id=:id;';
$this->con->executeQuery($query, array(
'nom' => array($nom, PDO::PARAM_STR),
'description' => array($description, PDO::PARAM_STR),
'id' => array($id,PDO::PARAM_INT))
);
}
public function CountListe($id){
$query="SELECT count(*) as nombreListe FROM ToDoList_Liste WHERE idUtilisateur=:id";
$this->con->executeQuery($query, array('id' => array($id, PDO::PARAM_INT)));
return $this->con->getResults()[0]['nombreListe'];
}
public function EditerNom(string $id, string $nom){
$query='UPDATE ToDoList_Liste SET nom=:nom WHERE id=:id;';
$this->con->executeQuery($query, array('nom' => array($nom, PDO::PARAM_STR),'id' => array($id, PDO::PARAM_INT)));
}
public function EditerDescription(string $id, string $description){
@ -58,10 +53,20 @@ class ListeGateway{
$query = "SELECT * FROM ToDoList_Liste WHERE estPublic LIMIT $offset, $limit";
$this->con->executeQuery($query);
$listes = [];
foreach ($this->con->getResults() as $liste) {
$listes[] = new Liste($liste["id"],$liste["nom"],$liste["description"],$liste["dateCreation"],$liste["estPublic"],$liste["idUtilisateur"]);
}
return $listes;
foreach ($this->con->getResults() as $liste) {
$listes[] = new Liste($liste["id"],$liste["nom"],$liste["description"],$liste["dateCreation"],$liste["estPublic"],$liste["idUtilisateur"]);
}
return $listes;
}
public function getListePrive($offset,$limit){
$query = "SELECT * FROM ToDoList_Liste WHERE !estPublic LIMIT $offset, $limit";
$this->con->executeQuery($query);
$listes = [];
foreach ($this->con->getResults() as $liste) {
$listes[] = new Liste($liste["id"],$liste["nom"],$liste["description"],$liste["dateCreation"],$liste["estPublic"],$liste["idUtilisateur"]);
}
return $listes;
}
}
?>

@ -1,7 +1,7 @@
<?php
class TacheGateway{
private $con;
public function __construct(){
private $con;
public function __construct(){
global $dsn,$user,$pass;
$this->con=new Connection($dsn,$user,$pass);
}
@ -17,8 +17,8 @@ class TacheGateway{
}
public function Editer(string $id, string $nom, string $description){
$query='UPDATE ToDoList_Tache SET nom=:nom, description =:description WHERE id=:id;';
$this->con->executeQuery($query, array('nom' => array($nom, PDO::PARAM_STR), 'description' => array($description, PDO::PARAM_STR), 'id' => array($id, PDO::PARAM_INT)));
$query='UPDATE ToDoList_Tache SET nom=:nom, description =:description WHERE id=:id;';
$this->con->executeQuery($query, array('nom' => array($nom, PDO::PARAM_STR), 'description' => array($description, PDO::PARAM_STR), 'id' => array($id, PDO::PARAM_INT)));
}
public function EditerNom(string $id, string $nom){

@ -20,10 +20,7 @@
<?php
if(isset($_SESSION['id'])){ ?>
<h5><a class="nav-item nav-link text-light" href="VueListePublic">Listes Publiques</a></h5>
<h5><a class="nav-item nav-link text-light" href="#">Mes listes</a></h5>
<?php if($_SESSION['role']=='admin'){?>
<h5><a class="nav-item nav-link text-warning" href="Users">Les utilisateurs</a></h5>
<?php } ?>
<h5><a class="nav-item nav-link text-light" href="listePrive">Mes listes</a></h5>
<h5><a class="nav-item nav-link text-light" href="MonProfil">Mon Profil</a></h5>
<h5><button class="nav-item btn btn-outline-light" onclick="myFunction()">Se déconnecter</button></h5>

@ -0,0 +1,339 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="shortcut icon" href="./vue/Images/c.gif" type="../Images/gif">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Home Page</title>
<!-- 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/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- JavaScript Bundle with Popper -->
<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>
</head>
<body style="-webkit-user-select: none; /* Safari */
-ms-user-select: none; /* IE 10 and IE 11 */
user-select: none;">
<?php require($rep.$vues['NavBar']); ?>
<br>
<br>
<br>
<button class="btn btn-default" data-toggle="modal" data-target="#formulaireAjoutListe">
Ajouter une liste
<img src="./vue/Images/plus.png" width="20" />
</button>
<div class="container">
<div class="modal fade" id="formulaireAjoutListe">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Ajout d'une liste</h4>
<button type="button" class="close" data-dismiss="modal">
<span>&times;</span>
</button>
</div>
<div class="modal-body row">
<form class="col" method="POST">
<div class="form-group">
<?php
if(isset($dVueErreur['nom'])){?>
<center><p class="text-danger"> <?php echo $dVueErreur['nom']?></p></center><?php
}
?>
<label for="nom" class="form-control-label">Nom</label>
<input type="text" class="form-control" name ="nom-ajout-liste" id="nom" placeholder="Entrez un nom">
</div>
<div class="form-group">
<?php
if(isset($dVueErreur['description'])){?>
<center><p class="text-danger"> <?php echo $dVueErreur['description']?></p></center><?php
}
?>
<label for="description" class="form-control-label">Description</label>
<input type="text" class="form-control" name="description-ajout-liste" id="description" placeholder="Entrez une description">
</div>
<button type="submit" class="btn btn-primary pull-right">Ajouter</button>
<input type="hidden" name="action" value="AjouterListePrive">
</form>
</div>
</div>
</div>
</div>
</div>
<?php
foreach($listesPrive as $liste){
if($liste->getIdUtilisateur() == $_SESSION['id']){
$done = 0;
$total = 0;
?>
<!-- Affichage des listesPrive -->
<div class="container py-2 h-100">
<div class="row d-flex justify-content-center align-items-center h-100">
<div class="col col-lg-8 col-xl-6">
<div class="card rounded-3">
<div class="card-body p-4">
<div>
<p class="mb-2">
<span class="h2 me-2 text-info"><?= $liste->getNom()?>
<a href="index.php?action=SupprimerListePrive&idListe=<?= $liste->getId() ?>">
<button class="btn btn-default">
<img src="./vue/Images/trash.png" width="20" />
</button>
</a>
<button data-toggle="modal" data-target="#formulaireModif<?= $liste->getId()?>" class="btn btn-default">
<img src="./vue/Images/edit.png" width="20" />
</button>
<button data-toggle="modal" data-target="#formulaireAjout<?= $liste->getId()?>" class="btn btn-default">
<img src="./vue/Images/plus.png" width="20" />
</button>
</span>
</p>
<p><span class="h5 me-2"><?= $liste->getDescription()?></span>
<p class="text-muted pb-2"><?= $liste->getDateCreation()?> : <?= $liste->getIdUtilisateur()?></p>
</div>
<!-- Fenetre modal -->
<div class="container">
<div class="modal fade" id="formulaireAjout<?= $liste->getId()?>">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Ajout d'une tache</h4>
<button type="button" class="close" data-dismiss="modal">
<span>&times;</span>
</button>
</div>
<div class="modal-body row">
<form class="col" method="POST">
<div class="form-group">
<?php
if(isset($dVueErreur['nom'])){?>
<center><p class="text-danger"> <?php echo $dVueErreur['nom']?></p></center><?php
}
?>
<label for="nom" class="form-control-label">Nom</label>
<input type="text" class="form-control" name ="nom-ajout" id="nom" placeholder="Entrez un nom">
</div>
<div class="form-group">
<?php
if(isset($dVueErreur['description'])){?>
<center><p class="text-danger"> <?php echo $dVueErreur['description']?></p></center><?php
}
?>
<label for="description" class="form-control-label">Description</label>
<input type="text" class="form-control" name="description-ajout" id="description" placeholder="Entrez une description">
</div>
<button type="submit" class="btn btn-primary pull-right">Ajouter</button>
<input type="hidden" name="action" value="AjouterTachePrive">
<input type="hidden" name="idListe" value="<?= $liste->getId() ?>">
</form>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="modal fade" id="formulaireModif<?= $liste->getId()?>">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Modification</h4>
<button type="button" class="close" data-dismiss="modal">
<span>&times;</span>
</button>
</div>
<div class="modal-body row">
<form class="col" method="POST">
<div class="form-group">
<?php
if(isset($dVueErreur['nom'])){?>
<center><p class="text-danger"> <?php echo $dVueErreur['nom']?></p></center><?php
}
?>
<label for="nom" class="form-control-label">Nouveau nom</label>
<input type="text" class="form-control" name ="nom-modif-liste" id="nom" placeholder="<?= $liste->getNom() ?>">
</div>
<div class="form-group">
<?php
if(isset($dVueErreur['description'])){?>
<center><p class="text-danger"> <?php echo $dVueErreur['description']?></p></center><?php
}
?>
<label for="description" class="form-control-label">Nouvelle description</label>
<input type="text" class="form-control" name="description-modif-liste" id="description" placeholder="<?= $liste->getDescription() ?>">
</div>
<button type="submit" class="btn btn-primary pull-right">Modifier</button>
<input type="hidden" name="action" value="ModifierListePrive">
<input type="hidden" name="idListe" value="<?= $liste->getId() ?>">
</form>
</div>
</div>
</div>
</div>
</div>
<!-- Tache -->
<ul class="list-group rounded-0">
<?php
foreach($taches as $tache){
if($tache->getIdListe() == $liste->getId()){
if($tache->getEstValide() == 1){
$done = $done + 1;
}
$total = $total + 1;
?>
<li class="list-group-item border-0 d-flex align-items-center ps-0">
<form name="action" action="index.php?action=checkPrive" method="POST">
<input class="form-check-input me-3" type="checkbox" onChange="submit();"
<?php if($tache->getEstValide() == 1) echo "checked" ?>>
<input type="hidden" name="idTache" value="<?= $tache->getId() ?>" >
</form>
<?= $tache->getNom() ?> : <?= $tache->getDescription() ?>
<a href="index.php?action=SupprimerTachePrive&idTache=<?= $tache->getId() ?>">
<button class="btn btn-default">
<img src="./vue/Images/trash.png" width="18" />
</button>
</a>
</li>
<?php
}
}
?>
</ul>
</div>
<div class="progress">
<?php
if($total != 0){
$pourcentage = $done * 100 / $total;
} else{
$pourcentage = 0;
}
?>
<div class="progress-bar progress-bar-striped" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo"$pourcentage" ?>%;"></div>
</div>
</div>
</div>
</div>
</div>
<?php
}
}
?>
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-center">
<li class="page-item">
<a class="page-link" href="#">Previous</a>
</li>
<li class="page-item">
<a class="page-link" href="#">Next</a>
</li>
</ul>
</nav>
</body>
<!-- Footer -->
<footer class="text-center text-lg-start bg-light ">
<br>
<!-- Section: Links -->
<section class="">
<div class="container text-center text-md-start mt-5">
<!-- Grid row -->
<div class="row mt-3">
<!-- Grid column -->
<div class="col-md-3 col-lg-4 col-xl-3 mx-auto mb-4">
<!-- Content -->
<h6 class="text-uppercase fw-bold mb-4">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-wallet2" viewBox="0 0 16 16">
<path d="M12.136.326A1.5 1.5 0 0 1 14 1.78V3h.5A1.5 1.5 0 0 1 16 4.5v9a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 0 13.5v-9a1.5 1.5 0 0 1 1.432-1.499L12.136.326zM5.562 3H13V1.78a.5.5 0 0 0-.621-.484L5.562 3zM1.5 4a.5.5 0 0 0-.5.5v9a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9a.5.5 0 0 0-.5-.5h-13z"/>
</svg> Project
</h6>
<p>
2nd year project, consisting of making a To do List in php
, which contains visitors or users, who can add,
delete, see tasks...
</p>
</div>
<!-- Grid column -->
<!-- Grid column -->
<div class="col-md-2 col-lg-2 col-xl-2 mx-auto mb-4">
<!-- Links -->
<h6 class="text-uppercase fw-bold mb-4">
Products
</h6>
<p>
<img src="https://img.shields.io/badge/HTML-000?style=for-the-badge&logo=html5&logoColor=orange&color=f8f9fa">
</img>
</p>
<p>
<img src="https://img.shields.io/badge/CSS-000?style=for-the-badge&logo=Css3&logoColor=blue&color=f8f9fa">
</img>
</p>
<p>
<img src="https://img.shields.io/badge/PHP-000?style=for-the-badge&logo=php&logoColor=purple&color=f8f9fa">
</img>
</p>
<p>
<img src="https://img.shields.io/badge/JavaScript-000?style=for-the-badge&logo=javascript&logoColor=yellow&color=f8f9fa">
</img>
</p>
</div>
<!-- Grid column -->
<!-- Grid column -->
<div class="col-md-4 col-lg-3 col-xl-3 mx-auto mb-md-0 mb-4">
<!-- Links -->
<h6 class="text-uppercase fw-bold mb-4">Contact</h6>
<p>
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" fill="currentColor" class="bi bi-envelope" viewBox="0 0 16 16">
<path d="M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4Zm2-1a1 1 0 0 0-1 1v.217l7 4.2 7-4.2V4a1 1 0 0 0-1-1H2Zm13 2.383-4.708 2.825L15 11.105V5.383Zm-.034 6.876-5.64-3.471L8 9.583l-1.326-.795-5.64 3.47A1 1 0 0 0 2 13h12a1 1 0 0 0 .966-.741ZM1 11.105l4.708-2.897L1 5.383v5.722Z"/>
</svg>
emre.kartal@etu.uca.fr
</p>
<p>
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" fill="currentColor" class="bi bi-envelope" viewBox="0 0 16 16">
<path d="M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4Zm2-1a1 1 0 0 0-1 1v.217l7 4.2 7-4.2V4a1 1 0 0 0-1-1H2Zm13 2.383-4.708 2.825L15 11.105V5.383Zm-.034 6.876-5.64-3.471L8 9.583l-1.326-.795-5.64 3.47A1 1 0 0 0 2 13h12a1 1 0 0 0 .966-.741ZM1 11.105l4.708-2.897L1 5.383v5.722Z"/>
</svg>
rayhan.hassou@etu.uca.fr
</p>
<p><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pin" viewBox="0 0 16 16">
<path d="M4.146.146A.5.5 0 0 1 4.5 0h7a.5.5 0 0 1 .5.5c0 .68-.342 1.174-.646 1.479-.126.125-.25.224-.354.298v4.431l.078.048c.203.127.476.314.751.555C12.36 7.775 13 8.527 13 9.5a.5.5 0 0 1-.5.5h-4v4.5c0 .276-.224 1.5-.5 1.5s-.5-1.224-.5-1.5V10h-4a.5.5 0 0 1-.5-.5c0-.973.64-1.725 1.17-2.189A5.921 5.921 0 0 1 5 6.708V2.277a2.77 2.77 0 0 1-.354-.298C4.342 1.674 4 1.179 4 .5a.5.5 0 0 1 .146-.354zm1.58 1.408-.002-.001.002.001zm-.002-.001.002.001A.5.5 0 0 1 6 2v5a.5.5 0 0 1-.276.447h-.002l-.012.007-.054.03a4.922 4.922 0 0 0-.827.58c-.318.278-.585.596-.725.936h7.792c-.14-.34-.407-.658-.725-.936a4.915 4.915 0 0 0-.881-.61l-.012-.006h-.002A.5.5 0 0 1 10 7V2a.5.5 0 0 1 .295-.458 1.775 1.775 0 0 0 .351-.271c.08-.08.155-.17.214-.271H5.14c.06.1.133.191.214.271a1.78 1.78 0 0 0 .37.282z"/>
</svg> Groupe 4</p>
</div>
<!-- Grid column -->
</div>
<!-- Grid row -->
</div>
</section>
<!-- Section: Links -->
<!-- Copyright -->
<div class="text-center p-4" style="background-color: rgba(0, 0, 0, 0.05);">
© 2021 Copyright:
<a class="text-reset fw-bold" href="#">ToDoList.com</a>
</div>
<!-- Copyright -->
</footer>
</html>

@ -1,14 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="shortcut icon" href="./vue/Images/gif.gif" type="../Images/gif">
<link rel="shortcut icon" href="./vue/Images/c.gif" type="../Images/gif">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Home Page</title>
<!-- 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/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="./vue/css/task.css">
<!-- JavaScript Bundle with Popper -->
<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>
@ -114,14 +113,24 @@
</button>
</div>
<div class="modal-body row">
<form class="col" method="POST" >
<form class="col" method="POST">
<div class="form-group">
<?php
if(isset($dVueErreur['nom'])){?>
<center><p class="text-danger"> <?php echo $dVueErreur['nom']?></p></center><?php
}
?>
<label for="nom" class="form-control-label">Nom</label>
<input type="text" class="form-control" name ="nom-ajout" id="nom" placeholder="Entrez un nom" required autofocus>
<input type="text" class="form-control" name ="nom-ajout" id="nom" placeholder="Entrez un nom">
</div>
<div class="form-group">
<?php
if(isset($dVueErreur['description'])){?>
<center><p class="text-danger"> <?php echo $dVueErreur['description']?></p></center><?php
}
?>
<label for="description" class="form-control-label">Description</label>
<input type="text" class="form-control" name="description-ajout" id="description" placeholder="Entrez une description" required autofocus>
<input type="text" class="form-control" name="description-ajout" id="description" placeholder="Entrez une description">
</div>
<button type="submit" class="btn btn-primary pull-right">Ajouter</button>
<input type="hidden" name="action" value="AjouterTache">
@ -148,10 +157,20 @@
<div class="modal-body row">
<form class="col" method="POST">
<div class="form-group">
<?php
if(isset($dVueErreur['nom'])){?>
<center><p class="text-danger"> <?php echo $dVueErreur['nom']?></p></center><?php
}
?>
<label for="nom" class="form-control-label">Nouveau nom</label>
<input type="text" class="form-control" name ="nom-modif-liste" id="nom" placeholder="<?= $liste->getNom() ?>">
</div>
<div class="form-group">
<?php
if(isset($dVueErreur['description'])){?>
<center><p class="text-danger"> <?php echo $dVueErreur['description']?></p></center><?php
}
?>
<label for="description" class="form-control-label">Nouvelle description</label>
<input type="text" class="form-control" name="description-modif-liste" id="description" placeholder="<?= $liste->getDescription() ?>">
</div>
@ -177,23 +196,19 @@
}
$total = $total + 1;
?>
<li class="list-group-item border-0 d-flex align-items-center ps-0">
<form name="action" action="index.php?action=check" method="POST">
<input class="form-check-input me-3" id="task-<?= $tache->getId() ?>" type="checkbox" onChange="submit();"
<input class="form-check-input me-3" type="checkbox" onChange="submit();"
<?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() ?>" >
</form>
<?= $tache->getNom() ?> : <?= $tache->getDescription() ?>
<a href="index.php?action=SupprimerTache&idTache=<?= $tache->getId() ?>">
<button class="btn btn-default">
<img src="./vue/Images/trash2.png" width="20" />
<img src="./vue/Images/trash.png" width="18" />
</button>
</a>
<button type="submit" class="btn btn-default">
<img src="./vue/Images/edit.png" width="18" />
</button>
</li>
<?php
}
@ -220,15 +235,12 @@
?>
<nav aria-label="Page navigation example">
<center>
<p>Page n°<?php echo $_COOKIE['page'] ?></p>
</center>
<ul class="pagination justify-content-center">
<li class="page-item">
<a class="page-link" href="previousPage">Previous</a>
</li>
<a class="page-link" href="#">Previous</a>
</li>
<li class="page-item">
<a class="page-link" href="nextPage">Next</a>
<a class="page-link" href="#">Next</a>
</li>
</ul>
</nav>

Loading…
Cancel
Save