Mathilde JEAN 2 years ago
commit 2a7b0e0572

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

@ -40,7 +40,7 @@ class Autoload
$filename = $class.'.php'; $filename = $class.'.php';
$dir = array('./','config/','controleurs/','modeles/Gateways/','modeles/Métier/','modeles/Modele/'); $dir = array('./','config/','controleurs/','modeles/Gateways/','modeles/Métier/','modeles/Modele/');
foreach ($dir as $d){ foreach ($dir as $d){
$file=$rep.$d.$filename; $file=$rep.$d.$filename;
if (file_exists($file)) if (file_exists($file))
{ {
include $file; include $file;

@ -3,57 +3,47 @@
class Validation { class Validation {
static function val_connexion($usrName,$mdp,$dataVueEreur) { static function val_connexion($usrName,$mdp,$dataVueEreur) {
if (!isset($usrName)||$usrName=="") { if (!isset($usrName)||$usrName=="") {
$dataVueEreur[] ="Nom d'utilisateur manquant"; $dataVueEreur[] ="Username or password missing";
throw new Exception('pas de username');
} }
$usrName = Validation::clear_string($usrName); $usrName = Validation::clear_string($usrName);
if($usrName == false){ if($usrName == false){
$dataVueEreur[] = "Sanitizing error"; $dataVueEreur[] = "Sanitizing error";
throw new Exception('sanitizing fail');
} }
if (!isset($mdp)||$mdp=="") { if (!isset($mdp)||$mdp=="") {
$dataVueEreur[] ="Mot de passe manquant"; $dataVueEreur[] ="Username or password missing";
throw new Exception('pas de password');
} }
$mdp = Validation::clear_string($mdp); $mdp = Validation::clear_string($mdp);
if($mdp == false){ if($mdp == false){
$dataVueEreur[] = "Sanitizing error"; $dataVueEreur[] = "Sanitizing error";
throw new Exception('sanitizing fail');
} }
return $dataVueEreur; return $dataVueEreur;
} }
static function val_inscription($dataVueEreur){ static function val_inscription($username,$pwd1,$pwd2,$dataVueEreur){
if (!isset($_POST['username'])||$_POST['username']==="") { if (!isset($username)||$username==="") {
$dataVueEreur[] ="Nom d'utilisateur manquant"; $dataVueEreur[] ="All fields are required";
throw new Exception('pas de username');
} }
$_POST['username'] = Validation::clear_string($_POST['username']); $_POST['username'] = Validation::clear_string($_POST['username']);
if($_POST['username'] == false){ if($_POST['username'] == false){
$dataVueEreur[] = "Sanitizing error"; $dataVueEreur[] = "Sanitizing error";
throw new Exception('sanitizing fail'); throw new Exception('sanitizing fail');
} }
if (!isset($_POST['username'])||$_POST['username']==="") { if (!isset($pwd1)||$pwd1==="") {
$dataVueEreur[] ="Mot de passe manquant"; $dataVueEreur[] ="All fields are required";
throw new Exception('pas de password');
} }
$_POST['password'] = Validation::clear_string($_POST['password']); $_POST['password'] = Validation::clear_string($_POST['password']);
if($_POST['password'] == false){ if($_POST['password'] == false){
$dataVueEreur[] = "Sanitizing error"; $dataVueEreur[] = "Sanitizing error";
throw new Exception('sanitizing fail');
} }
if (!isset($_POST['confirmpassword'])||$_POST['confirmpassword']==="") { if (!isset($pwd2)||$pwd2==="") {
$dataVueEreur[] ="Confirmation mot de passe manquant"; $dataVueEreur[] ="All fields are required";
throw new Exception('pas de confirmation password');
} }
$_POST['confirmpassword'] = Validation::clear_string($_POST['confirmpassword']); $_POST['confirmpassword'] = Validation::clear_string($_POST['confirmpassword']);
if($_POST['confirmpassword'] == false){ if($_POST['confirmpassword'] == false){
$dataVueEreur[] = "Sanitizing error"; $dataVueEreur[] = "Sanitizing error";
throw new Exception('sanitizing fail');
} }
if($_POST['password'] !== $_POST['confirmpassword']){ if($pwd1 !== $pwd2){
$dataVueEreur[]="Mot de passe et confirmation différents"; $dataVueEreur[]="Invalid confirmation";
throw new Exception("Mot de passe et confirmation différents");
} }
return $dataVueEreur; return $dataVueEreur;
} }

@ -3,7 +3,7 @@
//Prefixe //Prefixe
$rep=__DIR__.'/../'; $rep=__DIR__.'/../';
//BD //BD
$bd['dsn'] = "mysql:host=localhost;port=8888;dbname=bdPhp"; $bd['dsn'] = "mysql:host=localhost;port=8888;dbname=dbPhp";
$bd['user'] = "root"; $bd['user'] = "root";
$bd['pswd'] = "root"; $bd['pswd'] = "root";
//Vues //Vues
@ -16,11 +16,14 @@ $vues['listesPrivees']='vues/listesPrivees.php';
$vues['creationListe']='vues/creationListe.php'; $vues['creationListe']='vues/creationListe.php';
$vues['infosListe']='vues/infosListe.php'; $vues['infosListe']='vues/infosListe.php';
$vues['creationTache']='vues/creationTache.php'; $vues['creationTache']='vues/creationTache.php';
// Styles // Styles
$styles['commun']='styles/commonStyles.css'; $styles['commun']='styles/commonStyles.css';
$styles['connection']='styles/connectionStyle.css'; $styles['acceuil']='styles/acceuilStyles.css';
$styles['connection']='styles/connectionStyles.css';
$styles['listesPv']="styles/privateListsStyles.css";
// Assets // Assets
$assets['logo']='assets/chekliste.png'; $assets['logo']='assets/logo.png';
?> ?>

@ -6,38 +6,21 @@ class ControleurUtilisateur{
global $rep,$vues, $dataView,$styles,$assets; global $rep,$vues, $dataView,$styles,$assets;
$arrayErrorViews= array(); $arrayErrorViews= array();
$action = $_REQUEST['action']??null; $action = $_REQUEST['action'];
switch($action){ switch($action){
case "accessPrivateLists": case "accessPrivateLists":
$this->accessPrivateLists($arrayErrorViews); $this->accessPrivateLists($arrayErrorViews);
case "accessProfilePage":
require($rep.$vues['profile']);
break;
case "deconnection":
$this->deconnection($arrayErrorViews);
break;
case "creerListePv": case "creerListePv":
$this->creerListe($arrayErrorViews); $this->creerListe($arrayErrorViews);
break; break;
case "desinscription": default:
$this->desinctription($arrayErrorViews);
break;
case "changerInfos":
$this->changerPassword($arrayErrorViews);
break;
default :
$arrayErrorViews[]="Erreur innatendue !!!"; $arrayErrorViews[]="Erreur innatendue !!!";
require($rep.$vues['error']); require($rep.$vues['error']);
} }
} }
function deconnection($arrayErrorViews){
global $rep, $vues, $dataView;
$model = new UserModel();
$retour = $model->deconnection();
$_REQUEST['action']=null;
$control= new ControleurVisiteur();
}
function creerListePv($arrayErrorViews){ function creerListePv($arrayErrorViews){
global $rep, $vues, $dataView; global $rep, $vues, $dataView;
@ -67,21 +50,6 @@ class ControleurUtilisateur{
} }
} }
function changerPassword($arrayErrorViews){
global $rep, $vues, $dataView;
$password1=$_POST['password1'];
$passwordConfirm=$_POST['passwordConfirm'];
$newPassword=Validation::val_changer_password($password1,$passwordConfirm);
try{
UserModel::changerPassword($newPassword);
require($rep.$vues['profil']);
}catch(PDOException $e){
$dataView[]="Erreur inatendue";
require($rep.$vues['erreur']);
}
}
function accessPrivateLists($arrayErrorViews){ function accessPrivateLists($arrayErrorViews){
global $rep, $vues, $dataView; global $rep, $vues, $dataView;
$model = new UserModel(); $model = new UserModel();

@ -50,6 +50,9 @@ class ControleurVisiteur {
case "delListe": case "delListe":
$this->delListe($arrayErrorViews); $this->delListe($arrayErrorViews);
break; break;
case "deconnection":
$this->deconnection($arrayErrorViews);
break;
default : default :
$arrayErrorViews[]="Erreur innatendue !!!"; $arrayErrorViews[]="Erreur innatendue !!!";
require($rep.$vues['acceuil']); require($rep.$vues['acceuil']);
@ -61,6 +64,15 @@ class ControleurVisiteur {
exit(0); exit(0);
} }
function deconnection($arrayErrorViews){
global $rep, $vues, $dataView;
$model = new UserModel();
$retour = $model->deconnection();
$_REQUEST['action']=null;
$control= new ControleurVisiteur();
}
public function reinit(){ public function reinit(){
global $rep,$vues,$dataView,$styles; global $rep,$vues,$dataView,$styles;
$model = new VisiteurModel(); $model = new VisiteurModel();
@ -111,6 +123,9 @@ class ControleurVisiteur {
$usrname=$_POST['login']; $usrname=$_POST['login'];
$pwd=$_POST['mdp']; $pwd=$_POST['mdp'];
$vues_erreur=Validation::val_connexion($usrname,$pwd,$vues_erreur); $vues_erreur=Validation::val_connexion($usrname,$pwd,$vues_erreur);
if(!empty($vues_erreur)){
require($rep.$vues['connection']);
}
$model= new VisiteurModel(); $model= new VisiteurModel();
if($model->existUser($usrname)){ if($model->existUser($usrname)){
if(password_verify($pwd,$model->getHashedPassword($usrname))){ if(password_verify($pwd,$model->getHashedPassword($usrname))){
@ -119,26 +134,34 @@ class ControleurVisiteur {
$this->reinit(); $this->reinit();
} }
else{ else{
echo 'mauvais passwd verify'; $vues_erreur =array('username'=>$usrname,'password'=>$pwd);
$arrayErrorViews =array('username'=>$usrname,'password'=>$pwd); require($rep.$vues['connection']);
require($rep.$vues['erreur']);
} }
} }
else{ else{
echo 'mauvais user'; $vues_erreur =array('username'=>$usrname,'password'=>$pwd);
$arrayErrorViews =array('username'=>$usrname,'password'=>$pwd); require($rep.$vues['connection']);
require($rep.$vues['erreur']);
} }
} }
public function inscription(array $vues_erreur){ public function inscription(array $vues_erreur){
global $rep,$vues,$dataView; global $rep,$vues,$dataView;
$vues_erreur=Validation::val_inscription($vues_erreur); $usrname=$_POST['username'];
if($vues_erreur == []){ $pwd=$_POST['password'];
$confirm=$_POST['confirmpassword'];
$model = new VisiteurModel();
$vues_erreur=Validation::val_inscription($usrname,$pwd,$confirm,$vues_erreur);
if($model->existUser($usrname)){
$vues_erreur[]="Username already taken";
}
if(empty($vues_erreur)){
$hash= password_hash($pwd,PASSWORD_DEFAULT); $hash= password_hash($pwd,PASSWORD_DEFAULT);
$model = new VisiteurModel(); $model->inscription($usrname,$hash);
$model->inscription($_POST['username'],$hash); }
else{
require($rep.$vues['inscription']);
} }
$_REQUEST['action']=null; $_REQUEST['action']=null;
new ControleurVisiteur(); new ControleurVisiteur();
} }

@ -3,13 +3,13 @@
class FrontControleur{ class FrontControleur{
public function __construct(){ public function __construct(){
$liste_actions_utilisateur = array('accessPrivateLists','accessProfilePage','deconnection','crerListePv','desinscription','changerPassword'); $liste_actions_utilisateur = array('accessPrivateLists','crerListePv');
$liste_actions_visiteur = array('goHome','changeCompletedTache','accessCreationTachePage','addTache','delTache','accessListInfos','accessCreationListePage','accessInscription','accessConnectionPage','creerListe','delListe','connection','inscription'); $liste_actions_visiteur = array('goHome','changeCompletedTache','accessCreationTachePage','addTache','delTache','accessListInfos','accessCreationListePage','accessInscription','accessConnectionPage','creerListe','delListe','connection','inscription','deconnection');
global $rep,$vues,$bd,$dataView,$styles,$assets; global $rep,$vues,$bd,$dataView,$styles,$assets;
session_start(); session_start();
try{ try{
$user=$_SESSION??null; $user=$_SESSION??null;
$action = !empty($_REQUEST['action']) ? (string)$_REQUEST['action']:null; $action = $_REQUEST['action'];
if (in_array($action,$liste_actions_utilisateur)){ if (in_array($action,$liste_actions_utilisateur)){
if($user == null){ if($user == null){

@ -8,23 +8,6 @@ require_once(__DIR__.'/config/config.php');
require_once(__DIR__.'/config/Autoload.php'); require_once(__DIR__.'/config/Autoload.php');
Autoload::charger(); Autoload::charger();
/*
require_once(__DIR__.'/config/Validation.php');
require_once(__DIR__.'/controleurs/ControleurUtilisateur.php');
require_once(__DIR__.'/controleurs/ControleurVisiteur.php');
require_once(__DIR__.'/controleurs/FrontControleur.php');
require_once(__DIR__.'/modeles/Gateways/Connection.php');
require_once(__DIR__.'/modeles/Gateways/ListeGateway.php');
require_once(__DIR__.'/modeles/Gateways/UserGateway.php');
require_once(__DIR__.'/modeles/Métier/Liste.php');
require_once(__DIR__.'/modeles/Métier/Tache.php');
require_once(__DIR__.'/modeles/Métier/Utilisateur.php');
require_once(__DIR__.'/modeles/Modele/UserModel.php');
require_once(__DIR__.'/modeles/Modele/VisiteurModel.php');
require_once(__DIR__.'/modeles/Modele/ListModel.php');
*/
// Construction du controleur // Construction du controleur
//$cont=new FrontControleur(); //$cont=new FrontControleur();
$cont= new FrontControleur(); $cont= new FrontControleur();

@ -1,10 +1,10 @@
<?php <?php
class Liste { class Liste {
public int $id; private int $id;
public string $nom; private string $nom;
public ?string $nomCreateur; private ?string $nomCreateur;
public ?array $taches; private ?array $taches;
function __construct(int $i, string $n, ?string $nomCrea,?array $t){ function __construct(int $i, string $n, ?string $nomCrea,?array $t){
$this->id=$i; $this->id=$i;
@ -12,6 +12,22 @@ class Liste {
$this->nomCreateur=$nomCrea; $this->nomCreateur=$nomCrea;
$this->taches=$t; $this->taches=$t;
} }
public function get_id():int{
return $this->id;
}
public function get_nom():string{
return $this->nom;
}
public function get_nomCreateur():string{
return $this->nomCreateur;
}
public function get_taches():?array{
return $this->taches;
}
} }
?> ?>

@ -1,17 +1,33 @@
<?php <?php
Class Tache { Class Tache {
public int $id; private int $id;
public string $nom; private string $nom;
public bool $isCompleted; private bool $isCompleted;
public int $idListe; private int $idListe;
function __construct(int $i, string $in, bool $is, int $idListe){ public function __construct(int $i, string $in, bool $is, int $idListe){
$this->id = $i; $this->id = $i;
$this->nom = $in; $this->nom = $in;
$this->isCompleted = $is; $this->isCompleted = $is;
$this->idListe=$idListe; $this->idListe=$idListe;
} }
public function get_id():int{
return $this->id;
}
public function get_nom():string{
return $this->nom;
}
public function get_isCompleted():bool{
return $this->isCompleted;
}
public function get_idListe():int{
return $this->idListe;
}
} }
?> ?>

@ -10,9 +10,7 @@ Class Utilisateur {
$this->password=$p; $this->password=$p;
$this->listListe=$liste; $this->listListe=$liste;
} }
function get_id(): int {
return $this->id;
}
function get_nom(): string { function get_nom(): string {
return $this->nom; return $this->nom;
} }

@ -0,0 +1,69 @@
.head-body{
display:flex;
flex-direction: row;
height: 100px;
margin-bottom: 50px;
place-content: end space-between;
align-items: center;
}
.connection{
width: 125px;
padding: 15%;
background: none;
font-family: sans-serif;
font-size: 20;
color: #212F3D;
border: solid 2px;
border-radius: 10px;
border-color: #212F3D;
}
.deconnection{
width: 125px;
padding: 15%;
border: none;
color:#B2BABB;
background-color: #212F3D;
font-family: sans-serif;
border-radius: 10px;
}
#accessList{
color: #212F3D;
background-color: #E4F8FF;
margin: 2%;
padding: 3%;
border-radius: 30px;
display: flex;
place-content: end space-between;
}
.private-lists{
background: none;
border:none;
color: #212F3D;
background-color: #F7F9F9;
font-family: sans-serif;
font-size: 25;
padding : 40px;
border-radius: 25px;
}
.create-list{
margin-top: 2%;
background: none;
border:none;
color: #212F3D;
background-color: #F7F9F9;
font-family: sans-serif;
font-size: 25;
padding : 40px;
border-radius: 50px;
margin-left: 25%;
width: 50%;
}
.private-lists:hover{
background-color: #E4F8FF;
}

@ -1,26 +1,80 @@
header{ header{
padding-top: 2%;
padding-bottom: 2%;
height: 5%;
width: 100%;
background:none;
display: flex; display: flex;
flex-direction: row; justify-content: center;
background-color: #0971C9; align-items: center;
vertical-align: middle;
place-content: start space-evenly;
} }
body{ body{
background-color: #0D2350; display: flex;
flex-direction: column;
align-items: center;
align-content: center;
}
h1{
font-family: sans-serif;
font-size: 30;
}
h2{
margin-top: 35px;
font-family: sans-serif;
font-size: 25;
color: #E4F8FF;
}
.body{
animation: changeColor 5s infinite alternate linear;
width: 81%;
padding-left: 10%;
padding-right: 10%;
padding-bottom: 10%;
padding-top: 5%;
display: flex;
flex-direction: column;
} }
h1, h2, h3, h4, p{
@keyframes changeColor{
0% {
background-color: #004D67;
}
25% {
background: #005F80;
}
50%{
background: #007198;
}
75%{
background: #0081AD;
}
100%{
background: #0089B8;
}
}
h4{
margin-left: 5%;
align-self: center;
font-size: 20;
font-family: sans-serif; font-family: sans-serif;
font-weight: bolder; color: #212F3D;
color: #FFFEFD;
} }
.button{ .button{
width: 50%; border: none;
height: 100%; color:#B2BABB;
background-color: #FFFEFD; background-color: #212F3D;
border-radius: 20%; font-family: sans-serif;
border-color: #0971C9; padding:30px;
color: #0D2350; border-radius: 20px;
}
}
.button:hover{ #GoHome > input[type="image"] {
background-color: grey; height: 50px;
width: 50px;
} }

@ -0,0 +1,66 @@
.body{
align-items: center;
}
header{
place-content: start center;
}
h1{
margin-left: 5%;
}
#error{
margin-top: 5%;
margin-bottom: -5%;
margin-left: 29%;
}
#connectionForm{
background-color: #E4F8FF;
width: 50%;
padding: 5%;
border-radius: 50px;
place-content: start center;
}
#connectionForm > input[type="text"]{
width: 60%;
height: 40px;
margin-left: 20%;
border-radius: 10px;
border: 1px solid #212F3D;
margin-bottom: 3%;
}
#connectionForm > input[type="password"]{
width: 60%;
height: 40px;
margin-left: 20%;
border-radius: 10px;
border: 1px solid #212F3D;
margin-bottom: 3%;
}
.button{
border-radius: 50px;
width: 50%;
margin-left: 25%;
margin-top: 10%;
}
.accesInscription{
margin-top: 2%;
background: none;
border:none;
color: #212F3D;
background-color: #F7F9F9;
font-family: sans-serif;
font-size: 25;
padding-left : 100px;
padding-right : 100px;
padding-top:30px;
padding-bottom:30px;
border-radius: 50px;
width: 100%;
}

@ -0,0 +1,46 @@
header{
place-content: start center;
}
h1{
margin-left: 5%;
}
.body{
align-items: center;
}
#creationForm{
background-color: #E4F8FF;
width: 50%;
padding: 5%;
border-radius: 50px;
place-content: start center;
}
#creationForm > input[type="text"]{
width: 60%;
height: 40px;
margin-left: 20%;
border-radius: 10px;
border: 1px solid #212F3D;
margin-bottom: 3%;
}
label{
font-family: sans-serif;
font-weight: bold;
font-size: 20;
color: #212F3D;
}
p{
margin-left: 5%;
}
.button{
border-radius: 50px;
width: 50%;
margin-left: 25%;
margin-top: 10%;
}

@ -0,0 +1,61 @@
header{
place-content: start center;
}
h1{
margin-left: 5%;
}
#delTache > input[type='image']{
height: 50px;
width: 50px;
}
#check > input[type='image']{
height: 50px;
width: 50px;
}
#uncheck > input[type='image']{
height: 50px;
width: 50px;
}
.tache{
color: #212F3D;
background-color: #E4F8FF;
margin: 2%;
padding: 3%;
border-radius: 30px;
display: flex;
place-content: end space-between;
}
.add-task{
margin-top: 2%;
background: none;
border:none;
color: #212F3D;
background-color: #F7F9F9;
font-family: sans-serif;
font-size: 25;
padding : 40px;
border-radius: 50px;
margin-left: 25%;
width: 50%;
}
.del-list{
margin-top: 2%;
background: none;
border:none;
color: #212F3D;
background-color: #F7F9F9;
font-family: sans-serif;
font-size: 25;
padding : 25px;
border-radius: 50px;
margin-left: 35%;
width: 30%;
}

@ -0,0 +1,8 @@
header{
place-content: start center;
}
h1{
margin-left: 5%;
}

@ -3,64 +3,70 @@
<head> <head>
<title>Acceuil</title> <title>Acceuil</title>
<link rel="stylesheet" href="<?= $styles['commun'] ?>"> <link rel="stylesheet" href="styles/commonStyles.css"/>
<link rel="stylesheet" href="styles/acceuilStyles.css"/>
</head> </head>
<body> <body>
<header> <header>
<h1>Welcome to our fantastic to do list app !</h1> <form method="POST" name="goBackHome" id="GoHome">
<?php <input type="image" src="assets/logo.png"/>
if(!isset($_SESSION['login'])){ <input type="hidden" name="action" value="goHome"/>
echo ' </form>
<div> <h1>To-do</h1>
<form method="post" name="connection" id="connection"> <?php
<input class="button" type="submit" value="Connection"/> if(!isset($_SESSION['login'])){
<input type="hidden" name="action" value="accessConnectionPage"/> echo '
</form> <form method="post" name="connection" id="connection">
</div>'; <input class="connection" type="submit" value="Connection"/>
} <input type="hidden" name="action" value="accessConnectionPage"/>
else{ </form>';
echo' }
<div> else{
<form method="post" name="profil" id="profil"> echo'
<input class="button" type="submit" value="Profile"/>
<input type="hidden" name="action" value="accessProfilePage"/>
</form>
</div>';
}?>
</header>
<?php if(isset($_SESSION['login'])){
echo '
<div> <div>
<form method="post" name="listesPv" id="listesPv"> <form method="post" name="deconnection" id="deconnection">
<input class="button" type="submit" value="Access private lists"/> <input class="deconnection" type="submit" value="Deconnection"/>
<input type="hidden" name="action" value="accessPrivateLists"/> <input type="hidden" name="action" value="deconnection"/>
</form> </form>
</div>'; </div>';
}?> }?>
</header>
<div> <div class="body">
<div class="head-body">
<h2>Public Lists</h2> <h2>Public Lists</h2>
<?php <?php if(isset($_SESSION['login'])){
if(isset($dataView)) { echo '
foreach ($dataView as $liste){ <div>
echo ' <form method="post" name="listesPv" id="listesPv">
<div> <input class="private-lists" type="submit" value="Private Lists"/>
<form method="post" name="accessList" id="accessList"> <input type="hidden" name="action" value="accessPrivateLists"/>
<p>• '.$liste->nom.' </form>
<input type="submit" value="View List"/></p> </div>';
<input type="hidden" name="action" value="accessListInfos"/> }?>
<input type="hidden" name="liste" value="'.$liste->id.'"/> </div>
</form> <?php
</div>'; if(isset($dataView)) {
} foreach ($dataView as $liste){
echo '
<div>
<form method="post" name="accessList" id="accessList">
<h4>• '.$liste->get_nom().'</h4>
<input class="button" type="submit" value="View List"/>
<input type="hidden" name="action" value="accessListInfos"/>
<input type="hidden" name="liste" value="'.$liste->get_id().'"/>
</form>
</div>';
} }
?> }
<div> ?>
<form method="post" name="createList" id="createList">
<input class="button" type="submit" value="Create List"/> <div>
<input type="hidden" name="action" value="accessCreationListePage"/> <form method="post" name="createList" id="createList">
</form> <input class="create-list" type="submit" value="Create List"/>
</div> <input type="hidden" name="action" value="accessCreationListePage"/>
</form>
</div> </div>
</div>
</body> </body>
</html> </html>

@ -2,36 +2,39 @@
<html> <html>
<head> <head>
<title>connection</title> <title>connection</title>
<link rel="stylesheet" href="styles/commonStyles.css"> <link rel="stylesheet" href="styles/commonStyles.css"/>
<link rel="stylesheet" href="styles/connectionStyles.css"/>
</head> </head>
<body> <body>
<header> <header>
<h1>You are back ?!</h1> <form method="POST" name="goBackHome" id="GoHome">
<form method="POST" name="goBackHome" id="Go Home"> <input type="image" src="assets/logo.png"/>
<input type="submit" value="Home Page"/>
<input type="hidden" name="action" value="goHome"/> <input type="hidden" name="action" value="goHome"/>
</form> </form>
<h1>You are back ?!</h1>
</header> </header>
<div> <div class="body">
<form method="POST" name="connectionForm" id="connectionForm"> <form method="POST" name="connectionForm" id="connectionForm">
<p>Login <h4>Username</h4>
<input type="text" name="login" required/></p> <input type="text" name="login" required/>
<p>Password <h4>Password</h4>
<input type="password" name="mdp" required/></p> <input type="password" name="mdp" required/>
<br/> <?php
<br/> if(isset($vues_erreur)){
echo '<h4 id="error">Incorrect Username or Password</h4>';
}
?>
<input class="button" type="submit" value="Log In"/> <input class="button" type="submit" value="Log In"/>
<input type="hidden" name="action" value="connection"> <input type="hidden" name="action" value="connection">
</form> </form>
<br/> <br/>
<br/> <br/>
</div> <h2>You are new here?</h2>
<div> <form method="POST" name="accessInscription" id="accesInscription">
<form method="POST" name="accessInscription" id="accesInscription"> <input class="accesInscription" type="submit" value="Sign Up"/>
<h2>You are new here?</h2>
<input class="button" type="submit" value="Sign Up"/>
<input type="hidden" name="action" value="accessInscription"> <input type="hidden" name="action" value="accessInscription">
</form> </form>
</div> </div>
</body> </body>
</html> </html>

@ -1,15 +1,29 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>
<title>creationListe</title>
<link rel="stylesheet" href="<?=$styles['commun']?>"/>
<link rel="stylesheet" href="styles/creationStyles.css"/>
</head>
<body> <body>
<div> <header>
<h3>Create a new list</h3> <form method="POST" name="goBackHome" id="GoHome">
<form method="POST" name="creaListe" id="creaListe"> <input type="image" src="assets/logo.png"/>
<p>Name of the list <input type="hidden" name="action" value="goHome"/>
<input type="text" name="name" id="name" required/></p> </form>
<h1>Create a new list</h1>
</header>
<div class="body">
<form method="post" name="creationForm" id="creationForm">
<h4>Name of the list</h4>
<input type="text" name="name" id="name" required/>
<?php <?php
if(isset($_SESSION['login'])){ if(isset($_SESSION['login'])){
echo '<input type="checkbox" id="private" name="private"> echo '<p>
<label for="private">Private List?</label>'; <input type="checkbox" id="private" name="private">
<label for="private">Private List?</label>
</p>
';
} }
?> ?>
<input class="button" type="submit" value="Create List"/> <input class="button" type="submit" value="Create List"/>

@ -1,12 +1,23 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>
<title>creationTache</title>
<link rel="stylesheet" href="<?=$styles['commun']?>">
<link rel="stylesheet" href="styles/creationStyles.css">
</head>
<body> <body>
<div> <header>
<h3>Create a new list</h3> <form method="POST" name="goBackHome" id="GoHome">
<form method="POST" name="creaListe" id="creaListe"> <input type="image" src="assets/logo.png"/>
<p>Name of the task <input type="hidden" name="action" value="goHome"/>
<input type="text" name="name" id="name" required/></p> </form>
<input class="button" type="submit" value="Create Tache"/> <h1>Create a new task</h1>
</header>
<div class="body">
<form method="post" name="creationForm" id="creationForm">
<h4>Name of the task</h4>
<input type="text" name="name" id="name" required/>
<input class="button" type="submit" value="Create"/>
<input type="hidden" name="action" value="addTache"/> <input type="hidden" name="action" value="addTache"/>
<input type="hidden" name="liste" value="<?=$dataView?>"/> <input type="hidden" name="liste" value="<?=$dataView?>"/>
</form> </form>

@ -1,63 +1,70 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<header> <head>
<h2><?=$dataView->nom?></h2> <title>detailList</title>
<form method="POST" name="goBackHome" id="Go Home"> <link rel="stylesheet" href="styles/commonStyles.css"/>
<input type="submit" value="Home Page"/> <link rel="stylesheet" href="styles/detailsListStyles.css"/>
<input type="hidden" name="action" value="goHome"/> </head>
</form>
</header>
<body> <body>
<div> <header>
<form method="POST" name="goBackHome" id="GoHome">
<input type="image" src="assets/logo.png"/>
<input type="hidden" name="action" value="goHome"/>
</form>
<h1><?=$dataView->get_nom()?></h1>
</header>
<div class="body">
<?php <?php
if (isset($dataView)) { if (isset($dataView)) {
if($dataView->taches != null){ if($dataView->get_taches() != null){
foreach($dataView->taches as $tache){ foreach($dataView->get_taches() as $tache){
if($tache->isCompleted == true){ if($tache->get_isCompleted() == true){
echo ' echo '
<input type="checkbox" id="tache'.$tache->id.'" name="tache'.$tache->id.'" value="'.$tache->id.'" disabled checked> <div class="tache">
<label for="tache'.$tache->id.'">'.$tache->nom.'</label> <form method="POST" id="check" name="check">
<form method="POST" id="check'.$tache->id.'" name="check'.$tache->id.'"> <input type="image" src="assets/done.png"/>
<input type="submit" value="Undo"/> <input type="hidden" name="action" value="changeCompletedTache"/>
<input type="hidden" name="action" value="changeCompletedTache"/> <input type="hidden" name="tache" value="'.$tache->get_id().'"/>
<input type="hidden" name="tache" value="'.$tache->id.'"/> <input type="hidden" name="liste" value="'.$dataView->get_id().'"/>
<input type="hidden" name="liste" value="'.$dataView->id.'"/> </form>
</form> <h4>'.$tache->get_nom().'</h4>
'; ';
} }
else{ else{
echo ' echo '
<input type="checkbox" id="tache'.$tache->id.'" name="tache'.$tache->id.'" value="'.$tache->id.'" disabled> <div class="tache">
<label for="tache'.$tache->id.'">'.$tache->nom.'</label> <form method="POST" id="uncheck" name="uncheck">
<form method="POST" id="uncheck'.$tache->id.'" name="uncheck'.$tache->id.'"> <input type="image" src="assets/to-do.png"/>
<input type="submit" value="Done"/> <input type="hidden" name="action" value="changeCompletedTache"/>
<input type="hidden" name="action" value="changeCompletedTache"/> <input type="hidden" name="tache" value="'.$tache->get_id().'"/>
<input type="hidden" name="tache" value="'.$tache->id.'"/> <input type="hidden" name="liste" value="'.$dataView->get_id().'"/>
<input type="hidden" name="liste" value="'.$dataView->id.'"/> </form>
</form> <h4>'.$tache->get_nom().'</h4>
'; ';
} }
echo ' echo '
<form method="POST" id="delTache'.$tache->id.'" name="delTache'.$tache->id.'"> <form method="POST" id="delTache" name="delTache">
<input type="submit" value="Delete"/> <input type="image" src="assets/bin.png"/>
<input type="hidden" name="action" value="delTache"/> <input type="hidden" name="action" value="delTache"/>
<input type="hidden" name="tache" value="'.$tache->id.'"/> <input type="hidden" name="tache" value="'.$tache->get_id().'"/>
<input type="hidden" name="liste" value="'.$dataView->id.'"/> <input type="hidden" name="liste" value="'.$dataView->get_id().'"/>
</form>'; </form>
</div>';
echo '<br/>'; echo '<br/>';
} }
} }
} }
?> ?>
<form method="POST" id="addTache" name="addTache"> <form method="POST" id="addTache" name="addTache">
<input type="submit" value="Add a Task"/></p> <input class="add-task" type="submit" value="Add a Task"/></p>
<input type="hidden" name="action" value="accessCreationTachePage"/> <input type="hidden" name="action" value="accessCreationTachePage"/>
<input type="hidden" name="liste" value="<?=$dataView->id?>"/> <input type="hidden" name="liste" value="<?=$dataView->get_id()?>"/>
</form> </form>
<form method="POST" id="delListe" name="delListe"> <form method="POST" id="delListe" name="delListe">
<input type="submit" value="Delete the list"/></p> <input class="del-list" type="submit" value="Delete the list"/></p>
<input type="hidden" name="action" value="delListe"/> <input type="hidden" name="action" value="delListe"/>
<input type="hidden" name="liste" value="<?=$dataView->id?>"/> <input type="hidden" name="liste" value="<?=$dataView->get_id()?>"/>
</form> </form>
</div> </div>
</body> </body>

@ -2,23 +2,31 @@
<html> <html>
<head> <head>
<title>connection</title> <title>connection</title>
<link rel="stylesheet" href="styles/commonStyles.css"> <link rel="stylesheet" href="styles/commonStyles.css"/>
<link rel="stylesheet" href="styles/connectionStyles.css"/>
</head> </head>
<body> <body>
<header> <header>
<form method="POST" name="goBackHome" id="GoHome">
<input type="image" src="assets/logo.png"/>
<input type="hidden" name="action" value="goHome"/>
</form>
<h1>Join the good side of the force</h1> <h1>Join the good side of the force</h1>
</header> </header>
<div> <div class="body">
<form method="POST" name="inscription" id="inscription"> <h2>Please enter all the informations :</h2>
<h2>Please enter all the informations :</h2> <form method="POST" name="inscription" id="connectionForm">
<p>Login <h4>Username</h4>
<input type="text" name="username" required/></p> <input type="text" name="username" required/>
<p>Password <h4>Password</h4>
<input type="password" name="password" required/></p> <input type="password" name="password" required/>
<p>Confirm Password <h4>Confirm Password</h4>
<input type="password" name="confirmpassword" required/></p> <input type="password" name="confirmpassword" required/>
<br/> <?php
if(isset($vues_erreur)){
echo '<h4 id="error">'.$vues_erreur[0].'</h4>';
}
?>
<input class="button" type="submit" value="Sign Up"/> <input class="button" type="submit" value="Sign Up"/>
<input type="hidden" name="action" value="inscription"/> <input type="hidden" name="action" value="inscription"/>
</form> </form>

@ -1,31 +1,44 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<header> <head>
<h2>Private Lists</h2> <title>Acceuil</title>
<form method="POST" name="goBackHome" id="Go Home"> <link rel="stylesheet" href="styles/commonStyles.css"/>
<input type="submit" value="Home Page"/> <link rel="stylesheet" href="styles/acceuilStyles.css"/>
<input type="hidden" name="action" value="goHome"/> <link rel="stylesheet" href="styles/privateListsStyles.css"/>
</form> </head>
</header>
<body> <body>
<div> <header>
<form method="POST" name="goBackHome" id="GoHome">
<input type="image" src="assets/logo.png"/>
<input type="hidden" name="action" value="goHome"/>
</form>
<h1>Private lists</h1>
</header>
<div class="body">
<?php <?php
if(isset($dataView)) { if(isset($dataView) && !empty($dataView)) {
foreach ($dataView as $liste){ foreach ($dataView as $liste){
echo ' echo '
<div> <div>
<form method="post" name="accessList" id="accessList"> <form method="post" name="accessList" id="accessList">
<p>• '.$liste->nom.' <h4>• '.$liste->get_nom().'</h4>
<input type="submit" value="View List"/></p> <input class="button" type="submit" value="View List"/>
<input type="hidden" name="action" value="accessListInfos"/> <input type="hidden" name="action" value="accessListInfos"/>
<input type="hidden" name="liste" value="'.$liste->id.'"/> <input type="hidden" name="liste" value="'.$liste->get_id().'"/>
</form> </form>
</div>'; </div>';
} }
} }
else{
echo '
<h2>You do not have any list for the moment</h2>';
}
?> ?>
<form method="post" name="createList" id="createList">
<input class="create-list" type="submit" value="Create List"/>
<input type="hidden" name="action" value="accessCreationListePage"/>
</form>
</div> </div>
</body> </body>
</html> </html>

@ -1,19 +0,0 @@
<!DOCTYPE html>
<html>
<header>
<h2>What you wanna do young padawan?</h2>
<form method="POST" name="goBackHome" id="Go Home">
<input type="submit" value="Home Page"/>
<input type="hidden" name="action" value="goHome"/>
</form>
</header>
<body>
<div>
<form method="POST" name="deconnection">
<input class="button" type="submit" value="Déconnection"/>
<input type="hidden" name="action" value="deconnection"/>
</form>
</div>
</body>
</html>
Loading…
Cancel
Save