Modifs mineures
|
@ -4,7 +4,6 @@ if(!Authentification::checkUser(0)){
|
|||
header("Location: http://".$_SERVER['HTTP_HOST']."/index.php");
|
||||
die();
|
||||
};
|
||||
|
||||
// formattage $_GET['type']
|
||||
$answerType = (isset($_GET['type'])) ? $_GET['type'] : null;
|
||||
|
||||
|
|
|
@ -12,13 +12,15 @@ class Patient
|
|||
$params['date_naissance'] = DateTime::createFromFormat('d/m/Y', $params['date_naissance']);
|
||||
if(PatientRepo::add($params['civilite'],strtolower($params['prenom']),strtolower($params['nom']),$params['adresse'],$params['adresse2'],$params['ville'],$params['code_postal'],
|
||||
$params['date_naissance']->format('Y-m-d'),$params['lieu_naissance'],$params['num_secu'],$params['medecin_traitant']) !==FALSE){
|
||||
$response = new Response();
|
||||
$response->setHeader('Location',"http://".$_SERVER['HTTP_HOST']."/Patients.php?type=creation");
|
||||
$response->send();
|
||||
// $response = new Response();
|
||||
// $response->setHeader('Location',"http://".$_SERVER['HTTP_HOST']."/Patients.php?type=creation");
|
||||
// $response->send();
|
||||
Response::quickResponse(200, json_encode(['status'=>'success']));
|
||||
}else{
|
||||
$response = new Response(500);
|
||||
$response->setHeader('Location',"http://".$_SERVER['HTTP_HOST']."/Patients.php?type=error");
|
||||
$response->send();
|
||||
Response::quickResponse(200, json_encode(['status'=>'error']));
|
||||
// $response = new Response(500);
|
||||
// $response->setHeader('Location',"http://".$_SERVER['HTTP_HOST']."/Patients.php?type=error");
|
||||
// $response->send();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |