format('Y-m-d').' '.$params['heure'].':00',$params['duree'],$params['id_patient'],$params['id_medecin']) !==FALSE){ $response = new Response(); $response->setHeader('Location',"http://".$_SERVER['HTTP_HOST']."/Consultation.php?type=creation"); $response->send(); }else{ $response = new Response(500); $response->setHeader('Location',"http://".$_SERVER['HTTP_HOST']."/Consultation.php?type=error"); $response->send(); } } public function delete($params){ if(RDVRepo::delete($params['id_consultation']) !==FALSE){ $response = new Response(); $response->setHeader('Location',"http://".$_SERVER['HTTP_HOST']."/Consultation.php?type=supression"); $response->send(); }else{ $response = new Response(500); $response->setHeader('Location',"http://".$_SERVER['HTTP_HOST']."/Consultation.php?type=error"); $response->send(); } } public function update($params){ $params['date'] = DateTime::createFromFormat('d-m-Y', $params['date']); if(RDVRepo::updateDateTime($params['id_consultation'],$params['date']->format('Y-m-d').' '.$params['heure'].':00') !==FALSE){ $response = new Response(); $response->setHeader('Location',"http://".$_SERVER['HTTP_HOST']."/Consultation.php?type=maj"); $response->send(); }else{ $response = new Response(500); $response->setHeader('Location',"http://".$_SERVER['HTTP_HOST']."/Consultation.php?type=error"); $response->send(); } } }