small changes

userctrl
Anna BOUDOUL 2 years ago
parent edefb53549
commit 3754eba1d6

@ -1,13 +1,13 @@
<?php
class UserCtrl
{
private $model;
private $usrmodel;
private $view;
private $con;
public function __construct(Connection $con){
$this->con = $con;
$this->model = new UserModel($this->con);
$this->usrmodel = new UserModel($this->con);
try{
$action=$_REQUEST['action'];
switch($action){
@ -33,13 +33,14 @@ class UserCtrl
$TabList = array();
// $TabList[] = new ListTask(0, "Projet PHP");
// $TabList[] = new ListTask(1, "Projet Blazor");
$TabListPriv = $this->model->getPrivateList();
$TabListPriv = $this->taskmodel->getPrivateList();
require("../view/liste.php");
}
public function newListPrivate(){
$nom=$_POST['listeNom'];
insertL(new ListTask(0, $nom, $_SESSION['login']));
require("../view/liste.php");
}
}
?>

@ -37,16 +37,16 @@ foreach($tasks as $i)
// echo $i->get_id()."<br>";
# Test LOAD PRIVATE TASKS
$mt= new TaskModel($con);
$lists = $mt->loadPublicLists();
foreach($lists as $l){
echo 'List: '.$l->get_id()."<br>";
echo "Tasks: <br>";
foreach($l->get_taches() as $t){
echo $t->get_id()."<br>";
}
}
// $mt= new TaskModel($con);
// $lists = $mt->loadPublicLists();
// foreach($lists as $l){
// echo 'List: '.$l->get_id()."<br>";
// echo "Tasks: <br>";
// foreach($l->get_taches() as $t){
// echo $t->get_id()."<br>";
// }
// }
// $mt->addList('002','todo2','nifranco');
// $mt->modifList('2','nom','22do');

Loading…
Cancel
Save