parent
cfcc627fd7
commit
840ec257e1
@ -1,58 +1,45 @@
|
|||||||
<?php
|
<?php
|
||||||
|
class UserCtrl
|
||||||
require('../dal/UserGateway.php');
|
|
||||||
require('../model/UserModel.php');
|
|
||||||
|
|
||||||
class CtrlUser
|
|
||||||
{
|
{
|
||||||
private $model;
|
private $model;
|
||||||
private $view;
|
private $view;
|
||||||
private $con;
|
private $con;
|
||||||
|
|
||||||
public function __construct(Connection $con){
|
public function __construct(Connection $con){
|
||||||
$this->model = new UserModel();
|
|
||||||
$this->con = $con;
|
$this->con = $con;
|
||||||
|
$this->model = new UserModel($this->con);
|
||||||
try{
|
try{
|
||||||
$action=$_REQUEST['action'];
|
$action=$_REQUEST['action'];
|
||||||
switch($action){
|
switch($action){
|
||||||
// pas d'action afficher la home page avec toutes les listes
|
|
||||||
// case NULL:
|
|
||||||
// $this->home();
|
|
||||||
// break;
|
|
||||||
|
|
||||||
// voir les listes privees
|
// voir les listes privees
|
||||||
case 'voir_liste_priv':
|
case 'voir_liste_priv':
|
||||||
$this->listepriv();
|
$this->loadListePriv();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// // ajouter une liste publique
|
// ajouter une liste privee
|
||||||
// case 'creer_liste_pub':
|
case 'creer_liste_priv':
|
||||||
// $this->newList('public');
|
$this->newListPrivate();
|
||||||
// break;
|
break;
|
||||||
|
|
||||||
// // ajouter une liste privee
|
|
||||||
// case 'creer_liste_priv':
|
|
||||||
// $this->newList('private');
|
|
||||||
// break;
|
|
||||||
|
|
||||||
// // supprimer une liste
|
|
||||||
// case 'supprimer_liste':
|
|
||||||
// $this->delList();
|
|
||||||
// break;
|
|
||||||
|
|
||||||
// // changer nom de la liste
|
|
||||||
// case 'changer_nom':
|
|
||||||
// $this->changeListName();
|
|
||||||
// break;
|
|
||||||
|
|
||||||
// ajouter une tache
|
|
||||||
|
|
||||||
// completer tache
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch(Exception $e) {
|
} catch(Exception $e) {
|
||||||
require("../view/erreur.php");
|
require("../view/erreur.php");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function loadListePriv(){
|
||||||
|
$name = "Liste privée";
|
||||||
|
$TabList = array();
|
||||||
|
// $TabList[] = new ListTask(0, "Projet PHP");
|
||||||
|
// $TabList[] = new ListTask(1, "Projet Blazor");
|
||||||
|
$TabListPriv = $this->model->getPrivateList();
|
||||||
|
require("../view/liste.php");
|
||||||
|
}
|
||||||
|
|
||||||
|
public function newListPrivate(){
|
||||||
|
$nom=$_POST['listeNom'];
|
||||||
|
insertL(new ListTask(0, $nom, $_SESSION['login']));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
echo '<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css"
|
||||||
|
rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65"
|
||||||
|
crossorigin="anonymous">
|
||||||
|
</head>';
|
||||||
|
echo '<h1>'.$name.'</h1><center>';
|
||||||
|
echo '<div class="list-group list-group-light">';
|
||||||
|
foreach($TabList as $liste){
|
||||||
|
echo '<button type="button" class="list-group-item list-group-item-action px-3 border-0">'.$liste->get_nom().'</button>';
|
||||||
|
}
|
||||||
|
echo '</div></center>';
|
||||||
|
?>
|
Loading…
Reference in new issue