master
parent
ba0806aab2
commit
5a685d0399
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
class TacheModel {
|
||||
private $gwList;
|
||||
|
||||
public function __construct() {
|
||||
global $rep,$vues,$bd;
|
||||
$co = new Connection($bd['dsn'],$bd['user'],$bd['pswd']);
|
||||
$this->gwList = new ListeGateway($co);
|
||||
}
|
||||
|
||||
public function get_gwList(){
|
||||
return $this->gwList;
|
||||
}
|
||||
|
||||
function addTache(string $intitule, int $idListe ){
|
||||
$this->get_gwList()->creerTache($intitule,$idListe);
|
||||
}
|
||||
|
||||
function delTache(int $idTache){
|
||||
$this->get_gwList()->delTache($idTache);
|
||||
}
|
||||
|
||||
function changeCompletedTache(int $idTache){
|
||||
$complete=$this->get_gwList()->getTacheById($idTache);
|
||||
$this->get_gwList()->updateTache($idTache,$complete);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -1,51 +0,0 @@
|
||||
<?php
|
||||
|
||||
class VisiteurModel {
|
||||
public $gtwUsr;
|
||||
public $gtwListe;
|
||||
|
||||
public function __construct() {
|
||||
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 getHashedPassword(string $usr){
|
||||
return $this->gtwUsr->getHashedPassword($usr);
|
||||
}
|
||||
|
||||
public function existUser(string $usr):bool{
|
||||
if($this->gtwUsr->getUtilisateurNom($usr) != null){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function connexion($login){
|
||||
$_SESSION['role'] = 'Utilisateur';
|
||||
$_SESSION['login'] = $login;
|
||||
}
|
||||
|
||||
public function pullPublicLists(){
|
||||
return $this->gtwListe->getPublicLists();
|
||||
}
|
||||
|
||||
public function inscription($login, $mdp){
|
||||
$result=$this->gtwUsr->creerUtilisateur($login, $mdp);
|
||||
if ($result ==true){
|
||||
$_SESSION['role'] = 'Utilisateur';
|
||||
$_SESSION['login'] = $login;
|
||||
}
|
||||
}
|
||||
|
||||
public function supprListe($id) {
|
||||
$this->get_gtwListe()->delListe($id);
|
||||
}
|
||||
|
||||
public function creerTache(string $intitule){
|
||||
$this->get_gtwListe()->creerTache($intitule);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<div>
|
||||
<h3>Error!</h3>
|
||||
|
||||
<?php
|
||||
if (isset($dataVueErreur)) {
|
||||
foreach ($dataVueErreur as $value){
|
||||
echo $value;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in new issue