parent
5076f7848f
commit
eacd8f1aa2
@ -1,54 +0,0 @@
|
||||
<?php
|
||||
class CtrlUser
|
||||
{
|
||||
private $model;
|
||||
private $view;
|
||||
private $con;
|
||||
|
||||
public function __construct(TaskModel $model, HomeView $view,
|
||||
Connection $con){
|
||||
session_start();
|
||||
|
||||
$this->model = $model;
|
||||
$this->view = $view;
|
||||
$this->con = $con;
|
||||
}
|
||||
|
||||
try{
|
||||
$action=$_REQUEST['action'];
|
||||
switch($action){
|
||||
// pas d'action afficher la home page avec toutes les listes
|
||||
case NULL:
|
||||
$this->home();
|
||||
break;
|
||||
|
||||
// ajouter une liste publique
|
||||
case 'creer_liste_pub'
|
||||
$this->newList('private');
|
||||
break;
|
||||
|
||||
// ajouter une liste privee
|
||||
case 'creer_liste_priv'
|
||||
$this->newList('public');
|
||||
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
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
class CtrlUser
|
||||
{
|
||||
private $model;
|
||||
private $view;
|
||||
private $con;
|
||||
|
||||
public function __construct(TaskModel $model, HomeView $view,
|
||||
Connection $con){
|
||||
session_start();
|
||||
|
||||
$this->model = $model;
|
||||
$this->view = $view;
|
||||
$this->con = $con;
|
||||
}
|
||||
|
||||
public function handleAction(){
|
||||
try{
|
||||
$action=$_REQUEST['action'];
|
||||
switch($action){
|
||||
// pas d'action afficher la home page avec toutes les listes
|
||||
case NULL:
|
||||
$this->home();
|
||||
break;
|
||||
|
||||
// ajouter une liste publique
|
||||
case 'creer_liste_pub':
|
||||
$this->newList('private');
|
||||
break;
|
||||
|
||||
// ajouter une liste privee
|
||||
case 'creer_liste_priv':
|
||||
$this->newList('public');
|
||||
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) {
|
||||
require("../view/erreur.php");
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Reference in new issue