0.00% covered (danger)
@@ -99,13 +99,13 @@
StaticRepo.php |
-
- 84.91% covered (warning)
+
+ 83.93% covered (warning)
|
- 84.91% |
- 45 / 53 |
+ 83.93% |
+ 47 / 56 |
diff --git a/coverage/repos/MedecinRepo.php.html b/coverage/repos/MedecinRepo.php.html
index 794fa2e..3ee9160 100755
--- a/coverage/repos/MedecinRepo.php.html
+++ b/coverage/repos/MedecinRepo.php.html
@@ -52,22 +52,22 @@
0.00% |
0 / 1 |
-
- 83.33% covered (warning)
+
+ 85.71% covered (warning)
|
- 83.33% |
- 5 / 6 |
+ 85.71% |
+ 6 / 7 |
CRAP |
-
- 96.43% covered (success)
+
+ 97.06% covered (success)
|
- 96.43% |
- 27 / 28 |
+ 97.06% |
+ 33 / 34 |
|
@@ -81,22 +81,22 @@
0.00% |
0 / 1 |
-
- 83.33% covered (warning)
+
+ 85.71% covered (warning)
|
- 83.33% |
- 5 / 6 |
- 15 |
+ 85.71% |
+ 6 / 7 |
+ 17 |
-
- 96.43% covered (success)
+
+ 97.06% covered (success)
|
- 96.43% |
- 27 / 28 |
+ 97.06% |
+ 33 / 34 |
@@ -130,7 +130,7 @@
0.00% |
0 / 1 |
- 5.03 |
+ 3.01 |
88.89% covered (warning)
@@ -142,7 +142,7 @@
|
- delete |
+ delete |
100.00% covered (success)
@@ -159,11 +159,11 @@
|
100.00% |
- 3 / 3 |
+ 4 / 4 |
- search |
+ search |
100.00% covered (success)
@@ -172,7 +172,7 @@
|
100.00% |
1 / 1 |
- 3 |
+ 6 |
100.00% covered (success)
@@ -180,11 +180,11 @@
|
100.00% |
- 5 / 5 |
+ 8 / 8 |
- getPatients |
+ getPatients |
100.00% covered (success)
@@ -205,7 +205,28 @@
|
- getAll |
+ getAll |
+
+
+ 100.00% covered (success)
+
+
+ |
+ 100.00% |
+ 1 / 1 |
+ 1 |
+
+
+ 100.00% covered (success)
+
+
+ |
+ 100.00% |
+ 2 / 2 |
+
+
+
+ update |
100.00% covered (success)
@@ -243,69 +264,89 @@
| |
| public static function getById($id){ |
| |
- | if(!StaticRepo::checkParam($id,'Integer')){return false;} |
+ | if(!StaticRepo::checkParam($id, 'Numeric')) return false; |
| |
- | $req = StaticRepo::getConnexion()->prepare('SELECT * FROM Medecin WHERE Id = :id'); |
- | $req->execute(['id' => $id]); |
- | return StaticRepo::delNumeric( $req->fetch(), true ); |
+ | $req = StaticRepo::getConnexion()->prepare('SELECT * FROM Medecin WHERE Id = :id'); |
+ | $req->execute(['id' => $id]); |
+ | return StaticRepo::delNumeric( $req->fetch(), true ); |
| |
| } |
| |
| public static function add($civilite,$prenom,$nom){ |
| |
- | if(!StaticRepo::checkParam($civilite,'Civilite') && !StaticRepo::checkParam($prenom,'String45') && !StaticRepo::checkParam($nom,'String45')){return false;} |
+ | if(!StaticRepo::checkParam($civilite,'Civilite') | !StaticRepo::checkParam($prenom,'String45') | !StaticRepo::checkParam($nom,'String45')) return false; |
| |
- | $req = StaticRepo::getConnexion()->prepare('INSERT INTO Medecin VALUES (DEFAULT,:civilite,:prenom,:nom)'); |
- | $result = $req->execute(['civilite' => $civilite, |
- | 'nom' => $nom, |
- | 'prenom' => $prenom]); |
- | |
- | $id = StaticRepo::getConnexion()->lastInsertId(); |
- | settype($id,'integer'); |
- | if($result){return $id;} |
- | else{return false;} |
- | } |
+ | $req = StaticRepo::getConnexion()->prepare('INSERT INTO Medecin VALUES (DEFAULT,:civilite,:prenom,:nom)'); |
+ | $result = $req->execute(['civilite' => $civilite, |
+ | 'nom' => $nom, |
+ | 'prenom' => $prenom |
+ | ]); |
+ | |
+ | |
+ | $id = StaticRepo::getConnexion()->lastInsertId(); |
+ | settype($id, 'integer'); |
+ | |
| |
- | public static function delete($idMedecin){ |
- | |
- | if(!StaticRepo::checkParam($idMedecin,'Integer')){return false;} |
+ | if($result) return $id; |
+ | else return false; |
+ | } |
| |
- | $req = StaticRepo::getConnexion()->prepare('DELETE FROM Medecin WHERE Id = :id'); |
- | return $req->execute(['id' => $idMedecin]); |
- | } |
+ | public static function delete($idMedecin){ |
+ | |
+ | if(!StaticRepo::checkParam($idMedecin,'Numeric')) return false; |
| |
- | public static function search($nom,$prenom){ |
+ | var_dump($idMedecin); |
| |
- | if(!StaticRepo::checkParam($prenom,'String45') && !StaticRepo::checkParam($nom,'String45')){return false;} |
- | |
- | $req = StaticRepo::getConnexion()->prepare('SELECT * FROM Medecin WHERE Nom LIKE :nom AND Prenom LIKE :prenom'); |
- | $req->execute(['nom' => $nom, |
- | 'prenom' => $prenom]); |
+ | $req = StaticRepo::getConnexion()->prepare('DELETE FROM Medecin WHERE Id = :id'); |
+ | return $req->execute(['id' => $idMedecin]); |
+ | } |
+ | |
+ | public static function search($nom, $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() ); |
- | |
- | } |
- | |
- | } |
+ | if( !StaticRepo::checkParam($prenom,'String45') | !StaticRepo::checkParam($nom,'String45') ) return false; |
+ | |
+ | |
+ | $optPrenom = ( $prenom != 'null' && StaticRepo::checkParam($prenom,'String45') ) ? '%'.$prenom.'%' : '%'; |
+ | $optNom = ( $nom != 'null' && StaticRepo::checkParam($nom, 'String45') ) ? '%'.$nom.'%' : '%'; |
+ | |
+ | $req = StaticRepo::getConnexion()->query("SELECT Id, Civilite, Prenom, Nom |
+ | FROM Medecin |
+ | WHERE Nom LIKE '".$optNom."' |
+ | AND Prenom LIKE '".$optPrenom."' |
+ | ORDER BY Nom, Prenom ASC"); |
+ | |
+ | |
+ | return StaticRepo::delNumeric( $req->fetchAll() ); |
+ | } |
+ | |
+ | public static function getPatients($idMedecin){ |
+ | |
+ | if(!StaticRepo::checkParam($idMedecin,'Numeric')) 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() ); |
+ | |
+ | } |
+ | |
+ | |
+ | public static function update($id, $nom, $prenom){ |
+ | |
+ | $req = StaticRepo::getConnexion()->prepare("UPDATE Medecin SET Nom = :nom, Prenom = :prenom WHERE Id = :id"); |
+ | return $req->execute([ ':nom' => strtoupper($nom), ':prenom' => $prenom, ':id' => $id ]); |
+ | } |
+ | |
+ | } |
@@ -318,7 +359,7 @@
Dead Code
- Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.3 at Thu Dec 17 8:04:45 UTC 2015.
+ Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.1 and PHPUnit 5.1.3 at Sun Jan 3 17:34:44 UTC 2016.
diff --git a/coverage/repos/PatientRepo.php.html b/coverage/repos/PatientRepo.php.html
index a39d9ff..f0ff79c 100755
--- a/coverage/repos/PatientRepo.php.html
+++ b/coverage/repos/PatientRepo.php.html
@@ -61,13 +61,13 @@
5 / 7 |
CRAP |
-
- 97.44% covered (success)
+
+ 97.56% covered (success)
|
- 97.44% |
- 76 / 78 |
+ 97.56% |
+ 80 / 82 |
|
@@ -88,15 +88,15 @@
71.43% |
5 / 7 |
- 44 |
+ 46 |
-
- 97.44% covered (success)
+
+ 97.56% covered (success)
|
- 97.44% |
- 76 / 78 |
+ 97.56% |
+ 80 / 82 |
@@ -130,7 +130,7 @@
0.00% |
0 / 1 |
- 17 |
+ 16 |
96.77% covered (success)
@@ -184,7 +184,7 @@
|
- updateMedecinTraitant |
+ updateMedecinTraitant |
100.00% covered (success)
@@ -205,7 +205,7 @@
|
- search |
+ search |
100.00% covered (success)
@@ -214,7 +214,7 @@
|
100.00% |
1 / 1 |
- 3 |
+ 6 |
100.00% covered (success)
@@ -222,11 +222,11 @@
|
100.00% |
- 4 / 4 |
+ 8 / 8 |
- getAll |
+ getAll |
100.00% covered (success)
@@ -281,11 +281,11 @@
| $correctTypes = $correctTypes && StaticRepo::checkParam($codePostal,'String'); |
| $correctTypes = $correctTypes && StaticRepo::checkParam($dateNaissance,'Date'); |
| $correctTypes = $correctTypes && StaticRepo::checkParam($lieuNaissance,'String50'); |
- | $correctTypes = $correctTypes && ( $medecinTraitant == 'null' || $medecinTraitant === null ||StaticRepo::checkParam($medecinTraitant, 'Integer') ); |
+ | $correctTypes = $correctTypes && ( $medecinTraitant == 'null' || StaticRepo::checkParam($medecinTraitant, 'Numeric')); |
| if( !$correctTypes ) return false; |
| |
| $dateNaissance = strtotime($dateNaissance); |
- | $dateNaissance = Date('o-m-d',$dateNaissance); |
+ | $dateNaissance = Date('o-m-d', $dateNaissance); |
| |
| $req = StaticRepo::getConnexion()->prepare("INSERT INTO Patient |
| VALUES(DEFAULT, |
@@ -365,41 +365,53 @@
| |
| public static function delete($idPatient){ |
| |
- | if(!StaticRepo::checkParam($idPatient,'Integer')){ return false;} |
- | |
- | $req = StaticRepo::getConnexion()->prepare('DELETE FROM Patient WHERE Patient.Id = :id'); |
- | return $req->execute(['id' => $idPatient]); |
+ | |
+ | if( !StaticRepo::checkParam($idPatient, 'Numeric') ) return false; |
+ | |
+ | $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;} |
+ | 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]); |
- | |
- | } |
+ | 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() ); |
- | |
- | } |
+ | |
+ | public static function search($nom, $prenom){ |
+ | |
+ | if( !StaticRepo::checkParam($prenom,'String45') | !StaticRepo::checkParam($nom,'String45') ) return false; |
+ | |
+ | |
+ | $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, DATE_FORMAT(DateNaissance, '%d/%m/%Y') as DateNaissance, NumSecuriteSociale |
+ | FROM Patient |
+ | WHERE Nom LIKE '".$optNom."' |
+ | AND Prenom LIKE '".$optPrenom."' |
+ | ORDER BY Nom, Prenom ASC"); |
+ | |
| |
- | } |
+ | 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() ); |
+ | |
+ | } |
+ | |
+ | } |
@@ -412,7 +424,7 @@
Dead Code
- Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.3 at Thu Dec 17 8:04:45 UTC 2015.
+ Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.1 and PHPUnit 5.1.3 at Sun Jan 3 17:34:44 UTC 2016.
diff --git a/coverage/repos/RDVRepo.php.html b/coverage/repos/RDVRepo.php.html
index 77df5ec..3596caf 100755
--- a/coverage/repos/RDVRepo.php.html
+++ b/coverage/repos/RDVRepo.php.html
@@ -52,22 +52,22 @@
0.00% |
0 / 1 |
-
- 75.00% covered (warning)
+
+ 88.89% covered (warning)
|
- 75.00% |
- 6 / 8 |
+ 88.89% |
+ 8 / 9 |
CRAP |
-
- 94.64% covered (success)
+
+ 96.77% covered (success)
|
- 94.64% |
- 53 / 56 |
+ 96.77% |
+ 60 / 62 |
|
@@ -81,22 +81,22 @@
0.00% |
0 / 1 |
-
- 75.00% covered (warning)
+
+ 88.89% covered (warning)
|
- 75.00% |
- 6 / 8 |
- 24.09 |
+ 88.89% |
+ 8 / 9 |
+ 25 |
-
- 94.64% covered (success)
+
+ 96.77% covered (success)
|
- 94.64% |
- 53 / 56 |
+ 96.77% |
+ 60 / 62 |
@@ -121,7 +121,28 @@
- getByDate |
+ getForMonth |
+
+
+ 100.00% covered (success)
+
+
+ |
+ 100.00% |
+ 1 / 1 |
+ 1 |
+
+
+ 100.00% covered (success)
+
+
+ |
+ 100.00% |
+ 4 / 4 |
+
+
+
+ getByDate |
100.00% covered (success)
@@ -142,7 +163,7 @@
|
- delete |
+ delete |
100.00% covered (success)
@@ -163,28 +184,28 @@
|
- add |
-
-
- 0.00% covered (danger)
-
-
- |
- 0.00% |
- 0 / 1 |
- 6.02 |
+ add |
-
- 91.67% covered (success)
+
+ 100.00% covered (success)
|
- 91.67% |
- 11 / 12 |
+ 100.00% |
+ 1 / 1 |
+ 6 |
+
+
+ 100.00% covered (success)
+
+
+ |
+ 100.00% |
+ 12 / 12 |
- updateDateTime |
+ updateDateTime |
100.00% covered (success)
@@ -201,11 +222,11 @@
|
100.00% |
- 5 / 5 |
+ 6 / 6 |
- getByPatientAndDate |
+ getByPatientAndDate |
100.00% covered (success)
@@ -226,7 +247,7 @@
|
- getAll |
+ getAll |
0.00% covered (danger)
@@ -247,7 +268,7 @@
|
- getByMonth |
+ getByMonth |
100.00% covered (success)
@@ -264,7 +285,7 @@
|
100.00% |
- 6 / 6 |
+ 7 / 7 |
@@ -293,98 +314,117 @@
| |
| } |
| |
-
| public static function getByDate($date){ |
-
| |
-
| if(!StaticRepo::checkParam($date,'Date')){return false;} |
-
| |
-
| $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){ |
+
| public static function getForMonth($month, $year){ |
+
| $req = StaticRepo::getConnexion()->prepare("SELECT RDV.Id, RDV.DateRDV, RDV.Medecin_Id, RDV.Patient_Id, RDV.Duree, Medecin.Prenom as M_Prenom, Medecin.Nom as M_Nom, Patient.Prenom as P_Prenom, Patient.Nom as P_Nom |
+
| FROM RDV, Patient, Medecin |
+
| WHERE Patient.Id = RDV.Patient_Id |
+
| AND Medecin.Id = RDV.Medecin_Id |
+
| AND MONTH(DateRDV) = :month |
+
| AND YEAR(DateRDV) = :year |
+
| ORDER BY DateRDV ASC"); |
+
| $req->execute(array( ':month' => $month, ':year' => $year )); |
+
| return $req->fetchAll(); |
+
| } |
| |
-
| if(!StaticRepo::checkParam($idRDV,'Integer')){return false;} |
+
| public static function getByDate($date){ |
| |
-
| $req = StaticRepo::getConnexion()->prepare('DELETE FROM RDV WHERE RDV.id = :id'); |
-
| return $req->execute(['id' => $idRDV]); |
-
| } |
-
| |
-
| 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;} |
+
| if(!StaticRepo::checkParam($date,'Date')){return false;} |
+
| |
+
| $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()); |
+
| } |
| |
-
| $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]); |
+
| public static function delete($idRDV){ |
+
| |
+
| if(!StaticRepo::checkParam($idRDV,'Numeric')){return false;} |
+
| |
+
| $req = StaticRepo::getConnexion()->prepare('DELETE FROM RDV WHERE RDV.id = :id'); |
+
| return $req->execute(['id' => $idRDV]); |
+
| } |
| |
-
| |
-
| $id = StaticRepo::getConnexion()->lastInsertId(); |
-
| settype($id,'integer'); |
-
| if($result){return $id;} |
-
| else{return false;} |
-
| } |
-
| |
-
| public static function updateDateTime($idRDV,$dateTime){ |
-
| |
-
| if(!StaticRepo::checkParam($idRDV,'Integer')){return false;} |
-
| |
-
| $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){ |
+
| 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;} |
+
| |
+
| $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;} |
+
| } |
| |
-
| if(!StaticRepo::checkParam($idPatient,'Integer') && !StaticRepo::checkParam($date,'Date')){return false;} |
+
| public static function updateDateTime($idRDV, $dateRdv, $duree){ |
| |
-
| $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){ |
-
| |
-
| if(!StaticRepo::checkParam($date,'Integer')){return false;} |
-
| |
-
| $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 getByMonth($date){ |
-
| |
-
| if(!StaticRepo::checkParam($date,'Date')){return false;} |
-
| |
-
| $date = date('Y-m-d',strtotime($date)); |
-
| $req = StaticRepo::getConnexion()->prepare('SELECT * FROM RDV WHERE MONTH(DateRDV) = :month AND YEAR(DateRDV) = :year ORDER BY DateRDV ASC'); |
-
| $req->execute(['month' => date('m',strtotime($date)), |
-
| 'year' => date('Y',strtotime($date))]); |
-
| return StaticRepo::delNumeric($req->fetchAll()); |
-
| } |
-
| |
-
| } |
+
| if(!StaticRepo::checkParam($idRDV, 'Numeric')) return false; |
+
| |
+
| $req = StaticRepo::getConnexion()->prepare('UPDATE RDV SET DateRDV = :date_rdv, Duree = :duree WHERE id = :id'); |
+
| return $req->execute([ |
+
| ':date_rdv' => $dateRdv, |
+
| ':duree' => $duree, |
+
| ':id' => $idRDV |
+
| ]); |
+
| } |
+
| |
+
| public static function getByPatientAndDate($idPatient,$date){ |
+
| |
+
| if(!StaticRepo::checkParam($idPatient,'Integer') && !StaticRepo::checkParam($date,'Date')){return false;} |
+
| |
+
| $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){ |
+
| |
+
| if(!StaticRepo::checkParam($date,'Integer')){return false;} |
+
| |
+
| $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 getByMonth($date){ |
+
| |
+
| $strDate = date( 'Y-m-d', $date ); |
+
| |
+
| |
+
| if( !StaticRepo::checkParam($strDate, 'Date') ) return []; |
+
| |
+
| $req = StaticRepo::getConnexion()->prepare('SELECT *, ((HOUR(Duree)*60)+MINUTE(Duree)) AS Minute FROM RDV WHERE MONTH(DateRDV) = :month AND YEAR(DateRDV) = :year ORDER BY DateRDV ASC'); |
+
| $req->execute([ |
+
| 'month' => date( 'm', $date ), |
+
| 'year' => date( 'Y', $date ) |
+
| ]); |
+
| |
+
| return StaticRepo::delNumeric( $req->fetchAll() ); |
+
| } |
+
| |
+
| } |
@@ -397,7 +437,7 @@
Dead Code
- Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.3 at Thu Dec 17 8:04:45 UTC 2015.
+ Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.1 and PHPUnit 5.1.3 at Sun Jan 3 17:34:44 UTC 2016.
diff --git a/coverage/repos/StatsRepo.php.html b/coverage/repos/StatsRepo.php.html
index a221471..66b83a2 100755
--- a/coverage/repos/StatsRepo.php.html
+++ b/coverage/repos/StatsRepo.php.html
@@ -61,13 +61,13 @@
1 / 2 |
CRAP |
-
- 92.31% covered (success)
+
+ 93.55% covered (success)
|
-
92.31% |
-
24 / 26 |
+
93.55% |
+
29 / 31 |