ADD: ajout de pas mal de trucs qui marchent

master
Lucie Bedouret 2 years ago
parent 5c8ced8066
commit 58510209ba

BIN
.DS_Store vendored

Binary file not shown.

BIN
assets/.DS_Store vendored

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

@ -1,5 +1,9 @@
<?php
/* -----------
Problème avec l'autoloader
----------- */
class Autoload
{
private static $_instance = null;
@ -34,10 +38,10 @@ class Autoload
{
global $rep;
$filename = $class.'.php';
$dir = array('modeles/','./','config/','controleurs/');
$dir = array('./','config/','controleurs/','modeles/Gateways/','modeles/Métier/','modeles/Modele');
foreach ($dir as $d){
$file=$rep.$d.$filename;
//echo $file;
echo $file;
if (file_exists($file))
{
include $file;

@ -1,7 +1,7 @@
<?php
class Validation {
static function val_connexion($usrName,$mdp,&$dataVueEreur) {
static function val_connexion($usrName,$mdp,$dataVueEreur) {
if (!isset($usrName)||$usrName=="") {
$dataVueEreur[] ="Nom d'utilisateur manquant";
throw new Exception('pas de username');
@ -10,6 +10,27 @@
$dataVueEreur[] ="Mot de passe manquant";
throw new Exception('pas de password');
}
return $dataVueEreur;
}
static function val_inscription($username,$pwd1,$pwd2,$dataVueEreur){
if (!isset($username)||$username==="") {
$dataVueEreur[] ="Nom d'utilisateur manquant";
throw new Exception('pas de username');
}
if (!isset($pwd1)||$pwd1==="") {
$dataVueEreur[] ="Mot de passe manquant";
throw new Exception('pas de password');
}
if (!isset($pwd2)||$pwd2==="") {
$dataVueEreur[] ="Confirmation mot de passe manquant";
throw new Exception('pas de confirmation password');
}
if($pwd1 !== $pwd2){
$dataVueEreur[]="Mot de passe et confirmation différents";
throw new Exception("Mot de passe et confirmation différents");
}
return $dataVueEreur;
}
static function clear_string($champ){

@ -3,16 +3,22 @@
//Prefixe
$rep=__DIR__.'/../';
//BD
// ----
// A CHANGER
// ----
$base="votre_base";
$login="";
$mdp="";
$bd['dsn'] = "mysql:host=localhost;port=8888;dbname=dbPhp";
$bd['user'] = "root";
$bd['pswd'] = "root";
//Vues
$vues['acceuil']='vues/acceuil.php';
$vues['erreur']='vues/erreur.php';
$vues['connection']='vues/connection.php';
$vues['inscription']='vues/inscription.php';
$vues['profile']='vues/profile.php';
$vues['listesPrivees']='vues/listesPrivees.php';
$vues['creationListe']='vues/creationListe.php';
// Styles
$styles['commun']='vues/styles/commonStyles.css';
$styles['connection']='vues/styles/connectionStyle.css';
// Assets
$assets['logo']='assets/chekliste.png';
?>

@ -1,15 +1,18 @@
<?php
class UserController{
class ControleurUtilisateur{
public function __construct() {
global $rep,$vues;
//On démarre la session
session_sart();
function __construct() {
global $rep,$vues, $dataView;
$arrayErrorViews= array();
$action = $_REQUEST['action']??null;
switch($action){
case "accessPrivateLists":
$this->accessPrivateLists($arrayErrorViews);
case "accessProfilePage":
require($rep.$vues['profile']);
break;
case "deconnection":
$this->deconnection($arrayErrorViews);
break;
@ -28,14 +31,16 @@ class UserController{
}
}
public function deconnection($arrayErrorViews){
// appeler la méthode deco du modèle
$retour = UserModel::deconnection();
require($rep.$vues['acceuil']);
function deconnection($arrayErrorViews){
global $rep, $vues, $dataView;
$model = new UserModel();
$retour = $model->deconnection();
$_REQUEST['action']=null;
$control= new ControleurVisiteur();
}
public function creerListePv($arrayErrorViews){
global $rep, $vues;
function creerListePv($arrayErrorViews){
global $rep, $vues, $dataView;
//recupérer les valeurs du formulaire
$nomListe=$_POST['ListName'];
$privee=$_POST['isPrivate'];
@ -62,20 +67,27 @@ class UserController{
}
}
public function changerPassword($arrayErrorViews){
global $rep, $vues;
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'])
require($rep.$vues['profil']);
}catch(PDOException $e){
$dataView[]="Erreur inatendue";
require($rep.$vues['erreur']);
}
}
function accessPrivateLists($arrayErrorViews){
global $rep, $vues, $dataView;
$model = new UserModel();
$dataView = $model->pullListesPrivees($_SESSION['login']);
require($rep.$vues['listesPrivees']);
}
}
?>

@ -1,19 +1,25 @@
<?php
class VisitorController {
class ControleurVisiteur {
public function __construct() {
global $rep,$vues;
//On démarre la session
session_sart();
global $rep,$vues,$styles,$assets;
$arrayErrorViews= array();
try{
$action = $_REQUEST['action']??null;
switch($action){
case NULL:
$this->reinit();
break;
case 'accessConnectionPage':
require($rep.$vues['connection']);
break;
case "accessInscription":
require($rep.$vues['inscription']);
break;
case "accessCreationListePage":
require($rep.$vues['creationListe']);
break;
case "connection":
$this->connection($arrayErrorViews);
break;
@ -35,7 +41,7 @@ class VisitorController {
$this->supprTache($arrayErrorViews);
default :
$arrayErrorViews[]="Erreur innatendue !!!";
require($rep.$vues['error']);
require($rep.$vues['acceuil']);
}
} catch(PDOException $e){
$dataView[]="Erreur inatendue";
@ -45,49 +51,67 @@ class VisitorController {
}
public function reinit(){
global $rep,$vues;
global $rep,$vues,$dataView;
$model = new VisiteurModel();
$dataView = $model->pullPublicLists();
require($rep.$vues['acceuil']);
}
public function connection(array $vues_erreur){
global $rep,$vues;
global $rep,$vues,$dataView;
$usrname=$_POST['login'];
$pwd=$_POST['mdp'];
Validation::clear_string($pwd);
Validation::val_connexion($usrname,$pwd,$vues_erreur);
$model = new UserModel();
$worked=$model->connexion();
/* Utiliser si jamais connexion n'a pas marché et qu'on veut remettre le login dans la page pour que le visiteur n'ait pas à le retaper
$dVue = array (
'username' => $usrname,
);
*/
if($worked==false){
require('erreur.php');
$model= new VisiteurModel();
if($model->existUser($usrname)){
if(password_verify($pwd,$model->getHashedPassword($usrname))){
$model->connexion($usrname);
$_REQUEST['action']=null;
$this->reinit();
}
else{
$arrayErrorViews =array('username'=>$usrname,'password'=>$pwd);
require($rep.$vues['erreur']);
}
}
else{
$arrayErrorViews =array('username'=>$usrname,'password'=>$pwd);
require($rep.$vues['erreur']);
}
}
public function inscription(array $vues_erreur){
global $rep,$vues;
$usrname=$_POST['login'];
$pwd=$_POST['mdp'];
Validation::val_connexion($usrname,$pwd,$vues_erreur);
$model = new UserModel();
$model->inscription();
global $rep,$vues,$dataView;
$usrname=$_POST['username'];
$pwd=$_POST['password'];
$confirm=$_POST['confirmpassword'];
$vues_erreur=Validation::val_inscription($usrname,$pwd,$confirm,$vues_erreur);
if($vues_erreur == []){
$hash= password_hash($pwd,PASSWORD_DEFAULT);
$model = new VisiteurModel();
$model->inscription($usrname,$hash);
}
$_REQUEST['action']=null;
new ControleurVisiteur();
}
public function creerListe(array $vues_erreur){
global $rep, $vues;
require($rep.$vues['creationListe']);
$nom=$_POST['nom'];
$nom=$_POST['name'];
$model = new ListeModel();
$model->creerListe($nom);
if(isset($_SESSION['login'])){
foreach($_POST['private'] as $valeur){
$private=$valeur;
$model->creerListe($nom,$private);
}
}
else{
$model->creerListe($nom,null);
}
$_REQUEST['action']=null;
$this->reinit();
}
public function supprListe(array $vues_erreur){

@ -1,27 +1,24 @@
<?php
require('modeles/Modele/UserModel.php');
require('modeles/Modele/VisiteurModel.php');
class FrontControleur{
public function __construct(){
$liste_actions_utilisateur = array('deconnection','crerListePv','desinscription','changerPassword');
$liste_actions_visiteur = array('creerListe','suprrListe','connection','inscription','creerTache','cocherTache','supprTache');
global $rep,$vues;
$liste_actions_utilisateur = array('accessPrivateLists','accessProfilePage','deconnection','crerListePv','desinscription','changerPassword');
$liste_actions_visiteur = array('accessCreationListePage','accessInscription','accessConnectionPage','creerListe','suprrListe','connection','inscription','creerTache','cocherTache','supprTache');
global $rep,$vues,$bd,$dataView,$styles,$assets;
session_start();
try{
$user = $_SESSION['login'];
$action = $_REQUEST['action'];
$user=$_SESSION??null;
$action = !empty($_REQUEST['action']) ? (string)$_REQUEST['action']:null;
if (in_array($action,$liste_actions_utilisateur)){
if($user == null){
new VisiteurController();
new ControleurVisiteur();
} else {
new UserController();
new ControleurUtilisateur();
}
} else{
new VisiteurController();
new ControleurVisiteur();
}
} catch (Exception $e){require ($rep.$vues['erreur']);}
}

@ -1,14 +1,32 @@
<?php
require_once(__DIR__.'/controleurs/FrontControleur.php');
// Chargement config
require_once(__DIR__.'/config/config.php');
// Autoload des classes
require_once(__DIR__.'/config/Autoload.php');
Autoload::charger();
//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();
$cont= new FrontControleur();
?>

@ -9,30 +9,34 @@ class ListeGateway {
$this->co = $co;
}
public function getByCreator(int $idUsr) : array {
$listes = null;
public function getPublicLists():array{
$listes = array();
$taches = null;
if(!empty($idUsr)){
try {
$co = $this->co;
$query = "SELECT idListe FROM HasList WHERE idUser=:idUser";
$query = "SELECT * FROM Liste WHERE nomCreateur IS NULL";
$co->executeQuery($query, array(':id' => array($id, PDO::PARAM_STR)));
$co->executeQuery($query, []);
$results = $co->getResults();
Foreach($results as $row){
$idListe = $row['idListe'];
$queryTaches = "SELECT t.* FROM Tache t, HasTache h WHERE t.id=h.idTache AND h.idListe=:idListe";
$co->executeQuery($queryTaches, array(':idListe' => array($idListe, PDO::PARAM_STR)));
foreach($results as $row){
$idListe = $row['id'];
$queryTaches = "SELECT * FROM Tache WHERE idListe=:idListe";
$co->executeQuery($queryTaches, array(':idListe' => array($idListe, PDO::PARAM_INT)));
$resultsTaches = $co->getResults();
Foreach($resultsTaches as $rowTaches){
$taches[] = new Tache($rowTaches['id'], $rowTaches['intitule'], $rowTaches['isCompleted'], $rowTaches['description']);
foreach($resultsTaches as $rowTaches){
if($rowTaches['complete']=="0"){
$taches[] = new Tache($rowTaches['id'], $rowTaches['nom'],false,$idListe);
}else{
$taches[] = new Tache($rowTaches['id'], $rowTaches['nom'],true,$idListe);
}
}
$listes[] = new Liste($row['id'], $row['nom'], $taches);
$listes[] = new Liste($row['id'], $row['nom'],null, $taches);
$taches = null;
}
}
@ -40,7 +44,46 @@ class ListeGateway {
echo 'erreur';
echo $Exception->getMessage();
}
return $listes;
}
public function getByCreator(string $usr) : array {
$listes = array();
$taches = null;
try {
$co = $this->co;
$query = "SELECT * FROM Liste WHERE nomCreateur=:nomCrea";
$co->executeQuery($query, array('nomCrea' => array($usr, PDO::PARAM_STR)));
$results = $co->getResults();
foreach($results as $row){
$idListe = $row['id'];
$queryTaches = "SELECT * FROM Tache WHERE idListe=:idListe";
$co->executeQuery($queryTaches, array(':idListe' => array($idListe, PDO::PARAM_INT)));
$resultsTaches = $co->getResults();
foreach($resultsTaches as $rowTaches){
if($rowTaches['complete']=="0"){
$taches[] = new Tache($rowTaches['id'], $rowTaches['nom'],false,$idListe);
}else{
$taches[] = new Tache($rowTaches['id'], $rowTaches['nom'],true,$idListe);
}
}
$listes[] = new Liste($row['id'], $row['nom'],$usr, $taches);
$taches = null;
}
}
catch(PDOException $Exception) {
echo 'erreur';
echo $Exception->getMessage();
}
return $listes;
}
@ -92,15 +135,15 @@ class ListeGateway {
}
}
public function creerListe(string $nom, int $idCreator){
public function creerListe(string $nom, ?string $nomCreator){
try{
$co = $this->co;
$insertQuery = "INSERT INTO Liste VALUES (NULL, :nom, :idCreator)";
$insertQuery = "INSERT INTO Liste VALUES (NULL, :nom, :nomCreator)";
$co->executeQuery($insertQuery, array('nom' => array($nom, PDO::PARAM_STR),
'idCreator' => array($idCreator, PDO::PARAM_INT)));
'nomCreator' => array($nomCreator, PDO::PARAM_STR)));
}
catch(PDOException $Exception){
echo 'erreur';

@ -1,32 +1,50 @@
<?php
require_once("Connection.php");
require_once("Utilisateur.php");
class UserGateway {
private $co;
public function __construct(Connection $co) {
function __construct(Connection $co) {
$this->co = $co;
}
public function creerUtilisateur(string $nom, string $pwd){
if(!empty($id) && !empty($nom) && empty($password)){
function getUtilisateurNom(string $usr){
$co=$this->co;
$query="SELECT nom FROM Utilisateur WHERE nom=:nom";
$co->executeQuery($query,array('nom'=>array($usr,PDO::PARAM_STR)));
return $co->getResults();
}
function getHashedPassword(string $usrname):?string{
$hashedPwd=null;
$co=$this->co;
$query="SELECT pwd FROM Utilisateur WHERE nom=:nom";
$co->executeQuery($query,array('nom'=>array($usrname,PDO::PARAM_STR)));
$res=$co->getResults();
foreach($res as $row){
$hashedPwd=$row['pwd'];
}
return $hashedPwd;
}
function creerUtilisateur(string $nom, string $pwd){
try{
$co = $this->co;
$query = "INSERT INTO Utilisateur VALUES (NULL, :nom, :pwd)";
$query = "INSERT INTO Utilisateur VALUES (:nom, :pwd)";
$co->executeQuery($query, array(':nom' => array($nom, PDO::PARAM_STR), ':pwd' => array($pwd, PDO::PARAM_STR)));
}
catch(PDOException $Excception){
catch(PDOException $Exception){
echo 'erreur';
echo $Exception->getMessage();
return false;
}
}
return true;
}
public function delUtilisateur(int $id){
function delUtilisateur(int $id){
if(!empty($id)){
try{
$co = $this->co;
@ -42,7 +60,7 @@ class UserGateway {
}
}
public function putUtilisateur(Utilisateur $usr){
function putUtilisateur(Utilisateur $usr){
if(!empty($usr.getId()) && !empty($usr.getNom()) && empty($usr.getPassword())){
try{
$co = $this->co;
@ -66,7 +84,7 @@ class UserGateway {
}
}
public function getUtilisateurById(int $id) : Utilisateur {
function getUtilisateurById(int $id) : Utilisateur {
$usr = null;
if(!empty($id)){
try{
@ -78,7 +96,7 @@ class UserGateway {
$results = $co->getResults();
Foreach($results as $row){
foreach($results as $row){
$usr = new Utilisateur($row['id'], $row['nom'], $row['pwd']);
}
}
@ -91,27 +109,32 @@ class UserGateway {
return $usr;
}
public function getUtilisateurbyNameAndPassword(string $nom, string $pwd) : Utilisateur {
function getUtilisateurbyName(string $nom) : ?Utilisateur {
$usr = null;
if(!empty($nom) && !empty($password)){
$tabList= null;
try{
$co = $this->co;
$query = "SELECT * FROM Utilisateur WHERE nom=:nom AND pwd=:pwd";
$queryLists="SELECT id, nom FROM Liste WHERE nomCreateur=:nomCrea";
$queryUser = "SELECT * FROM Utilisateur WHERE nom=:nom";
$co->executeQuery($query, array(':nom' => array($nom, PDO::PARAM_STR), ':pwd' => array($pwd, PDO::PARAM_STR)));
$co->executeQuery($queryLists,array('nomCrea'=>array($nom,PDO::PARAM_STR)));
$res = $co->getResults();
foreach($res as $row){
$tabList[]= new Liste($row['id'],$row['nom'],$nom,array());
}
$co->executeQuery($queryUser, array('nom' => array($nom, PDO::PARAM_STR)));
$results = $co->getResults();
Foreach($results as $row){
$usr = new Utilisateur($row['id'], $row['nom'], $row['pwd']);
foreach($results as $row){
$usr = new Utilisateur($row['nom'], $row['pwd'],$tabList);
}
}
catch(PDOException $Exception){
echo 'erreur';
echo $Exception->getMessage();
}
}
return $usr;
}

@ -0,0 +1,25 @@
<?php
class ListeModel{
public $listgw;
function __construct(){
global $rep,$vues,$bd;
$co = new Connection($bd['dsn'],$bd['user'],$bd['pswd']);
$this->listgw = new ListeGateway($co);
}
function creerListe(string $nom, $private){
if(isset($_SESSION['login'])){
if($private="on"){
$this->listgw->creerListe($nom,$_SESSION['login']);
}else{
$this->listgw->creerListe($nom,null);
}
}else{
$this->listgw->creerListe($nom,null);
}
}
}
?>

@ -4,29 +4,35 @@ class UserModel{
public $listgw;
public $usergw;
public function __construct(){
$co = new Connection();
function __construct(){
global $rep,$vues,$bd;
$co = new Connection($bd['dsn'],$bd['user'],$bd['pswd']);
$this->usergw = new UserGateway($co);
$this->listgw = new ListeGateway($co);
}
public function deconnection(){
function deconnection(){
session_unset();
session_destroy();
$_SESSION = array();
}
public function creerListePv($nom,$idCeator){
function creerListePv($nom,$idCeator){
$this->listgw->creerListe($nom,$idCreator);
}
public function desinscription($login){
function desinscription($login){
$this->usergw->delUtilisateur($login);
}
public function changerPassword($newPassword){
function changerPassword($newPassword){
$this->usergw->putPassword($newPassword);
}
function pullListesPrivees($nom){
$listes=$this->listgw->getByCreator($nom);
return $listes;
}
}
?>

@ -1,39 +1,42 @@
<?php
class VisiteurModel {
private $gtwUsr;
private $gtwListe;
public $gtwUsr;
public $gtwListe;
public function __construct() {
$co = new Connection();
global $rep,$vues,$bd;
$co = new Connection($bd['dsn'],$bd['user'],$bd['pswd']);
$this->gtwUsr = new UserGateway($co);
$this->gtwListe = new ListeGateway($co);
}
public function get_gtwUsr(): UserGateway {
return $this->gtwUsr;
public function getHashedPassword(string $usr){
return $this->gtwUsr->getHashedPassword($usr);
}
public function get_gtwListe(): ListeGateway {
return $this->gtwListe;
public function existUser(string $usr):bool{
if($this->gtwUsr->getUtilisateurNom($usr) != null){
return true;
}
return false;
}
public function connexion($login, $mdp){
$results = $this->get_gtwUsr()->getUtilisateurbyNameAndPassword($login, $mdp);
if ($results != NULL){
$_SESSION['role'] = 'user';
public function connexion($login){
$_SESSION['role'] = 'Utilisateur';
$_SESSION['login'] = $login;
return true;
}
return false;
public function pullPublicLists(){
return $this->gtwListe->getPublicLists();
}
public function inscription($login, $mdp){
$this->get_gtwUsr()->creerUtilisateur($login, $mdp);
$result=$this->gtwUsr->creerUtilisateur($login, $mdp);
if ($result ==true){
$_SESSION['role'] = 'Utilisateur';
$_SESSION['login'] = $login;
}
public function creerListe($nom) {
$this->get_gtwListe()->creerListe($nom, NULL);
}
public function supprListe($id) {

@ -1,27 +1,17 @@
<?php
class Liste {
private int $id;
private string $nom;
private int $idCreator;
public int $id;
public string $nom;
public ?string $nomCreateur;
public ?array $taches;
function __construct(int $i, string $n, $t){
function __construct(int $i, string $n, ?string $nomCrea,?array $t){
$this->id=$i;
$this->nom=$n;
$this->nomCreateur=$nomCrea;
$this->taches=$t;
}
function get_id(): int {
return $this->id;
}
function get_nom(): string {
return $this->nom;
}
function get_idCreator(): array {
return $this->taches;
}
}
?>

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

@ -1,13 +1,11 @@
<?php
Class Utilisateur {
private int $id;
private string $nom;
private string $password;
private $listListe;
function __construct(int $i, string $n, string $p, $liste) {
$this->id=$i;
function __construct(string $n, string $p, $liste) {
$this->nom=$n;
$this->password=$p;
$this->listListe=$liste;

BIN
vues/.DS_Store vendored

Binary file not shown.

@ -8,17 +8,58 @@
<body>
<header>
<h1>Welcome to our fantastic to do list app !</h1>
<form method="post" name="connection">
<a href='vues/connection.php'>
<input class="button" type="button" value="Connection"/>
</a>
<?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 '
<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>
</div>';
}?>
<div>
<h2>Todo listes publiques</h2>
<h2>Public Lists</h2>
<?php
if(isset($dataView)) {
foreach ($dataView as $liste){
echo $liste->nom;
echo '<br/>';
if($liste->taches != null){
foreach($liste->taches as $tache){
echo ' * '.$tache->nom;
echo '<br/>';
}
}
}
}
?>
<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>
<article>
</article>
</body>
</html>

@ -9,19 +9,25 @@
<h1>You are back ?!</h1>
</header>
<div>
<h4>Username</h4>
<input type="text" name="login"/>
<h4>Password</h4>
<input type="password" name="mdp"/>
<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/>
<input class="button" type="button" value="Log In"/>
<input class="button" type="submit" value="Log In"/>
<input type="hidden" name="action" value="connection">
</form>
<br/>
<br/>
<p>You are new here?</p>
<a href="inscription.php">
<input class="button" type="button" value="Sign Up"/>
</a>
</div>
<div>
<form method="POST" name="accessInscription" id="accesInscription">
<h2>You are new here?</h2>
<input class="button" type="submit" value="Sign Up"/>
<input type="hidden" name="action" value="accessInscription">
</form>
</div>
</body>
</html>

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<body>
<div>
<h3>Create a new list</h3>
<form method="POST" name="creaListe" id="creaListe">
<p>Name of the liste
<input type="text" name="name" id="name" required/></p>
<?php
if(isset($_SESSION['login'])){
echo '<input type="checkbox" id="private" name="private[]">
<label for="private">Private List?</label>';
}
?>
<input class="button" type="submit" value="Create List"/>
<input type="hidden" name="action" value="creerListe"/>
</form>
</div>
</body>
</html>

@ -10,18 +10,18 @@
</header>
<div>
<p>Please enter all the informations :</p>
<h4>Username</h4>
<input type="text" name="login"/>
<h4>Password</h4>
<input type="password" name="mdp"/>
<h4>Email</h4>
<input type="email"/>
<h4>Date Of Birth</h4>
<input type="date"/>
<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/>
<br/>
<input class="button" type="button" value="Sign Up"/>
<input class="button" type="submit" value="Sign Up"/>
<input type="hidden" name="action" value="inscription"/>
</form>
</div>
</body>
</html>

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<body>
<div>
<h2>Private Lists</h2>
<?php
if (isset($dataView)) {
foreach ($dataView as $liste){
echo $liste->nom;
echo '<br/>';
if($liste->taches != null){
foreach($liste->taches as $tache){
echo ' * '.$tache->nom;
echo '<br/>';
}
}
}
}
?>
</div>
</body>
</html>

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<body>
<h2>What you wanna young padawan?</h2>
<div>
<form method="POST" name="deconnection">
<input class="button" type="submit" value="Déconnection"/>
<input type="hidden" name="action" value="deconnection"/>
</form>
</div>
<div>
<form method="POST" name="desincription">
<input class="button" type="submit" value="Desinscription"/>
<input type="hidden" name="action" value="desinscription"/>
</form>
</div>
</body>
</html>

Binary file not shown.

@ -0,0 +1,33 @@
html,
body {
height: 100%;
}
body {
display: flex;
align-items: center;
padding-top: 40px;
padding-bottom: 40px;
background-color: #f5f5f5;
}
.form-signin {
max-width: 330px;
padding: 15px;
}
.form-signin .form-floating:focus-within {
z-index: 2;
}
.form-signin input[type="text"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-signin input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
Loading…
Cancel
Save