Merge branch 'merged_PLE' of https://codefirst.iut.uca.fr/git/HeartDev/Web into merged_PLE

merged_PLE
Paul LEVRAULT 1 year ago
commit 3fe8bde432

@ -25,6 +25,7 @@ entity "Notification" as notif {
date date
statut statut
urgence urgence
senderId
#athleteId #athleteId
} }

@ -207,6 +207,7 @@ class AthleteController extends BaseController
'ecartType' => $activity->getStandardDeviation(), 'moyenne' => $activity->getAverage(), 'ecartType' => $activity->getStandardDeviation(), 'moyenne' => $activity->getAverage(),
'max' => $activity->getMaximum(), 'min' => $activity->getMinimum(), 'temperature' => $activity->getAvrTemperature()]; 'max' => $activity->getMaximum(), 'min' => $activity->getMinimum(), 'temperature' => $activity->getAvrTemperature()];
} }
//log::dd($listActivity);
$response = $this->render('./page/activity.html.twig', [ $response = $this->render('./page/activity.html.twig', [
'css' => $this->preference->getCookie(), 'css' => $this->preference->getCookie(),

@ -33,12 +33,13 @@ class SocialController extends BaseController
$notificationEntity = $map->notificationSqlToEntity($listSearch); $notificationEntity = $map->notificationSqlToEntity($listSearch);
$listUsers = []; $listUsers = [];
//log::dd($notificationEntity);
foreach ($notificationEntity as $entity) { foreach ($notificationEntity as $entity) {
$notification = $map->notificationEntityToModel($entity); $notification = $map->notificationEntityToModel($entity);
$listUsers[] = ['idnotif' => $notification->getId(), 'message' => $notification->getMessage(), $listUsers[] = ['idnotif' => $notification->getId(), 'message' => $notification->getMessage(),
'date' => $notification->getDate()->format("D j F Y"),'statut' => $notification->getStatut(), 'urgence' => $notification->getUrgence(), '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',[ $response = $this->render('./page/notification.html.twig',[

@ -12,6 +12,8 @@ use Data\Core\Preferences;
use Shared\Log; use Shared\Log;
use Database\Athletegateway; use Database\Athletegateway;
use Database\Connexion; use Database\Connexion;
use DateTime;
use DateInterval;
class UserController extends BaseController class UserController extends BaseController
{ {
@ -48,11 +50,10 @@ class UserController extends BaseController
{ {
$athleteGateway = new AthleteGateway(new Connexion(DSN, DB_USER, DB_PASSWORD)); $athleteGateway = new AthleteGateway(new Connexion(DSN, DB_USER, DB_PASSWORD));
$activity = $athleteGateway->getListActivity('1');//$currentUser->getId() $activity = $athleteGateway->getListActivity('1');//$currentUser->getId()
// Log::dd($activity);
$chart = []; $chart = [];
// PROBLEME AVEC LE GRAPHIQUE Soucis avec le graphique : Undefined array key "nbactivite" ligne 57 // PROBLEME AVEC LE GRAPHIQUE Soucis avec le graphique : Undefined array key "nbactivite" ligne 57
foreach($activity as $act){ 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)); // $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'])] #[Route(path: '/settings', name: 'settings', methods: ['GET'])]
public function settings(IRequest $req): Response public function settings(IRequest $req): Response
{ {

@ -32,6 +32,7 @@
<th>Maximum</th> <th>Maximum</th>
<th>Minimum</th> <th>Minimum</th>
<th>Temperature moyenne</th> <th>Temperature moyenne</th>
<th>Id Source</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
@ -49,6 +50,7 @@
<th>Maximum</th> <th>Maximum</th>
<th>Minimum</th> <th>Minimum</th>
<th>Temperature moyenne</th> <th>Temperature moyenne</th>
<th>Id Source</th>
</tr><tr></tr> </tr><tr></tr>
</tfoot> </tfoot>
@ -56,8 +58,8 @@
{% for analyze in analyzes %} {% for analyze in analyzes %}
<tr> <tr>
<td>{{analyze.date}}</td> <td>{{analyze.date}}</td>
<td>{{analyze.heureDebut}}</td> <td>{{analyze.heurededebut}}</td>
<td>{{analyze.heureFin}}</td> <td>{{analyze.heuredefin}}</td>
<td>{{analyze.type}}</td> <td>{{analyze.type}}</td>
<td>{{analyze.effortRessenti}}</td> <td>{{analyze.effortRessenti}}</td>
<td>{{analyze.variabilite}}</td> <td>{{analyze.variabilite}}</td>
@ -67,7 +69,7 @@
<td>{{analyze.max}} Bpm</td> <td>{{analyze.max}} Bpm</td>
<td>{{analyze.min}} Bpm</td> <td>{{analyze.min}} Bpm</td>
<td>{{analyze.temperature}} °C</td> <td>{{analyze.temperature}} °C</td>
<td>{{analyze.idactivity}} °C</td> <td>{{analyze.idactivite}}</td>
<td><a href="/analyze?id={{ analyze.idactivity }}">En savoir plus</a></td> <td><a href="/analyze?id={{ analyze.idactivity }}">En savoir plus</a></td>
</tr> </tr>
{% endfor %} {% endfor %}

@ -43,7 +43,7 @@
<img src="/assets/img/person/{{ami.img}}.png" width="35px" height="35px" class="image-ronde"></td> <img src="/assets/img/person/{{ami.img}}.png" width="35px" height="35px" class="image-ronde"></td>
<td>{{ami.nom}}</td> <td>{{ami.nom}}</td>
<td>{{ami.prenom}}</td> <td>{{ami.prenom}}</td>
<td>{{ami.status}}</td> <td>{{ami.username}}</td>
<td> <td>
<div > <div >
<form method="get" action="/mail"> <form method="get" action="/mail">

@ -29,8 +29,8 @@
<tbody> <tbody>
{% for mail in mails %} {% for mail in mails %}
<tr> <tr>
<td><img src="/assets/img/verif/{{mail.idnotif}}.png" width="25px" height="25px"></td> <td><img src="/assets/img/verif/{{mail.idNotif}}.png" width="25px" height="25px"></td>
<td>{{mail.idathlete}}</td> <td>{{mail.athleteId}}</td>
<td><a href="#">{{mail.message}}</a></td> <td><a href="#">{{mail.message}}</a></td>
<td>{{ mail.date }}</td> <td>{{ mail.date }}</td>
</tr> </tr>

@ -13,8 +13,8 @@ class ActivityMapper {
foreach ($data as $activityData) { foreach ($data as $activityData) {
$activity = new ActivityEntity(); $activity = new ActivityEntity();
if (isset($activityData['idactivite'])) { if (isset($activityData['idActivite'])) {
$activity->setIdActivity($activityData['idactivite']); $activity->setIdActivity($activityData['idActivite']);
} }
if (isset($activityData['type'])) { if (isset($activityData['type'])) {
@ -25,16 +25,16 @@ class ActivityMapper {
$activity->setDate($activityData['date']); $activity->setDate($activityData['date']);
} }
if (isset($activityData['heurededebut'])) { if (isset($activityData['heureDeDebut'])) {
$activity->setHeureDebut($activityData['heurededebut']); $activity->setHeureDebut($activityData['heureDeDebut']);
} }
if (isset($activityData['heuredefin'])) { if (isset($activityData['heureDeFin'])) {
$activity->setHeureFin($activityData['heuredefin']); $activity->setHeureFin($activityData['heureDeFin']);
} }
if (isset($activityData['effortressent'])) { if (isset($activityData['effortRessent'])) {
$activity->setEffortRessenti($activityData['effortressent']); $activity->setEffortRessenti($activityData['effortRessent']);
} }
if (isset($activityData['variabilite'])) { if (isset($activityData['variabilite'])) {
@ -45,8 +45,8 @@ class ActivityMapper {
$activity->setVariance($activityData['variance']); $activity->setVariance($activityData['variance']);
} }
if (isset($activityData['ecarttype'])) { if (isset($activityData['ecartType'])) {
$activity->setEcartType($activityData['ecarttype']); $activity->setEcartType($activityData['ecartType']);
} }
if (isset($activityData['moyenne'])) { if (isset($activityData['moyenne'])) {
@ -61,8 +61,8 @@ class ActivityMapper {
$activity->setMinimum($activityData['minimum']); $activity->setMinimum($activityData['minimum']);
} }
if (isset($activityData['temperaturemoyenne'])) { if (isset($activityData['temperatureMoyenne'])) {
$activity->setTemperatureMoyenne($activityData['temperaturemoyenne']); $activity->setTemperatureMoyenne($activityData['temperatureMoyenne']);
} }
$activityEntities[] = $activity; $activityEntities[] = $activity;

@ -13,7 +13,7 @@ class NotificationEntity
private $urgence; private $urgence;
private $idAthlete; private $idAthlete;
public function getIdNotif(): int public function getIdNotif()
{ {
return $this->idNotif; return $this->idNotif;
} }

@ -16,8 +16,8 @@ class NotificationMapper
foreach ($data as $notificationData) { foreach ($data as $notificationData) {
$notification = new NotificationEntity(); $notification = new NotificationEntity();
if (isset($notificationData['idnotif'])) { if (isset($notificationData['idNotif'])) {
$notification->setIdNotif($notificationData['idnotif']); $notification->setIdNotif($notificationData['idNotif']);
} }
if (isset($notificationData['message'])) { if (isset($notificationData['message'])) {
@ -36,8 +36,8 @@ class NotificationMapper
$notification->setUrgence($notificationData['urgence']); $notification->setUrgence($notificationData['urgence']);
} }
if (isset($notificationData['athleteid'])) { if (isset($notificationData['athleteId'])) {
$notification->setIdAthlete($notificationData['athleteid']); $notification->setIdAthlete($notificationData['athleteId']);
} }
$notificationEntities[] = $notification; $notificationEntities[] = $notification;

Loading…
Cancel
Save