Avancement mineur
This commit is contained in:
parent
67288b94bb
commit
bfd116e2c9
22
Patients.php
22
Patients.php
|
@ -92,19 +92,19 @@ $patientsSearch = ( isset($_GET['patients']) ) ? json_decode( customCompression(
|
|||
|
||||
// pour chaque médecin
|
||||
foreach($patientsSearch as $PAT){ if( isset($PAT['Id']) && isset($PAT['Civilite']) && isset($PAT['Prenom']) && isset($PAT['Nom']) && isset($PAT['DateNaissance']) && isset($PAT['NumSecuriteSociale'])){
|
||||
|
||||
echo '<tr>';
|
||||
|
||||
echo '<td>'.(($PAT['Civilite']=='M')?'Monsieur':'Madame').'</td>';
|
||||
echo '<td>'.$PAT['Prenom'].'</td>';
|
||||
echo '<td>'.strtoupper($PAT['Nom']).'</td>';
|
||||
echo '<td>'.$PAT['DateNaissance'].'</td>';
|
||||
echo '<td>'.$PAT['NumSecuriteSociale'].'</td>';
|
||||
|
||||
// début modification
|
||||
echo "<td><form class='updPatient' action='managers/' method='POST'>";
|
||||
echo "<input type='hidden' name='command' value='Patient:update'>";
|
||||
echo "<input type='hidden' name='id_patient' value='".$PAT['Id']."'>";
|
||||
echo "<input type='submit' value=''>";
|
||||
echo "<td colspan=5><form class='updPatient' action='managers/' method='POST'>";
|
||||
echo "<input type='hidden' name='Id' value='". $PAT['Id'] ."'>";
|
||||
echo "<input type='text' name='Civilite' value='". (($PAT['Civilite']=='M')?'Monsieur':'Madame') ."'>";
|
||||
echo "<input type='text' name='Prenom' value='". $PAT['Prenom'] ."'>";
|
||||
echo "<input type='text' name='Nom' value='". strtoupper($PAT['Nom']) ."'>";
|
||||
echo "<input type='text' name='DateNaissance' value='". $PAT['DateNaissance'] ."'>";
|
||||
echo "<input type='text' name='NumSecuriteSociale' value='". $PAT['NumSecuriteSociale'] ."'>";
|
||||
echo "<input type='hidden' name='command' value='Patient:update'>";
|
||||
echo "<input type='hidden' name='id_patient' value='". $PAT['Id'] ."'>";
|
||||
echo "<input type='submit' value=''>";
|
||||
echo '</form></td>';
|
||||
// fin modification
|
||||
|
||||
|
|
|
@ -784,6 +784,18 @@ input[type=radio]:checked + label:before{
|
|||
}
|
||||
|
||||
/* Modification champ de recherche (patient/médecin/consultation) */
|
||||
|
||||
#CONTAINER > article .updPatient input[type=text],
|
||||
#CONTAINER > article .updMedecin input[type=text]{
|
||||
width: 6em;
|
||||
padding: .1em;
|
||||
margin: 0 .2em;
|
||||
|
||||
border: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#CONTAINER > article .updPatient input[type=submit],
|
||||
#CONTAINER > article .updMedecin input[type=submit]{
|
||||
/* position */
|
||||
|
|
|
@ -53,7 +53,7 @@ APIClass.prototype = {
|
|||
if( ptrAPI.xhr[i].readyState == 4 ){ // si la requête est terminée
|
||||
|
||||
/* DEBUG : affiche la réponse BRUTE de API.php */
|
||||
console.log('managers/ => '+ptrAPI.xhr[i].responseText);
|
||||
// console.log('managers/ => '+ptrAPI.xhr[i].responseText);
|
||||
console.log( JSON.parse(ptrAPI.xhr[i].responseText) );
|
||||
|
||||
/* si success de requête */
|
||||
|
|
|
@ -229,19 +229,21 @@ sbCherche.addEventListener('click', function(e){
|
|||
////////////////////////////////////////////
|
||||
function displayFoundPatients(foundPatients){
|
||||
var container = document.getElementById('searchResultPatient');
|
||||
var content = '<table>';
|
||||
var content = '';
|
||||
|
||||
for( var i = 0 ; i < foundPatients.length ; i++ ){
|
||||
content += '<tr>';
|
||||
content += '<td>'+ ((foundPatients[i].Civilite=='M')?'Monsieur':'Madame') + '</td>';
|
||||
content += '<td>'+ foundPatients[i].Prenom + '</td>';
|
||||
content += '<td>'+ foundPatients[i].Nom.toUpperCase() + '</td>';
|
||||
content += '<td>'+ foundPatients[i].DateNaissance + '</td>';
|
||||
content += '<td>'+ foundPatients[i].NumSecuriteSociale + '</td>';
|
||||
// début modification
|
||||
content += "<td><form class='updPatient' action='managers/' method='POST'>";
|
||||
content += "<input type='hidden' name='command' value='Patient:update'>";
|
||||
content += "<input type='hidden' name='id_patient' value='"+foundPatients[i].Id+"'>";
|
||||
content += "<td colspan=6><form class='updPatient' action='managers/' method='POST'>";
|
||||
content += "<input type='hidden' name='Id' value='"+ foundPatients[i].Id +"'>";
|
||||
content += "<input type='text' name='Civilite' value='"+ ((foundPatients[i].Civilite=='M')?'Monsieur':'Madame') + "'>";
|
||||
content += "<input type='text' name='Prenom' value='"+ foundPatients[i].Prenom + "'>";
|
||||
content += "<input type='text' name='Nom' value='"+ foundPatients[i].Nom.toUpperCase() + "'>";
|
||||
content += "<input type='text' name='DateNaissance' value='"+ foundPatients[i].DateNaissance + "'>";
|
||||
content += "<input type='text' name='NumSecuriteSociale' value='"+ foundPatients[i].NumSecuriteSociale + "'>";
|
||||
|
||||
content += "<input type='hidden' name='command' value='Patient:update'>";
|
||||
content += "<input type='hidden' name='id_patient' value='"+foundPatients[i].Id+"'>";
|
||||
content += "<input type='submit' value=''>";
|
||||
content += '</form></td>';
|
||||
// fin modification
|
||||
|
@ -256,8 +258,6 @@ function displayFoundPatients(foundPatients){
|
|||
content += '</tr>';
|
||||
}
|
||||
|
||||
content += '</table>';
|
||||
|
||||
|
||||
// on vide le container
|
||||
container.innerHTML = content;
|
||||
|
|
|
@ -26,7 +26,7 @@ class Patient
|
|||
Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ]));
|
||||
else{
|
||||
$response = new Response();
|
||||
$response->setHeader('Location','http://'.$_SERVER['HTTP_HOST'].'/Patients.php?status='.$_status.'&title='.$_title.'&message='.$_message);
|
||||
$response->setHeader('Location', 'http://'.$_SERVER['HTTP_HOST'].'/Patients.php?status='.$_status.'&title='.$_title.'&message='.$_message);
|
||||
$response->send();
|
||||
}
|
||||
}else{
|
||||
|
@ -38,7 +38,7 @@ class Patient
|
|||
Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ]));
|
||||
else{
|
||||
$response = new Response();
|
||||
$response->setHeader('Location','http://'.$_SERVER['HTTP_HOST'].'/Patients.php?status='.$_status.'&title='.$_title.'&message='.$_message);
|
||||
$response->setHeader('Location', 'http://'.$_SERVER['HTTP_HOST'].'/Patients.php?status='.$_status.'&title='.$_title.'&message='.$_message);
|
||||
$response->send();
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ class Patient
|
|||
Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ]));
|
||||
else{
|
||||
$response = new Response();
|
||||
$response->setHeader('Location','http://'.$_SERVER['HTTP_HOST'].'/Patients.php?status='.$_status.'&title='.$_title.'&message='.$_message);
|
||||
$response->setHeader('Location', 'http://'.$_SERVER['HTTP_HOST'].'/Patients.php?status='.$_status.'&title='.$_title.'&message='.$_message);
|
||||
$response->send();
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ class Patient
|
|||
else{
|
||||
$response = new Response();
|
||||
// $response->write("patients=".$compressed_json);
|
||||
$response->setHeader('Location','http://'.$_SERVER['HTTP_HOST'].'/Patients.php?status='.$_status.'&title='.$_title.'&message='.$_message.'&patients='.customCompression( json_encode($_patients), true));
|
||||
$response->setHeader('Location', 'http://'.$_SERVER['HTTP_HOST'].'/Patients.php?status='.$_status.'&title='.$_title.'&message='.$_message.'&patients='.customCompression( json_encode($_patients), true));
|
||||
$response->send();
|
||||
}
|
||||
}else{
|
||||
|
@ -85,7 +85,7 @@ class Patient
|
|||
Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ]));
|
||||
else{
|
||||
$response = new Response();
|
||||
$response->setHeader('Location','http://'.$_SERVER['HTTP_HOST'].'/Patients.php?status='.$_status.'&title='.$_title.'&message='.$_message);
|
||||
$response->setHeader('Location', 'http://'.$_SERVER['HTTP_HOST'].'/Patients.php?status='.$_status.'&title='.$_title.'&message='.$_message);
|
||||
$response->send();
|
||||
}
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ class Patient
|
|||
Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ]));
|
||||
else{
|
||||
$response = new Response();
|
||||
$response->setHeader('Location','http://'.$_SERVER['HTTP_HOST'].'/Patients.php?status='.$_status.'&title='.$_title.'&message='.$_message);
|
||||
$response->setHeader('Location', 'http://'.$_SERVER['HTTP_HOST'].'/Patients.php?status='.$_status.'&title='.$_title.'&message='.$_message);
|
||||
$response->send();
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ class Patient
|
|||
Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ]));
|
||||
else{
|
||||
$response = new Response();
|
||||
$response->setHeader('Location','http://'.$_SERVER['HTTP_HOST'].'/Patients.php?status='.$_status.'&title='.$_title.'&message='.$_message);
|
||||
$response->setHeader('Location', 'http://'.$_SERVER['HTTP_HOST'].'/Patients.php?status='.$_status.'&title='.$_title.'&message='.$_message);
|
||||
$response->send();
|
||||
}
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ class Patient
|
|||
Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ]));
|
||||
else{
|
||||
$response = new Response();
|
||||
$response->setHeader('Location','http://'.$_SERVER['HTTP_HOST'].'/Patients.php?status='.$_status.'&title='.$_title.'&message='.$_message);
|
||||
$response->setHeader('Location', 'http://'.$_SERVER['HTTP_HOST'].'/Patients.php?status='.$_status.'&title='.$_title.'&message='.$_message);
|
||||
$response->send();
|
||||
}
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ class Patient
|
|||
Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ]));
|
||||
else{
|
||||
$response = new Response();
|
||||
$response->setHeader('Location','http://'.$_SERVER['HTTP_HOST'].'/Patients.php?status='.$_status.'&title='.$_title.'&message='.$_message);
|
||||
$response->setHeader('Location', 'http://'.$_SERVER['HTTP_HOST'].'/Patients.php?status='.$_status.'&title='.$_title.'&message='.$_message);
|
||||
$response->send();
|
||||
}
|
||||
|
||||
|
@ -162,7 +162,7 @@ class Patient
|
|||
Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ]));
|
||||
else{
|
||||
$response = new Response();
|
||||
$response->setHeader('Location','http://'.$_SERVER['HTTP_HOST'].'/Patients.php?status='.$_status.'&title='.$_title.'&message='.$_message);
|
||||
$response->setHeader('Location', 'http://'.$_SERVER['HTTP_HOST'].'/Patients.php?status='.$_status.'&title='.$_title.'&message='.$_message);
|
||||
$response->send();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ class PatientRepo
|
|||
$optPrenom = ( $prenom != 'null' && StaticRepo::checkParam($prenom,'String45') ) ? '%'.$prenom.'%' : '%';
|
||||
$optNom = ( $nom != 'null' && StaticRepo::checkParam($nom, 'String45') ) ? '%'.$nom.'%' : '%';
|
||||
|
||||
$req = StaticRepo::getConnexion()->query("SELECT Id, Civilite, Nom, Prenom, DateNaissance, NumSecuriteSociale
|
||||
$req = StaticRepo::getConnexion()->query("SELECT Id, Civilite, Nom, Prenom, DATE_FORMAT(DateNaissance, '%d/%m/%Y') as DateNaissance, NumSecuriteSociale
|
||||
FROM Patient
|
||||
WHERE Nom LIKE '".$optNom."'
|
||||
AND Prenom LIKE '".$optPrenom."'
|
||||
|
|
Loading…
Reference in New Issue