You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ProjetPHP/controller/UserCtrl.php

46 lines
1.2 KiB

<?php
class UserCtrl
{
private $model;
private $view;
private $con;
public function __construct(Connection $con){
$this->con = $con;
$this->model = new UserModel($this->con);
try{
$action=$_REQUEST['action'];
switch($action){
// voir les listes privees
case 'voir_liste_priv':
$this->loadListePriv();
break;
// ajouter une liste privee
case 'creer_liste_priv':
$this->newListPrivate();
break;
}
} catch(Exception $e) {
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']));
}
}
?>