|
|
|
@ -14,7 +14,7 @@ class TaskGateway
|
|
|
|
|
|
|
|
|
|
// functions
|
|
|
|
|
// code de retour pour les fonctions i,u,d?
|
|
|
|
|
public function insert(Task $t){
|
|
|
|
|
public function insertT(Task $t){
|
|
|
|
|
$query='INSERT INTO Tache VALUES (:id,:titre,:descript,NULL,NULL,:priorite,:idList,false)';
|
|
|
|
|
|
|
|
|
|
$this->con->executeQuery($query, array(
|
|
|
|
@ -29,20 +29,23 @@ class TaskGateway
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function update($id,$element, $valeur){
|
|
|
|
|
$query='UPDATE Tache SET '.$element.'=:'.$element.' WHERE id=:id';
|
|
|
|
|
|
|
|
|
|
public function update($table,$id,$element, $valeur){
|
|
|
|
|
if($table == 'task'){
|
|
|
|
|
$query='UPDATE Tache SET '.$element.'=:'.$element.' WHERE id=:id';
|
|
|
|
|
} else {
|
|
|
|
|
$query='UPDATE uList SET '.$element.'=:'.$element.' WHERE id=:id';
|
|
|
|
|
}
|
|
|
|
|
$this->con->executeQuery($query, array(
|
|
|
|
|
':id'=>array($id,PDO::PARAM_STR),
|
|
|
|
|
':'.$element =>array($valeur,PDO::PARAM_STR)));
|
|
|
|
|
/*
|
|
|
|
|
element é o attributo da classe, valaeur é oque queremos botar
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function delete($id){
|
|
|
|
|
$query='DELETE FROM Tache WHERE id = :id';
|
|
|
|
|
|
|
|
|
|
public function delete($table,$id){
|
|
|
|
|
if($table == 'task'){
|
|
|
|
|
$query='DELETE FROM Tache WHERE id = :id';
|
|
|
|
|
} else {
|
|
|
|
|
$query='DELETE FROM uList WHERE id = :id';
|
|
|
|
|
}
|
|
|
|
|
$this->con->executeQuery($query, array(
|
|
|
|
|
':id'=>array($id,PDO::PARAM_STR)));
|
|
|
|
|
}
|
|
|
|
@ -69,5 +72,15 @@ class TaskGateway
|
|
|
|
|
}
|
|
|
|
|
return $tabTaches;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* # LIST FUNCTIONS */
|
|
|
|
|
/*create, update, delete, read(select info)*/
|
|
|
|
|
public function insertL(ListTask $l){
|
|
|
|
|
$query='INSERT INTO uList VALUES (:id,:nom,:user,0)';
|
|
|
|
|
$this->con->executeQuery($query, array(
|
|
|
|
|
':id'=> array($l->get_id(),PDO::PARAM_STR),
|
|
|
|
|
':nom'=> array($l->get_nom(),PDO::PARAM_STR),
|
|
|
|
|
':user'=> array($l->get_owner(),PDO::PARAM_STR)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|