|
|
|
@ -3,7 +3,7 @@
|
|
|
|
|
class ControleurVisiteur {
|
|
|
|
|
|
|
|
|
|
public function __construct() {
|
|
|
|
|
global $rep,$vues,$styles,$assets;
|
|
|
|
|
global $rep,$vues,$dataView,$styles,$assets;
|
|
|
|
|
$arrayErrorViews= array();
|
|
|
|
|
try{
|
|
|
|
|
$action = $_REQUEST['action']??null;
|
|
|
|
@ -11,6 +11,9 @@ class ControleurVisiteur {
|
|
|
|
|
case NULL:
|
|
|
|
|
$this->reinit();
|
|
|
|
|
break;
|
|
|
|
|
case "goHome":
|
|
|
|
|
$this->reinit();
|
|
|
|
|
break;
|
|
|
|
|
case 'accessConnectionPage':
|
|
|
|
|
require($rep.$vues['connection']);
|
|
|
|
|
break;
|
|
|
|
@ -20,6 +23,22 @@ class ControleurVisiteur {
|
|
|
|
|
case "accessCreationListePage":
|
|
|
|
|
require($rep.$vues['creationListe']);
|
|
|
|
|
break;
|
|
|
|
|
case "accessCreationTachePage":
|
|
|
|
|
$dataView=$_POST['liste'];
|
|
|
|
|
require($rep.$vues['creationTache']);
|
|
|
|
|
break;
|
|
|
|
|
case "addTache":
|
|
|
|
|
$this->addTache($arrayErrorViews);
|
|
|
|
|
break;
|
|
|
|
|
case "accessListInfos":
|
|
|
|
|
$this->accessListInfos($arrayErrorViews);
|
|
|
|
|
break;
|
|
|
|
|
case "delTache":
|
|
|
|
|
$this->delTache($arrayErrorViews);
|
|
|
|
|
break;
|
|
|
|
|
case "changeCompletedTache":
|
|
|
|
|
$this->changeCompletedTache($arrayErrorViews);
|
|
|
|
|
break;
|
|
|
|
|
case "connection":
|
|
|
|
|
$this->connection($arrayErrorViews);
|
|
|
|
|
break;
|
|
|
|
@ -28,17 +47,9 @@ class ControleurVisiteur {
|
|
|
|
|
case "creerListe":
|
|
|
|
|
$this->creerListe($arrayErrorViews);
|
|
|
|
|
break;
|
|
|
|
|
case "supprListe":
|
|
|
|
|
$this->supprListe($arrayErrorViews);
|
|
|
|
|
break;
|
|
|
|
|
case "creerTache":
|
|
|
|
|
$this->creerTache($arrayErrorViews);
|
|
|
|
|
case "delListe":
|
|
|
|
|
$this->delListe($arrayErrorViews);
|
|
|
|
|
break;
|
|
|
|
|
case "cocherTache":
|
|
|
|
|
$this->cocherTache($arrayErrorViews);
|
|
|
|
|
break;
|
|
|
|
|
case "supprTache":
|
|
|
|
|
$this->supprTache($arrayErrorViews);
|
|
|
|
|
default :
|
|
|
|
|
$arrayErrorViews[]="Erreur innatendue !!!";
|
|
|
|
|
require($rep.$vues['acceuil']);
|
|
|
|
@ -58,6 +69,42 @@ class ControleurVisiteur {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function accessListInfos($arrayErrorViews){
|
|
|
|
|
global $rep,$vues,$dataView;
|
|
|
|
|
$idListe=$_POST['liste'];
|
|
|
|
|
$model = new ListeModel();
|
|
|
|
|
$dataView = $model->pullListById($idListe);
|
|
|
|
|
require($rep.$vues['infosListe']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function addTache($arrayErrorViews){
|
|
|
|
|
global $rep,$vues,$dataView;
|
|
|
|
|
$nom=$_POST['name'];
|
|
|
|
|
$idListe=$_POST['liste'];
|
|
|
|
|
$model = new ListeModel();
|
|
|
|
|
$model->addTache($nom,$idListe);
|
|
|
|
|
$_REQUEST['action']="accessListInfos";
|
|
|
|
|
$this->accessListInfos($arrayErrorViews);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function delTache($arrayErrorViews){
|
|
|
|
|
global $rep,$vues,$dataView;
|
|
|
|
|
$idTache=$_POST['tache'];
|
|
|
|
|
$model= new ListeModel();
|
|
|
|
|
$model->delTache($idTache);
|
|
|
|
|
$_REQUEST['action']="accessListInfos";
|
|
|
|
|
$this->accessListInfos($arrayErrorViews);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function changeCompletedTache($arrayErrorViews){
|
|
|
|
|
global $rep,$vues,$dataView;
|
|
|
|
|
$idTache=$_POST['tache'];
|
|
|
|
|
$model = new ListeModel();
|
|
|
|
|
$model->changeCompletedTache($idTache);
|
|
|
|
|
$_REQUEST['action']="accessListInfos";
|
|
|
|
|
$this->accessListInfos($arrayErrorViews);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function connection(array $vues_erreur){
|
|
|
|
|
global $rep,$vues,$dataView;
|
|
|
|
|
$usrname=$_POST['login'];
|
|
|
|
@ -102,11 +149,9 @@ class ControleurVisiteur {
|
|
|
|
|
$vues_erreur=Validation::val_intitule($nom, $vues_erreur);
|
|
|
|
|
$model = new ListeModel();
|
|
|
|
|
if(isset($_SESSION['login'])){
|
|
|
|
|
foreach($_POST['private'] as $valeur){
|
|
|
|
|
$private=$valeur;
|
|
|
|
|
$private=$_POST['private'];
|
|
|
|
|
$model->creerListe($nom,$private);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
$model->creerListe($nom,null);
|
|
|
|
|
}
|
|
|
|
@ -114,12 +159,13 @@ class ControleurVisiteur {
|
|
|
|
|
$this->reinit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function supprListe(array $vues_erreur){
|
|
|
|
|
public function delListe(array $vues_erreur){
|
|
|
|
|
global $rep, $vues;
|
|
|
|
|
require($rep.$vues['suppressionListe']);
|
|
|
|
|
|
|
|
|
|
$idListe=$_POST['liste'];
|
|
|
|
|
$model = new ListeModel();
|
|
|
|
|
$model->supprListe();
|
|
|
|
|
$model->delListe($idListe);
|
|
|
|
|
$_REQUEST['action']=null;
|
|
|
|
|
$this->reinit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function creerTache(array $vues_erreur){
|
|
|
|
|