change UserCtrl

userctrl
Anna BOUDOUL 2 years ago
parent 908ec8ebf4
commit 114dfccefb

@ -12,20 +12,23 @@ class UserCtrl
$action=$_REQUEST['action'];
switch($action){
// // voir les listes privees
// case 'voir_liste_priv':
// $this->loadListePriv();
// break;
// voir les listes privees
case 'voir_liste_priv':
$this->loadListePriv();
break;
// // ajouter une liste privee
// case 'creer_liste_priv':
// $this->newListPrivate();
// break;
// ajouter une liste privee
case 'creer_liste_priv':
$this->newListPrivate();
break;
case 'deconnexion':
$this->deconnexion();
break;
// }
// } catch(Exception $e) {
// require("../view/erreur.php");
// }
}
} catch(Exception $e) {
require("../view/erreur.php");
}
}
public function loadListePriv(){
@ -35,7 +38,7 @@ class UserCtrl
var_dump($TabTask);
// $TabList[] = new ListTask(0, "Projet PHP");
// $TabList[] = new ListTask(1, "Projet Blazor");
$TabListPriv = $this->taskmodel->getPrivateList();
$TabListPriv = $this->taskmodel->loadPrivateLists($user);
require("../view/liste.php");
}
@ -44,5 +47,10 @@ class UserCtrl
insertL(new ListTask(0, $nom, $_SESSION['login']));
require("../view/liste.php");
}
public function deconnexion(){
$usrmodel->deconnexion();
}
}
?>

@ -43,7 +43,7 @@ class TaskModel
/* LIST FUNCTIONS */
public function addList($id,$nom,$owner="",$dc=0)
{
$l = new ListTask($id,$nom,$owner="",$dc=0);
$l = new ListTask($id,$nom,$owner,$dc);
$this->gtw->insertL($l);
// retourne quoi? con->lastInsertId() ??
}

@ -1,4 +1,4 @@
<?php
static $user = 'anboudoul';
static $pass = 'achanger';
static $pass = 'mdpMYSQL';
?>

@ -11,7 +11,7 @@ echo "<h1>2do test</h1>";
# connection
include("credentials.php");
$con = new Connection('mysql:host=localhost;dbname=dbanboudoul', 'anboudoul', 'achanger');
$con = new Connection('mysql:host=localhost;dbname=dbanboudoul', 'anboudoul', 'mdpMYSQL');
# gateway
// $t = new Task(3,'richarlison voltar pro flu','desc.','urgent','0');
@ -29,7 +29,7 @@ foreach($tasks as $i)
echo $i->get_id()."<br>"; */
# Test du modele Tache
// $mt= new TaskModel($con);
$mt= new TaskModel($con);
//$mt->addTask('3','testIsDone','desc.','urgent','001');
//$mt->modifTask('3','isDone','1');
//$tasks = $mt->getTaskBy('titre','tache1');
@ -79,16 +79,19 @@ require('../controller/UserCtrl.php');
// Test Modèle User
// $mdl = new UserModel($con);
$mdl = new UserModel($con);
// $mdl->ajouter('Anna', 'unmdptrescomplique');
// $mdl->modifLogin('Anna', 'Aeryn');
// $mdl->modifMdp('Aeryn', 'wtfmec');
// $mdl->supprimer('Aeryn');
// $mdl->connexion('Aeryn', 'wtfmec');
$mdl->connexion('Aeryn', 'wtfmec');
$usrctrl = new UserCtrl($con);
// $usrctrl = new UserCtrl($con);
// // $usrctrl->loadListePriv();
// $usrctrl->loadListePriv();
$usrctrl->loadListePriv();
// $mt->addList(0, "Test Liste");
$mt->addList(1, "Liste privée", "Aeryn");
?>

Loading…
Cancel
Save