diff --git a/Documents/Diagramme/BDD/MLD.plantuml b/Documents/Diagramme/BDD/MLD.plantuml index cdf6bec3..1830cff8 100755 --- a/Documents/Diagramme/BDD/MLD.plantuml +++ b/Documents/Diagramme/BDD/MLD.plantuml @@ -25,6 +25,7 @@ entity "Notification" as notif { date statut urgence + senderId #athleteId } diff --git a/Sources/src/app/controller/AthleteController.php b/Sources/src/app/controller/AthleteController.php index 24337566..d7b2a71c 100644 --- a/Sources/src/app/controller/AthleteController.php +++ b/Sources/src/app/controller/AthleteController.php @@ -207,6 +207,7 @@ class AthleteController extends BaseController 'ecartType' => $activity->getStandardDeviation(), 'moyenne' => $activity->getAverage(), 'max' => $activity->getMaximum(), 'min' => $activity->getMinimum(), 'temperature' => $activity->getAvrTemperature()]; } + //log::dd($listActivity); $response = $this->render('./page/activity.html.twig', [ 'css' => $this->preference->getCookie(), diff --git a/Sources/src/app/controller/SocialController.php b/Sources/src/app/controller/SocialController.php index f2867f55..765b8ca3 100644 --- a/Sources/src/app/controller/SocialController.php +++ b/Sources/src/app/controller/SocialController.php @@ -33,12 +33,13 @@ class SocialController extends BaseController $notificationEntity = $map->notificationSqlToEntity($listSearch); $listUsers = []; + //log::dd($notificationEntity); foreach ($notificationEntity as $entity) { $notification = $map->notificationEntityToModel($entity); $listUsers[] = ['idnotif' => $notification->getId(), 'message' => $notification->getMessage(), 'date' => $notification->getDate()->format("D j F Y"),'statut' => $notification->getStatut(), 'urgence' => $notification->getUrgence(), - 'idathlete' => $notification->getToUserId()]; + 'athleteId' => $notification->getToUserId()]; } $response = $this->render('./page/notification.html.twig',[ diff --git a/Sources/src/app/controller/UserController.php b/Sources/src/app/controller/UserController.php index c6301d5e..0c34e763 100644 --- a/Sources/src/app/controller/UserController.php +++ b/Sources/src/app/controller/UserController.php @@ -12,6 +12,8 @@ use Data\Core\Preferences; use Shared\Log; use Database\Athletegateway; use Database\Connexion; +use DateTime; +use DateInterval; class UserController extends BaseController { @@ -48,11 +50,10 @@ class UserController extends BaseController { $athleteGateway = new AthleteGateway(new Connexion(DSN, DB_USER, DB_PASSWORD)); $activity = $athleteGateway->getListActivity('1');//$currentUser->getId() -// Log::dd($activity); $chart = []; // PROBLEME AVEC LE GRAPHIQUE Soucis avec le graphique : Undefined array key "nbactivite" ligne 57 foreach($activity as $act){ - $chart[] = ['act' => $act['nbactivite'], 'mois' => date('m', $act['mois'])]; + $chart[] = ['act' => $act['nbActivite'], 'mois' => date('m', $act['mois'])]; } // $activityGateway = new ActivityGateway(new Connexion(DSN, DB_USER, DB_PASSWORD)); @@ -85,7 +86,6 @@ class UserController extends BaseController ]); } - #[Route(path: '/settings', name: 'settings', methods: ['GET'])] public function settings(IRequest $req): Response { diff --git a/Sources/src/app/views/Templates/page/activity.html.twig b/Sources/src/app/views/Templates/page/activity.html.twig index e14809bc..0d74e925 100644 --- a/Sources/src/app/views/Templates/page/activity.html.twig +++ b/Sources/src/app/views/Templates/page/activity.html.twig @@ -32,6 +32,7 @@ Maximum Minimum Temperature moyenne + Id Source @@ -49,6 +50,7 @@ Maximum Minimum Temperature moyenne + Id Source @@ -56,8 +58,8 @@ {% for analyze in analyzes %} {{analyze.date}} - {{analyze.heureDebut}} - {{analyze.heureFin}} + {{analyze.heurededebut}} + {{analyze.heuredefin}} {{analyze.type}} {{analyze.effortRessenti}} {{analyze.variabilite}} @@ -67,7 +69,7 @@ {{analyze.max}} Bpm {{analyze.min}} Bpm {{analyze.temperature}} °C - {{analyze.idactivity}} °C + {{analyze.idactivite}} En savoir plus {% endfor %} diff --git a/Sources/src/app/views/Templates/page/friend.html.twig b/Sources/src/app/views/Templates/page/friend.html.twig index 03a5e4b7..a9ca2ac1 100755 --- a/Sources/src/app/views/Templates/page/friend.html.twig +++ b/Sources/src/app/views/Templates/page/friend.html.twig @@ -43,7 +43,7 @@ {{ami.nom}} {{ami.prenom}} - {{ami.status}} + {{ami.username}}
diff --git a/Sources/src/app/views/Templates/page/notification.html.twig b/Sources/src/app/views/Templates/page/notification.html.twig index 9f84ee37..42216d3c 100755 --- a/Sources/src/app/views/Templates/page/notification.html.twig +++ b/Sources/src/app/views/Templates/page/notification.html.twig @@ -29,8 +29,8 @@ {% for mail in mails %} - - {{mail.idathlete}} + + {{mail.athleteId}} {{mail.message}} {{ mail.date }} diff --git a/Sources/src/data/core/database/ActivityMapper.php b/Sources/src/data/core/database/ActivityMapper.php index adad8141..ded83195 100644 --- a/Sources/src/data/core/database/ActivityMapper.php +++ b/Sources/src/data/core/database/ActivityMapper.php @@ -13,8 +13,8 @@ class ActivityMapper { foreach ($data as $activityData) { $activity = new ActivityEntity(); - if (isset($activityData['idactivite'])) { - $activity->setIdActivity($activityData['idactivite']); + if (isset($activityData['idActivite'])) { + $activity->setIdActivity($activityData['idActivite']); } if (isset($activityData['type'])) { @@ -25,16 +25,16 @@ class ActivityMapper { $activity->setDate($activityData['date']); } - if (isset($activityData['heurededebut'])) { - $activity->setHeureDebut($activityData['heurededebut']); + if (isset($activityData['heureDeDebut'])) { + $activity->setHeureDebut($activityData['heureDeDebut']); } - if (isset($activityData['heuredefin'])) { - $activity->setHeureFin($activityData['heuredefin']); + if (isset($activityData['heureDeFin'])) { + $activity->setHeureFin($activityData['heureDeFin']); } - if (isset($activityData['effortressent'])) { - $activity->setEffortRessenti($activityData['effortressent']); + if (isset($activityData['effortRessent'])) { + $activity->setEffortRessenti($activityData['effortRessent']); } if (isset($activityData['variabilite'])) { @@ -45,8 +45,8 @@ class ActivityMapper { $activity->setVariance($activityData['variance']); } - if (isset($activityData['ecarttype'])) { - $activity->setEcartType($activityData['ecarttype']); + if (isset($activityData['ecartType'])) { + $activity->setEcartType($activityData['ecartType']); } if (isset($activityData['moyenne'])) { @@ -61,8 +61,8 @@ class ActivityMapper { $activity->setMinimum($activityData['minimum']); } - if (isset($activityData['temperaturemoyenne'])) { - $activity->setTemperatureMoyenne($activityData['temperaturemoyenne']); + if (isset($activityData['temperatureMoyenne'])) { + $activity->setTemperatureMoyenne($activityData['temperatureMoyenne']); } $activityEntities[] = $activity; diff --git a/Sources/src/data/core/database/NotificationEntity.php b/Sources/src/data/core/database/NotificationEntity.php index 69ecfbf9..986982f0 100644 --- a/Sources/src/data/core/database/NotificationEntity.php +++ b/Sources/src/data/core/database/NotificationEntity.php @@ -13,7 +13,7 @@ class NotificationEntity private $urgence; private $idAthlete; - public function getIdNotif(): int + public function getIdNotif() { return $this->idNotif; } diff --git a/Sources/src/data/core/database/NotificationMapper.php b/Sources/src/data/core/database/NotificationMapper.php index 51622e96..7fe24a65 100644 --- a/Sources/src/data/core/database/NotificationMapper.php +++ b/Sources/src/data/core/database/NotificationMapper.php @@ -16,8 +16,8 @@ class NotificationMapper foreach ($data as $notificationData) { $notification = new NotificationEntity(); - if (isset($notificationData['idnotif'])) { - $notification->setIdNotif($notificationData['idnotif']); + if (isset($notificationData['idNotif'])) { + $notification->setIdNotif($notificationData['idNotif']); } if (isset($notificationData['message'])) { @@ -36,8 +36,8 @@ class NotificationMapper $notification->setUrgence($notificationData['urgence']); } - if (isset($notificationData['athleteid'])) { - $notification->setIdAthlete($notificationData['athleteid']); + if (isset($notificationData['athleteId'])) { + $notification->setIdAthlete($notificationData['athleteId']); } $notificationEntities[] = $notification;