From 4fce4e78a951b7e0720f9f1f9dbe372dad09eb60 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 10 Dec 2015 11:13:30 +0100 Subject: [PATCH] =?UTF-8?q?Condition=20n=C3=A9cessaire=20de=20soumission?= =?UTF-8?q?=20de=20
=20impl=C3=A9ment=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Consultations.php | 2 +- Medecins.php | 2 +- Patients.php | 4 ++-- js/patients.js | 13 +++++++++++++ managers/Medecin.class.php | 0 managers/Patient.class.php | 0 managers/RDV.class.php | 0 7 files changed, 17 insertions(+), 4 deletions(-) mode change 100644 => 100755 js/patients.js mode change 100644 => 100755 managers/Medecin.class.php mode change 100644 => 100755 managers/Patient.class.php mode change 100644 => 100755 managers/RDV.class.php diff --git a/Consultations.php b/Consultations.php index 879a0da..1b54a7b 100755 --- a/Consultations.php +++ b/Consultations.php @@ -73,7 +73,7 @@ if(!Authentification::checkUser(0)){ Durée de la consultation

- +
diff --git a/Medecins.php b/Medecins.php index 1f75fae..937b376 100755 --- a/Medecins.php +++ b/Medecins.php @@ -59,7 +59,7 @@ if(!Authentification::checkUser(0)){

- + diff --git a/Patients.php b/Patients.php index 209f63e..de35b96 100755 --- a/Patients.php +++ b/Patients.php @@ -84,8 +84,8 @@ if(!Authentification::checkUser(0)){ ?>
- - + + diff --git a/js/patients.js b/js/patients.js old mode 100644 new mode 100755 index e84072e..dc9c87a --- a/js/patients.js +++ b/js/patients.js @@ -7,6 +7,7 @@ var inVille = document.getElementById('crVille'); var inDN = document.getElementById('crDN'); var inLN = document.getElementById('crLN'); var inSecu = document.getElementById('crSecu'); +var sbCreer = document.getElementById('sbCreer'); // SUBMIT var inCk = new inputChecker(); // format de la date @@ -15,6 +16,7 @@ var dateFormat = new formatChecker(null, 'Ji/Mi/Aiii', { 'J': '[0-3]', 'M': '[0- var secuFormat = new formatChecker(null, 'S ii Mi ii iii iii ii', { 'S': '[0-1]', 'M': '[0-1]' } ); inCk.append( inCP, new formatChecker( null, 'iiiii'), '09000'); // on ajoute le CODE_POSTAL au vérificateur de champs inCk.append( inDN, dateFormat, '01/01/2015'); // on ajoute la DATE_NAISSANCE au vérificateur de champs +inCk.append( inSecu, secuFormat, '1 99 19 99 999 999 99'); // on ajoute le NUM_SECU au vérificateur de champs @@ -126,3 +128,14 @@ inSecu.addEventListener('keyup', function(e){ } } }, false); + + +sbCreer.addEventListener('click', function(e){ + e.preventDefault(); // on annule le submit() + + var inputCheckerValid = inCk.checkAll(); + var allInputValidated = inPrenom.className.indexOf('validated') > -1 && inNom.className.indexOf('validated') > -1 && inAdr.className.indexOf('validated') > -1 && inAdr2.className.indexOf('validated') > -1 && inCP.className.indexOf('validated') > -1 && inVille.className.indexOf('validated') > -1 && inDN.className.indexOf('validated') > -1 && inLN.className.indexOf('validated') > -1 && inSecu.className.indexOf('validated') > -1; + + if( inputCheckerValid && allInputValidated ) // si tout es ok uniquement, on submit() + sbCreer.parentNode.submit(); +}, false); \ No newline at end of file diff --git a/managers/Medecin.class.php b/managers/Medecin.class.php old mode 100644 new mode 100755 diff --git a/managers/Patient.class.php b/managers/Patient.class.php old mode 100644 new mode 100755 diff --git a/managers/RDV.class.php b/managers/RDV.class.php old mode 100644 new mode 100755