diff --git a/Dashboard.php b/Dashboard.php index 72d3234..21488d7 100755 --- a/Dashboard.php +++ b/Dashboard.php @@ -21,7 +21,6 @@ if(!Authentification::checkUser(0)){ - @@ -58,7 +57,97 @@ if(!Authentification::checkUser(0)){ - +
+ + +
+

Homme

+
+
'; + } + ?> + +
+

Total

+ '.$key.'

'; + } + ?> +
+ +
+

+ '.$value.'

'; + } + ?> +
+ +
+

Femme

+
+
'; + } + ?> + +
+

Total

+ '.$key.'

'; + } + ?> +
+ +
+

+ '.$value.'

'; + } + ?> +
+ +
+ +
+ + + diff --git a/Docs/Model.mwb.beforefix b/Docs/Model.mwb.beforefix new file mode 100644 index 0000000..71a3690 Binary files /dev/null and b/Docs/Model.mwb.beforefix differ diff --git a/css/global.css b/css/global.css index 502d6f9..a2ac798 100755 --- a/css/global.css +++ b/css/global.css @@ -957,4 +957,58 @@ input[type=radio]:checked + label:before{ left: calc( 100% - 3em ); top: .5em; background-image: url(../src/svg/edit.svg) !important; +} + +/* Conteneur des barres de stats du Dashboard */ +.StatContainer{ + float: left; + margin-top: 20px; + height: 240px; + width:50%; +} + +/* classe pour clear après des floats */ +.clear{ + clear: both; +} + +.bar{ + float: left; + width: 15%; + margin-right: 10%; +} + +.man{ + background-color: #F09108; +} + +.woman{ + background-color: #E04F5F; +} + +.labels{ + width: 100%; + height: 30px; +} + +.label{ + display: block; + float: left; + width: 15%; + margin-right: 10%; + text-align: center; + text-decoration: underline; +} + +.value{ + text-decoration: none; + font-size: 1.4em; +} + +.title{ + display: block; + width: 100%; + margin: 0px; + text-align: center; + font-size: 1.8em; } \ No newline at end of file diff --git a/repositories/repos/StatsRepo.php b/repositories/repos/StatsRepo.php index 5a5d91b..5f39354 100755 --- a/repositories/repos/StatsRepo.php +++ b/repositories/repos/StatsRepo.php @@ -15,6 +15,9 @@ class StatsRepo $homme = ['25-'=>0,'25-50'=>0,'50+'=>0]; $femme = ['25-'=>0,'25-50'=>0,'50+'=>0]; + $nbrHomme=0; + $nbrFemme=0; + foreach($patients as $key=>$patient){ $dateNaissance = strtotime($patient['DateNaissance']); $age = date('Y',time()-$dateNaissance); @@ -22,6 +25,7 @@ class StatsRepo switch($patient['Civilite']){ case 'M': + $nbrHomme++; if($patient['age']<25){ $homme['25-']++; }elseif($patient['age']<50){ @@ -31,6 +35,7 @@ class StatsRepo } break; case 'F': + $nbrFemme++; if($patient['age']<25){ $femme['25-']++; }elseif($patient['age']<50){ @@ -42,13 +47,15 @@ class StatsRepo } } - return ['H'=>$homme,'F'=>$femme]; + return ['H'=>$homme,'F'=>$femme,'NbrH'=>$nbrHomme,'NbrF'=>$nbrFemme]; } public static function getRDVStat($medecin){ - $req = StaticRepo::getConnexion()->prepare('SELECT count(*) NombreRDV FROM RDV WHERE Medecin_id = :medecin;'); + $req = StaticRepo::getConnexion()->prepare('SELECT count(*) NombreRDV, sum((HOUR(Duree)*60)+MINUTE(Duree)) AS DureeTotale FROM RDV WHERE Medecin_id = :medecin;'); $req->execute(['medecin'=>$medecin]); - return StaticRepo::delNumeric($req->fetch(),true); + $returned = StaticRepo::delNumeric($req->fetch(),true); + + return $returned; }