projet-php/managers/Medecin.class.php

34 lines
1014 B
PHP
Executable File

<?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::quickResponse(200, json_encode([
'status' => 'success',
'title' => 'Création enregistrée!',
'message' => 'Le médecin '.$params['prenom'].' '.$params['nom'].' a bien été créé.'
]));
}else{
Response::quickResponse(200, json_encode([
'status' => 'error',
'title' => 'Erreur de création!'
]));
}
}
public function delete($params){
if(MedecinRepo::delete($params['id_medecin']) !==FALSE){
Response::quickResponse(200, json_encode(['status'=>'success']));
}else{
Response::quickResponse(200, json_encode(['status'=>'error']));
}
}
}