parent
a3bc6d1e97
commit
061aa6ed32
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class Validation {
|
||||||
|
static function val_connexion($usrName,$mdp,&$dataVueEreur) {
|
||||||
|
if (!isset($usrName)||$usrName=="") {
|
||||||
|
$dataVueEreur[] ="Nom d'utilisateur manquant";
|
||||||
|
throw new Exception('pas de username');
|
||||||
|
}
|
||||||
|
if (!isset($mdp)||$mdp=="") {
|
||||||
|
$dataVueEreur[] ="Mot de passe manquant";
|
||||||
|
throw new Exception('pas de password');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static function clear_string($champ){
|
||||||
|
// Wesh
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class UserModel {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class VisiteurModel {
|
||||||
|
private $gtwUsr;
|
||||||
|
private $gtwListe;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$co = new Connection();
|
||||||
|
$this->gtwUsr = new UserGateway($co);
|
||||||
|
$this->gtwListe = new ListeGateway($co);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get_gtwUsr(): UserGateway {
|
||||||
|
return $this->gtwUsr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get_gtwListe(): ListeGateway {
|
||||||
|
return $this->gtwListe;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function connexion($login, $mdp){
|
||||||
|
$results = $this->get_gtwUsr()->getUtilisateurbyNameAndPassword($login, $mdp);
|
||||||
|
if ($results != NULL){
|
||||||
|
$_SESSION['role'] = 'user';
|
||||||
|
$_SESSION['login'] = $login;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function inscription($login, $mdp){
|
||||||
|
$this->get_gtwUsr()->creerUtilisateur($login, $mdp);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function creerListe($nom) {
|
||||||
|
$this->get_gtwListe()->creerListe($nom, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function supprListe($id) {
|
||||||
|
$this->get_gtwListe()->delListe($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function creerTache(string $intitule){
|
||||||
|
$this->get_gtwListe()->creerTache($intitule);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
@ -1,26 +0,0 @@
|
|||||||
header{
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
background-color: #0971C9;
|
|
||||||
}
|
|
||||||
body{
|
|
||||||
background-color: #0D2350;
|
|
||||||
|
|
||||||
}
|
|
||||||
h1,h2,h3,h4,p{
|
|
||||||
font-family: sans-serif;
|
|
||||||
font-weight: bolder;
|
|
||||||
color: #6da8e2;
|
|
||||||
}
|
|
||||||
.button{
|
|
||||||
width: 150%;
|
|
||||||
height: 75%;
|
|
||||||
background-color: #FFFEFD;
|
|
||||||
border-radius: 20%;
|
|
||||||
border-color: #0971C9;
|
|
||||||
color: #0D2350;
|
|
||||||
|
|
||||||
}
|
|
||||||
.button:hover{
|
|
||||||
background-color: grey;
|
|
||||||
}
|
|
Loading…
Reference in new issue