projet-php/managers/Medecin.class.php

35 lines
1.1 KiB
PHP

<?php
/**
* Created by PhpStorm.
* User: seekdasky
* Date: 10/12/15
* Time: 10:02
*/
class Medecin
{
public function add($params){
if(MedecinRepo::add($params['civilite'],strtolower($params['prenom']),strtolower($params['nom'])) !==FALSE){
$response = new Response();
$response->setHeader('Location',"http://".$_SERVER['HTTP_HOST']."/Medecins.php?type=creation");
$response->send();
}else{
$response = new Response(500);
$response->setHeader('Location',"http://".$_SERVER['HTTP_HOST']."/Medecins.php?type=error");
$response->send();
}
}
public function delete($params){
if(MedecinRepo::delete($params['id_medecin']) !==FALSE){
$response = new Response();
$response->setHeader('Location',"http://".$_SERVER['HTTP_HOST']."/Medecins.php?type=supression");
$response->send();
}else{
$response = new Response(500);
$response->setHeader('Location',"http://".$_SERVER['HTTP_HOST']."/Medecins.php?type=error");
$response->send();
}
}
}