Avancement mineur

This commit is contained in:
xdrm-brackets 2015-12-26 13:05:56 +01:00
parent 67288b94bb
commit bfd116e2c9
6 changed files with 46 additions and 34 deletions

View File

@ -92,19 +92,19 @@ $patientsSearch = ( isset($_GET['patients']) ) ? json_decode( customCompression(
// pour chaque médecin // 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'])){ 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 '<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 // début modification
echo "<td><form class='updPatient' action='managers/' method='POST'>"; echo "<td colspan=5><form class='updPatient' action='managers/' method='POST'>";
echo "<input type='hidden' name='command' value='Patient:update'>"; echo "<input type='hidden' name='Id' value='". $PAT['Id'] ."'>";
echo "<input type='hidden' name='id_patient' value='".$PAT['Id']."'>"; echo "<input type='text' name='Civilite' value='". (($PAT['Civilite']=='M')?'Monsieur':'Madame') ."'>";
echo "<input type='submit' value=''>"; 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>'; echo '</form></td>';
// fin modification // fin modification

View File

@ -784,6 +784,18 @@ input[type=radio]:checked + label:before{
} }
/* Modification champ de recherche (patient/médecin/consultation) */ /* 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 .updPatient input[type=submit],
#CONTAINER > article .updMedecin input[type=submit]{ #CONTAINER > article .updMedecin input[type=submit]{
/* position */ /* position */

View File

@ -53,7 +53,7 @@ APIClass.prototype = {
if( ptrAPI.xhr[i].readyState == 4 ){ // si la requête est terminée if( ptrAPI.xhr[i].readyState == 4 ){ // si la requête est terminée
/* DEBUG : affiche la réponse BRUTE de API.php */ /* 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) ); console.log( JSON.parse(ptrAPI.xhr[i].responseText) );
/* si success de requête */ /* si success de requête */

View File

@ -229,19 +229,21 @@ sbCherche.addEventListener('click', function(e){
//////////////////////////////////////////// ////////////////////////////////////////////
function displayFoundPatients(foundPatients){ function displayFoundPatients(foundPatients){
var container = document.getElementById('searchResultPatient'); var container = document.getElementById('searchResultPatient');
var content = '<table>'; var content = '';
for( var i = 0 ; i < foundPatients.length ; i++ ){ for( var i = 0 ; i < foundPatients.length ; i++ ){
content += '<tr>'; 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 // début modification
content += "<td><form class='updPatient' action='managers/' method='POST'>"; content += "<td colspan=6><form class='updPatient' action='managers/' method='POST'>";
content += "<input type='hidden' name='command' value='Patient:update'>"; content += "<input type='hidden' name='Id' value='"+ foundPatients[i].Id +"'>";
content += "<input type='hidden' name='id_patient' 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 += "<input type='submit' value=''>";
content += '</form></td>'; content += '</form></td>';
// fin modification // fin modification
@ -256,8 +258,6 @@ function displayFoundPatients(foundPatients){
content += '</tr>'; content += '</tr>';
} }
content += '</table>';
// on vide le container // on vide le container
container.innerHTML = content; container.innerHTML = content;

View File

@ -26,7 +26,7 @@ class Patient
Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ])); Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ]));
else{ else{
$response = new Response(); $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(); $response->send();
} }
}else{ }else{
@ -38,7 +38,7 @@ class Patient
Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ])); Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ]));
else{ else{
$response = new Response(); $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(); $response->send();
} }
@ -52,7 +52,7 @@ class Patient
Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ])); Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ]));
else{ else{
$response = new Response(); $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(); $response->send();
} }
@ -73,7 +73,7 @@ class Patient
else{ else{
$response = new Response(); $response = new Response();
// $response->write("patients=".$compressed_json); // $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(); $response->send();
} }
}else{ }else{
@ -85,7 +85,7 @@ class Patient
Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ])); Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ]));
else{ else{
$response = new Response(); $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(); $response->send();
} }
} }
@ -106,7 +106,7 @@ class Patient
Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ])); Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ]));
else{ else{
$response = new Response(); $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(); $response->send();
} }
@ -119,7 +119,7 @@ class Patient
Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ])); Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ]));
else{ else{
$response = new Response(); $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(); $response->send();
} }
} }
@ -132,7 +132,7 @@ class Patient
Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ])); Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ]));
else{ else{
$response = new Response(); $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(); $response->send();
} }
} }
@ -149,7 +149,7 @@ class Patient
Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ])); Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ]));
else{ else{
$response = new Response(); $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(); $response->send();
} }
@ -162,7 +162,7 @@ class Patient
Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ])); Response::quickResponse(200, json_encode([ 'status' => $_status, 'title' => $_title, 'message' => $_message ]));
else{ else{
$response = new Response(); $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(); $response->send();
} }
} }

View File

@ -134,7 +134,7 @@ class PatientRepo
$optPrenom = ( $prenom != 'null' && StaticRepo::checkParam($prenom,'String45') ) ? '%'.$prenom.'%' : '%'; $optPrenom = ( $prenom != 'null' && StaticRepo::checkParam($prenom,'String45') ) ? '%'.$prenom.'%' : '%';
$optNom = ( $nom != 'null' && StaticRepo::checkParam($nom, 'String45') ) ? '%'.$nom.'%' : '%'; $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 FROM Patient
WHERE Nom LIKE '".$optNom."' WHERE Nom LIKE '".$optNom."'
AND Prenom LIKE '".$optPrenom."' AND Prenom LIKE '".$optPrenom."'