From 47fe33740b6294a53a27fa6413d2536d0b11237d Mon Sep 17 00:00:00 2001 From: Lucas Mascaro Date: Sun, 3 Jan 2016 17:44:20 +0100 Subject: [PATCH] =?UTF-8?q?Impl=C3=A9mentation=20du=20Dashboard=20(version?= =?UTF-8?q?=20moche)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dashboard.php | 93 ++++++++++++++++++++++++++++++- Docs/Model.mwb.beforefix | Bin 0 -> 8949 bytes css/global.css | 54 ++++++++++++++++++ repositories/repos/StatsRepo.php | 13 ++++- 4 files changed, 155 insertions(+), 5 deletions(-) create mode 100644 Docs/Model.mwb.beforefix 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 0000000000000000000000000000000000000000..71a36902804989fb746c39547113a69cd6bfae0f GIT binary patch literal 8949 zcmZ{KWl$VIvn@`L#odA|?(Qt^vbg&a+}&M5aEIU!G!Wcfg1ft0a3?_EChy&<@7AmP zW~QgRdb)r1)byMKR)B@Wf%-Q%n@$o}}|2ymh)V_R_ zO#l11kt7)u)HMYR6vp2$h@-i?y@i7ti@m2Ai9$!*Gp7G9A*ZAc31voEH zH{U*sN*j_rTPAI#$7EPIu}u5u`Kzm$?f~dtP2Si7bOmG#z)?k-pz&8MImjXFyBD#y z3@b2Zz32U&;I4QtF#GKQpLp=tir{CwGDaNu^_0CBM6v>{EIknaaqp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Z{U6Oxj6SJ0w0>1T7nN#&Gs#DVEefu%M7A zb@!SOh(%BGnyeX`c;}2U%gWBoX^b0ECp#a>X?$M&`OD?K-)OT;%SKbD za^1MR?@daFDP^qYp?D>{6$OWMM4hnznA+fc^v}?Q!zgc_WgvuN$)eS#mG$$2H&UC| zjKr5rOdqe$VG2fIrg2;pwj(KZviV1Eg-@Y+?xjsmX5OQM9hzI}w|UJZ4%I(;uo0MQ z6@RsEC4BqC)!9S2T9vl063DT(`ZH7}HP-N{rVS;K>1jMkg(WpQTx}&cqkLR1zxCr- ze?aC`Ug^1?!R6L?+tMW@5Gv;2CD4|*tjUUOV(aHMsin&&+c6(k-awN?mD+t4)=0%R zi>YME`;HnCwlMDyp*V}OB0}P*xQI9f*h%hRfTs}80qjlPAOOe=`WoAMbJs?gw}cZB}@s zCvEy2MPfKk~*L_uaj0efQl0cBgnXTNQKmt{?<&ZuZ>L>!ov{*cU8zF+;bN zN=+G8f411u7SwOfBx;z_>~lU7md{a?STxnuxtN&KU^RQ;N8lcT^=VNMGVknMdK_8& zeLxg(r%$v`3_RO%Ra6uy(0xHK*Qj`{{P7z zf6MIujHcj!>K_&4KNLhM`ajv3f4L?9qr$-o@Cg47 zVgJtZzxss&3Q7=4$y;4jkzCu+#n#Ni!Q6^m$q`~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; }