thchazot1 2 years ago
parent 078533719a
commit 19af04b9f2

@ -35,7 +35,7 @@
<input type="submit" value="Submit"/> <input type="submit" value="Submit"/>
<input type="hidden" name="action" value="addTask"/> <input type="hidden" name="action" value="addTask"/>
<input type="hidden" name="list" value="<?=$dataView[0]?>"/> <input type="hidden" name="list" value="<?=$dataView?>"/>
</form> </form>
</div> </div>

@ -39,6 +39,7 @@ class VisitorController {
case "accessAddTask": case "accessAddTask":
$dataView=$_POST['list']; $dataView=$_POST['list'];
echo $dataView;
require($rep.$vues['addTask']); require($rep.$vues['addTask']);
break; break;

@ -42,6 +42,10 @@ class Tache
$this->name=$name; $this->name=$name;
} }
public function setId(int $id){
$this->id=$id;
}
public function setContent(string $content){ public function setContent(string $content){
$this->content=$content; $this->content=$content;
} }

@ -82,7 +82,7 @@ class MdlListe{
$tabTache=[]; $tabTache=[];
$taches=$gateTache->getTacheFromIdList($row['id']); $taches=$gateTache->getTacheFromIdList($row['id']);
foreach($taches as $tata){ foreach($taches as $tata){
$tabTache[]=new Tache($tata['id'], $tata['name'], $tata['content'], $tata['completed']); $tabTache[]=new Tache($tata->getId(), $tata->getName(), $tata->getContent(), $tata->getCompleted());
} }
$tabListe[]=new Liste($row['id'], $row['name'], $row['private'], $user, $tabTache); $tabListe[]=new Liste($row['id'], $row['name'], $row['private'], $user, $tabTache);
} }

@ -15,9 +15,9 @@ class MdlTache{
public function insert(string $name, string $content ,bool $completed, string $idListe): Tache{ public function insert(string $name, string $content ,bool $completed, string $idListe): Tache{
$gate=new TacheGateway($this->con); $gate=new TacheGateway($this->con);
$t=new Tache(0, $name, $content, $completed); $t=new Tache(0, $name, $content, $completed);
$gate->insert($t); $gate->insert($t, $idListe);
$id=$gate->getLastId(); $id=$gate->getLastId();
$t->setId($id[0]['oldId']); $t->setId($id);
return $t; return $t;
} }

Loading…
Cancel
Save