diff --git a/.drone.yml b/.drone.yml index 8a1f3075..e69de29b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,61 +0,0 @@ -kind: pipeline -type: docker -name: HeartWave - -trigger: - event: - - push - -steps: - - # Test ✔️ - - name: test - image: composer:2.6 - commands: - - cd Sources - # Installe les dépendances PHP si nécessaire - - composer install --no-interaction - - ./vendor/bin/phpunit tests - - # Sonar static code analisis deployment - # TODO : use an image that already have unzip - - name: code-analysis - image: php:8.1-cli - environment: - SONAR_TOKEN: - from_secret: SONAR_TOKEN - commands: - - apt-get update && apt-get install -y curl unzip - - export SONAR_SCANNER_VERSION=4.7.0.2747 - - export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux - - curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip - - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ - - export PATH=$SONAR_SCANNER_HOME/bin:$PATH - - export SONAR_SCANNER_OPTS="-server" - - cd Sources - - sonar-scanner -D sonar.projectKey=HeartTrack -D sonar.host.url=https://codefirst.iut.uca.fr/sonar - depends_on: [ test ] - - # build image and push on the registry ✔️ - - name: docker-build-and-push - image: plugins/docker - settings: - dockerfile: Sources/config/Dockerfile - context: Sources - registry: hub.codefirst.iut.uca.fr - repo: hub.codefirst.iut.uca.fr/david.d_almeida/web - username: - from_secret: SECRET_REGISTRY_USERNAME - password: - from_secret: SECRET_REGISTRY_PASSWORD - - - name: notify - image: ruby:2.1 - when: - status: [ success ] - ref: - include: - - refs/tags/*-demo - commands: - - sh ./notifymail.sh - depends_on: [ docker-build-and-push ] diff --git a/.gitignore b/.gitignore index b67a9030..749e45fe 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,12 @@ dist *.swo .env +loginDatabase.php +# Cache file on macOS .DS_Store + +.phpunit.cache + # Cache files for Sublime Text *.tmlanguage.cache *.tmPreferences.cache diff --git a/Documents/Diagramme/BDD/README_BDD.md b/Documents/Diagramme/BDD/README_BDD.md index 5bc2be22..3fafee5b 100644 --- a/Documents/Diagramme/BDD/README_BDD.md +++ b/Documents/Diagramme/BDD/README_BDD.md @@ -174,5 +174,120 @@ sendNotif --> notif friendship --> athlete notif --> athlete athlete <-- friendship +@enduml +``` + +```plantuml +@startuml + +class Athlete { + idAthlete + username + nom + prenom + email + sexe + taille + poids + motDePasse + dateNaissance + isCoach +} + +class Amitie { + idAthlete1 + idAthlete2 +} + +class Notification { + idNotif + message + date + statut + urgence + athleteId +} + +class Envoi { + idAthlete + idNotif +} + +class Statistique { + idStatistique + poids + fcMoyenne + fcMax + caloriesBruleesMoy + date + athleteId +} + +class Entrainement { + idEntrainement + date + description + latitude + longitude + feedback + athleteId +} + +class Participe { + athleteId + entrainementId +} + +class Donne { + coachId + entrainementId +} + +class SourceDonnee { + idSource + type + modele + precision + athleteId +} + +class Activite { + idActivite + type + date + heureDeDebut + heureDeFin + effortRessent + variabilite + variance + ecartType + moyenne + maximum + minimum + temperatureMoyenne + athleteId + sourceId +} + +class FrequenceCardiaque { + idFc + altitude + temps + temperature + bpm + longitude + latitude + activiteId +} + +Athlete "1" --o "0..*" Amitie +Athlete "1" --o "0..*" Notification +Athlete "1" --o "0..*" Statistique +Athlete "1" --o "0..*" Entrainement +Entrainement "0..*" --o "0..*" Athlete : Participants +Entrainement "0..*" --o "0..*" Athlete : Coachs +Athlete "1" --o "0..*" SourceDonnee +Activite "1" --o "0..*" FrequenceCardiaque + @enduml ``` \ No newline at end of file diff --git a/Documents/Gestion/GANTT/GANTTReel.mpp b/Documents/Gestion/GANTT/GANTTReel.mpp index d0f0d7ec..d716efa5 100755 Binary files a/Documents/Gestion/GANTT/GANTTReel.mpp and b/Documents/Gestion/GANTT/GANTTReel.mpp differ diff --git a/Sources/composer.lock b/Sources/composer.lock index 9e57cd5a..e6d830ad 100644 --- a/Sources/composer.lock +++ b/Sources/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1887e85fc3cfddacf8d7e17588dae6f1", + "content-hash": "5a409c8bab8a792898aeb0f32ad5cf48", "packages": [ { "name": "adriangibbons/php-fit-file-analysis", @@ -756,25 +756,27 @@ }, { "name": "nikic/php-parser", - "version": "v4.17.1", + "version": "v5.0.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" + "reference": "4a21235f7e56e713259a6f76bf4b5ea08502b9dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", - "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4a21235f7e56e713259a6f76bf4b5ea08502b9dc", + "reference": "4a21235f7e56e713259a6f76bf4b5ea08502b9dc", "shasum": "" }, "require": { + "ext-ctype": "*", + "ext-json": "*", "ext-tokenizer": "*", - "php": ">=7.0" + "php": ">=7.4" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/php-parse" @@ -782,7 +784,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.9-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -806,9 +808,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.0" }, - "time": "2023-08-13T19:53:39+00:00" + "time": "2024-01-07T17:17:35+00:00" }, { "name": "phar-io/manifest", @@ -923,23 +925,23 @@ }, { "name": "phpunit/php-code-coverage", - "version": "10.1.9", + "version": "10.1.11", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "a56a9ab2f680246adcf3db43f38ddf1765774735" + "reference": "78c3b7625965c2513ee96569a4dbb62601784145" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/a56a9ab2f680246adcf3db43f38ddf1765774735", - "reference": "a56a9ab2f680246adcf3db43f38ddf1765774735", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/78c3b7625965c2513ee96569a4dbb62601784145", + "reference": "78c3b7625965c2513ee96569a4dbb62601784145", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.15", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=8.1", "phpunit/php-file-iterator": "^4.0", "phpunit/php-text-template": "^3.0", @@ -989,7 +991,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.9" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.11" }, "funding": [ { @@ -997,7 +999,7 @@ "type": "github" } ], - "time": "2023-11-23T12:23:20+00:00" + "time": "2023-12-21T15:38:30+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1244,16 +1246,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.4.2", + "version": "10.5.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "cacd8b9dd224efa8eb28beb69004126c7ca1a1a1" + "reference": "ed21115d505b4b4f7dc7b5651464e19a2c7f7856" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/cacd8b9dd224efa8eb28beb69004126c7ca1a1a1", - "reference": "cacd8b9dd224efa8eb28beb69004126c7ca1a1a1", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ed21115d505b4b4f7dc7b5651464e19a2c7f7856", + "reference": "ed21115d505b4b4f7dc7b5651464e19a2c7f7856", "shasum": "" }, "require": { @@ -1293,7 +1295,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.4-dev" + "dev-main": "10.5-dev" } }, "autoload": { @@ -1325,7 +1327,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.4.2" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.5" }, "funding": [ { @@ -1341,7 +1343,7 @@ "type": "tidelift" } ], - "time": "2023-10-26T07:21:45+00:00" + "time": "2023-12-27T15:13:52+00:00" }, { "name": "sebastian/cli-parser", @@ -1589,20 +1591,20 @@ }, { "name": "sebastian/complexity", - "version": "3.1.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "68cfb347a44871f01e33ab0ef8215966432f6957" + "reference": "68ff824baeae169ec9f2137158ee529584553799" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68cfb347a44871f01e33ab0ef8215966432f6957", - "reference": "68cfb347a44871f01e33ab0ef8215966432f6957", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799", + "reference": "68ff824baeae169ec9f2137158ee529584553799", "shasum": "" }, "require": { - "nikic/php-parser": "^4.10", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=8.1" }, "require-dev": { @@ -1611,7 +1613,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.1-dev" + "dev-main": "3.2-dev" } }, "autoload": { @@ -1635,7 +1637,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", "security": "https://github.com/sebastianbergmann/complexity/security/policy", - "source": "https://github.com/sebastianbergmann/complexity/tree/3.1.0" + "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0" }, "funding": [ { @@ -1643,20 +1645,20 @@ "type": "github" } ], - "time": "2023-09-28T11:50:59+00:00" + "time": "2023-12-21T08:37:17+00:00" }, { "name": "sebastian/diff", - "version": "5.0.3", + "version": "5.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b" + "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/912dc2fbe3e3c1e7873313cc801b100b6c68c87b", - "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/fbf413a49e54f6b9b17e12d900ac7f6101591b7f", + "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f", "shasum": "" }, "require": { @@ -1669,7 +1671,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -1702,7 +1704,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/5.0.3" + "source": "https://github.com/sebastianbergmann/diff/tree/5.1.0" }, "funding": [ { @@ -1710,7 +1712,7 @@ "type": "github" } ], - "time": "2023-05-01T07:48:21+00:00" + "time": "2023-12-22T10:55:06+00:00" }, { "name": "sebastian/environment", @@ -1918,20 +1920,20 @@ }, { "name": "sebastian/lines-of-code", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "649e40d279e243d985aa8fb6e74dd5bb28dc185d" + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/649e40d279e243d985aa8fb6e74dd5bb28dc185d", - "reference": "649e40d279e243d985aa8fb6e74dd5bb28dc185d", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0", "shasum": "" }, "require": { - "nikic/php-parser": "^4.10", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=8.1" }, "require-dev": { @@ -1964,7 +1966,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.1" + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2" }, "funding": [ { @@ -1972,7 +1974,7 @@ "type": "github" } ], - "time": "2023-08-31T09:25:50+00:00" + "time": "2023-12-21T08:38:20+00:00" }, { "name": "sebastian/object-enumerator", @@ -2314,7 +2316,10 @@ "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, - "platform": [], + "platform": { + "ext-couchbase": "*", + "ext-pdo": "*" + }, "platform-dev": [], "plugin-api-version": "2.6.0" } diff --git a/Sources/src/app/AppCreator.php b/Sources/src/app/AppCreator.php index e39da119..05ca5546 100644 --- a/Sources/src/app/AppCreator.php +++ b/Sources/src/app/AppCreator.php @@ -88,7 +88,6 @@ class AppCreator return $this; } - public function getServiceRegistered(): array { return $this->services; diff --git a/Sources/src/app/controller/ApiController.php b/Sources/src/app/controller/ApiController.php new file mode 100644 index 00000000..c0a2c41c --- /dev/null +++ b/Sources/src/app/controller/ApiController.php @@ -0,0 +1,131 @@ +userMgr = $manager; + } + #[Route(path: '/api/activities', name: 'api-activities', methods: ['GET'])] + public function apiActivities(IRequest $request) + { + $activityGateway = new ActivityGateway(new Connexion(DSN, DB_USER, DB_PASSWORD)); + $listSearch = $activityGateway->getActivity(); + $map = new ActivityMapper(); + $activityGateway = $map->activitySqlToEntity($listSearch); + $listActivity = []; + foreach ($activityGateway as $entity) { + $activity = $map->activityEntityToModel($entity); + $listActivity[] = ['idactivity' => number_format($activity->getIdActivity()), 'type' => $activity->getType(), + 'date' => $activity->getDate()->format("Y-m-d"), 'heureDebut' => $activity->getHeureDebut()->format("Y-m-d"), 'heureFin' => $activity->getHeureFin()->format("Y-m-d"), + 'effortRessenti' => $activity->getEffortRessenti(), 'variabilite' => $activity->getVariability(), 'variance' => $activity->getVariance(), + 'ecartType' => $activity->getStandardDeviation(), 'moyenne' => $activity->getAverage(), + 'max' => $activity->getMaximum(), 'min' => $activity->getMinimum(), 'temperature' => $activity->getAvrTemperature()]; + } + + $jsonSerializer = new JsonSerializer(); + $jsonData = $jsonSerializer::serialize($listActivity); + + $response = new Response(); + $response->setContent($jsonData); + $response->setHeader('Content-Type', 'application/json'); + + return $response; + } + + // cela ne trouve pas la methode avec la route '/api/activities/1' + #[Route(path: '/api/activities/{id}', name: 'api-activities-by-id', methods: ['GET'])] + public function apiActivityById(IRequest $request, int $id) + { + $activityGateway = new ActivityGateway(new Connexion(DSN, DB_USER, DB_PASSWORD)); + $listSearch = $activityGateway->getActivityById($id); + Log::dd($listSearch); + $map = new ActivityMapper(); + $activityGateway = $map->activitySqlToEntity($listSearch); + $listActivity = []; + foreach ($activityGateway as $entity) { + $activity = $map->activityEntityToModel($entity); + $listActivity[] = ['idactivity' => number_format($activity->getIdActivity()), 'type' => $activity->getType(), + 'date' => $activity->getDate()->format("Y-m-d"), 'heureDebut' => $activity->getHeureDebut()->format("Y-m-d"), 'heureFin' => $activity->getHeureFin()->format("Y-m-d"), + 'effortRessenti' => $activity->getEffortRessenti(), 'variabilite' => $activity->getVariability(), 'variance' => $activity->getVariance(), + 'ecartType' => $activity->getStandardDeviation(), 'moyenne' => $activity->getAverage(), + 'max' => $activity->getMaximum(), 'min' => $activity->getMinimum(), 'temperature' => $activity->getAvrTemperature()]; + } + + $jsonSerializer = new JsonSerializer(); + $jsonData = $jsonSerializer::serialize($listActivity); + + $response = new Response(); + $response->setContent($jsonData); + $response->setHeader('Content-Type', 'application/json'); + // pour delete renvoyer 204 pour dire ok et supprimer + // update 200 + + + return $response; + } +// +// #[Route(path: '/api/activities', name: 'api-activities-post', methods: ['POST'])] +// public function apiAddActivity(IRequest $request) +// { +// $activityGateway = new ActivityGateway(new Connexion(DSN, DB_USER, DB_PASSWORD)); +// $listSearch = $activityGateway->getActivity(); +// $map = new ActivityMapper(); +// $activityGateway = $map->activitySqlToEntity($listSearch); +// $listActivity = []; +// foreach ($activityGateway as $entity) { +// $activity = $map->activityEntityToModel($entity); +// $listActivity[] = ['idactivity' => number_format($activity->getIdActivity()), 'type' => $activity->getType(), +// 'date' => $activity->getDate()->format("Y-m-d"), 'heureDebut' => $activity->getHeureDebut()->format("Y-m-d"), 'heureFin' => $activity->getHeureFin()->format("Y-m-d"), +// 'effortRessenti' => $activity->getEffortRessenti(), 'variabilite' => $activity->getVariability(), 'variance' => $activity->getVariance(), +// 'ecartType' => $activity->getStandardDeviation(), 'moyenne' => $activity->getAverage(), +// 'max' => $activity->getMaximum(), 'min' => $activity->getMinimum(), 'temperature' => $activity->getAvrTemperature()]; +// } +// +// $jsonSerializer = new JsonSerializer(); +// $jsonData = $jsonSerializer::serialize($listActivity); +// +// $response = new Response(); +// $response->setContent($jsonData); +// $response->setHeader('Content-Type', 'application/json'); +// +// return $response; +// } +// #[Route(path: '/api/activities/{id}', name: 'api-activities-post', methods: ['DELETE'])] +// public function apiDeleteActivity(IRequest $request, int $id) +// { +// $activityGateway = new ActivityGateway(new Connexion(DSN, DB_USER, DB_PASSWORD)); +// $listSearch = $activityGateway->removeActivityById($id); +// +// $response = new Response(); +// $response->setContent($jsonData); +// $response->setHeader('Content-Type', 'application/json'); +// +// return $response; +// } +// #[Route(path: '/api/activities/{id}', name: 'api-activities-post', methods: ['PUT'])] +// public function apiUpdateActivity(IRequest $request, int $id) +// { +// $activityGateway = new ActivityGateway(new Connexion(DSN, DB_USER, DB_PASSWORD)); +// $listSearch = $activityGateway->updateActivity($id); +// +// $response = new Response(); +// $response->setContent($jsonData); +// $response->setHeader('Content-Type', 'application/json'); +// +// return $response; +// } +} \ No newline at end of file diff --git a/Sources/src/app/controller/HeartRateController.php b/Sources/src/app/controller/HeartRateController.php index 05ee1c8f..02c97bc3 100644 --- a/Sources/src/app/controller/HeartRateController.php +++ b/Sources/src/app/controller/HeartRateController.php @@ -15,7 +15,6 @@ use Shared\Log; class HeartRateController extends BaseController { - private ActivityManager $activityMgr; public function __construct(ActivityManager $manager) @@ -59,7 +58,7 @@ class HeartRateController extends BaseController try { if ($this->activityMgr->uploadFile($activityType, 5, $content)) { - return new RedirectResponse('/'); + return new RedirectResponse('/home'); } } catch (\Exception $e) { return $this->renderError([$e->getMessage()]); diff --git a/Sources/src/app/controller/SocialController.php b/Sources/src/app/controller/SocialController.php index 506eda77..f2867f55 100644 --- a/Sources/src/app/controller/SocialController.php +++ b/Sources/src/app/controller/SocialController.php @@ -5,6 +5,11 @@ namespace App\Controller; use App\Container; use App\Router\Request\IRequest; use App\Router\Response\Response; +use Database\AthleteGateway; +use Database\AthleteMapper; +use Database\Connexion; +use Database\NotificationGateway; +use Database\NotificationMapper; use Shared\Attributes\Route; use Twig\Environment; use Data\Core\Preferences; @@ -12,33 +17,49 @@ use Shared\Log; class SocialController extends BaseController { - - private Environment $twig; protected Preferences $preference; - public function __construct() - { - session_start(); - $this->preference = new Preferences(); + public function __construct(){ + $this->preference = new Preferences(); } - - #[Route(path: '/mail', name: 'mail', methods: ['GET'])] + #[Route(path: '/notification', name: 'notification', methods: ['GET'])] public function mail(): Response { - return $this->render('./page/mail.html.twig',[ - 'css' => $this->preference->getCookie(), - 'pp' => "test2", - 'user' => "Doe", - 'role' => "Athlète", - 'friendship' => [], - 'analyzes' => [], - 'mails' => [], - 'users' => [], - 'infoUser' => [], - 'exos' => [], - 'member' => [] - ]); + try { + $notificationGateway = new NotificationGateway(new Connexion(DSN, DB_USER, DB_PASSWORD)); + $listSearch = $notificationGateway->getNotifications(); + $map = new NotificationMapper(); + $notificationEntity = $map->notificationSqlToEntity($listSearch); + + $listUsers = []; + + 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()]; + } + + $response = $this->render('./page/notification.html.twig',[ + 'css' => $this->preference->getCookie(), + 'pp' => "test2", + 'user' => "Doe", + 'role' => "Athlète", + 'friendship' => [], + 'analyzes' => [], + 'mails' => $listUsers, + 'users' => [], + 'infoUser' => [], + 'exos' => [], + 'member' => [] + ]); + + } catch (\Throwable $th) { + throw $th; + return $this->render("notification.html.twig", ['tabError' => $taberror]); + } + return $response; } diff --git a/Sources/src/app/views/Templates/base.html.twig b/Sources/src/app/views/Templates/base.html.twig index d4224e82..d45a0b6c 100755 --- a/Sources/src/app/views/Templates/base.html.twig +++ b/Sources/src/app/views/Templates/base.html.twig @@ -12,6 +12,7 @@ +