Total |
-
- 92.35% covered (success)
+
+ 90.78% covered (success)
|
- 92.35% |
- 169 / 183 |
+ 90.78% |
+ 197 / 217 |
-
- 69.23% covered (warning)
+
+ 65.38% covered (warning)
|
- 69.23% |
- 18 / 26 |
+ 65.38% |
+ 17 / 26 |
0.00% covered (danger)
@@ -71,21 +71,21 @@
repos |
-
- 94.16% covered (success)
+
+ 92.73% covered (success)
|
- 94.16% |
- 129 / 137 |
+ 92.73% |
+ 153 / 165 |
-
- 72.73% covered (warning)
+
+ 68.18% covered (warning)
|
- 72.73% |
- 16 / 22 |
+ 68.18% |
+ 15 / 22 |
0.00% covered (danger)
@@ -99,13 +99,13 @@
StaticRepo.php |
-
- 86.96% covered (warning)
+
+ 84.62% covered (warning)
|
- 86.96% |
- 40 / 46 |
+ 84.62% |
+ 44 / 52 |
diff --git a/coverage/repos/MedecinRepo.php.html b/coverage/repos/MedecinRepo.php.html
index cc941fd..644839d 100755
--- a/coverage/repos/MedecinRepo.php.html
+++ b/coverage/repos/MedecinRepo.php.html
@@ -61,13 +61,13 @@
5 / 6 |
CRAP |
-
- 95.83% covered (success)
+
+ 96.43% covered (success)
|
- 95.83% |
- 23 / 24 |
+ 96.43% |
+ 27 / 28 |
|
@@ -88,15 +88,15 @@
83.33% |
5 / 6 |
- 12 |
+ 15 |
-
- 95.83% covered (success)
+
+ 96.43% covered (success)
|
- 95.83% |
- 23 / 24 |
+ 96.43% |
+ 27 / 28 |
@@ -130,19 +130,19 @@
0.00% |
0 / 1 |
- 5.07 |
+ 5.03 |
-
- 85.71% covered (warning)
+
+ 88.89% covered (warning)
|
- 85.71% |
- 6 / 7 |
+ 88.89% |
+ 8 / 9 |
- delete |
+ delete |
100.00% covered (success)
@@ -151,7 +151,7 @@
|
100.00% |
1 / 1 |
- 1 |
+ 2 |
100.00% covered (success)
@@ -159,11 +159,11 @@
|
100.00% |
- 2 / 2 |
+ 3 / 3 |
- search |
+ search |
100.00% covered (success)
@@ -172,7 +172,7 @@
|
100.00% |
1 / 1 |
- 1 |
+ 3 |
100.00% covered (success)
@@ -180,11 +180,11 @@
|
100.00% |
- 4 / 4 |
+ 5 / 5 |
- getPatients |
+ getPatients |
100.00% covered (success)
@@ -205,7 +205,7 @@
|
- getAll |
+ getAll |
100.00% covered (success)
@@ -259,44 +259,53 @@
| $result = $req->execute(['civilite' => $civilite, |
| 'nom' => $nom, |
| 'prenom' => $prenom]); |
- | if($result != false){return StaticRepo::getConnexion()->lastInsertId();} |
- | else{return false;} |
- | } |
- | |
- | public static function delete($idMedecin){ |
- | $req = StaticRepo::getConnexion()->prepare('DELETE FROM Medecin WHERE Id = :id'); |
- | return $req->execute(['id' => $idMedecin]); |
- | } |
+ | |
+ | $id = StaticRepo::getConnexion()->lastInsertId(); |
+ | settype($id,'integer'); |
+ | if($result){return $id;} |
+ | else{return false;} |
+ | } |
+ | |
+ | public static function delete($idMedecin){ |
| |
- | public static function search($nom,$prenom){ |
- | $req = StaticRepo::getConnexion()->prepare('SELECT * FROM Medecin WHERE Nom LIKE :nom AND Prenom LIKE :prenom'); |
- | $req->execute(['nom' => $nom, |
- | 'prenom' => $prenom]); |
- | |
- | return StaticRepo::delNumeric($req->fetchAll()); |
- | } |
+ | if(!StaticRepo::checkParam($idMedecin,'Integer')){return false;} |
+ | |
+ | $req = StaticRepo::getConnexion()->prepare('DELETE FROM Medecin WHERE Id = :id'); |
+ | return $req->execute(['id' => $idMedecin]); |
+ | } |
+ | |
+ | public static function search($nom,$prenom){ |
| |
- | public static function getPatients($idMedecin){ |
+ | if(!StaticRepo::checkParam($prenom,'String45') && !StaticRepo::checkParam($nom,'String45')){return false;} |
| |
- | if(!StaticRepo::checkParam($idMedecin,'Integer')){return false;} |
- | |
- | $req = StaticRepo::getConnexion()->prepare('SELECT Patient.* FROM Patient,Medecin |
- | WHERE Medecin.Id = :id |
- | AND Medecin.Id = Patient.MedecinTraitant'); |
- | |
- | $req->execute(['id' => $idMedecin]); |
- | return StaticRepo::delNumeric($req->fetchAll()); |
- | } |
- | |
- | public static function getAll(){ |
- | |
- | $req = StaticRepo::getConnexion()->query('SELECT * FROM Medecin ORDER BY nom, prenom ASC'); |
- | |
- | return StaticRepo::delNumeric( $req->fetchAll() ); |
- | |
- | } |
- | |
- | } |
+ | $req = StaticRepo::getConnexion()->prepare('SELECT * FROM Medecin WHERE Nom LIKE :nom AND Prenom LIKE :prenom'); |
+ | $req->execute(['nom' => $nom, |
+ | 'prenom' => $prenom]); |
+ | |
+ | return StaticRepo::delNumeric($req->fetchAll()); |
+ | } |
+ | |
+ | public static function getPatients($idMedecin){ |
+ | |
+ | if(!StaticRepo::checkParam($idMedecin,'Integer')){return false;} |
+ | |
+ | $req = StaticRepo::getConnexion()->prepare('SELECT Patient.* FROM Patient,Medecin |
+ | WHERE Medecin.Id = :id |
+ | AND Medecin.Id = Patient.MedecinTraitant'); |
+ | |
+ | $req->execute(['id' => $idMedecin]); |
+ | return StaticRepo::delNumeric($req->fetchAll()); |
+ | } |
+ | |
+ | public static function getAll(){ |
+ | |
+ | $req = StaticRepo::getConnexion()->query('SELECT * FROM Medecin ORDER BY nom, prenom ASC'); |
+ | |
+ | return StaticRepo::delNumeric( $req->fetchAll() ); |
+ | |
+ | } |
+ | |
+ | } |
@@ -309,7 +318,7 @@
Dead Code
- Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.0 at Thu Dec 10 10:12:27 UTC 2015.
+ Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.0 at Thu Dec 10 10:46:08 UTC 2015.
diff --git a/coverage/repos/PatientRepo.php.html b/coverage/repos/PatientRepo.php.html
index 0533854..590790d 100755
--- a/coverage/repos/PatientRepo.php.html
+++ b/coverage/repos/PatientRepo.php.html
@@ -61,13 +61,13 @@
5 / 7 |
CRAP |
-
- 95.65% covered (success)
+
+ 96.88% covered (success)
|
- 95.65% |
- 44 / 46 |
+ 96.88% |
+ 62 / 64 |
|
@@ -88,15 +88,15 @@
71.43% |
5 / 7 |
- 9 |
+ 39 |
-
- 95.65% covered (success)
+
+ 96.88% covered (success)
|
- 95.65% |
- 44 / 46 |
+ 96.88% |
+ 62 / 64 |
@@ -109,7 +109,70 @@
100.00% |
1 / 1 |
- 1 |
+ 2 |
+
+
+ 100.00% covered (success)
+
+
+ |
+ 100.00% |
+ 4 / 4 |
+
+
+
+ add |
+
+
+ 0.00% covered (danger)
+
+
+ |
+ 0.00% |
+ 0 / 1 |
+ 14 |
+
+
+ 95.65% covered (success)
+
+
+ |
+ 95.65% |
+ 22 / 23 |
+
+
+
+ update |
+
+
+ 0.00% covered (danger)
+
+
+ |
+ 0.00% |
+ 0 / 1 |
+ 14 |
+
+
+ 96.00% covered (success)
+
+
+ |
+ 96.00% |
+ 24 / 25 |
+
+
+
+ delete |
+
+
+ 100.00% covered (success)
+
+
+ |
+ 100.00% |
+ 1 / 1 |
+ 2 |
100.00% covered (success)
@@ -121,49 +184,7 @@
|
- add |
-
-
- 0.00% covered (danger)
-
-
- |
- 0.00% |
- 0 / 1 |
- 2.00 |
-
-
- 93.75% covered (success)
-
-
- |
- 93.75% |
- 15 / 16 |
-
-
-
- update |
-
-
- 0.00% covered (danger)
-
-
- |
- 0.00% |
- 0 / 1 |
- 2.00 |
-
-
- 94.44% covered (success)
-
-
- |
- 94.44% |
- 17 / 18 |
-
-
-
- delete |
+ updateMedecinTraitant |
100.00% covered (success)
@@ -172,49 +193,7 @@
|
100.00% |
1 / 1 |
- 1 |
-
-
- 100.00% covered (success)
-
-
- |
- 100.00% |
- 2 / 2 |
-
-
-
- updateMedecinTraitant |
-
-
- 100.00% covered (success)
-
-
- |
- 100.00% |
- 1 / 1 |
- 1 |
-
-
- 100.00% covered (success)
-
-
- |
- 100.00% |
- 2 / 2 |
-
-
-
- search |
-
-
- 100.00% covered (success)
-
-
- |
- 100.00% |
- 1 / 1 |
- 1 |
+ 3 |
100.00% covered (success)
@@ -226,7 +205,28 @@
|
- getAll |
+ search |
+
+
+ 100.00% covered (success)
+
+
+ |
+ 100.00% |
+ 1 / 1 |
+ 3 |
+
+
+ 100.00% covered (success)
+
+
+ |
+ 100.00% |
+ 4 / 4 |
+
+
+
+ getAll |
100.00% covered (success)
@@ -262,95 +262,117 @@
| class PatientRepo |
| { |
| public static function getById($id){ |
- | |
- | |
- | |
- | $req = StaticRepo::getConnexion()->prepare('SELECT * FROM Patient WHERE Id = :id'); |
- | $req->execute(['id' => $id]); |
- | return StaticRepo::delNumeric( $req->fetch(), true ); |
- | |
- | } |
- | |
- | public static function add($civilite,$prenom,$nom,$adresse,$adresse2,$ville,$codePostal,$dateNaissance,$lieuNaissance,$numSecu,$medecinTraitant = null){ |
- | |
- | $dateNaissance = strtotime($dateNaissance); |
- | $dateNaissance = Date('o-m-d',$dateNaissance); |
- | |
- | $req = StaticRepo::getConnexion()->prepare('INSERT INTO Patient VALUES (DEFAULT,:civilite,:nom,:prenom,:adresse,:adresse2,:ville,:codePostal,:dateNaissance,:lieuNaissance,:numSecu,:medecin)'); |
- | $result = $req->execute(['civilite' => $civilite, |
- | 'nom' => $nom, |
- | 'prenom' => $prenom, |
- | 'adresse' => $adresse, |
- | 'adresse2' => $adresse2, |
- | 'ville' => $ville, |
- | 'codePostal' => $codePostal, |
- | 'dateNaissance' => $dateNaissance, |
- | 'lieuNaissance' => $lieuNaissance, |
- | 'numSecu' => $numSecu, |
- | 'medecin' => $medecinTraitant ]); |
- | if($result){return StaticRepo::getConnexion()->lastInsertId();} |
- | else{return false;} |
- | |
- | } |
- | |
- | public static function update($id,$civilite,$prenom,$nom,$adresse,$adresse2,$ville,$codePostal,$dateNaissance,$lieuNaissance,$numSecu,$medecinTraitant){ |
- | $dateNaissance = strtotime($dateNaissance); |
- | $dateNaissance = Date('o-m-d',$dateNaissance); |
- | |
- | $req = StaticRepo::getConnexion()->prepare('UPDATE Patient SET Civilite=:civilite,Nom=:nom,Prenom=:prenom,Adresse=:adresse,Adresse2=:adresse2,Ville=:ville, |
- | CodePostal=:codePostal,DateNaissance=:dateNaissance,LieuNaissance=:lieuNaissance,NumSecuriteSociale=:numSecu,MedecinTraitant=:medecin WHERE Id=:id;'); |
- | $result = $req->execute(['civilite' => $civilite, |
- | 'nom' => $nom, |
- | 'prenom' => $prenom, |
- | 'adresse' => $adresse, |
- | 'adresse2' => $adresse2, |
- | 'ville' => $ville, |
- | 'codePostal' => $codePostal, |
- | 'dateNaissance' => $dateNaissance, |
- | 'lieuNaissance' => $lieuNaissance, |
- | 'numSecu' => $numSecu, |
- | 'medecin' => $medecinTraitant, |
- | 'id' => $id]); |
- | if($result){return StaticRepo::getConnexion()->lastInsertId();} |
- | else{return false;} |
+ | if(!StaticRepo::checkParam($id,'Integer')){return false;} |
+ | |
+ | $req = StaticRepo::getConnexion()->prepare('SELECT * FROM Patient WHERE Id = :id'); |
+ | $req->execute(['id' => $id]); |
+ | return StaticRepo::delNumeric( $req->fetch(), true ); |
+ | |
+ | } |
+ | |
+ | public static function add($civilite,$prenom,$nom,$adresse,$adresse2,$ville,$codePostal,$dateNaissance,$lieuNaissance,$numSecu,$medecinTraitant = null){ |
+ | |
+ | if(!StaticRepo::checkParam($civilite,'Civilite') && !StaticRepo::checkParam($prenom,'String45') && !StaticRepo::checkParam($nom,'String45') |
+ | && !StaticRepo::checkParam($adresse,'String255') && !StaticRepo::checkParam($adresse2,'String255')&& !StaticRepo::checkParam($ville,'String50') |
+ | && !StaticRepo::checkParam($codePostal,'String5') && !StaticRepo::checkParam($dateNaissance,'Date') && !StaticRepo::checkParam($lieuNaissance,'String50') |
+ | && !StaticRepo::checkParam($numSecu,'String15')){return false;} |
+ | |
+ | if($medecinTraitant != null && !StaticRepo::checkParam($medecinTraitant,'Integer')){return false;} |
+ | |
+ | $dateNaissance = strtotime($dateNaissance); |
+ | $dateNaissance = Date('o-m-d',$dateNaissance); |
+ | |
+ | $req = StaticRepo::getConnexion()->prepare('INSERT INTO Patient VALUES (DEFAULT,:civilite,:nom,:prenom,:adresse,:adresse2,:ville,:codePostal,:dateNaissance,:lieuNaissance,:numSecu,:medecin)'); |
+ | $result = $req->execute(['civilite' => $civilite, |
+ | 'nom' => $nom, |
+ | 'prenom' => $prenom, |
+ | 'adresse' => $adresse, |
+ | 'adresse2' => $adresse2, |
+ | 'ville' => $ville, |
+ | 'codePostal' => $codePostal, |
+ | 'dateNaissance' => $dateNaissance, |
+ | 'lieuNaissance' => $lieuNaissance, |
+ | 'numSecu' => $numSecu, |
+ | 'medecin' => $medecinTraitant ]); |
+ | |
+ | $id = StaticRepo::getConnexion()->lastInsertId(); |
+ | settype($id,'integer'); |
+ | if($result){return $id;} |
+ | else{return false;} |
+ | |
+ | } |
+ | |
+ | public static function update($id,$civilite,$prenom,$nom,$adresse,$adresse2,$ville,$codePostal,$dateNaissance,$lieuNaissance,$numSecu,$medecinTraitant){ |
+ | |
+ | if(!StaticRepo::checkParam($civilite,'Civilite') && !StaticRepo::checkParam($prenom,'String45') && !StaticRepo::checkParam($nom,'String45') |
+ | && !StaticRepo::checkParam($adresse,'String255') && !StaticRepo::checkParam($adresse2,'String255')&& !StaticRepo::checkParam($ville,'String50') |
+ | && !StaticRepo::checkParam($codePostal,'String5') && !StaticRepo::checkParam($dateNaissance,'Date') && !StaticRepo::checkParam($lieuNaissance,'String50') |
+ | && !StaticRepo::checkParam($numSecu,'String15')){return false;} |
+ | |
+ | if($medecinTraitant != null && !StaticRepo::checkParam($medecinTraitant,'Integer')){return false;} |
+ | |
+ | $dateNaissance = strtotime($dateNaissance); |
+ | $dateNaissance = Date('o-m-d',$dateNaissance); |
| |
- | } |
- | |
- | public static function delete($idPatient){ |
- | |
- | |
- | |
- | $req = StaticRepo::getConnexion()->prepare('DELETE FROM Patient WHERE Patient.Id = :id'); |
- | return $req->execute(['id' => $idPatient]); |
- | |
- | } |
- | |
- | public static function updateMedecinTraitant($idPatient,$idMedecin){ |
- | |
- | |
- | |
- | $req = StaticRepo::getConnexion()->prepare('UPDATE Patient SET MedecinTraitant = :medecin WHERE Id = :id'); |
- | return $req->execute(['medecin' => $idMedecin, 'id' => $idPatient]); |
- | |
- | } |
+ | $req = StaticRepo::getConnexion()->prepare('UPDATE Patient SET Civilite=:civilite,Nom=:nom,Prenom=:prenom,Adresse=:adresse,Adresse2=:adresse2,Ville=:ville, |
+ | CodePostal=:codePostal,DateNaissance=:dateNaissance,LieuNaissance=:lieuNaissance,NumSecuriteSociale=:numSecu,MedecinTraitant=:medecin WHERE Id=:id;'); |
+ | $result = $req->execute(['civilite' => $civilite, |
+ | 'nom' => $nom, |
+ | 'prenom' => $prenom, |
+ | 'adresse' => $adresse, |
+ | 'adresse2' => $adresse2, |
+ | 'ville' => $ville, |
+ | 'codePostal' => $codePostal, |
+ | 'dateNaissance' => $dateNaissance, |
+ | 'lieuNaissance' => $lieuNaissance, |
+ | 'numSecu' => $numSecu, |
+ | 'medecin' => $medecinTraitant, |
+ | 'id' => $id]); |
+ | |
+ | $id = StaticRepo::getConnexion()->lastInsertId(); |
+ | settype($id,'integer'); |
+ | if($result){return $id;} |
+ | else{return false;} |
| |
- | public static function search($nom,$prenom){ |
+ | } |
| |
- | $req = StaticRepo::getConnexion()->prepare('SELECT * FROM Patient WHERE Nom LIKE :nom AND Prenom LIKE :prenom'); |
- | $req->execute(['nom' => $nom, 'prenom' => $prenom]); |
- | return StaticRepo::delNumeric($req->fetchAll()); |
+ | public static function delete($idPatient){ |
+ | |
+ | if(!StaticRepo::checkParam($idPatient,'Integer')){ return false;} |
| |
- | } |
- | |
- | public static function getAll(){ |
- | |
- | $req = StaticRepo::getConnexion()->query('SELECT * FROM Patient ORDER BY nom, prenom ASC'); |
- | |
- | return StaticRepo::delNumeric( $req->fetchAll() ); |
- | |
- | } |
- | |
- | } |
+ | $req = StaticRepo::getConnexion()->prepare('DELETE FROM Patient WHERE Patient.Id = :id'); |
+ | return $req->execute(['id' => $idPatient]); |
+ | |
+ | } |
+ | |
+ | public static function updateMedecinTraitant($idPatient,$idMedecin){ |
+ | |
+ | if(!StaticRepo::checkParam($idPatient,'Integer') && !StaticRepo::checkParam($idMedecin,'Integer')){return false;} |
+ | |
+ | $req = StaticRepo::getConnexion()->prepare('UPDATE Patient SET MedecinTraitant = :medecin WHERE Id = :id'); |
+ | return $req->execute(['medecin' => $idMedecin, 'id' => $idPatient]); |
+ | |
+ | } |
+ | |
+ | public static function search($nom,$prenom){ |
+ | |
+ | if(!StaticRepo::checkParam($prenom,'String45') && !StaticRepo::checkParam($nom,'String45')){return false;} |
+ | |
+ | $req = StaticRepo::getConnexion()->prepare('SELECT * FROM Patient WHERE Nom LIKE :nom AND Prenom LIKE :prenom'); |
+ | $req->execute(['nom' => $nom, 'prenom' => $prenom]); |
+ | return StaticRepo::delNumeric($req->fetchAll()); |
+ | |
+ | } |
+ | |
+ | public static function getAll(){ |
+ | |
+ | $req = StaticRepo::getConnexion()->query('SELECT * FROM Patient ORDER BY nom, prenom ASC'); |
+ | |
+ | return StaticRepo::delNumeric( $req->fetchAll() ); |
+ | |
+ | } |
+ | |
+ | } |
@@ -363,7 +385,7 @@
Dead Code
- Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.0 at Thu Dec 10 10:12:27 UTC 2015.
+ Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.0 at Thu Dec 10 10:46:08 UTC 2015.
diff --git a/coverage/repos/RDVRepo.php.html b/coverage/repos/RDVRepo.php.html
index 20da2c0..2967ba9 100755
--- a/coverage/repos/RDVRepo.php.html
+++ b/coverage/repos/RDVRepo.php.html
@@ -52,22 +52,22 @@
0.00% |
0 / 1 |
-
- 71.43% covered (warning)
+
+ 57.14% covered (warning)
|
- 71.43% |
- 5 / 7 |
+ 57.14% |
+ 4 / 7 |
CRAP |
-
-
- 92.68% covered (success)
+
+
+ 85.11% covered (warning)
|
- 92.68% |
- 38 / 41 |
+ 85.11% |
+ 40 / 47 |
| |
@@ -81,22 +81,22 @@
0.00% |
0 / 1 |
-
- 71.43% covered (warning)
+
+ 57.14% covered (warning)
|
- 71.43% |
- 5 / 7 |
- 11.05 |
-
-
- 92.68% covered (success)
+ 57.14% |
+ 4 / 7 |
+ 19.07 |
+
+
+ 85.11% covered (warning)
|
- 92.68% |
- 38 / 41 |
+ 85.11% |
+ 40 / 47 |
|
@@ -109,7 +109,49 @@
100.00% |
1 / 1 |
- 1 |
+ 2 |
+
+
+ 100.00% covered (success)
+
+
+ |
+ 100.00% |
+ 4 / 4 |
+
+
+
+ getByDate |
+
+
+ 0.00% covered (danger)
+
+
+ |
+ 0.00% |
+ 0 / 1 |
+ 4.05 |
+
+
+ 20.00% covered (danger)
+
+
+ |
+ 20.00% |
+ 1 / 5 |
+
+
+
+ delete |
+
+
+ 100.00% covered (success)
+
+
+ |
+ 100.00% |
+ 1 / 1 |
+ 2 |
100.00% covered (success)
@@ -121,49 +163,7 @@
|
- getByDate |
-
-
- 100.00% covered (success)
-
-
- |
- 100.00% |
- 1 / 1 |
- 1 |
-
-
- 100.00% covered (success)
-
-
- |
- 100.00% |
- 4 / 4 |
-
-
-
- delete |
-
-
- 100.00% covered (success)
-
-
- |
- 100.00% |
- 1 / 1 |
- 1 |
-
-
- 100.00% covered (success)
-
-
- |
- 100.00% |
- 2 / 2 |
-
-
-
- add |
+ add |
0.00% covered (danger)
@@ -172,19 +172,19 @@
|
0.00% |
0 / 1 |
- 2.01 |
-
-
- 88.89% covered (warning)
+ 6.02 |
+
+
+ 91.67% covered (success)
|
- 88.89% |
- 8 / 9 |
+ 91.67% |
+ 11 / 12 |
|
- updateDateTime |
+ updateDateTime |
100.00% covered (success)
@@ -205,7 +205,7 @@
|
- getByPatientAndDate |
+ getByPatientAndDate |
100.00% covered (success)
@@ -226,7 +226,7 @@
|
- getAll |
+ getAll |
0.00% covered (danger)
@@ -263,72 +263,87 @@
| { |
| |
| public static function getById($id){ |
- | $req = StaticRepo::getConnexion()->prepare('SELECT * FROM RDV WHERE RDV.id = :id'); |
- | $req->execute(['id' => $id]); |
- | return StaticRepo::delNumeric( $req->fetch(), true ); |
- | |
- | } |
- | |
- | public static function getByDate($date){ |
- | $date = date('Y-m-d',strtotime($date)); |
- | $req = StaticRepo::getConnexion()->prepare('SELECT * FROM RDV WHERE DATE(DateRDV) = :date ORDER BY DateRDV ASC'); |
- | $req->execute(['date' => $date]); |
- | return StaticRepo::delNumeric($req->fetchAll()); |
- | } |
+ | |
+ | if(!StaticRepo::checkParam($id,'Integer')){return false;} |
+ | |
+ | $req = StaticRepo::getConnexion()->prepare('SELECT * FROM RDV WHERE RDV.id = :id'); |
+ | $req->execute(['id' => $id]); |
+ | return StaticRepo::delNumeric( $req->fetch(), true ); |
+ | |
+ | } |
+ | |
+ | public static function getByDate($date){ |
+ | |
+ | if(!StaticRepo::checkParam($date,'Date')){return false;} |
| |
- | public static function delete($idRDV){ |
- | $req = StaticRepo::getConnexion()->prepare('DELETE FROM RDV WHERE RDV.id = :id'); |
- | return $req->execute(['id' => $idRDV]); |
- | } |
- | |
- | public static function add($date,$duree,$idPatient,$idMedecin){ |
- | $date = date('Y-m-d H:i:s',strtotime($date)); |
- | $duree = date('H:i:s',$duree*60); |
- | $req = StaticRepo::getConnexion()->prepare('INSERT INTO RDV VALUES (DEFAULT,:date,:duree,:patient,:medecin)'); |
- | $result = $req->execute(['date' => $date, |
- | 'duree' => $duree, |
- | 'patient' => $idPatient, |
- | 'medecin' => $idMedecin]); |
+ | $date = date('Y-m-d',strtotime($date)); |
+ | $req = StaticRepo::getConnexion()->prepare('SELECT * FROM RDV WHERE DATE(DateRDV) = :date ORDER BY DateRDV ASC'); |
+ | $req->execute(['date' => $date]); |
+ | return StaticRepo::delNumeric($req->fetchAll()); |
+ | } |
+ | |
+ | public static function delete($idRDV){ |
+ | |
+ | if(!StaticRepo::checkParam($idRDV,'Integer')){return false;} |
+ | |
+ | $req = StaticRepo::getConnexion()->prepare('DELETE FROM RDV WHERE RDV.id = :id'); |
+ | return $req->execute(['id' => $idRDV]); |
+ | } |
| |
- | if($result != false){return StaticRepo::getConnexion()->lastInsertId();} |
- | else{return false;} |
- | } |
+ | public static function add($date,$duree,$idPatient,$idMedecin){ |
+ | |
+ | if(!StaticRepo::checkParam($date,'Date') && !StaticRepo::checkParam($duree,'Integer') && !StaticRepo::checkParam($idPatient,'Integer') && !StaticRepo::checkParam($idMedecin,'Integer')){return false;} |
| |
- | public static function updateDateTime($idRDV,$dateTime){ |
- | $date = date('Y-m-d H:i:s',strtotime($dateTime)); |
- | $req = StaticRepo::getConnexion()->prepare('UPDATE RDV SET DateRDV = :date WHERE id = :id'); |
- | return $req->execute(['date' => $date, |
- | 'id' => $idRDV]); |
- | } |
- | |
- | public static function getByPatientAndDate($idPatient,$date){ |
- | $date = date('Y-m-d',strtotime($date)); |
- | $req = StaticRepo::getConnexion()->prepare('SELECT * FROM RDV WHERE Patient_Id=:patient AND DATE(DateRDV)=:date'); |
- | $req->execute(['patient' => $idPatient, |
- | 'date' => $date]); |
- | return StaticRepo::delNumeric($req->fetchAll()); |
+ | $date = date('Y-m-d H:i:s',strtotime($date)); |
+ | $duree = date('H:i:s',$duree*60); |
+ | $req = StaticRepo::getConnexion()->prepare('INSERT INTO RDV VALUES (DEFAULT,:date,:duree,:patient,:medecin)'); |
+ | $result = $req->execute(['date' => $date, |
+ | 'duree' => $duree, |
+ | 'patient' => $idPatient, |
+ | 'medecin' => $idMedecin]); |
+ | |
+ | |
+ | $id = StaticRepo::getConnexion()->lastInsertId(); |
+ | settype($id,'integer'); |
+ | if($result){return $id;} |
+ | else{return false;} |
| } |
| |
- | public static function getAll($date = 0){ |
- | $dateTime = date('Y-m-d',time()); |
- | switch($date){ |
- | case -1: |
- | $req = StaticRepo::getConnexion()->prepare('SELECT * FROM RDV WHERE DATE(DateRDV) <= :date ORDER BY DateRDV ASC'); |
- | $req->execute(['date' => $dateTime]); |
- | break; |
- | case 0: |
- | $req = StaticRepo::getConnexion()->prepare('SELECT * FROM RDV ORDER BY DateRDV ASC'); |
- | $req->execute(); |
- | break; |
- | case 1: |
- | $req = StaticRepo::getConnexion()->prepare('SELECT * FROM RDV WHERE DATE(DateRDV) >= :date ORDER BY DateRDV ASC'); |
- | $req->execute(['date' => $dateTime]); |
- | break; |
- | } |
- | return StaticRepo::delNumeric($req->fetchAll()); |
- | } |
- | |
- | } |
+ | public static function updateDateTime($idRDV,$dateTime){ |
+ | $date = date('Y-m-d H:i:s',strtotime($dateTime)); |
+ | $req = StaticRepo::getConnexion()->prepare('UPDATE RDV SET DateRDV = :date WHERE id = :id'); |
+ | return $req->execute(['date' => $date, |
+ | 'id' => $idRDV]); |
+ | } |
+ | |
+ | public static function getByPatientAndDate($idPatient,$date){ |
+ | $date = date('Y-m-d',strtotime($date)); |
+ | $req = StaticRepo::getConnexion()->prepare('SELECT * FROM RDV WHERE Patient_Id=:patient AND DATE(DateRDV)=:date'); |
+ | $req->execute(['patient' => $idPatient, |
+ | 'date' => $date]); |
+ | return StaticRepo::delNumeric($req->fetchAll()); |
+ | } |
+ | |
+ | public static function getAll($date = 0){ |
+ | $dateTime = date('Y-m-d',time()); |
+ | switch($date){ |
+ | case -1: |
+ | $req = StaticRepo::getConnexion()->prepare('SELECT * FROM RDV WHERE DATE(DateRDV) <= :date ORDER BY DateRDV ASC'); |
+ | $req->execute(['date' => $dateTime]); |
+ | break; |
+ | case 0: |
+ | $req = StaticRepo::getConnexion()->prepare('SELECT * FROM RDV ORDER BY DateRDV ASC'); |
+ | $req->execute(); |
+ | break; |
+ | case 1: |
+ | $req = StaticRepo::getConnexion()->prepare('SELECT * FROM RDV WHERE DATE(DateRDV) >= :date ORDER BY DateRDV ASC'); |
+ | $req->execute(['date' => $dateTime]); |
+ | break; |
+ | } |
+ | return StaticRepo::delNumeric($req->fetchAll()); |
+ | } |
+ | |
+ | } |
@@ -341,7 +356,7 @@
Dead Code
- Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.0 at Thu Dec 10 10:12:27 UTC 2015.
+ Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.0 at Thu Dec 10 10:46:08 UTC 2015.
diff --git a/coverage/repos/StatsRepo.php.html b/coverage/repos/StatsRepo.php.html
index 59c7604..dd23b07 100755
--- a/coverage/repos/StatsRepo.php.html
+++ b/coverage/repos/StatsRepo.php.html
@@ -213,7 +213,7 @@
Dead Code
- Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.0 at Thu Dec 10 10:12:27 UTC 2015.
+ Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.0 at Thu Dec 10 10:46:08 UTC 2015.
diff --git a/coverage/repos/dashboard.html b/coverage/repos/dashboard.html
index 8b92fa9..ce784c4 100755
--- a/coverage/repos/dashboard.html
+++ b/coverage/repos/dashboard.html
@@ -59,6 +59,7 @@
|
+ RDVRepo | 85% |
@@ -75,6 +76,7 @@
|
+ RDVRepo | 19 |
@@ -112,9 +114,9 @@
|