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,16 +92,16 @@ $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 "<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=''>";

View File

@ -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 */

View File

@ -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 */

View File

@ -229,17 +229,19 @@ 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 += "<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=''>";
@ -256,8 +258,6 @@ function displayFoundPatients(foundPatients){
content += '</tr>';
}
content += '</table>';
// on vide le container
container.innerHTML = content;

View File

@ -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."'