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

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

@ -3,7 +3,7 @@
//Prefixe
$rep=__DIR__.'/../';
//BD
$bd['dsn'] = "mysql:host=localhost;port=8888;dbname=bdPhp";
$bd['dsn'] = "mysql:host=localhost;port=8888;dbname=dbPhp";
$bd['user'] = "root";
$bd['pswd'] = "root";
//Vues
@ -16,11 +16,14 @@ $vues['listesPrivees']='vues/listesPrivees.php';
$vues['creationListe']='vues/creationListe.php';
$vues['infosListe']='vues/infosListe.php';
$vues['creationTache']='vues/creationTache.php';
// Styles
$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['logo']='assets/chekliste.png';
$assets['logo']='assets/logo.png';
?>

@ -6,38 +6,21 @@ class ControleurUtilisateur{
global $rep,$vues, $dataView,$styles,$assets;
$arrayErrorViews= array();
$action = $_REQUEST['action']??null;
$action = $_REQUEST['action'];
switch($action){
case "accessPrivateLists":
$this->accessPrivateLists($arrayErrorViews);
case "accessProfilePage":
require($rep.$vues['profile']);
break;
case "deconnection":
$this->deconnection($arrayErrorViews);
break;
case "creerListePv":
$this->creerListe($arrayErrorViews);
break;
case "desinscription":
$this->desinctription($arrayErrorViews);
break;
case "changerInfos":
$this->changerPassword($arrayErrorViews);
break;
default :
default:
$arrayErrorViews[]="Erreur innatendue !!!";
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){
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){
global $rep, $vues, $dataView;
$model = new UserModel();

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

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

@ -8,23 +8,6 @@ require_once(__DIR__.'/config/config.php');
require_once(__DIR__.'/config/Autoload.php');
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
//$cont=new FrontControleur();
$cont= new FrontControleur();

@ -1,10 +1,10 @@
<?php
class Liste {
public int $id;
public string $nom;
public ?string $nomCreateur;
public ?array $taches;
private int $id;
private string $nom;
private ?string $nomCreateur;
private ?array $taches;
function __construct(int $i, string $n, ?string $nomCrea,?array $t){
$this->id=$i;
@ -12,6 +12,22 @@ class Liste {
$this->nomCreateur=$nomCrea;
$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
Class Tache {
public int $id;
public string $nom;
public bool $isCompleted;
public int $idListe;
private int $id;
private string $nom;
private bool $isCompleted;
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->nom = $in;
$this->isCompleted = $is;
$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->listListe=$liste;
}
function get_id(): int {
return $this->id;
}
function get_nom(): string {
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{
padding-top: 2%;
padding-bottom: 2%;
height: 5%;
width: 100%;
background:none;
display: flex;
flex-direction: row;
background-color: #0971C9;
justify-content: center;
align-items: center;
vertical-align: middle;
place-content: start space-evenly;
}
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-weight: bolder;
color: #FFFEFD;
color: #212F3D;
}
.button{
width: 50%;
height: 100%;
background-color: #FFFEFD;
border-radius: 20%;
border-color: #0971C9;
color: #0D2350;
.button{
border: none;
color:#B2BABB;
background-color: #212F3D;
font-family: sans-serif;
padding:30px;
border-radius: 20px;
}
.button:hover{
background-color: grey;
#GoHome > input[type="image"] {
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>
<title>Acceuil</title>
<link rel="stylesheet" href="<?= $styles['commun'] ?>">
<link rel="stylesheet" href="styles/commonStyles.css"/>
<link rel="stylesheet" href="styles/acceuilStyles.css"/>
</head>
<body>
<header>
<h1>Welcome to our fantastic to do list app !</h1>
<?php
if(!isset($_SESSION['login'])){
echo '
<div>
<form method="post" name="connection" id="connection">
<input class="button" type="submit" value="Connection"/>
<input type="hidden" name="action" value="accessConnectionPage"/>
</form>
</div>';
}
else{
echo'
<div>
<form method="post" name="profil" id="profil">
<input class="button" type="submit" value="Profile"/>
<input type="hidden" name="action" value="accessProfilePage"/>
</form>
</div>';
}?>
</header>
<?php if(isset($_SESSION['login'])){
echo '
<header>
<form method="POST" name="goBackHome" id="GoHome">
<input type="image" src="assets/logo.png"/>
<input type="hidden" name="action" value="goHome"/>
</form>
<h1>To-do</h1>
<?php
if(!isset($_SESSION['login'])){
echo '
<form method="post" name="connection" id="connection">
<input class="connection" type="submit" value="Connection"/>
<input type="hidden" name="action" value="accessConnectionPage"/>
</form>';
}
else{
echo'
<div>
<form method="post" name="listesPv" id="listesPv">
<input class="button" type="submit" value="Access private lists"/>
<input type="hidden" name="action" value="accessPrivateLists"/>
</form>
<form method="post" name="deconnection" id="deconnection">
<input class="deconnection" type="submit" value="Deconnection"/>
<input type="hidden" name="action" value="deconnection"/>
</form>
</div>';
}?>
<div>
</header>
<div class="body">
<div class="head-body">
<h2>Public Lists</h2>
<?php
if(isset($dataView)) {
foreach ($dataView as $liste){
echo '
<div>
<form method="post" name="accessList" id="accessList">
<p>• '.$liste->nom.'
<input type="submit" value="View List"/></p>
<input type="hidden" name="action" value="accessListInfos"/>
<input type="hidden" name="liste" value="'.$liste->id.'"/>
</form>
</div>';
}
<?php if(isset($_SESSION['login'])){
echo '
<div>
<form method="post" name="listesPv" id="listesPv">
<input class="private-lists" type="submit" value="Private Lists"/>
<input type="hidden" name="action" value="accessPrivateLists"/>
</form>
</div>';
}?>
</div>
<?php
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"/>
<input type="hidden" name="action" value="accessCreationListePage"/>
</form>
</div>
}
?>
<div>
<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>
</html>

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

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

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

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

@ -2,23 +2,31 @@
<html>
<head>
<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>
<body>
<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>
</header>
<div>
<form method="POST" name="inscription" id="inscription">
<h2>Please enter all the informations :</h2>
<p>Login
<input type="text" name="username" required/></p>
<p>Password
<input type="password" name="password" required/></p>
<p>Confirm Password
<input type="password" name="confirmpassword" required/></p>
<br/>
<div class="body">
<h2>Please enter all the informations :</h2>
<form method="POST" name="inscription" id="connectionForm">
<h4>Username</h4>
<input type="text" name="username" required/>
<h4>Password</h4>
<input type="password" name="password" required/>
<h4>Confirm Password</h4>
<input type="password" name="confirmpassword" required/>
<?php
if(isset($vues_erreur)){
echo '<h4 id="error">'.$vues_erreur[0].'</h4>';
}
?>
<input class="button" type="submit" value="Sign Up"/>
<input type="hidden" name="action" value="inscription"/>
</form>

@ -1,31 +1,44 @@
<!DOCTYPE html>
<html>
<header>
<h2>Private Lists</h2>
<form method="POST" name="goBackHome" id="Go Home">
<input type="submit" value="Home Page"/>
<input type="hidden" name="action" value="goHome"/>
</form>
</header>
<head>
<title>Acceuil</title>
<link rel="stylesheet" href="styles/commonStyles.css"/>
<link rel="stylesheet" href="styles/acceuilStyles.css"/>
<link rel="stylesheet" href="styles/privateListsStyles.css"/>
</head>
<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
if(isset($dataView)) {
if(isset($dataView) && !empty($dataView)) {
foreach ($dataView as $liste){
echo '
<div>
<form method="post" name="accessList" id="accessList">
<p>• '.$liste->nom.'
<input type="submit" value="View List"/></p>
<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->id.'"/>
<input type="hidden" name="liste" value="'.$liste->get_id().'"/>
</form>
</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>
</body>
</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