Compare commits

...

67 Commits

Author SHA1 Message Date
Paul LEVRAULT 86069e192a Merge branch 'merged_PLE' of https://codefirst.iut.uca.fr/git/HeartDev/Web into merged_PLE
1 year ago
Paul LEVRAULT 4aff3b5a58 Ajout
1 year ago
Kevin MONTEIRO 56d7da2ce8 Résolution de bug En savoir plus activité/analyse
1 year ago
Paul LEVRAULT 3fe8bde432 Merge branch 'merged_PLE' of https://codefirst.iut.uca.fr/git/HeartDev/Web into merged_PLE
1 year ago
Paul LEVRAULT d39694036a modif ajout d'amis
1 year ago
Kevin MONTEIRO aa4567da8f Résolution bug du graphique page /home (pas d'affichage du graphique mais pas d'erreur)
1 year ago
Kevin MONTEIRO db633e71d7 Résolution bug Messagerie ;;; Potentiellement un bug sur mauvais id de celui qui envoie la notif
1 year ago
Kevin MONTEIRO aa7de10a99 Résolution bug page Analyse
1 year ago
Paul LEVRAULT b1839f15ba Mise à jour de 'Documents/Diagramme/BDD/MLD.plantuml'
1 year ago
Paul LEVRAULT a6febfeec6 Mise à jour de 'Documents/Diagramme/BDD/MLD.plantuml'
1 year ago
Paul LEVRAULT 15e631011f Mise à jour de 'Documents/Diagramme/BDD/MLD.plantuml'
1 year ago
Paul LEVRAULT f7ad66158b Merge branch 'merged_PLE' of https://codefirst.iut.uca.fr/git/HeartDev/Web into merged_PLE
1 year ago
Kevin MONTEIRO 90b6185c0a Essai de résolution de bug : Bug affichage du graphique, bug /activity : valeur NULL, pas trouver comment ajouter un exercice ...
1 year ago
Paul LEVRAULT bc0b4ee2d6 Affichage ami
1 year ago
Kevin MONTEIRO f237a7986a Merge branch 'merged_PLE' of https://codefirst.iut.uca.fr/git/HeartDev/Web into merged_PLE
1 year ago
Kevin MONTEIRO 602c62ed61 Modif
1 year ago
Antoine PEREDERII 6786eea1c4 add heartRate Graph
1 year ago
Antoine PEREDERII 9e57169ae6 test to add chart but not conclude
1 year ago
Antoine PEREDERII 90c43b08f2 Merge branch 'merged_PLE' of codefirst.iut.uca.fr:HeartDev/Web into merged_PLE
1 year ago
Antoine PEREDERII a691e2a952 add activity analyze
1 year ago
Paul LEVRAULT 23ccabbb71 Test ajout graphique
1 year ago
Antoine PEREDERII 1b4448fecd update activities
1 year ago
Paul LEVRAULT f844bfaca2 Merge branch 'merged_PLE' of https://codefirst.iut.uca.fr/git/HeartDev/Web into merged_PLE
1 year ago
Antoine PEREDERII 6585a92eb6 Merge branch 'merged_PLE' of codefirst.iut.uca.fr:HeartDev/Web into merged_PLE
1 year ago
Antoine PEREDERII 98eddfc9f7 update controllers
1 year ago
Paul LEVRAULT 07b223c633 correction de trucs
1 year ago
Paul LEVRAULT d092f7c318 Ajout de notif dans la BD
1 year ago
Paul LEVRAULT 39f5026f99 Correction AthleteMapper
1 year ago
Paul LEVRAULT ca3e2591f0 Correction AthleteMapper
1 year ago
Antoine PEREDERII 0093f21b81 update vues with database
1 year ago
Antoine PEREDERII 6e935ce864 add database on athlete page
1 year ago
Antoine PEREDERII 8473b52a96 Update '.drone.yml'
1 year ago
Antoine PEREDERII 0b4e76e66f add Training Entity and gateway
continuous-integration/drone/push Build is failing Details
1 year ago
Paul LEVRAULT de5f390af1 Merge
continuous-integration/drone/push Build is failing Details
1 year ago
Paul LEVRAULT 76c6b4b8d1 Ok il me faut une base de données
1 year ago
Paul LEVRAULT 16ee9a131e Ca marche pas et ca commence a m'enerver
1 year ago
Antoine PEREDERII 15b97837f7 update paul's branch with database link on search user
continuous-integration/drone/push Build is failing Details
1 year ago
Paul LEVRAULT d4ee62ce18 test
continuous-integration/drone/push Build is failing Details
1 year ago
Paul LEVRAULT fe2dbded3b J'en ai marre
continuous-integration/drone/push Build is failing Details
1 year ago
Paul LEVRAULT ae9744cde6 Merge remote-tracking branch 'origin/WORK-KMO-Gateway' into merged_PLE
1 year ago
Paul LEVRAULT 0ac615539b Merge remote-tracking branch 'origin/merged' into merged_PLE
1 year ago
Paul LEVRAULT 7c1824f072 Controlleur athlete quasi terminée
1 year ago
Paul LEVRAULT aa49d0960a Un autre truc
continuous-integration/drone/push Build is failing Details
1 year ago
Paul LEVRAULT 9ee8e90065 Truc de test
continuous-integration/drone/push Build is failing Details
1 year ago
Paul LEVRAULT 661b9c80cf athlete controller quasi fini
continuous-integration/drone/push Build is failing Details
1 year ago
Paul LEVRAULT 24919e6ba5 La recherche de users fonctionne
continuous-integration/drone/push Build is failing Details
1 year ago
Kevin MONTEIRO fe12112ce6 Finition gateway Athlete Coach et Activite a tester mais normalement fonctionnel
continuous-integration/drone/push Build is failing Details
1 year ago
Kevin MONTEIRO aba0924f64 Gateways, Mappers et Entity pour Athlete et Coach a tester mais fonctionnel normalement
continuous-integration/drone/push Build is failing Details
1 year ago
antoine.perederii c311825459 Merge branch 'merged' of https://codefirst.iut.uca.fr/git/HeartDev/Web into merged
continuous-integration/drone/push Build is failing Details
1 year ago
antoine.perederii 8488240e9c update gestion de projet
1 year ago
Paul LEVRAULT 1aa8dcc9fa test
1 year ago
Kevin MONTEIRO af9821709c Grosse Amélioration Gateways, Mappers, Entity Athlète et Coach
continuous-integration/drone/push Build is failing Details
1 year ago
Antoine PINAGOT 09dafc90c0 merge terminé
continuous-integration/drone/push Build is failing Details
1 year ago
Antoine PINAGOT 64ecdf87f2 Merge remote-tracking branch 'origin/issue_032_models' into merged
1 year ago
Antoine PINAGOT c201ee9bff Finition de link route/controller
continuous-integration/drone/push Build is failing Details
1 year ago
Antoine PINAGOT 35cb501e47 Il reste le AuthController, et le Athlete
continuous-integration/drone/push Build is failing Details
1 year ago
Antoine PINAGOT 637c522959 Ajout route dans les bons controller (pas terminé)
continuous-integration/drone/push Build is failing Details
1 year ago
antoine.perederii 3a2b0dd405 Merge branch 'merged' of https://codefirst.iut.uca.fr/git/HeartDev/Web into merged
continuous-integration/drone/push Build is failing Details
1 year ago
antoine.perederii 591bbe67c1 update GANTT Project
1 year ago
Antoine PEREDERII 4d67c66080 update oral diaporama
continuous-integration/drone/push Build is failing Details
1 year ago
antoine.perederii a9c5c28143 Merge branch 'merged' of https://codefirst.iut.uca.fr/git/HeartDev/Web into merged
continuous-integration/drone/push Build is failing Details
1 year ago
antoine.perederii 3f17b380ee update GANTT project
1 year ago
Kevin MONTEIRO acf783143f Début Diapo Oral 2
continuous-integration/drone/push Build is failing Details
1 year ago
antoine.perederii f15e45e197 update real GANTT
continuous-integration/drone/push Build is failing Details
1 year ago
Antoine PEREDERII 1918025c2f update msProject
continuous-integration/drone/push Build is failing Details
1 year ago
Antoine PINAGOT c0c7d6560f final page
continuous-integration/drone/push Build is failing Details
1 year ago
Antoine PEREDERII 637085afce update app and diagrams
continuous-integration/drone/push Build is failing Details
1 year ago

@ -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 ]

1
.gitignore vendored

@ -6,6 +6,7 @@ dist
*.swo *.swo
.env .env
loginDatabase.php
# Cache file on macOS # Cache file on macOS
.DS_Store .DS_Store

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

@ -0,0 +1,121 @@
[retour au README.md](../../../README.md)
[Retour aux Documents](../../README_DOCUMENTS.md)
[Retour au diagramme de classes](../README_DIAGRAMMES.md)
# BDD
```plantuml
@startuml
skinparam classAttributeIconSize 0
package MLD{
entity "Athlète" as athlete {
{static} idAthlete
nom
prénom
email
sexe
taille
poids
motDePasse
dateNaissance
}
entity "Amitié" as friendship{
{static}# idAthlete1
{static}# idAthlete2
début
}
entity "Notification" as notif {
{static} idNotif
message
date
statut
urgence
#athleteId
}
entity "Coach" as coach {
{static} idCoach
// attributs spécifiques au coach
#athleteId
}
entity "Statistique" as stats {
{static} idStatistique
poids
fcMoyenne
fcMax
caloriesBrûléesMoy
date
#athleteId
}
entity "Entraînement" as training {
{static} idEntrainement
date
description
// Exercices
latitude
longitude
feedback
#coachId
}
entity "Participe" as takepart {
{static} #athleteId
{static} #entrainementId
}
entity "SourceDonnée" as source {
{static} idSource
type
modèle
précision
#athleteId
}
entity "Activité" as activity {
{static} idActivité
type
date
heureDeDébut
heureDeFin
effortRessent
variabilité
variance
ecartType
moyenne
maximum
minimum
temperatureMoyenne
#athleteId
#sourceId
}
entity "FréquenceCardiaque" as fc {
{static} idFc
altitude
temps : time
température
bpm
longitude
latitude
#activitéId
}
}
activity --> athlete
activity --> source
activity <-- fc
coach --> athlete
athlete <-- source
stats --> athlete
takepart --> athlete
takepart --> training
friendship --> athlete
notif --> athlete
coach <-- training
athlete <-- friendship
@enduml
```

@ -36,7 +36,7 @@ abstract class IGenericRepository {
+ addItem(item) : void + addItem(item) : void
+ deleteItem(item) : bool + deleteItem(item) : bool
} }
abstract class IUserRepository extends IGenericRepository { interface IUserRepository extends IGenericRepository {
} }
interface INotificationRepository extends IGenericRepository { interface INotificationRepository extends IGenericRepository {
} }

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

@ -24,7 +24,8 @@
"Shared\\Exception\\": "src/shared/exception", "Shared\\Exception\\": "src/shared/exception",
"Shared\\Attributes\\": "src/shared/attributes", "Shared\\Attributes\\": "src/shared/attributes",
"App\\Views\\Directives\\" : "src/app/views/directives", "App\\Views\\Directives\\" : "src/app/views/directives",
"Data\\Core\\": "src/data/core/" "Data\\Core\\": "src/data/core/",
"Database\\": "src/data/core/database"
} }
}, },
"require": { "require": {
@ -32,7 +33,9 @@
"altorouter/altorouter": "1.1.0", "altorouter/altorouter": "1.1.0",
"vlucas/phpdotenv": "^5.5", "vlucas/phpdotenv": "^5.5",
"psr/container": "^2.0", "psr/container": "^2.0",
"adriangibbons/php-fit-file-analysis": "^3.2.0" "adriangibbons/php-fit-file-analysis": "^3.2.0",
"ext-couchbase": "*",
"ext-pdo": "*"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "*" "phpunit/phpunit": "*"

@ -12,10 +12,11 @@ $dotenv->safeLoad();
// const DB_PASSWORD = $_ENV['DB_PASSWORD'] ?? 'achanger'; // const DB_PASSWORD = $_ENV['DB_PASSWORD'] ?? 'achanger';
define("APP_ENV", 'development'); define("APP_ENV", 'development');
const DB_SERVER = 'mysql';
const DB_HOST = 'localhost'; const DB_HOST = 'localhost';
const DB_DATABASE = 'heartTrack'; const DB_DATABASE = 'new';
const DB_USER = 'toto'; const DB_USER = 'root';
const DB_PASSWORD = 'achanger'; const DB_PASSWORD = '';
//const APP_ENV = 'console'; //const APP_ENV = 'console';
const DSN = "mysql:host=" . DB_HOST . ";dbname=" . DB_DATABASE; const DSN = DB_SERVER . ":host=" . DB_HOST . ";dbname=" . DB_DATABASE;

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 586 B

After

Width:  |  Height:  |  Size: 692 B

File diff suppressed because it is too large Load Diff

@ -0,0 +1,34 @@
/*!
* Start Bootstrap - New Age v6.0.7 (https://startbootstrap.com/theme/new-age)
* Copyright 2013-2023 Start Bootstrap
* Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-new-age/blob/master/LICENSE)
*/
//
// Scripts
//
window.addEventListener('DOMContentLoaded', event => {
// Activate Bootstrap scrollspy on the main nav element
const mainNav = document.body.querySelector('#mainNav');
if (mainNav) {
new bootstrap.ScrollSpy(document.body, {
target: '#mainNav',
offset: 74,
});
};
// Collapse responsive navbar when toggler is visible
const navbarToggler = document.body.querySelector('.navbar-toggler');
const responsiveNavItems = [].slice.call(
document.querySelectorAll('#navbarResponsive .nav-link')
);
responsiveNavItems.map(function (responsiveNavItem) {
responsiveNavItem.addEventListener('click', () => {
if (window.getComputedStyle(navbarToggler).display !== 'none') {
navbarToggler.click();
}
});
});
});

@ -0,0 +1,34 @@
/*!
* Start Bootstrap - New Age v6.0.7 (https://startbootstrap.com/theme/new-age)
* Copyright 2013-2023 Start Bootstrap
* Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-new-age/blob/master/LICENSE)
*/
//
// Scripts
//
window.addEventListener('DOMContentLoaded', event => {
// Activate Bootstrap scrollspy on the main nav element
const mainNav = document.body.querySelector('#mainNav');
if (mainNav) {
new bootstrap.ScrollSpy(document.body, {
target: '#mainNav',
offset: 74,
});
};
// Collapse responsive navbar when toggler is visible
const navbarToggler = document.body.querySelector('.navbar-toggler');
const responsiveNavItems = [].slice.call(
document.querySelectorAll('#navbarResponsive .nav-link')
);
responsiveNavItems.map(function (responsiveNavItem) {
responsiveNavItem.addEventListener('click', () => {
if (window.getComputedStyle(navbarToggler).display !== 'none') {
navbarToggler.click();
}
});
});
});

@ -24,6 +24,13 @@ class AppCreator
return $this; return $this;
} }
public function registerSingleton(string $serviceId, $service): self
{
$this->container->set($serviceId, $service, Container::SINGLETON);
$this->services[] = $serviceId;
return $this;
}
/** /**
* Create an instance or perform actions based on the current application environment. * Create an instance or perform actions based on the current application environment.
* *
@ -71,7 +78,7 @@ class AppCreator
if ($reflectionClass->isSubclassOf(BaseController::class)) { if ($reflectionClass->isSubclassOf(BaseController::class)) {
// Register in DI container // Register in DI container
$this->container->set($fullClassName, function () use ($fullClassName) { $this->container->set($fullClassName, function () use ($fullClassName) {
$controllerInstance = new $fullClassName(); $controllerInstance = $this->container->resolve($fullClassName);
$controllerInstance->setContainer($this->container); $controllerInstance->setContainer($this->container);
return $controllerInstance; return $controllerInstance;
}); });
@ -81,7 +88,6 @@ class AppCreator
return $this; return $this;
} }
public function getServiceRegistered(): array public function getServiceRegistered(): array
{ {
return $this->services; return $this->services;

@ -2,6 +2,20 @@
namespace App\Controller; namespace App\Controller;
use Database\ActivityGateway;
use Database\ActivityMapper;
use Database\AnalyzeGateway;
use Database\AnalyzeMapper;
use Database\AthleteEntity;
use Database\AthleteMapper;
use Database\EntrainementGateway;
use Database\EntrainementMapper;
use Database\NotificationEntity;
use Database\NotificationGateway;
use Database\NotificationMapper;
use DateTime;
use Model\Notification;
use Shared\Validation;
use App\Container; use App\Container;
use App\Router\Request\IRequest; use App\Router\Request\IRequest;
use App\Router\Response\Response; use App\Router\Response\Response;
@ -9,142 +23,390 @@ use Shared\Attributes\Route;
use Twig\Environment; use Twig\Environment;
use Data\Core\Preferences; use Data\Core\Preferences;
use Shared\Log; use Shared\Log;
use Manager\UserManager;
use Database\Connexion;
use Database\AthleteGateway;
class AthleteController extends BaseController class AthleteController extends BaseController
{ {
#[Route(path: '/search-ath', name: 'search-ath', methods: ['GET'])] private Environment $twig;
protected Preferences $preference;
// private UserManager $userMgr;
public function __construct()
{
$this->preference = new Preferences();
// $this->userMgr = $manager;
}
// #[Route(path: '/search-user', name: 'search-user', methods: ['GET'])]
// public function searchUser(string $username, IRequest $req): Response
// {
// $taberror = [];
// if(!Validation::val_string($username)){
// print("Nom invalide.");
// }
// else {
// try {
// $athleteGateway = new AthleteGateway(new Connexion("mysql:host=localhost;dbname=sae_3", "Perederii", ""));
//// $listSearch=$this->container->get(UserManager::class)->searchUsersByName($username);
// $listSearch = $athleteGateway->getAthlete();
// $map = new AthleteMapper ();
// $athleteEntity = $map->athleteSqlToEntity($listSearch);
// foreach ($athleteEntity as $entity) {
// $users = $map->athleteEntityToModel($entity);
// $listUsers[$i++]=['nom' => $users->getNom(), 'prenom'=>$users->getPrenom(), 'img'=>'john_doe'];
// }
//
// $i=0;
// foreach ($users as $user){
// echo "<h1> HELLO </h1>";
// $listUsers[$i++]=['nom' => $user->getNom(), 'prenom'=>$user->getPrenom(), 'img'=>'john_doe', 'username'=>$user->getUsername()];
// }
// echo "<h1> HEllO </h1>";
// //$currentUser=$this->container->get(UserManager::class)->getCurrentUser();
// //$currentUser=$_SESSION['user'];
// $response = $this->render('./page/addfriend.html.twig',[
// 'css' => $_COOKIE['preferences'],
// 'pp' => "test",
// 'user' => 'johndoe',//$currentUser->getUsername(),
// 'role' => 'Athlete',//$currentUser->getRole(),
// 'users' => $listUsers
// ]);
// } catch (\Throwable $th) {
// throw $th;
// return $this->render("addfriend.html.twig", ['tabError' => $taberror ]);
// }
// }
// return $response;
//
// }
#[Route(path: '/search-user', name: 'search-user', methods: ['GET'])]
public function searchUser(string $username, IRequest $req): Response public function searchUser(string $username, IRequest $req): Response
{ {
$taberror = []; $taberror = [];
$utiliArray = [ if (!Validation::val_string($username)) {
[ print("Nom invalide.");
'nom' => 'John', } else {
'prenom' => 'Doe',
'img' => 'john_doe',
'username' => 'johndoe',
],
[
'nom' => 'Alice',
'prenom' => 'Smith',
'img' => 'alice_smith',
'username' => 'alicesmith',
],
];
// if(!Validation::val_string($name)){
try { try {
//code... $athleteGateway = new AthleteGateway(new Connexion(DSN, DB_USER, DB_PASSWORD));
// $model->userMgr->getUser($name); if($username==null){
return $this->render('./page/addfriend.html.twig', [ $listSearch=$athleteGateway->getAthlete();
} else {
$listSearch = $athleteGateway->getAthleteByName($username);
}
$map = new AthleteMapper();
$athleteEntity = $map->athleteSqlToEntity($listSearch);
$listUsers = [];
foreach ($athleteEntity as $entity) {
$user = $map->athleteEntityToModel($entity);
$listUsers[] = ['idathlete' => number_format($user->getId(), 1), 'nom' => $user->getNom(),
'prenom' => $user->getPrenom(),'email' => $user->getEmail(), 'sexe' => $user->getSexe(),
'taille' => $user->getTaille(), 'poids' => $user->getPoids(), 'motdepasse' => $user->getMotDePasse(),
'datenaissance' => $user->getDateNaissance(), 'iscoach' => $user->getRole(), 'img' => 'test',
'username' => $user->getUsername()];
}
$response = $this->render('./page/addfriend.html.twig',[
'css' => $_COOKIE['preferences'],
'pp' => 'test',
'user' => 'John',//$currentUser->getUsername(),
'role' => 'Athlete',//$currentUser->getRole(),
'users' => $listUsers
]);
} catch (\Throwable $th) {
throw $th;
return $this->render("addfriend.html.twig", ['tabError' => $taberror]);
}
}
return $response;
}
#[Route(path: '/analyze', name: 'analyze_details', methods: ['GET'])]
public function activityDetails(): Response
{
try {
// Utilisez $id pour récupérer les détails de l'activité depuis la base de données
// $activityGateway = new ActivityGateway(new Connexion(DSN, DB_USER, DB_PASSWORD));
// $activityEntity = $activityGateway->getActivityById($id); // Assurez-vous d'avoir une méthode similaire dans votre gateway
//$user = getCurrentUser(); FAIRE AVEC RECUP DE CURRENT USER ID
//$athleteId = $user->getId();
$athleteId = 1;
$activityGateway = new ActivityGateway(new Connexion(DSN, DB_USER, DB_PASSWORD));
$listActivityId = $activityGateway->getActivityByAthleteId($athleteId);
$listAnalyze = [];
foreach ($listActivityId as $activityId) {
$analyzeGateway = new AnalyzeGateway(new Connexion(DSN, DB_USER, DB_PASSWORD));
$analyzeSql = $analyzeGateway->getFrequenceCardiaqueByIdActivityAndCurrentAthlete($activityId, $athleteId);
$map = new AnalyzeMapper();
$analyzeEntity = $map->analyzeSqlToEntity($analyzeSql);
foreach ($analyzeEntity as $analyze) {
$listAnalyze = ['idFc' => $analyze->getIdFc(), 'altitude' => $analyze->getAltitude()];
}
}
$response = $this->render('./page/analyze.html.twig', [
'css' => $this->preference->getCookie(), 'css' => $this->preference->getCookie(),
'pp' => "test2", 'pp' => "test2",
'user' => "Doe", 'user' => 'johndoe',//$currentUser->getUsername(),
'role' => "Athlète", 'role' => 'Athlete',//$currentUser->getRole(),
'friendship' => [], 'friendship' => [],
'analyzes' => [], 'activity' => [],
'mails' => [], 'analyzes' => $listAnalyze,
'users' => $utiliArray,
'infoUser' => [],
'exos' => [],
'member' => [],
'responce' => "Notification d'ajout envoyée à $username"
]); ]);
} catch (\Throwable $th) { } catch (\Throwable $th) {
//throw $th; throw $th;
// return $this->render("addfriend.html.twig", ['tabError' => $taberror ]); return $this->render("./page/analyze.html.twig", ['tabError' => $taberror]);
} }
return $response;
}
//
// #[Route(path: '/analyses/{id}', name: 'analyses', methods: ['GET'])]
// public function analyses(): Response
// {
// try {
// $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(), 1), 'type' => $activity->getType(),
// 'date' => $activity->getDate()->format("D j F Y"), 'heureDebut' => $activity->getHeureDebut()->format("H\h i"), 'heureFin' => $activity->getHeureFin()->format("H\h i"),
// 'effortRessenti' => $activity->getEffortRessenti(), 'variabilite' => $activity->getVariability(), 'variance' => $activity->getVariance(),
// 'ecartType' => $activity->getStandardDeviation(), 'moyenne' => $activity->getAverage(),
// 'max' => $activity->getMaximum(), 'min' => $activity->getMinimum(), 'temperature' =>$activity->getAvrTemperature()];
// }
//
// $response = $this->render('./page/analyze.html.twig',[
// 'css' => $this->preference->getCookie(),
// 'pp' => "test2",
// 'user' => 'johndoe',//$currentUser->getUsername(),
// 'role' => 'Athlete',//$currentUser->getRole(),
// 'friendship' => [],
// 'analyzes' => $listActivity,
// 'mails' => [],
// 'users' => [],
// 'infoUser' => [],
// 'exos' => [],
// 'member' => []
// ]);
// } catch (\Throwable $th) {
// throw $th;
// return $this->render("./page/analyze.html.twig", ['tabError' => $taberror]);
// }
// return $response;
// } // }
#[Route(path: '/activity', name: 'activity', methods: ['GET'])]
public function activity(): Response
{
try {
$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[] = ['idactivite' => number_format($activity->getIdActivity()), 'type' => $activity->getType(),
'date' => $activity->getDate()->format("D j F Y"), 'heurededebut' => $activity->getHeureDebut()->format("H\h i"), 'heuredefin' => $activity->getHeureFin()->format("H\h i"),
'effortRessenti' => $activity->getEffortRessenti(), 'variabilite' => $activity->getVariability(), 'variance' => $activity->getVariance(),
'ecartType' => $activity->getStandardDeviation(), 'moyenne' => $activity->getAverage(),
'max' => $activity->getMaximum(), 'min' => $activity->getMinimum(), 'temperature' => $activity->getAvrTemperature()];
} }
//log::dd($listActivity);
#[Route(path: '/analyses', name: 'analyses', methods: ['GET'])] $response = $this->render('./page/activity.html.twig', [
public function analyses(): Response
{
return $this->render('./page/analyze.html.twig', [
'css' => $this->preference->getCookie(), 'css' => $this->preference->getCookie(),
'pp' => "test2", 'pp' => "test2",
'user' => "Doe", 'user' => 'johndoe',//$currentUser->getUsername(),
'role' => "Athlète", 'role' => 'Athlete',//$currentUser->getRole(),
'friendship' => [], 'friendship' => [],
'analyzes' => [], 'analyzes' => $listActivity,
'mails' => [], 'mails' => [],
'users' => [], 'users' => [],
'infoUser' => [], 'infoUser' => [],
'exos' => [], 'exos' => [],
'member' => [] 'member' => []
]); ]);
} catch (\Throwable $th) {
throw $th;
return $this->render("./page/analyze.html.twig", ['tabError' => $taberror]);
}
return $response;
} }
#[Route(path: '/exercice', name: 'exercice', methods: ['GET'])] // 8 #[Route(path: '/exercice', name: 'exercice', methods: ['GET'])] // 8
public function exercice(): Response public function exercice(): Response
{ {
return $this->render('./page/exercice.html.twig', [ try {
$entrainementGateway = new EntrainementGateway(new Connexion(DSN, DB_USER, DB_PASSWORD));
$listSearch = $entrainementGateway->getEntrainements();
$map = new EntrainementMapper();
$entrainementEntity = $map->entrainementSqlToEntity($listSearch);
$listUsers = [];
foreach ($entrainementEntity as $entity) {
$training = $map->entrainementEntityToModel($entity);
$listUsers[] = ['idTraining' => number_format($training->getId(), 1), 'date' => $training->getDate()->format("D j F Y"),
'location' => $training->getLocation(), 'description' => $training->getDescription(),
'feedback' => $training->getFeedback()];
}
$response = $this->render('./page/exercice.html.twig',[
'css' => $this->preference->getCookie(), 'css' => $this->preference->getCookie(),
'pp' => "test2", 'pp' => "test2",
'user' => "Doe", 'user' => 'johndoe',//$currentUser->getUsername(),
'role' => "Athlète", 'role' => 'Athlete',//$currentUser->getRole(),
'friendship' => [], 'friendship' => [],
'analyzes' => [], 'analyzes' => [],
'mails' => [], 'mails' => [],
'users' => [], 'users' => [],
'infoUser' => [], 'infoUser' => [],
'exos' => [], 'exos' => $listUsers,
'member' => [] 'member' => []
]); ]);
} catch (\Throwable $th) {
throw $th;
return $this->render("addfriend.html.twig", ['tabError' => $taberror]);
}
return $response;
} }
#[Route(path: '/add-friend', name: 'add-friend', methods: ['POST'])] #[Route(path: '/exercices', name: 'exercices', methods: ['POST'])] // 8
public function addFriend(string $username, IRequest $req): Response public function exercices(String $type, String $intensite, String $date, IRequest $req): Response
{ {
$taberror = []; $exercicesArray = [
$utiliArray = [
[ [
'nom' => 'John', 'date' => $date,
'prenom' => 'Doe', 'type' => $type,
'img' => 'john_doe', 'intensite' => $intensite,
'username' => 'johndoe', 'status' => 'A venir',
], ]
[
'nom' => 'Alice',
'prenom' => 'Smith',
'img' => 'alice_smith',
'username' => 'alicesmith',
],
]; ];
// if(!Validation::val_string($name)){ return $this->render('./page/exercice.html.twig',[
try { 'css' => $this->preference->getCookie(),
//code... 'pp' => "test2",
// $model->userMgr->addFriend($name); 'user' => 'johndoe',//$currentUser->getUsername(),
'role' => 'Athlete',//$currentUser->getRole(),
'friendship' => [],
'analyzes' => [],
'mails' => [],
'users' => [],
'infoUser' => [],
'exos' => $exercicesArray,
'member' => []
]);
}
#[Route(path: '/add-friend', name: 'add-friend', methods: ['POST'])]
public function addFriend(string $id, IRequest $req): Response
{
try {/*
$athleteGateway = new AthleteGateway(new Connexion(DSN, DB_USER, DB_PASSWORD));
$map=new AthleteMapper();
$friendEntity = $athleteGateway->getListIdFriends(1);
foreach($friendEntity as $users) {
if ($users['idathlete1']==1){
$user=(int)$users['idathlete2'];
} else {
$user=(int)$users['idathlete1'];
}
$listUserEntity[] = $map->athleteSqlToEntity($athleteGateway->getAthleteById(1));
}
foreach ($listUserEntity as $user) {
$friendList[] = ['nom' => $user[0]->getNom(), 'prenom' => $user[0]->getPrenom(), 'img' => 'test', 'username' => 'test'];
}*/
// $entrainementGateway = new EntrainementGateway(new Connexion(DSN, DB_USER, DB_PASSWORD));
// $listSearch = $entrainementGateway->getEntrainements();
// $map = new EntrainementMapper();
// $entrainementEntity = $map->entrainementSqlToEntity($listSearch);
//
// $listUsers = [];
// foreach ($entrainementEntity as $entity) {
// $training = $map->entrainementEntityToModel($entity);
// $listUsers[] = ['idTraining' => number_format($training->getId(), 1), 'date' => $training->getDate()->format("D j F Y"),
// 'location' => $training->getLocation(), 'description' => $training->getDescription(),
// 'feedback' => $training->getFeedback()];
// }
$athleteGateway = new AthleteGateway(new Connexion(DSN, DB_USER, DB_PASSWORD));
$map = new AthleteMapper();
$userSearched = $athleteGateway->getAthleteById((int)$id);
$athleteEntity = $map->athleteSqlToEntity($userSearched);
// $user = $athleteGateway->getAthleteById(1);
// $currentUser = $map->athleteToEntity($user);
// Log::dd($currentUser);
// foreach($userSearched as $user) {
// $listUser[] = $map->athleteToEntity($user);
// }
foreach ($athleteEntity as $user) {
// $this->userMgr->getCurrentUser()->addFriend($user);
// $currentUser->addFriend($user);
$users[] = ['nom' => $user->getNom(), 'prenom' => $user->getPrenom(), 'img' => 'test', 'username' => $user->getUsername(), 'idathlete' => $user->getIdAthlete()];
}
$notif = new NotificationGateway(new Connexion(DSN, DB_USER, DB_PASSWORD));
$mapper = new NotificationMapper();
$date = new DateTime();
// DateTime::createFromFormat('d/m/Y', date('d/m/Y'));
// Log::dd($date);
$myNotif = new Notification(20,"Demande d'ami de la part de ".$users['username'], $date, true, 7, 1);
$notif->addNotification($mapper->notificationToEntity($myNotif));
return $this->render('./page/addfriend.html.twig',[ return $this->render('./page/addfriend.html.twig',[
'css' => $this->preference->getCookie(), 'css' => $this->preference->getCookie(),
'pp' => "test2", 'pp' => "test2",
'user' => "Doe", 'user' => 'johndoe',//$currentUser->getUsername(),
'role' => "Athlète", 'role' => 'Athlete',//$currentUser->getRole(),
'friendship' => [], 'friendship' => [],
'analyzes' => [], 'analyzes' => [],
'mails' => [], 'mails' => [],
'users' => $utiliArray, 'users' => $users,
'infoUser' => [], 'infoUser' => [],
'exos' => [], 'exos' => [],
'member' => [], 'member' => [],
'responce' => "Notification d'ajout envoyée à $username" 'responce' => "Notification d'ajout envoyée à ".$users[0]['username']
]); ]);
} catch (\Throwable $th) { } catch (\Throwable $th) {
//throw $th; throw $th;
// return $this->render("addfriend.html.twig", ['tabError' => $taberror ]); return $this->render("addfriend.html.twig", ['tabError' => $taberror ]);
} }
// }
} }
#[Route(path: '/friend', name: 'friend', methods: ['GET'])] #[Route(path: '/friend', name: 'friend', methods: ['GET'])]
public function friend(): Response public function friend(): Response
{ {
$utiliArray = [ return $this->render('./page/addfriend.html.twig',[
'css' => $this->preference->getCookie(),
'pp' => "test2",
'user' => 'John',//$currentUser->getUsername(),
'role' => 'Athlete',//$currentUser->getRole(),
'friendship' => [],
'analyzes' => [],
'mails' => [],
'users' => [],
'infoUser' => [],
'exos' => [],
'member' => [],
]);
}
/*#[Route(path: '/friendlist', name: 'friendlist', methods: ['POST'])]
public function friendlist(string $username, IRequest $req): Response
{
$friendList = [
[ [
'nom' => 'John', 'nom' => 'John',
'prenom' => 'Doe', 'prenom' => 'Doe',
@ -158,19 +420,63 @@ class AthleteController extends BaseController
'username' => 'alicesmith', 'username' => 'alicesmith',
], ],
]; ];
return $this->render('./page/addfriend.html.twig',[ // TODO
// -> Enlever ou bloquer un utilisateur en fonction de son username
//$friendList = currentUser->getFriends();
return $this->render('./page/friend.html.twig',[
'css' => $this->preference->getCookie(),
'pp' => "test2",
'user' => 'johndoe',//$currentUser->getUsername(),
'role' => 'Athlete',//$currentUser->getRole(),
'friendship' => $friendList,
]);
}*/
#[Route(path: '/friendlist', name: 'friendlist2', methods: ['GET'])]
public function friendlist2(): Response
{
try {
$athleteGateway = new AthleteGateway(new Connexion(DSN, DB_USER, DB_PASSWORD));
$map=new AthleteMapper();
$friendEntity = $athleteGateway->getListIdFriends(3/*$currentUser->getId()*/);
foreach($friendEntity as $friendship){
if($friendship['idAthlete1']==3/*$currentUser->getId()*/){
$listFriend[]=$friendship['idAthlete2'];
} else {
$listFriend[]=$friendship['idAthlete1'];
}
}
foreach($listFriend as $friend){
$friends[]=$athleteGateway->getById($friend);
}
foreach($friends as $friend){
$friendlist[]=$friend[0];
}
$listUserEntity = $map->athleteSqlToEntity($friendlist);
foreach ($listUserEntity as $user) {
$friendList[] = ['nom' => $user->getNom(), 'prenom' => $user->getPrenom(), 'img' => 'test', 'username' => $user->getUsername()];
}
$response = $this->render('./page/friend.html.twig',[
'css' => $this->preference->getCookie(), 'css' => $this->preference->getCookie(),
'pp' => "test2", 'pp' => "test2",
'user' => "Doe", 'user' => "Doe",
'role' => "Athlète", 'role' => "Athlète",
'friendship' => [], 'friendship' => $friendList,
'analyzes' => [],
'mails' => [],
'users' => $utiliArray,
'infoUser' => [],
'exos' => [],
'member' => [],
]); ]);
} catch (\Throwable $th) {
throw $th;
return $this->render("addfriend.html.twig", ['tabError' => $taberror]);
}
return $response;
} }
// #[Route(path: '/delete-friend', name: 'delete-friend', methods: ['POST'])]
} }
?>

@ -5,11 +5,7 @@ namespace App\Controller;
use App\Container; use App\Container;
use App\Router\Request\IRequest; use App\Router\Request\IRequest;
use App\Router\Response\Response; use App\Router\Response\Response;
use App\Router\Response\IResponse;
use Couchbase\UserManager;
use Shared\Attributes\Route; use Shared\Attributes\Route;
use Shared\Validation;
use Twig\Environment; use Twig\Environment;
use Data\Core\Preferences; use Data\Core\Preferences;
use Shared\Log; use Shared\Log;
@ -17,34 +13,118 @@ use Shared\Log;
class AuthController extends BaseController class AuthController extends BaseController
{ {
protected Preferences $preference;
public function __construct(){
$this->preference = new Preferences();
}
// ! private UserManager $userMgr;
// public function __construct(UserManager $manager){
// parent::__construct();
// $this->userMgr = $manager;
// }
#[Route('/login', name: 'login',methods: ['POST'])]
public function login(IRequest $request): IResponse {
$error = [];
try { #[Route('/login', name: 'login')]
$log=Validation::clean_string($request->getBody()['email']); public function login(?string $username, ?string $password ,IRequest $request): Response {
$mdp=Validation::clean_string($request->getBody()['password']); // if user is already logged in, don't display the login page again
} catch (\Throwable $th) { if ($user) {
$error = "Wrong cred"; return $this->redirectToRoute('blog_index');
} }
if($this->container->get(UserManager::class)->login($log,$mdp)){ // this statement solves an edge-case: if you change the locale in the login
return $this->redirectToRoute('/'); // page, after a successful login you are redirected to a page in the previous
// locale. This code regenerates the referrer URL whenever the login page is
// browsed, to ensure that its locale is always the current one.
$this->saveTargetPath($request->getSession(), 'main', $this->generateUrl('admin_index'));
return $this->render('security/login.html.twig', [
// last username entered by the user (if any)
'last_username' => $helper->getLastUsername(),
// last authentication error (if any)
'error' => $helper->getLastAuthenticationError(),
]);
} }
else{
$error [] = "Erreur de connexion. Essayez encore"; // #[Route('/login', name: 'login')]
// public function login(?string $username, ?string $password ,IRequest $request): Response {
// // if user is already logged in, don't display the login page again
// if ($user) {
// return $this->redirectToRoute('blog_index');
// }
// // this statement solves an edge-case: if you change the locale in the login
// // page, after a successful login you are redirected to a page in the previous
// // locale. This code regenerates the referrer URL whenever the login page is
// // browsed, to ensure that its locale is always the current one.
// $this->saveTargetPath($request->getSession(), 'main', $this->generateUrl('admin_index'));
// return $this->render('security/login.html.twig', [
// // last username entered by the user (if any)
// 'last_username' => $helper->getLastUsername(),
// // last authentication error (if any)
// 'error' => $helper->getLastAuthenticationError(),
// ]);
// }
#[Route(path: '/register', name: 'register', methods: ['POST'])]
public function register(string $username,string $mdp,string $confirmMdp,string $nom,string $prenom,string $dateNaissance,string $sexe,string $taille,string $poids, IRequest $req): Response
{
// CONFIRMER LES DONNESS !!!!! IMPORTANT
return $this->render('./page/home.html.twig',[
'css' => $this->preference->getCookie()
]);
} }
return $this->render('./page/login.html.twig', ['error' => $error]);
#[Route(path: '/regist', name: 'regist', methods: ['GET'])]
public function register2(): Response
{
// CONFIRMER LES DONNESS !!!!! IMPORTANT
return $this->render('./page/register.html.twig',[
'css' => $this->preference->getCookie()
]);
} }
#[Route('/log', name: 'baseLog',methods: ['GET'])]
public function index(IRequest $request): IResponse {
return $this->render('./page/login.html.twig',[ function inscription() {
$model = new ModelVisitor();
$log=Validation::clean_string($_POST['pseudo']);
$mdp=Validation::clean_string($_POST['password']);
if($model->createAUser($log,$mdp)){
if(ModelUser::login($log, $mdp)){
UserControler::displayView();
}
}
}
function connexion(){
$model = new ModelVisitor();
if(!isset($_POST['pseudo']) || !isset($_POST['password'])) throw new Exception(" some wrong with credentials !!!!!");
$log=Validation::clean_string($_POST['pseudo']);
$mdp=Validation::clean_string($_POST['password']);
if(ModelUser::login($log, $mdp)){
UserControler::displayView();
}
}
#[Route(path: '/pass', name: 'pass', methods: ['GET'])]
public function pass(): Response
{
// CONFIRMER LES DONNESS !!!!! IMPORTANT
return $this->render('./page/password.html.twig',[
'css' => $this->preference->getCookie(), 'css' => $this->preference->getCookie(),
'pp' => "test2", 'pp' => "test2",
'user' => "Doe", 'user' => "Doe",
@ -57,74 +137,36 @@ class AuthController extends BaseController
'exos' => [], 'exos' => [],
'member' => [] 'member' => []
]); ]);
} }
#[Route('/register', name: 'register' , methods:['GET'])] #[Route(path: '/log', name: 'log', methods: ['GET'])]
public function register(IRequest $request): IResponse public function login2(): Response
{ {
if ($request->getMethod() == 'POST') {
$nom = $request->getBody()['nom'];
$prenom = $request->getBody()['prenom'];
$username = $request->getBody()['username'];
$email = $request->getBody()['email']; // CONFIRMER LES DONNESS !!!!! IMPORTANT
$motDePasse = $request->getBody()['motDePasse'];
$sexe = $request->getBody()['sexe'];
$taille = $request->getBody()['taille'];
$poids = $request->getBody()['poids'];
$dateNaissanceStr = $request->getBody()['nom'];
$dateNaissance = new \DateTime($dateNaissanceStr);
if (!$dateNaissance) {
throw new \Exception("Date de naissance non valide. Format attendu : YYYY-MM-DD");
}
$roleName = $request->getBody()['roleName'];
$registrationData = [
'nom' => $nom,
'prenom' => $prenom,
'username' => $username,
'email' => $email,
'sexe' => $sexe,
'taille' => $taille,
'poids' => $poids,
'dateNaissance' => $dateNaissance,
'roleName' => $roleName
];
try {
if ($this->container->get(UserManager::class)->register($email, $motDePasse, $registrationData)) {
return $this->redirectToRoute('/');
} else {
$error [] = 'L\'inscription a échoué. Veuillez réessayer.';
}
} catch (\Exception $e) {
$error [] = 'Erreur lors de l\'inscription: ' . $e->getMessage();
}
}
return $this->render('/register.html.twig'); return $this->render('./page/login.html.twig',[
'css' => $this->preference->getCookie(),
'pp' => "test2",
'user' => "Doe",
'role' => "Athlète",
'friendship' => [],
'analyzes' => [],
'mails' => [],
'users' => [],
'infoUser' => [],
'exos' => [],
'member' => []
]);
} }
#[Route(path: '/mdp', name: 'mdp', methods: ['POST'])] #[Route(path: '/password', name: 'password', methods: ['POST'])]
public function mdp(string $ancienMotDePasse,string $nouveauMotDePasse,string $confirmerMotDePasse, IRequest $req): Response public function password(string $email, IRequest $req): Response
{ {
// CONFIRMER LES DONNESS !!!!! IMPORTANT // CONFIRMER LES DONNESS !!!!! IMPORTANT
return $this->render('./page/settings.html.twig',[ return $this->render('./page/login.html.twig',[
'css' => $this->preference->getCookie(), 'css' => $this->preference->getCookie(),
'pp' => "test2", 'pp' => "test2",
'user' => "Doe", 'user' => "Doe",
@ -140,8 +182,6 @@ class AuthController extends BaseController
} }
} }
?> ?>

@ -1,49 +1,35 @@
<?php <?php
// namespace App\Controller; namespace App\Controller;
// use App\Container; use App\Container;
// use App\Router\Request\IRequest; use App\Router\Request\IRequest;
// use App\Router\Response\Response; use App\Router\Response\Response;
// use App\Router\Response\IResponse; use App\Router\Response\IResponse;
// use Shared\Attributes\Route; use Manager\DataManager;
// use Twig\Environment; use Shared\Attributes\Route;
// use Data\Core\Preferences; use Twig\Environment;
// use Shared\Log; use Data\Core\Preferences;
use Shared\Log;
class CoachController extends BaseController
// #[Route(path: '/coach', name: 'coach')] {
// class CoachController extends BaseController
// {
// private ICoachManager $coachManager; // private ICoachManager $coachManager;
// private $security; // private $security;
// private Environment $twig;
protected Preferences $preference;
// public function __construct(DataManager $dataManager, Security $security) public function __construct()
// { {
// session_start();
// $this->coachManager = $dataManager->coachMgr; // $this->coachManager = $dataManager->coachMgr;
// $this->security = $security; // $this->security = $security;
// } $this->preference = new Preferences();
}
// #[Route(path: '/', name: 'home', methods: ['GET'])]
// public function index(): Response
// {
// return $this->render('./page/home.html.twig',[
// 'css' => $this->preference->getCookie(),
// 'pp' => "test2",
// 'user' => "Doe",
// 'role' => "Athlète",
// 'friendship' => [],
// 'analyzes' => [],
// 'mails' => [],
// 'users' => [],
// 'infoUser' => [],
// 'exos' => [],
// 'member' => []
// ]);
// }
// #[Route('/global-stats', name: 'coach_global_stats', methods: ['GET'])] // #[Route('/global-stats', name: 'coach_global_stats', methods: ['GET'])]
// public function globalStats(): Response // public function globalStats(): Response
// { // {
@ -51,42 +37,146 @@
// return $this->render('coach/global_stats.html.twig'); // return $this->render('coach/global_stats.html.twig');
// } // }
// #[Route(path: '/exercice', name: 'exercice', methods: ['GET'])] // 8
// public function exercice(): Response #[Route(path: '/coaching', name: 'coaching', methods: ['GET'])]
// { public function coaching(): Response
// return $this->render('./page/exercice.html.twig',[ {
// 'css' => $this->preference->getCookie(), return $this->render('./page/coaching.html.twig',[
// 'pp' => "test2", 'css' => $this->preference->getCookie(),
// 'user' => "Doe", 'pp' => "test2",
// 'role' => "Athlète", 'user' => "Doe",
// 'friendship' => [], 'role' => "Coach",
// 'analyzes' => [], 'friendship' => [],
// 'mails' => [], 'analyzes' => [],
// 'users' => [], 'mails' => [],
// 'infoUser' => [], 'users' => [],
// 'exos' => [], 'infoUser' => [],
// 'member' => [] 'exos' => [],
// ]); 'member' => []
]);
}
#[Route(path: '/search-member', name: 'search-member', methods: ['GET'])]
public function searchMember(string $username, IRequest $req): Response
{
$taberror = [];
// FILTER
$utiliArray = [
[
'nom' => 'John',
'prenom' => 'Doe',
'img' => 'john_doe',
'username' => 'johndoe',
],
[
'nom' => 'Alice',
'prenom' => 'Smith',
'img' => 'alice_smith',
'username' => 'alicesmith',
],
];
// if(!Validation::val_string($name)){
try {
//code...
// $model->userMgr->addFriend($name);
return $this->render('./page/addmember.html.twig',[
'css' => $this->preference->getCookie(),
'pp' => "test2",
'user' => "Doe",
'role' => "Athlète",
'friendship' => [],
'analyzes' => [],
'mails' => [],
'users' => $utiliArray,
'infoUser' => [],
'exos' => [],
'member' => [],
'responce' => "Notification d'ajout envoyée à $username"
]);
} catch (\Throwable $th) {
//throw $th;
// return $this->render("addfriend.html.twig", ['tabError' => $taberror ]);
}
// } // }
// #[Route(path: '/coaching', name: 'coaching', methods: ['GET'])] }
// public function coaching(): Response
// { #[Route(path: '/add-member', name: 'add-member', methods: ['POST'])]
// return $this->render('./page/coaching.html.twig',[ public function addmember(string $username, IRequest $req): Response
// 'css' => $this->preference->getCookie(), {
// 'pp' => "test2", $taberror = [];
// 'user' => "Doe", $utiliArray = [
// 'role' => "Athlète", [
// 'friendship' => [], 'nom' => 'John',
// 'analyzes' => [], 'prenom' => 'Doe',
// 'mails' => [], 'img' => 'john_doe',
// 'users' => [], 'username' => 'johndoe',
// 'infoUser' => [], ],
// 'exos' => [], [
// 'member' => [] 'nom' => 'Alice',
// ]); 'prenom' => 'Smith',
'img' => 'alice_smith',
'username' => 'alicesmith',
],
];
// if(!Validation::val_string($name)){
try {
//code...
// $model->userMgr->addFriend($name);
return $this->render('./page/addmember.html.twig',[
'css' => $this->preference->getCookie(),
'pp' => "test2",
'user' => "Doe",
'role' => "Athlète",
'friendship' => [],
'analyzes' => [],
'mails' => [],
'users' => $utiliArray,
'infoUser' => [],
'exos' => [],
'member' => [],
'responce' => "Notification d'ajout envoyée à $username"
]);
} catch (\Throwable $th) {
//throw $th;
// return $this->render("addfriend.html.twig", ['tabError' => $taberror ]);
}
// } // }
}
#[Route(path: '/member', name: 'member', methods: ['GET'])]
public function member(): Response
{
$utiliArray = [
[
'nom' => 'John',
'prenom' => 'Doe',
'img' => 'john_doe',
'username' => 'johndoe',
],
[
'nom' => 'Alice',
'prenom' => 'Smith',
'img' => 'alice_smith',
'username' => 'alicesmith',
],
];
return $this->render('./page/addmember.html.twig',[
'css' => $this->preference->getCookie(),
'pp' => "test2",
'user' => "Doe",
'role' => "Athlète",
'friendship' => [],
'analyzes' => [],
'mails' => [],
'users' => $utiliArray,
'infoUser' => [],
'exos' => [],
'member' => [],
]);
}
// #[Route('/list-athletes', name: 'coach_list_athletes')] // #[Route('/list-athletes', name: 'coach_list_athletes')]
// public function listAthletes(): Response // public function listAthletes(): Response
// { // {
@ -121,4 +211,4 @@
// // } // // }
// } }

File diff suppressed because it is too large Load Diff

@ -1,36 +1,44 @@
<?php <?php
// namespace App\Controller; namespace App\Controller;
// use App\Container; use App\Container;
// use App\Router\Request\IRequest; use App\Router\Request\IRequest;
// use App\Router\Response\Response; use App\Router\Response\Response;
// use Shared\Attributes\Route; use Shared\Attributes\Route;
// use Twig\Environment; use Twig\Environment;
// use Data\Core\Preferences; use Data\Core\Preferences;
// use Shared\Log; use Shared\Log;
// class HeartRateController extends BaseController class HeartRateController extends BaseController
// { {
private Environment $twig;
// #[Route(path: '/import', name: 'import', methods: ['GET'])] protected Preferences $preference;
// public function import(): Response
// { public function __construct()
// return $this->render('./page/import.html.twig',[ {
// 'css' => $this->preference->getCookie(), $this->preference = new Preferences();
// 'pp' => "test2", }
// 'user' => "Doe",
// 'role' => "Athlète",
// 'friendship' => [], #[Route(path: '/import', name: 'import', methods: ['GET'])]
// 'analyzes' => [], public function import(): Response
// 'mails' => [], {
// 'users' => [], return $this->render('./page/import.html.twig',[
// 'infoUser' => [], 'css' => $this->preference->getCookie(),
// 'exos' => [], 'pp' => "test2",
// 'member' => [] 'user' => "Doe",
// ]); 'role' => "Athlète",
// } 'friendship' => [],
'analyzes' => [],
'mails' => [],
// } 'users' => [],
'infoUser' => [],
'exos' => [],
'member' => []
]);
}
}

@ -1,19 +1,67 @@
<?php <?php
// namespace App\Controller; namespace App\Controller;
// use App\Container; use App\Container;
// use App\Router\Request\IRequest; use App\Router\Request\IRequest;
// use App\Router\Response\Response; use App\Router\Response\Response;
// use App\Router\Response\IResponse; 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;
use Shared\Log;
// use Shared\Attributes\Route; class SocialController extends BaseController
// use Twig\Environment; {
// use Data\Core\Preferences; protected Preferences $preference;
// use Shared\Log;
public function __construct(){
$this->preference = new Preferences();
}
#[Route(path: '/notification', name: 'notification', methods: ['GET'])]
public function mail(): Response
{
try {
$notificationGateway = new NotificationGateway(new Connexion(DSN, DB_USER, DB_PASSWORD));
$listSearch = $notificationGateway->getNotifications();
$map = new NotificationMapper();
$notificationEntity = $map->notificationSqlToEntity($listSearch);
// #[Route(path: '/coach', name: 'coach')] $listUsers = [];
// class CoachController extends BaseController //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(),
'athleteId' => $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;
}
}

@ -5,19 +5,71 @@ namespace App\Controller;
use App\Container; use App\Container;
use App\Router\Request\IRequest; use App\Router\Request\IRequest;
use App\Router\Response\Response; use App\Router\Response\Response;
use Database\ActivityMapper;
use Shared\Attributes\Route; use Shared\Attributes\Route;
use Twig\Environment; use Twig\Environment;
use Data\Core\Preferences; use Data\Core\Preferences;
use Shared\Log; use Shared\Log;
use Database\Athletegateway;
use Database\Connexion;
use DateTime;
use DateInterval;
class UserController extends BaseController class UserController extends BaseController
{ {
private Environment $twig;
protected Preferences $preference;
#[Route(path: '/', name: 'home', methods: ['GET'])] public function __construct()
{
$this->preference = new Preferences();
}
#[Route(path: '/', name: 'index', methods: ['GET'])]
public function index(): Response public function index(): Response
{ {
return $this->render('./page/index.html',[
'css' => $this->preference->getCookie(),
'pp' => "test2",
'user' => "Doe",
'role' => "Athlète",
'friendship' => [],
'analyzes' => [],
'mails' => [],
'users' => [],
'infoUser' => [],
'exos' => [],
'member' => []
]);
}
#[Route(path: '/home', name: 'home', methods: ['GET'])]
public function home(): Response
{
$athleteGateway = new AthleteGateway(new Connexion(DSN, DB_USER, DB_PASSWORD));
$activity = $athleteGateway->getListActivity('1');//$currentUser->getId()
$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'])];
}
// $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("D j F Y"), 'heureDebut' => $activity->getHeureDebut()->format("H\h i"), 'heureFin' => $activity->getHeureFin()->format("H\h i"),
// 'effortRessenti' => $activity->getEffortRessenti(), 'variabilite' => $activity->getVariability(), 'variance' => $activity->getVariance(),
// 'ecartType' => $activity->getStandardDeviation(), 'moyenne' => $activity->getAverage(),
// 'max' => $activity->getMaximum(), 'min' => $activity->getMinimum(), 'temperature' => $activity->getAvrTemperature()];
// }
// Log::dd($chart);
return $this->render('./page/home.html.twig',[ return $this->render('./page/home.html.twig',[
'css' => $this->preference->getCookie(), 'css' => $this->preference->getCookie(),
'pp' => "test2", 'pp' => "test2",
@ -25,6 +77,7 @@ class UserController extends BaseController
'role' => "Athlète", 'role' => "Athlète",
'friendship' => [], 'friendship' => [],
'analyzes' => [], 'analyzes' => [],
'chart' => $chart,
'mails' => [], 'mails' => [],
'users' => [], 'users' => [],
'infoUser' => [], 'infoUser' => [],
@ -33,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
{ {
@ -52,10 +104,28 @@ class UserController extends BaseController
]); ]);
} }
#[Route(path: '/profile', name: 'profile', methods: ['GET'])]
public function profile(): Response
{
return $this->render('./page/profile.html.twig',[
'css' => $this->preference->getCookie(),
'pp' => "test2",
'user' => "Doe",
'role' => "Athlète",
'friendship' => [],
'analyzes' => [],
'mails' => [],
'users' => [],
'infoUser' => [],
'exos' => [],
'member' => []
]);
}
#[Route(path: '/preferences', name: 'preferences', methods: ['POST'])] #[Route(path: '/preferences', name: 'preferences', methods: ['POST'])]
public function preferences(string $theme, IRequest $req): Response public function preferences(string $theme, IRequest $req): Response
{ {
/*TODO*/
// VALIDER LES DONNEES // VALIDER LES DONNEES
$this->preference->majCookie($theme); $this->preference->majCookie($theme);
@ -75,4 +145,45 @@ class UserController extends BaseController
]); ]);
} }
#[Route(path: '/psettings', name: 'psettings', methods: ['POST'])]
public function psettings(string $nom,string $prenom,string $dateNaissance,string $mail,string $tel, IRequest $req): Response
{
return $this->render('./page/settings.html.twig',[
'css' => $this->preference->getCookie(),
'pp' => "test2",
'user' => $prenom,
'role' => "Athlète",
'friendship' => [],
'analyzes' => [],
'mails' => [],
'users' => [],
'infoUser' => [],
'exos' => [],
'member' => []
]);
}
#[Route(path: '/mdp', name: 'mdp', methods: ['POST'])]
public function mdp(string $ancienMotDePasse,string $nouveauMotDePasse,string $confirmerMotDePasse, IRequest $req): Response
{
// CONFIRMER LES DONNESS !!!!! IMPORTANT
return $this->render('./page/settings.html.twig',[
'css' => $this->preference->getCookie(),
'pp' => "test2",
'user' => "Doe",
'role' => "Athlète",
'friendship' => [],
'analyzes' => [],
'mails' => [],
'users' => [],
'infoUser' => [],
'exos' => [],
'member' => []
]);
}
} }

@ -8,8 +8,9 @@
<meta name="author" content="PINAGOT Antoine" /> <meta name="author" content="PINAGOT Antoine" />
<title>{% block title %}{% endblock %}</title> <title>{% block title %}{% endblock %}</title>
<link href="https://cdn.jsdelivr.net/npm/simple-datatables@7.1.2/dist/style.min.css" rel="stylesheet" /> <link href="https://cdn.jsdelivr.net/npm/simple-datatables@7.1.2/dist/style.min.css" rel="stylesheet" />
<link href="/css/{% block css %}style{% endblock %}.css" rel="stylesheet" /> <link href="/css/{% block css %}styles{% endblock %}.css" rel="stylesheet" />
<script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script> <script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
</head> </head>
<body class="sb-nav-fixed"> <body class="sb-nav-fixed">
<nav class="sb-topnav navbar navbar-expand navbar-dark bg-dark"> <nav class="sb-topnav navbar navbar-expand navbar-dark bg-dark">
@ -35,7 +36,7 @@
<li><a class="dropdown-item" href="/profile">Profile</a></li> <li><a class="dropdown-item" href="/profile">Profile</a></li>
<li><a class="dropdown-item" href="/settings">Paramètres</a></li> <li><a class="dropdown-item" href="/settings">Paramètres</a></li>
<li><hr class="dropdown-divider" /></li> <li><hr class="dropdown-divider" /></li>
<li><a class="dropdown-item" href="/logout">Déconnexion</a></li> <li><a class="dropdown-item" href="/">Déconnexion</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
@ -46,7 +47,7 @@
<div class="sb-sidenav-menu"> <div class="sb-sidenav-menu">
<div class="nav"> <div class="nav">
<div class="sb-sidenav-menu-heading">Menu</div> <div class="sb-sidenav-menu-heading">Menu</div>
<a class="nav-link" href="/"> <a class="nav-link" href="/home">
<div class="sb-nav-link-icon"><img src="/assets/img/house.png"></div> <div class="sb-nav-link-icon"><img src="/assets/img/house.png"></div>
Accueil Accueil
</a> </a>
@ -55,7 +56,7 @@
<div class="sb-nav-link-icon"><img src="/assets/img/sprinter.png"></div> <div class="sb-nav-link-icon"><img src="/assets/img/sprinter.png"></div>
Exercices Exercices
</a> </a>
<a class="nav-link" href="/analyses"> <a class="nav-link" href="/activity">
<div class="sb-nav-link-icon"><i class="fas fa-chart-area"></i></div> <div class="sb-nav-link-icon"><i class="fas fa-chart-area"></i></div>
Analyses Analyses
</a> </a>
@ -68,7 +69,7 @@
<div class="sb-nav-link-icon"><img src="/assets/img/coaching.png"></div> <div class="sb-nav-link-icon"><img src="/assets/img/coaching.png"></div>
Coaching Coaching
</a> </a>
<a class="nav-link" href="/mail"> <a class="nav-link" href="/notification">
<div class="sb-nav-link-icon"><img src="/assets/img/letter.png"></div> <div class="sb-nav-link-icon"><img src="/assets/img/letter.png"></div>
Messagerie Messagerie
</a> </a>

@ -21,7 +21,7 @@
<h1 class="display-1">{% block nb %}{% endblock %}</h1> <h1 class="display-1">{% block nb %}{% endblock %}</h1>
<p class="lead">{% block name %}{% endblock %}</p> <p class="lead">{% block name %}{% endblock %}</p>
<p>{% block descr %}{% endblock %}</p> <p>{% block descr %}{% endblock %}</p>
<a href="/"> <a href="/home">
<i class="fas fa-arrow-left me-1"></i> <i class="fas fa-arrow-left me-1"></i>
Retour à l'accueil Retour à l'accueil
</a> </a>

@ -4,30 +4,87 @@
{% block css %}{{css}}{% endblock %} {% block css %}{{css}}{% endblock %}
{% block title %}Exercices - HearthTrack{% endblock %} {% block title %}Analyses - HearthTrack{% endblock %}
{% block user %}{{user}} - {{role}}{% endblock %} {% block user %}{{user}} - {{role}}{% endblock %}
{% block body %} {% block body %}
<div class="container-fluid px-4"> <div class="container-fluid px-4">
<h1 class="mt-4">Exercices</h1> <h1 class="mt-4">Analyses</h1>
<ol class="breadcrumb mb-4"> <ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a href="/">Accueil</a></li> <li class="breadcrumb-item"><a href="/home">Accueil</a></li>
<li class="breadcrumb-item active">Exercices</li> <li class="breadcrumb-item active">Analyses</li>
</ol> </ol>
<div class="card-body"> <div class="card-body">
<div class="datatable-container"> <div class="datatable-container">
<form method="post" action="/exercices"> <table id="datatablesSimple" class="datatable-table">
Type : <input type="text" name="type"/> <thead>
Intensité : <input type="text" name="intensite"/> <tr>
Date : <input type="text" name="date"/> <th>Date</th>
<button class="btn btn-primary btn-mrg" id="btnNavbarSearch" type="submit">Ajouter l'exercice</button> <th>Heure de début</th>
</form> <th>Heure de fin</th>
<th>Type</th>
<th>effort ressenti</th>
<th>Variabilité</th>
<th>Variance</th>
<th>Ecart type</th>
<th>Moyenne</th>
<th>Maximum</th>
<th>Minimum</th>
<th>Temperature moyenne</th>
<th>Id Source</th>
<th></th>
</tr>
</thead>
<tfoot>
<tr>
<th>Date</th>
<th>Heure de début</th>
<th>Heure de fin</th>
<th>Type</th>
<th>effort ressenti</th>
<th>Variabilité</th>
<th>Variance</th>
<th>Ecart type</th>
<th>Moyenne</th>
<th>Maximum</th>
<th>Minimum</th>
<th>Temperature moyenne</th>
<th>Id Source</th>
</tr><tr></tr>
</tfoot>
<tbody>
{% for analyze in analyzes %}
<tr>
<td>{{analyze.date}}</td>
<td>{{analyze.heurededebut}}</td>
<td>{{analyze.heuredefin}}</td>
<td>{{analyze.type}}</td>
<td>{{analyze.effortRessenti}}</td>
<td>{{analyze.variabilite}}</td>
<td>{{analyze.variance}}</td>
<td>{{analyze.ecartType}}</td>
<td>{{analyze.moyenne}} Bpm</td>
<td>{{analyze.max}} Bpm</td>
<td>{{analyze.min}} Bpm</td>
<td>{{analyze.temperature}} °C</td>
<td>{{analyze.idactivite}}</td>
<td><a href="/analyze?id={{ analyze.idactivity }}">En savoir plus</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<h1>{{responce}}</h1> {% endblock %}
{% block script %}
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
<script src="js/scripts.js"></script>
<script src="https://cdn.jsdelivr.net/npm/simple-datatables@7.1.2/dist/umd/simple-datatables.min.js" crossorigin="anonymous"></script>
<script src="js/datatables-simple-demo.js"></script>
{% endblock %} {% endblock %}

@ -12,7 +12,7 @@
<div class="container-fluid px-4"> <div class="container-fluid px-4">
<h1 class="mt-4">Liste d'ami</h1> <h1 class="mt-4">Liste d'ami</h1>
<ol class="breadcrumb mb-4"> <ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a href="/">Accueil</a></li> <li class="breadcrumb-item"><a href="/home">Accueil</a></li>
<li class="breadcrumb-item active">Ami</li> <li class="breadcrumb-item active">Ami</li>
</ol> </ol>
@ -43,10 +43,9 @@
<img src="/assets/img/person/{{utili.img}}.png" width="35px" height="35px" class="image-ronde"></td> <img src="/assets/img/person/{{utili.img}}.png" width="35px" height="35px" class="image-ronde"></td>
<td>{{utili.nom}}</td> <td>{{utili.nom}}</td>
<td>{{utili.prenom}}</td> <td>{{utili.prenom}}</td>
<td style=" <td style="padding-left: 45%;">
padding-left: 45%;">
<form method="post" action="/add-friend"> <form method="post" action="/add-friend">
<input type="hidden" name="username" value="{{ utili.username }}"> <input type="hidden" name="id" value="{{ utili.idathlete }}">
<button class="btn btn-primary" type="submit">Ajouter un ami</button> <button class="btn btn-primary" type="submit">Ajouter un ami</button>
</form> </form>

@ -12,7 +12,7 @@
<div class="container-fluid px-4"> <div class="container-fluid px-4">
<h1 class="mt-4">Coaching</h1> <h1 class="mt-4">Coaching</h1>
<ol class="breadcrumb mb-4"> <ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a href="/">Accueil</a></li> <li class="breadcrumb-item"><a href="/home">Accueil</a></li>
<li class="breadcrumb-item active">Coaching</li> <li class="breadcrumb-item active">Coaching</li>
</ol> </ol>

@ -4,63 +4,148 @@
{% block css %}{{css}}{% endblock %} {% block css %}{{css}}{% endblock %}
{% block title %}Analyses - HearthTrack{% endblock %} {% block title %}Exercices - HearthTrack{% endblock %}
{% block user %}{{user}} - {{role}}{% endblock %} {% block user %}{{user}} - {{role}}{% endblock %}
{% block body %} {% block body %}
<div class="container-fluid px-4"> <div class="container-fluid px-4">
<h1 class="mt-4">Analyses</h1> <h1 class="mt-4">Exercices</h1>
<ol class="breadcrumb mb-4"> <ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a href="/">Accueil</a></li> <li class="breadcrumb-item"><a href="/home">Accueil</a></li>
<li class="breadcrumb-item active">Analyses</li> <li class="breadcrumb-item active">Exercices</li>
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
</ol> </ol>
<div class="card-body"> <div class="card-body">
<div class="datatable-container">
<table id="datatablesSimple" class="datatable-table"> <table id="datatablesSimple" class="datatable-table">
<thead> <thead>
<tr> <tr>
<th>Date</th> <th>id FC</th>
<th>Type</th> <th>altitude</th>
<th>BMP</th> <th>temps</th>
<th>KM/H</th> <th>Temperature</th>
<th>Distance</th> <th>bpm</th>
<th>longitude</th>
<th>latitude</th>
<th>activiteid</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
<tfoot>
<tr>
<th>Date</th>
<th>Type</th>
<th>BPM</th>
<th>KM/H</th>
<th>Distance</th>
</tr><tr></tr>
</tfoot>
<tbody>
{% for analyze in analyzes %} {% for analyze in analyzes %}
<tbody>
<tr> <tr>
<td>{{analyze.date}}</td> <td>{{analyze.idfc}}</td>
<td>{{analyze.type}}</td> <td>{{analyze.altitude}}</td>
<td>{{analyze.temps}}</td>
<td>{{analyze.temperature}}</td>
<td>{{analyze.bpm}}</td> <td>{{analyze.bpm}}</td>
<td>{{analyze.kmh}} Km/H</td> <td>{{analyze.longitude}}</td>
<td>{{analyze.distance}} Km</td> <td>{{analyze.latitude}}</td>
<td><a href="#about">En savoir plus</a></td> <td>{{analyze.activiteid}}</td>
<td><a href="/home">Home</a></td>
</tr> </tr>
{% endfor %}
</tbody> </tbody>
{% endfor %}
</table> </table>
{# <div>#}
{# <canvas id="myChart" width="400" height="200">#}
{# <p>Hello Fallback World</p>#}
{# </canvas>#}
{# </div>#}
{# <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>#}
{# <script>#}
{# const ctx = document.getElementById('myChart');#}
{# new Chart(ctx, {#}
{# type: 'line',#}
{# data: {#}
{# labels: [#}
{# {% for analyze in analyzes %}#}
{# {{analyze.temps}}#}
{# {% endfor %}#}
{# ],#}
{# datasets: [{#}
{# label: 'Batement par minute',#}
{# data: [#}
{# {% for analyze in analyzes %}#}
{# {{analyze.bpm}}#}
{# {% endfor %}#}
{# ],#}
{# borderWidth: 1#}
{# }]#}
{# },#}
{# options: {#}
{# scales: {#}
{# y: {#}
{# beginAtZero: true#}
{# }#}
{# }#}
{# }#}
{# });#}
{# </script>#}
<div>
<canvas id="myChart" width="400" height="200">
<p>Hello Fallback World</p>
</canvas>
</div> </div>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
const ctx = document.getElementById('myChart');
const labels = [
{% for analyze in analyzes %}
'{{ analyze.temps }}',
{% endfor %}
];
const data = [
{% for analyze in analyzes %}
{{ analyze.bpm }},
{% endfor %}
];
new Chart(ctx, {
type: 'line',
data: {
labels: labels,
datasets: [{
label: 'Batement par minute',
data: data,
borderWidth: 1
}]
},
options: {
scales: {
y: {
beginAtZero: false
}
}
}
});
</script>
<div class="card-body">
<div id="map" style="height: 500px;"></div>
<script>
document.addEventListener("DOMContentLoaded", function () {
{#var lat = {{ analyze.latitude }}#}
var map = L.map('map').setView([45.75771709151474, 3.113484980409329], 14);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© OpenStreetMap contributors'
}).addTo(map);
{% for analyze in analyzes %}
var marker = L.marker([{{ analyze.latitude }}, {{ analyze.longitude }}]).addTo(map);
marker.bindPopup(`
<strong>Date:</strong> {{ analyze.temps }}<br>
<strong>FC:</strong> {{ analyze.bpm }}<br>
<strong>Altitude:</strong> {{ analyze.altitude }}<br>
<strong>Temperature:</strong> {{ analyze.temperature }}
`);
{% endfor %}
});
</script>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{% endblock %} </div>
<h1>{{responce}}</h1>
{% block script %}
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
<script src="js/scripts.js"></script>
<script src="https://cdn.jsdelivr.net/npm/simple-datatables@7.1.2/dist/umd/simple-datatables.min.js" crossorigin="anonymous"></script>
<script src="js/datatables-simple-demo.js"></script>
{% endblock %} {% endblock %}

@ -13,7 +13,7 @@
<div class="container-fluid px-4"> <div class="container-fluid px-4">
<h1 class="mt-4">Coaching</h1> <h1 class="mt-4">Coaching</h1>
<ol class="breadcrumb mb-4"> <ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a href="/">Accueil</a></li> <li class="breadcrumb-item"><a href="/home">Accueil</a></li>
<li class="breadcrumb-item active">Coaching</li> <li class="breadcrumb-item active">Coaching</li>
</ol> </ol>
<style>.btn-mrg{margin:15px; margin-left:83%}</style> <style>.btn-mrg{margin:15px; margin-left:83%}</style>

@ -9,10 +9,11 @@
{% block user %}{{user}} - {{role}}{% endblock %} {% block user %}{{user}} - {{role}}{% endblock %}
{% block body %} {% block body %}
<div class="container-fluid px-4"> <div class="container-fluid px-4">
<h1 class="mt-4">Exercices</h1> <h1 class="mt-4">Exercices</h1>
<ol class="breadcrumb mb-4"> <ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a href="/">Accueil</a></li> <li class="breadcrumb-item"><a href="/home">Accueil</a></li>
<li class="breadcrumb-item active">Exercices</li> <li class="breadcrumb-item active">Exercices</li>
</ol> </ol>
<style>.btn-mrg{margin:15px; margin-left:85%}</style> <style>.btn-mrg{margin:15px; margin-left:85%}</style>
@ -25,18 +26,39 @@
<thead> <thead>
<tr> <tr>
<th>Date</th> <th>Date</th>
<th>Type</th> <th>Description</th>
<th>Intensité prévue</th> <th>Localisation</th>
<th>Status</th> <th>FeedBack</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
{% for exo in exos %} {% for exo in exos %}
<tr> <tr>
<td>{{ exo.date }}</td> <td>{{ exo.date }}</td>
<td>{{exo.type}}</td> <td>{{ exo.description }}</td>
<td>{{exo.intensite}}</td> <td>
<td>{{exo.status}}</td> <div id="map-{{ loop.index }}"
data-lat=45.758285982369415
data-lng=3.110223414416445
style="height: 300px; width: 650px;"></div>
<script>
document.addEventListener("DOMContentLoaded", function() {
var map{{ loop.index }} = L.map('map-{{ loop.index }}').setView([45.75771709151474, 3.113484980409329], 14);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© OpenStreetMap contributors'
}).addTo(map{{ loop.index }});
var marker{{ loop.index }} = L.marker([45.75771709151474, 3.113484980409329]).addTo(map{{ loop.index }});
marker{{ loop.index }}.bindPopup(`
<strong>Date:</strong> {{ exo.date }}<br>
<strong>Description:</strong> {{ exo.description }}<br>
<strong>Feedback:</strong> {{ exo.feedback }}
`);
});
</script>
</td>
<td>{{ exo.feedback }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>

@ -12,7 +12,7 @@
<div class="container-fluid px-4"> <div class="container-fluid px-4">
<h1 class="mt-4">Liste d'ami</h1> <h1 class="mt-4">Liste d'ami</h1>
<ol class="breadcrumb mb-4"> <ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a href="/">Accueil</a></li> <li class="breadcrumb-item"><a href="/home">Accueil</a></li>
<li class="breadcrumb-item active">Ami</li> <li class="breadcrumb-item active">Ami</li>
</ol> </ol>
<style>.btn-mrg{margin:15px; margin-left:87%}</style> <style>.btn-mrg{margin:15px; margin-left:87%}</style>
@ -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">

@ -21,8 +21,55 @@
<i class="fas fa-chart-area me-1"></i> <i class="fas fa-chart-area me-1"></i>
Stastiques globales Stastiques globales
</div> </div>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<div class="card-body"> <div class="card-body">
{# <canvas id="myAreaChart" width="100%" height="40"></canvas> #} <canvas id="myChart" width="100%" height="40">
</canvas>
<script>
document.addEventListener("DOMContentLoaded", function () {
const ctx = document.getElementById('myAreaChart').getContext('2d');
const myChart = new Chart(ctx, {
type: 'line',
data: {
labels: chart.map(entry => entry.mois),
datasets: [{
label: 'Nombre d\'activité',
data: {
{% for analyze in analyzes %}
{{ chart.act }},
{{ chart.mois }},
{% endfor %}
},
fill: false
}]
}
});
});
</script>
{# <script>#}
{# const ctx = document.getElementById('myChart');#}
{# new Chart(ctx, {#}
{# type: 'bar',#}
{# data: {#}
{# labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'],#}
{# datasets: [{#}
{# label: '# of Votes',#}
{# data: [12, 19, 3, 5, 2, 3],#}
{# borderWidth: 1#}
{# }]#}
{# },#}
{# options: {#}
{# scales: {#}
{# y: {#}
{# beginAtZero: true#}
{# }#}
{# }#}
{# }#}
{# });#}
{# </script>#}
</div> </div>
</div> </div>
</div> </div>

@ -1 +1,292 @@
<a href="/log">Se connecter</button> <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="index page du site web" />
<meta name="author" content="PINAGOT Antoine" />
<title>HeartTrack - Getting Started</title>
<link rel="icon" type="image/x-icon" href="assets/favicon.ico" />
<!-- Bootstrap icons-->
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" rel="stylesheet" />
<!-- Google fonts-->
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link href="https://fonts.googleapis.com/css2?family=Newsreader:ital,wght@0,600;1,600&amp;display=swap" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css2?family=Mulish:ital,wght@0,300;0,500;0,600;0,700;1,300;1,500;1,600;1,700&amp;display=swap" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css2?family=Kanit:ital,wght@0,400;1,400&amp;display=swap" rel="stylesheet" />
<!-- Core theme CSS (includes Bootstrap)-->
<link href="css/styles2.css" rel="stylesheet" />
</head>
<body id="page-top">
<!-- Navigation-->
<nav class="navbar navbar-expand-lg navbar-light fixed-top shadow-sm" id="mainNav">
<div class="container px-5">
<a class="navbar-brand fw-bold" href="/">HeartTrack</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
Menu
<i class="bi-list"></i>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ms-auto me-4 my-3 my-lg-0">
<li class="nav-item"><a class="nav-link me-lg-3" href="/log">Se connecter</a></li>
<li class="nav-item"><a class="nav-link me-lg-3" href="/regist">S'inscire</a></li>
</ul>
<button class="btn btn-primary rounded-pill px-3 mb-2 mb-lg-0" data-bs-toggle="modal" data-bs-target="#feedbackModal">
<span class="d-flex align-items-center">
<i class="bi-chat-text-fill me-2"></i>
<span class="small">Donnez votre avis</span>
</span>
</button>
</div>
</div>
</nav>
<!-- Mashead header-->
<header class="masthead">
<div class="container px-5">
<div class="row gx-5 align-items-center">
<div class="col-lg-6">
<!-- Mashead text and app badges-->
<div class="mb-5 mb-lg-0 text-center text-lg-start">
<h1 class="display-1 lh-1 mb-3">HeartTrack pour mobile !</h1>
<p class="lead fw-normal text-muted mb-5">Une application pour suivre vos analyses en direct, est en cours de développement.</p>
<!-- <div class="d-flex flex-column flex-lg-row align-items-center">
<a class="me-lg-3 mb-4 mb-lg-0" href="#!"><img class="app-badge" src="assets/img/google-play-badge.svg" alt="..." /></a>
<a href="#!"><img class="app-badge" src="assets/img/app-store-badge.svg" alt="..." /></a>
</div> -->
</div>
</div>
<div class="col-lg-6">
<!-- Masthead device mockup feature-->
<div class="masthead-device-mockup">
<svg class="circle" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="circleGradient" gradientTransform="rotate(45)">
<stop class="gradient-start-color" offset="0%"></stop>
<stop class="gradient-end-color" offset="100%"></stop>
</linearGradient>
</defs>
<circle cx="50" cy="50" r="50"></circle></svg
><svg class="shape-1 d-none d-sm-block" viewBox="0 0 240.83 240.83" xmlns="http://www.w3.org/2000/svg">
<rect x="-32.54" y="78.39" width="305.92" height="84.05" rx="42.03" transform="translate(120.42 -49.88) rotate(45)"></rect>
<rect x="-32.54" y="78.39" width="305.92" height="84.05" rx="42.03" transform="translate(-49.88 120.42) rotate(-45)"></rect></svg
><svg class="shape-2 d-none d-sm-block" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="50"></circle></svg>
<div class="device-wrapper">
<div class="device" data-device="iPhoneX" data-orientation="portrait" data-color="black">
<div class="screen bg-black">
<!-- PUT CONTENTS HERE:-->
<!-- * * This can be a video, image, or just about anything else.-->
<!-- * * Set the max width of your media to 100% and the height to-->
<!-- * * 100% like the demo example below.-->
<video muted="muted" autoplay="" loop="" style="max-width: 100%; height: 100%"><source src="assets/img/demo-screen.mp4" type="video/mp4" /></video>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</header>
<!-- Quote/testimonial aside-->
<aside class="text-center bg-gradient-primary-to-secondary">
<div class="container px-5">
<div class="row gx-5 justify-content-center">
<div class="col-xl-8">
<div class="h2 fs-1 text-white mb-4">"Une solution gratuite pour analyser vos données de fréquences cardiaques !"</div>
<img src="assets/img/tnw-logo.svg" alt="..." style="height: 3rem" />
</div>
</div>
</div>
</aside>
<!-- App features section-->
<section id="features">
<div class="container px-5">
<div class="row gx-5 align-items-center">
<div class="col-lg-8 order-lg-1 mb-5 mb-lg-0">
<div class="container-fluid px-5">
<div class="row gx-5">
<div class="col-md-6 mb-5">
<!-- Feature item-->
<div class="text-center">
<i class="bi-phone icon-feature text-gradient d-block mb-3"></i>
<h3 class="font-alt">Web/Mobile</h3>
<p class="text-muted mb-0">Gardez les informations tant bien dans l'application que sur le site web avec la synchronisation des données !</p>
</div>
</div>
<div class="col-md-6 mb-5">
<!-- Feature item-->
<div class="text-center">
<i class="bi-cast icon-feature text-gradient d-block mb-3"></i>
<h3 class="font-alt">Importez vos données</h3>
<p class="text-muted mb-0">Importez vos données directement depuis un fichier .FIT !</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 mb-5 mb-md-0">
<!-- Feature item-->
<div class="text-center">
<i class="bi-gift icon-feature text-gradient d-block mb-3"></i>
<h3 class="font-alt">Gratuit</h3>
<p class="text-muted mb-0">Ce site et cette application sont entièrement gratuites !</p>
</div>
</div>
<div class="col-md-6">
<!-- Feature item-->
<div class="text-center">
<i class="bi-patch-check icon-feature text-gradient d-block mb-3"></i>
<h3 class="font-alt">Open Source</h3>
<p class="text-muted mb-0">Ce projet est fait en Open Source, tout le monde peut y accéder !</p>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-4 order-lg-0">
<!-- Features section device mockup-->
<div class="features-device-mockup">
<svg class="circle" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="circleGradient" gradientTransform="rotate(45)">
<stop class="gradient-start-color" offset="0%"></stop>
<stop class="gradient-end-color" offset="100%"></stop>
</linearGradient>
</defs>
<circle cx="50" cy="50" r="50"></circle></svg
><svg class="shape-1 d-none d-sm-block" viewBox="0 0 240.83 240.83" xmlns="http://www.w3.org/2000/svg">
<rect x="-32.54" y="78.39" width="305.92" height="84.05" rx="42.03" transform="translate(120.42 -49.88) rotate(45)"></rect>
<rect x="-32.54" y="78.39" width="305.92" height="84.05" rx="42.03" transform="translate(-49.88 120.42) rotate(-45)"></rect></svg
><svg class="shape-2 d-none d-sm-block" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="50"></circle></svg>
<div class="device-wrapper">
<div class="device" data-device="iPhoneX" data-orientation="portrait" data-color="black">
<div class="screen bg-black">
<!-- PUT CONTENTS HERE:-->
<!-- * * This can be a video, image, or just about anything else.-->
<!-- * * Set the max width of your media to 100% and the height to-->
<!-- * * 100% like the demo example below.-->
<video muted="muted" autoplay="" loop="" style="max-width: 100%; height: 100%"><source src="assets/img/demo-screen.mp4" type="video/mp4" /></video>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Basic features section-->
<section class="bg-light">
<div class="container px-5">
<div class="row gx-5 align-items-center justify-content-center justify-content-lg-between">
<div class="col-12 col-lg-5">
<h2 class="display-4 lh-1 mb-4">Fonctionnalité supplémentaire de notre application</h2>
<p class="lead fw-normal text-muted mb-5 mb-lg-0">Notre application propose un service de coaching personnalisé en fonction du besoin que vous avez en tant qu'athelète. Vous pouvez aussi fournir un service de coaching aux autres utilisateurs en vous inscrivant en tant que coach sportif.</p>
</div>
<div class="col-sm-8 col-md-6">
<div class="px-5 px-sm-0"><img class="img-fluid rounded-circle" src="./assets/img/bg1.png" alt="..." /></div>
</div>
</div>
</div>
</section>
<!-- Call to action section-->
<section class="cta">
<div class="cta-content">
<div class="container px-5">
<h2 class="text-white display-1 lh-1 mb-4">
Arrêtez d'attendre...
<br />
Inscrivez-vous !
</h2>
<!-- <a class="btn btn-outline-light py-3 px-4 rounded-pill" href="#" target="_blank">Download for free</a> -->
</div>
</div>
</section>
<!-- App badge section-->
<section class="bg-gradient-primary-to-secondary" id="download">
<div class="container px-5">
<h2 class="text-center text-white font-alt mb-4">Application bientôt disponible !</h2>
<!-- <div class="d-flex flex-column flex-lg-row align-items-center justify-content-center">
<a class="me-lg-3 mb-4 mb-lg-0" href="#!"><img class="app-badge" src="assets/img/google-play-badge.svg" alt="..." /></a>
<a href="#!"><img class="app-badge" src="assets/img/app-store-badge.svg" alt="..." /></a>
</div> -->
</div>
</section>
<!-- Footer-->
<footer class="bg-black text-center py-5">
<div class="container px-5">
<div class="text-white-50 small">
<div class="mb-2">&copy; HeartTrack 2023. Tous droits réservé.</div>
<a href="#!">Politique de confidentialité</a>
<span class="mx-1">&middot;</span>
<a href="#!">Termes & Conditions d'utilisation</a>
</div>
</div>
</footer>
<!-- Feedback Modal-->
<div class="modal fade" id="feedbackModal" tabindex="-1" aria-labelledby="feedbackModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header bg-gradient-primary-to-secondary p-4">
<h5 class="modal-title font-alt text-white" id="feedbackModalLabel">Envoyez votre avis</h5>
<button class="btn-close btn-close-white" type="button" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body border-0 p-4">
<!-- * * * * * * * * * * * * * * *-->
<!-- * * SB Forms Contact Form * *-->
<!-- * * * * * * * * * * * * * * *-->
<!-- This form is pre-integrated with SB Forms.-->
<!-- To make this form functional, sign up at-->
<!-- https://startbootstrap.com/solution/contact-forms-->
<!-- to get an API token!-->
<form id="contactForm" data-sb-form-api-token="API_TOKEN">
<!-- Name input-->
<div class="form-floating mb-3">
<input class="form-control" id="name" type="text" placeholder="Entrez votre nom complet..." data-sb-validations="required" />
<label for="name">Nom complet</label>
<div class="invalid-feedback" data-sb-feedback="name:required">Un nom est requis.</div>
</div>
<!-- Email address input-->
<div class="form-floating mb-3">
<input class="form-control" id="email" type="email" placeholder="nom@exemple.com" data-sb-validations="required,email" />
<label for="email">Adresse email</label>
<div class="invalid-feedback" data-sb-feedback="email:required">Adresse email requis.</div>
<div class="invalid-feedback" data-sb-feedback="email:email">L'adresse email n'est pas valide.</div>
</div>
<!-- Phone number input-->
<div class="form-floating mb-3">
<input class="form-control" id="phone" type="tel" placeholder="06 12 34 56 78" data-sb-validations="required" />
<label for="phone">Numéro de téléphone</label>
<div class="invalid-feedback" data-sb-feedback="phone:required">Numéro de téléphone requis.</div>
</div>
<!-- Message input-->
<div class="form-floating mb-3">
<textarea class="form-control" id="message" type="text" placeholder="Entrez votre message..." style="height: 10rem" data-sb-validations="required"></textarea>
<label for="message">Message</label>
<div class="invalid-feedback" data-sb-feedback="message:required">Un message est requis.</div>
</div>
<!-- Submit success message-->
<!---->
<!-- This is what your users will see when the form-->
<!-- has successfully submitted-->
<div class="d-none" id="submitSuccessMessage">
<div class="text-center mb-3">
<div class="fw-bolder">Avis envoyé !</div>
</div>
</div>
<!-- Submit error message-->
<!---->
<!-- This is what your users will see when there is-->
<!-- an error submitting the form-->
<div class="d-none" id="submitErrorMessage"><div class="text-center text-danger mb-3">Erreur du formulaire !</div></div>
<!-- Submit Button-->
<div class="d-grid"><button class="btn btn-primary rounded-pill btn-lg disabled" id="submitButton" type="submit">Envoyer</button></div>
</form>
</div>
</div>
</div>
</div>
<!-- Bootstrap core JS-->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
<!-- Core theme JS-->
<script src="js/scripts2.js"></script>
<script src="https://cdn.startbootstrap.com/sb-forms-latest.js"></script>
</body>
</html>

@ -25,13 +25,13 @@
<label class="form-check-label" for="inputRememberPassword">Mémoriser le mot de passe</label> <label class="form-check-label" for="inputRememberPassword">Mémoriser le mot de passe</label>
</div> </div>
<div class="d-flex align-items-center justify-content-between mt-4 mb-0"> <div class="d-flex align-items-center justify-content-between mt-4 mb-0">
<a class="small" href="password.html">Mot de passe oublié ?</a> <a class="small" href="/pass">Mot de passe oublié ?</a>
<a class="btn btn-primary" href="index.html">Se connecter</a> <a class="btn btn-primary" href="/home">Se connecter</a>
</div> </div>
</form> </form>
</div> </div>
<div class="card-footer text-center py-3"> <div class="card-footer text-center py-3">
<div class="small"><a href="register.html">Besoin d'un compte ? Inscrivez-vous !</a></div> <div class="small"><a href="/regist">Besoin d'un compte ? Inscrivez-vous !</a></div>
</div> </div>
</div> </div>
</div> </div>

@ -23,14 +23,16 @@
<th>Lu</th> <th>Lu</th>
<th>De:</th> <th>De:</th>
<th>Description</th> <th>Description</th>
<th>Date</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for mail in mails %} {% for mail in mails %}
<tr> <tr>
<td><img src="/assets/img/verif/{{mail.lu}}.png" width="25px" height="25px"></td> <td><img src="/assets/img/verif/{{mail.idNotif}}.png" width="25px" height="25px"></td>
<td>{{mail.nom}} {{mail.prenom}}</td> <td>{{mail.athleteId}}</td>
<td><a href="#">{{mail.message}}</a></td> <td><a href="#">{{mail.message}}</a></td>
<td>{{ mail.date }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>

@ -19,7 +19,7 @@
</div> </div>
<div class="d-flex align-items-center justify-content-between mt-4 mb-0"> <div class="d-flex align-items-center justify-content-between mt-4 mb-0">
<a class="small" href="/log">Retour à la connexion</a> <a class="small" href="/log">Retour à la connexion</a>
<button class="btn btn-primary" type="submit">Réinitialiser votre mot de passe</a> <button class="btn btn-primary" type="submit">Réinitialiser votre mot de passe</button>
</div> </div>
</form> </form>
</div> </div>

@ -12,7 +12,7 @@
<div class="container-fluid px-4"> <div class="container-fluid px-4">
<h1 class="mt-4">Profile</h1> <h1 class="mt-4">Profile</h1>
<ol class="breadcrumb mb-4"> <ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a href="/">Accueil</a></li> <li class="breadcrumb-item"><a href="/home">Accueil</a></li>
<li class="breadcrumb-item active">Profile</li> <li class="breadcrumb-item active">Profile</li>
</ol> </ol>
<div class="row"> <div class="row">

@ -81,12 +81,12 @@
</div> </div>
</div> </div>
<div class="mt-4 mb-0"> <div class="mt-4 mb-0">
<div class="d-grid"><a class="btn btn-primary btn-block" href="login.html.twig">Créer un compte</a></div> <div class="d-grid"><a class="btn btn-primary btn-block" href="/log">Créer un compte</a></div>
</div> </div>
</form> </form>
</div> </div>
<div class="card-footer text-center py-3"> <div class="card-footer text-center py-3">
<div class="small"><a href="login.html.twig">Avez-vous déjà un compte ? Connectez-vous ?</a></div> <div class="small"><a href="/log">Avez-vous déjà un compte ? Connectez-vous ?</a></div>
</div> </div>
</div> </div>
</div> </div>

@ -12,7 +12,7 @@
<div class="container-fluid px-4"> <div class="container-fluid px-4">
<h1 class="mt-4">Paramètres</h1> <h1 class="mt-4">Paramètres</h1>
<ol class="breadcrumb mb-4"> <ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a href="/">Accueil</a></li> <li class="breadcrumb-item"><a href="/home">Accueil</a></li>
<li class="breadcrumb-item active">Paramètres</li> <li class="breadcrumb-item active">Paramètres</li>
</ol> </ol>
<div class="row"> <div class="row">

@ -1,51 +0,0 @@
<?php
namespace Database;
use Model\Activite;
class ActiviteMapper {
public function map(array $data):ActiviteEntity {
$activite = new ActiviteEntity();
$activite->setIdActivite($data['idActivite']);
$activite->setType($data['type']);
$activite->setDate($data['date']);
$activite->setHeureDebut($data['heureDebut']);
$activite->setHeureFin($data['heureFin']);
$activite->setEffortRessenti($data['effortRessenti']);
$activite->setVariabilite($data['variabilite']);
$activite->setVariance($data['variance']);
$activite->setEcartType($data['ecartType']);
$activite->setMoyenne($data['moyenne']);
$activite->setMaximum($data['maximum']);
$activite->setMinimum($data['minimum']);
$activite->setTemperatureMoyenne($data['temperatureMoyenne']);
return $activite;
}
//public function ActiviteEntityToModel(ActiviteEntity entity): Activite;
public function ActiviteEntityToModel(ActiviteEntity $activiteEntity):Activite{
$act = new Activite(
$activiteEntity->getIdActivite(),
$activiteEntity->getType(),
$activiteEntity->getDate(),
$activiteEntity->getHeureDebut(),
$activiteEntity->getHeureFin(),
$activiteEntity->getEffortRessenti(),
$activiteEntity->getVariabilite(),
$activiteEntity->getVariance(),
$activiteEntity->getEcartType(),
$activiteEntity->getMoyenne(),
$activiteEntity->getMaximum(),
$activiteEntity->getMinimum(),
$activiteEntity->getTemperatureMoyenne()
);
return $act;
}
//public function ActiviteToEntity(Activite model): ActiviteEntity;
}
?>

@ -2,8 +2,8 @@
namespace Database; namespace Database;
class ActiviteEntity { class ActivityEntity {
private $idActivite; private $idActivity;
private $type; private $type;
private $date; private $date;
private $heureDebut; private $heureDebut;
@ -18,7 +18,7 @@ class ActiviteEntity {
private $temperatureMoyenne; private $temperatureMoyenne;
// Getters // Getters
public function getIdActivite() { public function getIdActivity() :int {
return $this->idActivity; return $this->idActivity;
} }
@ -42,7 +42,7 @@ class ActiviteEntity {
return $this->effortRessenti; return $this->effortRessenti;
} }
public function getVariabilite() { public function getVariability() {
return $this->variabilite; return $this->variabilite;
} }
@ -71,7 +71,7 @@ class ActiviteEntity {
} }
// Setters // Setters
public function setIdActivite($idActivite) { public function setIdActivity($idActivity) {
$this->idActivity = $idActivity; $this->idActivity = $idActivity;
} }

@ -1,38 +1,39 @@
<?php <?php
namespace Database; namespace Database;
use \PDO;
class ActiviteGateway { class ActivityGateway {
private $connection; private Connexion $connection;
public function __construct(Connection $connection) { public function __construct(Connexion $connection) {
$this->connection = $connection; $this->connection = $connection;
} }
public function getActivite() { public function getActivity() {
$query = "SELECT * FROM Activite"; $query = "SELECT * FROM Activite";
return $this->connection->executeWithErrorHandling($query); return $this->connection->executeWithErrorHandling($query);
} }
public function getActiviteById(int $activiteId) { public function getActivityById(int $activityId) {
$query = "SELECT * FROM Activite WHERE idActivite = :id"; $query = "SELECT * FROM Activite WHERE idActivite = :id";
$params = [':id' => [$activiteId, PDO::PARAM_INT]]; $params = [':id' => $activityId];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function getActiviteByType(string $type) { public function getActivityByType(string $type) {
$query = "SELECT * FROM Activite WHERE type = :type"; $query = "SELECT * FROM Activite WHERE type = :type";
$params = [':type' => [$type, PDO::PARAM_STR]]; $params = [':type' => [$type, PDO::PARAM_STR]];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function getActiviteByDate(string $date) { public function getActivityByDate(string $date) {
$query = "SELECT * FROM Activite WHERE date = :date"; $query = "SELECT * FROM Activite WHERE date = :date";
$params = [':date' => [$date, PDO::PARAM_STR]]; $params = [':date' => [$date, PDO::PARAM_STR]];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function getActiviteByTimeRange(string $startTime, string $endTime) { public function getActivityByTimeRange(string $startTime, string $endTime) {
$query = "SELECT * FROM Activite WHERE heureDebut >= :startTime AND heureFin <= :endTime"; $query = "SELECT * FROM Activite WHERE heureDebut >= :startTime AND heureFin <= :endTime";
$params = [ $params = [
':startTime' => [$startTime, PDO::PARAM_STR], ':startTime' => [$startTime, PDO::PARAM_STR],
@ -41,76 +42,82 @@ class ActiviteGateway {
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function getActiviteByEffort(int $effortRessenti) { public function getActivityByEffort(int $effortRessenti) {
$query = "SELECT * FROM Activite WHERE effortRessenti = :effort"; $query = "SELECT * FROM Activite WHERE effortRessenti = :effort";
$params = [':effort' => [$effortRessenti, PDO::PARAM_INT]]; $params = [':effort' => [$effortRessenti, PDO::PARAM_INT]];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function getActiviteByVariability(int $variabilite) { public function getActivityByVariability(int $variabilite) {
$query = "SELECT * FROM Activite WHERE variabilite = :variability"; $query = "SELECT * FROM Activite WHERE variabilite = :variability";
$params = [':variability' => [$variabilite, PDO::PARAM_INT]]; $params = [':variability' => [$variabilite, PDO::PARAM_INT]];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function getActiviteByTemperature(int $temperatureMoyenne) { public function getActivityByTemperature(int $temperatureMoyenne) {
$query = "SELECT * FROM Activite WHERE temperatureMoyenne = :temperature"; $query = "SELECT * FROM Activite WHERE temperatureMoyenne = :temperature";
$params = [':temperature' => [$temperatureMoyenne, PDO::PARAM_INT]]; $params = [':temperature' => [$temperatureMoyenne, PDO::PARAM_INT]];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function addActivite(ActiviteEntity $activite) { public function getActivityByAthleteId(int $athleteId){
$query = "SELECT * FROM Activite WHERE athleteId = :athleteId";
$params = [':athleteId' => [$athleteId, PDO::PARAM_INT]];
return $this->connection->executeWithErrorHandling($query, $params);
}
public function addActivity(ActivityEntity $activity) {
$query = "INSERT INTO Activite (type, date, heureDebut, heureDeFin, effortRessenti, variabilite, variance, ecartType, moyenne, maximum, minimum, temperatureMoyenne) $query = "INSERT INTO Activite (type, date, heureDebut, heureDeFin, effortRessenti, variabilite, variance, ecartType, moyenne, maximum, minimum, temperatureMoyenne)
VALUES (:type, :date, :heureDebut, :heureDeFin, :effortRessenti, :variabilite, :variance, :ecartType, :moyenne, :maximum, :minimum, :temperatureMoyenne)"; VALUES (:type, :date, :heureDebut, :heureDeFin, :effortRessenti, :variabilite, :variance, :ecartType, :moyenne, :maximum, :minimum, :temperatureMoyenne)";
$params = [ $params = [
':type' => $activite->getType(), ':type' => $activity->getType(),
':date' => $activite->getDate()->format('Y-m-d'), // Format date pour SQL ':date' => $activity->getDate()->format('Y-m-d'), // Format date pour SQL
':heureDebut' => $activite->getHeureDebut()->format('H:i:s'), // Format heure pour SQL ':heureDebut' => $activity->getHeureDebut()->format('H:i:s'), // Format heure pour SQL
':heureDeFin' => $activite->getHeureFin()->format('H:i:s'), // Format heure pour SQL ':heureDeFin' => $activity->getHeureFin()->format('H:i:s'), // Format heure pour SQL
':effortRessenti' => $activite->getEffortRessenti(), ':effortRessenti' => $activity->getEffortRessenti(),
':variabilite' => $activite->getVariabilite(), ':variabilite' => $activity->getVariabilite(),
':variance' => $activite->getVariance(), ':variance' => $activity->getVariance(),
':ecartType' => $activite->getEcartType(), ':ecartType' => $activity->getEcartType(),
':moyenne' => $activite->getMoyenne(), ':moyenne' => $activity->getMoyenne(),
':maximum' => $activite->getMaximum(), ':maximum' => $activity->getMaximum(),
':minimum' => $activite->getMinimum(), ':minimum' => $activity->getMinimum(),
':temperatureMoyenne' => $activite->getTemperatureMoyenne(), ':temperatureMoyenne' => $activity->getTemperatureMoyenne(),
]; ];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function updateActivite(ActiviteEntity $oldActivite, ActiviteEntity $newActivite) { public function updateActivity(ActivityEntity $oldActivity, ActivityEntity $newActivity) {
$query = "UPDATE Activite $query = "UPDATE Activite
SET type = :type, date = :date, heureDebut = :heureDebut, heureDeFin = :heureDeFin, SET type = :type, date = :date, heureDebut = :heureDebut, heureDeFin = :heureDeFin,
effortRessenti = :effortRessenti, variabilite = :variabilite, variance = :variance, ecartType = :ecartType, moyenne = :moyenne, maximum = :maximum, minimum = :minimum, temperatureMoyenne = :temperatureMoyenne effortRessenti = :effortRessenti, variabilite = :variabilite, variance = :variance, ecartType = :ecartType, moyenne = :moyenne, maximum = :maximum, minimum = :minimum, temperatureMoyenne = :temperatureMoyenne
WHERE idActivite = :idActivite"; WHERE idActivite = :idActivite";
$params = [ $params = [
':idActivite' => $oldActivite->getIdActivite(), ':idActivite' => $oldActivity->getIdActivity(),
':type' => $newActivite->getType(), ':type' => $newActivity->getType(),
':date' => $newActivite->getDate()->format('Y-m-d'), // Format date pour SQL ':date' => $newActivity->getDate()->format('Y-m-d'), // Format date pour SQL
':heureDebut' => $newActivite->getHeureDebut()->format('H:i:s'), // Format heure pour SQL ':heureDebut' => $newActivity->getHeureDebut()->format('H:i:s'), // Format heure pour SQL
':heureDeFin' => $newActivite->getHeureFin()->format('H:i:s'), // Format heure pour SQL ':heureDeFin' => $newActivity->getHeureFin()->format('H:i:s'), // Format heure pour SQL
':effortRessenti' => $newActivite->getEffortRessenti(), ':effortRessenti' => $newActivity->getEffortRessenti(),
':variabilite' => $newActivite->getVariabilite(), ':variabilite' => $newActivity->getVariabilite(),
':variance' => $newActivite->getVariance(), ':variance' => $newActivity->getVariance(),
':ecartType' => $newActivite->getEcartType(), ':ecartType' => $newActivity->getEcartType(),
':moyenne' => $newActivite->getMoyenne(), ':moyenne' => $newActivity->getMoyenne(),
':maximum' => $newActivite->getMaximum(), ':maximum' => $newActivity->getMaximum(),
':minimum' => $newActivite->getMinimum(), ':minimum' => $newActivity->getMinimum(),
':temperatureMoyenne' => $newActivite->getTemperatureMoyenne(), ':temperatureMoyenne' => $newActivity->getTemperatureMoyenne(),
]; ];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function deleteActivite(int $idActivite) { public function deleteActivity(int $idActivity) {
$query = "DELETE FROM Activite WHERE idActivite = :idActivite"; $query = "DELETE FROM Activite WHERE idActivite = :idActivity";
$params = [ $params = [
':idActivite' => $idActivite, ':idActivity' => $idActivity,
]; ];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);

@ -0,0 +1,127 @@
<?php
namespace Database;
use DateTime;
use Model\Activity;
use Shared\Log;
class ActivityMapper {
public function activitySqlToEntity(array $data):array
{
$activityEntities = [];
foreach ($data as $activityData) {
$activity = new ActivityEntity();
if (isset($activityData['idActivite'])) {
$activity->setIdActivity($activityData['idActivite']);
}
if (isset($activityData['type'])) {
$activity->setType($activityData['type']);
}
if (isset($activityData['date'])) {
$activity->setDate($activityData['date']);
}
if (isset($activityData['heureDeDebut'])) {
$activity->setHeureDebut($activityData['heureDeDebut']);
}
if (isset($activityData['heureDeFin'])) {
$activity->setHeureFin($activityData['heureDeFin']);
}
if (isset($activityData['effortRessent'])) {
$activity->setEffortRessenti($activityData['effortRessent']);
}
if (isset($activityData['variabilite'])) {
$activity->setVariabilite($activityData['variabilite']);
}
if (isset($activityData['variance'])) {
$activity->setVariance($activityData['variance']);
}
if (isset($activityData['ecartType'])) {
$activity->setEcartType($activityData['ecartType']);
}
if (isset($activityData['moyenne'])) {
$activity->setMoyenne($activityData['moyenne']);
}
if (isset($activityData['maximum'])) {
$activity->setMaximum($activityData['maximum']);
}
if (isset($activityData['minimum'])) {
$activity->setMinimum($activityData['minimum']);
}
if (isset($activityData['temperatureMoyenne'])) {
$activity->setTemperatureMoyenne($activityData['temperatureMoyenne']);
}
$activityEntities[] = $activity;
}
return $activityEntities;
}
/**
* @throws \Exception
*/
public function activityEntityToModel(ActivityEntity $activiteEntity):Activity {
$date = new DateTime($activiteEntity->getDate());
$heureDebut = new \DateTime($activiteEntity->getHeureDebut());
$heureFin = new \DateTime($activiteEntity->getHeureFin());
$effortRessenti = intval($activiteEntity->getEffortRessenti());
$variability = floatval($activiteEntity->getVariability());
$variance = floatval($activiteEntity->getVariance());
$ecartType = floatval($activiteEntity->getEcartType());
$act = new Activity(
$activiteEntity->getIdActivity(),
$activiteEntity->getType(),
$date,
$heureDebut,
$heureFin,
$effortRessenti,
$variability,
$variance,
$ecartType,
$activiteEntity->getMoyenne(),
$activiteEntity->getMaximum(),
$activiteEntity->getMinimum(),
$activiteEntity->getTemperatureMoyenne(),
'false'
);
return $act;
}
//public function ActivityToEntity(Activity model): ActivityEntity;
public function activityToEntity(Activity $act):ActivityEntity{
$act = new ActivityEntity();
$act->setIdActivity($act->getIdActivity()());
$act->setType($act->getType());
$act->setDate($act->getDate());
$act->setHeureDebut($act->getHeureDebut());
$act->setHeureFin($act->getHeureFin());
$act->setEffortRessenti($act->getEffortRessenti());
$act->setVariabilite($act->getVariability());
$act->setVariance($act->getVariance());
$act->setEcartType($act->getEcartType());
$act->setMoyenne($act->getMoyenne());
$act->setMaximum($act->getMaximum());
$act->setMinimum($act->getMinimum());
$act->setTemperatureMoyenne($act->getTemperatureMoyenne());
return $act;
}
}
?>

@ -0,0 +1,79 @@
<?php
namespace Database;
class AnalyzeEntity
{
private $idFc;
private $altitude;
private $time;
private $temperature;
private $bpm;
private $longitude;
private $latitude;
private $idactivity;
public function getIdFC()
{
return $this->idFc;
}
public function getAltitude()
{
return $this->altitude;
}
public function getTime()
{
return $this->temps;
}
public function getTemperature()
{
return $this->temperature;
}
public function getBpm()
{
return $this->bpm;
}
public function getLongitude()
{
return $this->longitude;
}
public function getLatitude()
{
return $this->latitude;
}
public function getIdActivity()
{
return $this->idactivity;
}
public function setIdFC($idFc)
{
$this->idFc = $idFc;
}
public function setAltitude($altitude)
{
$this->altitude = $altitude;
}
public function setTime($time)
{
$this->time = $time;
}
public function setTemperature($temperature)
{
$this->temperature = $temperature;
}
public function setBpm($bpm)
{
$this->bpm = $bpm;
}
public function setLongitude($longitude)
{
$this->longitude = $longitude;
}
public function setLatitude($latitude)
{
$this->latitude = $latitude;
}
public function setIdActivity($idactivity)
{
$this->idactivity = $idactivity;
}
}

@ -0,0 +1,31 @@
<?php
namespace Database;
class AnalyzeGateway
{
private Connexion $connection;
public function __construct(Connexion $connection) {
$this->connection = $connection;
}
public function getFrequenceCardiaque() {
$query = "SELECT * FROM FrequenceCardiaque";
return $this->connection->executeWithErrorHandling($query);
}
public function getFrequenceCardiaqueByIdActivity(int $activityId)
{
$query = "SELECT * FROM FrequenceCardiaque WHERE activiteId = :id";
$params = [':id' => $activityId];
return $this->connection->executeWithErrorHandling($query, $params);
}
public function getFrequenceCardiaqueByIdActivityAndCurrentAthlete(int $activityId, int $athleteId)
{
$query = "SELECT * FROM FrequenceCardiaque WHERE activiteId = :id AND athleteId = :athleteId";
$params = [':id' => $activityId, ':athleteId' => $athleteId];
return $this->connection->executeWithErrorHandling($query, $params);
}
}

@ -0,0 +1,126 @@
<?php
namespace Database;
use Shared\Log;
class AnalyzeMapper
{
public function analyzeSqlToEntity(array $data):array
{
$analyzeEntities = [];
foreach ($data as $analyzeData) {
$analyze = new ActivityEntity();
if (isset($analyzeData['idactivite'])) {
$analyze->setIdActivity($analyzeData['idactivite']);
}
if (isset($analyzeData['type'])) {
$analyze->setType($analyzeData['type']);
}
if (isset($analyzeData['date'])) {
$analyze->setDate($analyzeData['date']);
}
if (isset($analyzeData['heurededebut'])) {
$analyze->setHeureDebut($analyzeData['heurededebut']);
}
if (isset($analyzeData['heuredefin'])) {
$analyze->setHeureFin($analyzeData['heuredefin']);
}
if (isset($analyzeData['effortressent'])) {
$analyze->setEffortRessenti($analyzeData['effortressent']);
}
if (isset($analyzeData['variabilite'])) {
$analyze->setVariabilite($analyzeData['variabilite']);
}
if (isset($analyzeData['variance'])) {
$analyze->setVariance($analyzeData['variance']);
}
if (isset($analyzeData['ecarttype'])) {
$analyze->setEcartType($analyzeData['ecarttype']);
}
if (isset($analyzeData['moyenne'])) {
$analyze->setMoyenne($analyzeData['moyenne']);
}
if (isset($analyzeData['maximum'])) {
$analyze->setMaximum($analyzeData['maximum']);
}
if (isset($analyzeData['minimum'])) {
$analyze->setMinimum($analyzeData['minimum']);
}
if (isset($analyzeData['temperaturemoyenne'])) {
$analyze->setTemperatureMoyenne($analyzeData['temperaturemoyenne']);
}
$analyzeEntities[] = $analyze;
}
return $analyzeEntities;
}
/**
* @throws \Exception
*/
public function analyzeEntityToModel(ActivityEntity $activiteEntity) {
$date = new DateTime($activiteEntity->getDate());
$heureDebut = new \DateTime($activiteEntity->getHeureDebut());
$heureFin = new \DateTime($activiteEntity->getHeureFin());
$effortRessenti = intval($activiteEntity->getEffortRessenti());
$variability = floatval($activiteEntity->getVariability());
$variance = floatval($activiteEntity->getVariance());
$ecartType = floatval($activiteEntity->getEcartType());
$act = new Activity(
$activiteEntity->getIdActivity(),
$activiteEntity->getType(),
$date,
$heureDebut,
$heureFin,
$effortRessenti,
$variability,
$variance,
$ecartType,
$activiteEntity->getMoyenne(),
$activiteEntity->getMaximum(),
$activiteEntity->getMinimum(),
$activiteEntity->getTemperatureMoyenne(),
'false'
);
return $act;
}
//public function ActivityToEntity(Activity model): ActivityEntity;
// public function activityToEntity( $act):ActivityEntity{
//
// $act = new ActivityEntity();
// $act->setIdActivity($act->getIdActivity()());
// $act->setType($act->getType());
// $act->setDate($act->getDate());
// $act->setHeureDebut($act->getHeureDebut());
// $act->setHeureFin($act->getHeureFin());
// $act->setEffortRessenti($act->getEffortRessenti());
// $act->setVariabilite($act->getVariability());
// $act->setVariance($act->getVariance());
// $act->setEcartType($act->getEcartType());
// $act->setMoyenne($act->getMoyenne());
// $act->setMaximum($act->getMaximum());
// $act->setMinimum($act->getMinimum());
// $act->setTemperatureMoyenne($act->getTemperatureMoyenne());
//
// return $act;
// }
}

@ -6,12 +6,14 @@ class AthleteEntity {
private $idAthlete; private $idAthlete;
private $nom; private $nom;
private $prenom; private $prenom;
private $username;
private $email; private $email;
private $sexe; private $sexe;
private $taille; private $taille;
private $poids; private $poids;
private $motDePasse; private $motDePasse;
private $dateNaissance; private $dateNaissance;
private $isCoach;
// Getters // Getters
public function getIdAthlete() { public function getIdAthlete() {
@ -26,6 +28,10 @@ class AthleteEntity {
return $this->prenom; return $this->prenom;
} }
public function getUsername(){
return $this->username;
}
public function getEmail() { public function getEmail() {
return $this->email; return $this->email;
} }
@ -50,6 +56,11 @@ class AthleteEntity {
return $this->dateNaissance; return $this->dateNaissance;
} }
public function getIsCoach(){
return $this->isCoach;
}
// Setters // Setters
public function setIdAthlete($idAthlete) { public function setIdAthlete($idAthlete) {
$this->idAthlete = $idAthlete; $this->idAthlete = $idAthlete;
@ -63,6 +74,10 @@ class AthleteEntity {
$this->prenom = $prenom; $this->prenom = $prenom;
} }
public function setUsername($username){
$this->username = $username;
}
public function setEmail($email) { public function setEmail($email) {
$this->email = $email; $this->email = $email;
} }
@ -86,6 +101,10 @@ class AthleteEntity {
public function setDateNaissance($dateNaissance) { public function setDateNaissance($dateNaissance) {
$this->dateNaissance = $dateNaissance; $this->dateNaissance = $dateNaissance;
} }
public function setIsCoach($isCoach){
$this->isCoach = $isCoach;
}
} }
?> ?>

@ -2,70 +2,118 @@
namespace Database; namespace Database;
use \PDO; use \PDO;
use Shared\Log;
class AthleteGateway { class AthleteGateway {
private $connection; private Connexion $connection;
public function __construct(Connexion $connection) { public function __construct(Connexion $connection) {
$this->connection = $connection; $this->connection = $connection;
} }
public function getAthlete() { public function getAthlete(): array
$query = "SELECT * FROM Athlete"; {
return $this->connection->executeWithErrorHandling($query); $query = "SELECT * FROM Athlete WHERE isCoach=FALSE";
$res = $this->connection->executeWithErrorHandling($query);
return $res;
} }
public function getAthleteById(int $userId) { public function getAthleteById(int $userId): array
$query = "SELECT * FROM Athlete WHERE idAthlete = :id"; {
$params = [':id' => [$userId, PDO::PARAM_INT]]; $query = "SELECT * FROM Athlete WHERE idAthlete = :id AND isCoach=FALSE";
return $this->connection->executeWithErrorHandling($query, $params); $params = [':id' => $userId];
$res = $this->connection->executeWithErrorHandling($query, $params);
return $res;
} }
public function getAthleteByName(string $name) { public function getAthleteByName(string $name): array
$query = "SELECT * FROM Athlete WHERE nom = :name"; {
$params = [':name' => [$name, PDO::PARAM_STR]]; $query = "SELECT * FROM Athlete WHERE nom = :name AND isCoach=FALSE";
$params = [':name' => $name];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function getAthleteByFirstName(string $firstName) { public function getAthleteByFirstName(string $firstName): array
$query = "SELECT * FROM Athlete WHERE prenom = :firstName"; {
$params = [':firstName' => [$firstName, PDO::PARAM_STR]]; $query = "SELECT * FROM Athlete WHERE prenom = :firstName AND isCoach=FALSE";
$params = [':firstName' => $firstName];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function getAthleteByEmail(string $email) { public function getAthleteByEmail(string $email): array
$query = "SELECT * FROM Athlete WHERE email = :email"; {
$params = [':email' => [$email, PDO::PARAM_STR]]; $query = "SELECT * FROM Athlete WHERE email = :email AND isCoach=FALSE";
$params = [':email' => $email];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function getAthleteByGender(string $gender) { public function getAthleteByGender(string $gender): array
$query = "SELECT * FROM Athlete WHERE sexe = :gender"; {
$params = [':gender' => [$gender, PDO::PARAM_STR]]; $query = "SELECT * FROM Athlete WHERE sexe = :gender AND isCoach=FALSE";
$params = [':gender' => $gender];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function getAthleteByHeight(int $height) { public function getAthleteByHeight(int $height): array
$query = "SELECT * FROM Athlete WHERE taille = :height"; {
$query = "SELECT * FROM Athlete WHERE taille = :height AND isCoach=FALSE";
$params = [':height' => [$height, PDO::PARAM_INT]]; $params = [':height' => [$height, PDO::PARAM_INT]];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function getAthleteByWeight(int $weight) { public function getAthleteByWeight(int $weight): array
$query = "SELECT * FROM Athlete WHERE poids = :weight"; {
$query = "SELECT * FROM Athlete WHERE poids = :weight AND isCoach=FALSE";
$params = [':weight' => [$weight, PDO::PARAM_INT]]; $params = [':weight' => [$weight, PDO::PARAM_INT]];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function getAthleteByBirthDate(string $birthdate) { public function getAthleteByBirthDate(string $birthdate): array
$query = "SELECT * FROM Athlete WHERE dateNaissance = :birthdate"; {
$query = "SELECT * FROM Athlete WHERE dateNaissance = :birthdate AND isCoach=FALSE";
$params = [':birthdate' => [$birthdate, PDO::PARAM_STR]]; $params = [':birthdate' => [$birthdate, PDO::PARAM_STR]];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function addAthlete(AthleteEntity $athlete) { public function getListIdFriends(int $idAthlete): array
$query = "INSERT INTO Athlete (nom, prenom, email, sexe, taille, poids, motDePasse, dateNaissance) {
VALUES (:nom, :prenom, :email, :sexe, :taille, :poids, :motDePasse, :dateNaissance)"; $query = "SELECT idAthlete1, idAthlete2 FROM Friendship WHERE idAthlete1 = :idAthlete OR idAthlete2= :idAthlete";
$params = [
':idAthlete' => $idAthlete,
];
return $this->connection->executeWithErrorHandling($query, $params);
}
public function getListActivity(int $idAthlete): array
{
/*$query = "SELECT count(ac.idActivite) AS nbActivite, EXTRACT(MONTH FROM ac.date) AS mois
FROM Athlete at, Activite ac
WHERE at.idAthlete = :idAthlete
AND ac.date > CURRENT_DATE - INTERVAL '1 YEAR'
AND ac.athleteId = at.idAthlete
GROUP BY mois";*/
$query = "SELECT COUNT(ac.idActivite) AS nbActivite, EXTRACT(MONTH FROM ac.date) AS mois
FROM Athlete at
JOIN Activite ac ON ac.athleteId = at.idAthlete
WHERE at.idAthlete = :idAthlete
AND ac.date > CURRENT_DATE - INTERVAL 1 YEAR
GROUP BY mois";
$params = [
':idAthlete' => $idAthlete,
];
return $this->connection->executeWithErrorHandling($query, $params);
}
public function addAthlete(AthleteEntity $athlete): array
{
$query = "INSERT INTO Athlete (nom, prenom, email, sexe, taille, poids, motDePasse, dateNaissance, isCoach)
VALUES (:nom, :prenom, :email, :sexe, :taille, :poids, :motDePasse, :dateNaissance, :isCoach)";
$params = [ $params = [
':nom' => $athlete->getNom(), ':nom' => $athlete->getNom(),
@ -76,15 +124,17 @@ class AthleteGateway {
':poids' => $athlete->getPoids(), ':poids' => $athlete->getPoids(),
':motDePasse' => $athlete->getMotDePasse(), ':motDePasse' => $athlete->getMotDePasse(),
':dateNaissance' => $athlete->getDateNaissance(), ':dateNaissance' => $athlete->getDateNaissance(),
':isCoach' => $athlete->getIsCoach(),
]; ];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function updateAthlete(AthleteEntity $oldAthlete, AthleteEntity $newAthlete) { public function updateAthlete(AthleteEntity $oldAthlete, AthleteEntity $newAthlete): array
{
$query = "UPDATE Athlete $query = "UPDATE Athlete
SET nom = :nom, prenom = :prenom, email = :email, sexe = :sexe, SET nom = :nom, prenom = :prenom, email = :email, sexe = :sexe,
taille = :taille, poids = :poids, motDePasse = :motDePasse, dateNaissance = :dateNaissance taille = :taille, poids = :poids, motDePasse = :motDePasse, dateNaissance = :dateNaissance, isCoach = :isCoach
WHERE idAthlete = :idAthlete"; WHERE idAthlete = :idAthlete";
$params = [ $params = [
@ -97,12 +147,14 @@ class AthleteGateway {
':poids' => $newAthlete->getPoids(), ':poids' => $newAthlete->getPoids(),
':motDePasse' => $newAthlete->getMotDePasse(), ':motDePasse' => $newAthlete->getMotDePasse(),
':dateNaissance' => $newAthlete->getDateNaissance(), ':dateNaissance' => $newAthlete->getDateNaissance(),
':isCoach' => $newAthlete->getIsCoach(),
]; ];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function deleteAthlete(int $idAthlete) { public function deleteAthlete(int $idAthlete): array
{
$query = "DELETE FROM Athlete WHERE idAthlete = :idAthlete"; $query = "DELETE FROM Athlete WHERE idAthlete = :idAthlete";
$params = [ $params = [
@ -112,6 +164,14 @@ class AthleteGateway {
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function getById(int $userId): array
{
$query = "SELECT * FROM Athlete WHERE idAthlete = :id";
$params = [':id' => $userId];
$res = $this->connection->executeWithErrorHandling($query, $params);
return $res;
}
} }

@ -6,14 +6,14 @@ use \PDO;
use \DateTime; use \DateTime;
use Model\Role; use Model\Role;
use Model\Athlete; use Model\Athlete;
use Shared\Log;
class AthleteMapper { class AthleteMapper {
public function fromSqlToEntity(array $data): array { public function athleteSqlToEntity(array $data): array {
$athleteEntities = []; $athleteEntities = [];
foreach ($data as $athleteData) { foreach ($data as $athleteData) {
$athlete = new AthleteEntity(); $athlete = new AthleteEntity();
if (isset($athleteData['idAthlete'])) { if (isset($athleteData['idAthlete'])) {
$athlete->setIdAthlete($athleteData['idAthlete']); $athlete->setIdAthlete($athleteData['idAthlete']);
} }
@ -26,6 +26,10 @@ class AthleteMapper {
$athlete->setPrenom($athleteData['prenom']); $athlete->setPrenom($athleteData['prenom']);
} }
if (isset($athleteData['username'])) {
$athlete->setUsername($athleteData['username']);
}
if (isset($athleteData['email'])) { if (isset($athleteData['email'])) {
$athlete->setEmail($athleteData['email']); $athlete->setEmail($athleteData['email']);
} }
@ -50,6 +54,10 @@ class AthleteMapper {
$athlete->setDateNaissance($athleteData['dateNaissance']); $athlete->setDateNaissance($athleteData['dateNaissance']);
} }
if (isset($athleteData['isCoach'])) {
$athlete->setIsCoach($athleteData['isCoach']);
}
$athleteEntities[] = $athlete; $athleteEntities[] = $athlete;
} }
@ -58,19 +66,20 @@ class AthleteMapper {
public function athleteEntityToModel(AthleteEntity $athleteEntity): User { public function athleteEntityToModel(AthleteEntity $athleteEntity): User {
$role = new Athlete(); // Utilisez la classe Athlete $role = new Athlete(); // Utilisez la classe Athlete
$date = new DateTime($athleteEntity->getDateNaissance());
$dateSpecifique = $athleteEntity->getDateNaissance(); $poids = floatval($athleteEntity->getPoids());
$date = new DateTime($dateSpecifique); $taille = floatval($athleteEntity->getTaille());
$user = new User( $user = new User(
$athleteEntity->getIdAthlete(), $athleteEntity->getIdAthlete(),
$athleteEntity->getNom(), $athleteEntity->getNom(),
$athleteEntity->getPrenom(), $athleteEntity->getPrenom(),
$athleteEntity->getUsername(),
$athleteEntity->getEmail(), $athleteEntity->getEmail(),
$athleteEntity->getMotDePasse(), $athleteEntity->getMotDePasse(),
$athleteEntity->getSexe(), $athleteEntity->getSexe(),
$athleteEntity->getTaille(), $taille,
$athleteEntity->getPoids(), $poids,
$date, $date,
$role $role
); );
@ -84,12 +93,15 @@ class AthleteMapper {
$ath->setIdAthlete($user->getId()); $ath->setIdAthlete($user->getId());
$ath->setNom($user->getNom()); $ath->setNom($user->getNom());
$ath->setPrenom($user->getPrenom()); $ath->setPrenom($user->getPrenom());
$ath->setUsername($user->getUsername());
$ath->setEmail($user->getEmail()); $ath->setEmail($user->getEmail());
$ath->setSexe($user->getSexe()); $ath->setSexe($user->getSexe());
$ath->setTaille($user->getTaille()); $ath->setTaille($user->getTaille());
$ath->setPoids($user->getPoids()); $ath->setPoids($user->getPoids());
$ath->setMotDePasse($user->getMotDePasse()); $ath->setMotDePasse($user->getMotDePasse());
$ath->setDateNaissance($user->getDateNaissance()); $ath->setDateNaissance($user->getDateNaissance());
$ath->setIsCoach(FALSE);
$ath->setCoachId(NULL);
return $ath; return $ath;
} }

@ -4,50 +4,15 @@ namespace Database;
class CoachEntity { class CoachEntity {
private $idCoach; private $idCoach;
private $nom; private $athleteId;
private $prenom;
private $email;
private $sexe;
private $taille;
private $poids;
private $motDePasse;
private $dateNaissance;
// Getters // Getters
public function getIdCoach() { public function getIdCoach() {
return $this->idCoach; return $this->idCoach;
} }
public function getNom() { public function getAthleteId() {
return $this->nom; return $this->athleteId;
}
public function getPrenom() {
return $this->prenom;
}
public function getEmail() {
return $this->email;
}
public function getSexe() {
return $this->sexe;
}
public function getTaille() {
return $this->taille;
}
public function getPoids() {
return $this->poids;
}
public function getMotDePasse() {
return $this->motDePasse;
}
public function getDateNaissance() {
return $this->dateNaissance;
} }
// Setters // Setters
@ -55,37 +20,10 @@ class CoachEntity {
$this->idCoach = $idCoach; $this->idCoach = $idCoach;
} }
public function setNom($nom) { public function setAthleteId($athleteId) {
$this->nom = $nom; $this->athleteId = $athleteId;
} }
public function setPrenom($prenom) {
$this->prenom = $prenom;
}
public function setEmail($email) {
$this->email = $email;
}
public function setSexe($sexe) {
$this->sexe = $sexe;
}
public function setTaille($taille) {
$this->taille = $taille;
}
public function setPoids($poids) {
$this->poids = $poids;
}
public function setMotDePasse($motDePasse) {
$this->motDePasse = $motDePasse;
}
public function setDateNaissance($dateNaissance) {
$this->dateNaissance = $dateNaissance;
}
} }
?> ?>

@ -10,93 +10,96 @@ class CoachGateway {
$this->connection = $connection; $this->connection = $connection;
} }
public function getCoach() { public function getCoach(): array
{
$query = "SELECT * FROM Coach"; $query = "SELECT * FROM Coach";
return $this->connection->executeWithErrorHandling($query); return $this->connection->executeWithErrorHandling($query);
} }
public function getCoachById(int $userId) { public function getCoachById(int $userId): array
{
$query = "SELECT * FROM Coach WHERE idCoach = :id"; $query = "SELECT * FROM Coach WHERE idCoach = :id";
$params = [':id' => [$userId, PDO::PARAM_INT]]; $params = [':id' => [$userId, PDO::PARAM_INT]];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function getCoachByName(string $name) { public function getAthleteByCoachId(int $coachId): array
$query = "SELECT * FROM Coach WHERE nom = :name"; {
$query = "SELECT * FROM Athlete a, Coach c WHERE a.coachId = :id AND a.isCoach = TRUE";
$params = [':id' => [$coachId, PDO::PARAM_INT]];
return $this->connection->executeWithErrorHandling($query, $params);
}
public function getCoachByName(string $name): array
{
$query = "SELECT * FROM Coach c, Athlete a WHERE c.athleteId = a.idAthlete AND a.nom = :name";
$params = [':name' => [$name, PDO::PARAM_STR]]; $params = [':name' => [$name, PDO::PARAM_STR]];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function getCoachByFirstName(string $firstName) { public function getCoachByFirstName(string $firstName): array
$query = "SELECT * FROM Coach WHERE prenom = :firstName"; {
$query = "SELECT * FROM Coach c, Athlete a WHERE c.athleteId = a.idAthlete AND a.prenom = :firstName";
$params = [':firstName' => [$firstName, PDO::PARAM_STR]]; $params = [':firstName' => [$firstName, PDO::PARAM_STR]];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function getCoachByEmail(string $email) { public function getCoachByEmail(string $email): array
$query = "SELECT * FROM Coach WHERE email = :email"; {
$query = "SELECT * FROM Coach c, Athlete a WHERE c.athleteId = a.idAthlete AND a.email = :email";
$params = [':email' => [$email, PDO::PARAM_STR]]; $params = [':email' => [$email, PDO::PARAM_STR]];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function getCoachByGender(string $gender) { public function getCoachByGender(string $gender): array
$query = "SELECT * FROM Coach WHERE sexe = :gender"; {
$query = "SELECT * FROM Coach c, Athlete a WHERE c.athleteId = a.idAthlete AND a.sexe = :gender";
$params = [':gender' => [$gender, PDO::PARAM_STR]]; $params = [':gender' => [$gender, PDO::PARAM_STR]];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function getCoachByHeight(int $height) { public function getCoachByHeight(int $height): array
$query = "SELECT * FROM Coach WHERE taille = :height"; {
$query = "SELECT * FROM Coach c, Athlete a WHERE c.athleteId = a.idAthlete AND a.taille = :height";
$params = [':height' => [$height, PDO::PARAM_INT]]; $params = [':height' => [$height, PDO::PARAM_INT]];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function getCoachByBirthDate(string $birthdate) { public function getCoachByBirthDate(string $birthdate): array
$query = "SELECT * FROM Coach WHERE dateNaissance = :birthdate"; {
$query = "SELECT * FROM Coach c, Athlete a WHERE c.athleteId = a.idAthlete AND a.dateNaissance = :birthdate";
$params = [':birthdate' => [$birthdate, PDO::PARAM_STR]]; $params = [':birthdate' => [$birthdate, PDO::PARAM_STR]];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function addCoach(CoachEntity $coach) { public function addCoach(CoachEntity $coach): array
$query = "INSERT INTO Coach (nom, prenom, email, sexe, taille, poids, motDePasse, dateNaissance) {
VALUES (:nom, :prenom, :email, :sexe, :taille, :poids, :motDePasse, :dateNaissance)"; $query = "INSERT INTO Coach (athleteId)
VALUES (:athleteId)";
$params = [ $params = [
':nom' => $coach->getNom(), ':athleteId' => $coach->getAthleteId(),
':prenom' => $coach->getPrenom(),
':email' => $coach->getEmail(),
':sexe' => $coach->getSexe(),
':taille' => $coach->getTaille(),
':poids' => $coach->getPoids(),
':motDePasse' => $coach->getMotDePasse(),
':dateNaissance' => $coach->getDateNaissance(),
]; ];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function updateCoach(CoachEntity $oldCoach, CoachEntity $newCoach) { public function updateCoach(CoachEntity $oldCoach, CoachEntity $newCoach): array
{
$query = "UPDATE Coach $query = "UPDATE Coach
SET nom = :nom, prenom = :prenom, email = :email, sexe = :sexe, SET athleteId = :athleteId
taille = :taille, poids = :poids, motDePasse = :motDePasse, dateNaissance = :dateNaissance
WHERE idCoach = :idCoach"; WHERE idCoach = :idCoach";
$params = [ $params = [
':idCoach' => $oldCoach->getIdCoach(), ':idCoach' => $oldCoach->getIdCoach(),
':nom' => $newCoach->getNom(), ':athleteId' => $newCoach->getAthleteId(),
':prenom' => $newCoach->getPrenom(),
':email' => $newCoach->getEmail(),
':sexe' => $newCoach->getSexe(),
':taille' => $newCoach->getTaille(),
':poids' => $newCoach->getPoids(),
':motDePasse' => $newCoach->getMotDePasse(),
':dateNaissance' => $newCoach->getDateNaissance(),
]; ];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function deleteCoach(int $idCoach) { public function deleteCoach(int $idCoach): array
{
$query = "DELETE FROM Coach WHERE idCoach = :idCoach"; $query = "DELETE FROM Coach WHERE idCoach = :idCoach";
$params = [ $params = [

@ -1,6 +1,7 @@
<?php <?php
namespace Database; namespace Database;
use Model\CoachAthlete;
use Model\User; use Model\User;
use \PDO; use \PDO;
use \DateTime; use \DateTime;
@ -8,34 +9,48 @@ use Model\Role;
use Model\Coach; use Model\Coach;
class CoachMapper { class CoachMapper {
public function map(array $data) { public function coachSqlToEntity(array $data): array {
$coachEntities = [];
foreach ($data as $coachData) {
$coach = new CoachEntity(); $coach = new CoachEntity();
$coach->setIdCoach($data['idCoach']);
$coach->setNom($data['nom']);
$coach->setPrenom($data['prenom']);
$coach->setEmail($data['email']);
$coach->setSexe($data['sexe']);
$coach->setTaille($data['taille']);
$coach->setPoids($data['poids']);
$coach->setMotDePasse($data['motDePasse']);
$coach->setDateNaissance($data['dateNaissance']);
return $coach; if (isset($coachData['idCoach'])) {
$coach->setIdCoach($coachData['idCoach']);
}
if (isset($coachData['athleteId'])) {
$coach->setAthleteId($coachData['athleteId']);
}
$coachEntities[] = $coach;
}
return $coachEntities;
} }
public function CoachEntityToModel(CoachEntity $coachEntity):User{ public function CoachEntityToModel(CoachEntity $coachEntity):User{
$role = "Coach"; $role = new CoachAthlete();
$idCoach = $coachEntity->getIdCoach();
$ath = getAthleteByCoachId($idCoach);
$athlete = athleteSqlToEntity($ath);
$dateSpecific = $athlete->getDateNaissance();
$date = new DateTime($dateSpecific);
$user = new User( $user = new User(
$coachEntity->getIdCoach(), $coachEntity->getIdCoach(),
$coachEntity->getNom(), $athlete->getNom(),
$coachEntity->getPrenom(), $athlete->getPrenom(),
$coachEntity->getEmail(), $athlete->getEmail(),
$coachEntity->getMotDePasse(), $athlete->getMotDePasse(),
$coachEntity->getSexe(), $athlete->getSexe(),
$coachEntity->getTaille(), $athlete->getTaille(),
$coachEntity->getPoids(), $athlete->getPoids(),
$coachEntity->getDateNaissance(), $athlete->getDateNaissance(),
$date,
$role $role
); );
@ -46,17 +61,10 @@ class CoachMapper {
$coach = new CoachEntity(); $coach = new CoachEntity();
$coach->setIdCoach($user->getId()); $coach->setIdCoach($user->getId());
$coach->setNom($user->getNom()); $coach->setAthleteId($user->getId());
$coach->setPrenom($user->getPrenom());
$coach->setEmail($user->getEmail());
$coach->setSexe($user->getSexe());
$coach->setTaille($user->getTaille());
$coach->setPoids($user->getPoids());
$coach->setMotDePasse($user->getMotDePasse());
$coach->setDateNaissance($user->getDateNaissance());
return $coach; return $coach;
} }
} }
?> ?>

@ -2,6 +2,9 @@
namespace Database; namespace Database;
use DateTime;
use Shared\Log;
class Connexion extends \PDO { class Connexion extends \PDO {
private $stmt; private $stmt;
@ -15,13 +18,11 @@ class Connexion extends \PDO {
} }
} }
public function executeQuery(string $query, array $parameters = []): bool { public function executeQuery(string $query, array $parameters = []) {
$this->stmt = $this->prepare($query); $this->stmt = $this->prepare($query);
//foreach ($parameters as $name => $value) {
// $this->stmt->bindValue($name, $value[0], $value[1]);
//}
foreach ($parameters as $name => $value) { foreach ($parameters as $name => $value) {
$bindValueResult = $this->stmt->bindValue($name, $value, \PDO::PARAM_STR); $dataType = is_numeric($value) ? \PDO::PARAM_INT : \PDO::PARAM_STR;
$bindValueResult = $this->stmt->bindValue($name, $value, $dataType);
if (!$bindValueResult) { if (!$bindValueResult) {
// Gérez l'erreur, par exemple, en lançant une exception. // Gérez l'erreur, par exemple, en lançant une exception.
throw new \PDOException('Failed to bind value for parameter ' . $name); throw new \PDOException('Failed to bind value for parameter ' . $name);

@ -0,0 +1,71 @@
<?php
namespace Database;
class EntrainementEntity
{
private $idEntrainement;
private $date;
private $description;
private $latitude;
private $longitude;
private $feedback;
private $coachId;
public function getIdEntrainement()
{
return $this->idEntrainement;
}
public function getDate()
{
return $this->date;
}
public function getDescription()
{
return $this->description;
}
public function getLatitude()
{
return $this->latitude;
}
public function getLongitude()
{
return $this->longitude;
}
public function getFeedback()
{
return $this->feedback;
}
public function getCoachId()
{
return $this->coachId;
}
public function setIdEntrainement($idEntrainement)
{
$this->idEntrainement = $idEntrainement;
}
public function setDate($date)
{
$this->date = $date;
}
public function setDescription($description)
{
$this->description = $description;
}
public function setLatitude($latitude)
{
$this->latitude = $latitude;
}
public function setLongitude($longitude)
{
$this->longitude = $longitude;
}
public function setFeedback($feedback)
{
$this->feedback = $feedback;
}
public function setCoachId($coachId)
{
$this->coachId = $coachId;
}
}

@ -0,0 +1,21 @@
<?php
namespace Database;
use Shared\Log;
class EntrainementGateway
{
private Connexion $connection;
public function __construct(Connexion $connection) {
$this->connection = $connection;
}
public function getEntrainements(): array
{
$query = "SELECT * FROM Entrainement";
$res = $this->connection->executeWithErrorHandling($query);
return $res;
}
}

@ -0,0 +1,82 @@
<?php
namespace Database;
use DateTime;
use Model\Athlete;
use Model\Training;
use Model\User;
use Shared\Log;
class EntrainementMapper
{
public function entrainementSqlToEntity(array $data): array {
$entrainementEntities = [];
foreach ($data as $entrainementData) {
$entrainement = new EntrainementEntity();
if (isset($entrainementData['identrainement'])) {
$entrainement->setIdEntrainement($entrainementData['identrainement']);
}
if (isset($entrainementData['date'])) {
$entrainement->setDate($entrainementData['date']);
}
if (isset($entrainementData['description'])) {
$entrainement->setDescription($entrainementData['description']);
}
if (isset($entrainementData['latitude'])) {
$entrainement->setLatitude($entrainementData['latitude']);
}
if (isset($entrainementData['longitude'])) {
$entrainement->setLongitude($entrainementData['longitude']);
}
if (isset($entrainementData['feedback'])) {
$entrainement->setFeedback($entrainementData['feedback']);
}
if (isset($entrainementData['athleteid'])) {
$entrainement->setCoachId($entrainementData['athleteid']);
}
$entrainementEntities[] = $entrainement;
}
return $entrainementEntities;
}
public function entrainementEntityToModel(EntrainementEntity $entrainementEntity): Training {
$date = new DateTime($entrainementEntity->getDate());
$idTraining = intval($entrainementEntity->getIdEntrainement());
$latitude = floatval($entrainementEntity->getLatitude());
$longitude = floatval($entrainementEntity->getLongitude());
return new Training(
$idTraining,
$date,
$latitude,
$longitude,
$entrainementEntity->getDescription(),
$entrainementEntity->getFeedback()
);
}
public function entrainementToEntity(Training $training):EntrainementEntity{
$train = new EntrainementEntity();
$train->setIdEntrainement($training->getId());
$train->setDate($training->getDate());
$train->setDescription($training->getDescription());
$train->setLatitude($training->getLatitude());
$train->setLongitude($training->getLongitude());
$train->setFeedback($training->getFeedback());
$train->setCoachId(1);
return $train;
}
}

@ -0,0 +1,28 @@
<?php
namespace Database;
class EnvoiEntity {
private $idAthlete;
private $idNotif;
// Getters
public function getIdAthlete() :int {
return $this->idActivity;
}
public function getIdNotif() {
return $this->type;
}
// Setters
public function setIdAthlete($idAthlete) {
$this->idAthlete = $idAthlete;
}
public function setIdNotif($idNotif) {
$this->idNotif = $idNotif;
}
}
?>

@ -0,0 +1,25 @@
<?php
namespace Database;
class EnvoiGateway
{
private Connexion $connection;
public function __construct(Connexion $connection) {
$this->connection = $connection;
}
public function getEnvois(): array
{
$query = "SELECT * FROM Envoi";
$res = $this->connection->executeWithErrorHandling($query);
return $res;
}
public function addEnvoi(EnvoiEntity $envoi){
$query = "INSERT INTO Envoi (idAthlete, idEnvoi) VALUES (:idAthlete, :idEnvoi)";
$params = [':idAthlete'=>$envoi->getIdAthlete(), ':date'=>$idNotif->getIdNotif()];
return $this->connection->executeWithErrorHandling($query, $params);
}
}

@ -0,0 +1,44 @@
<?php
namespace Database;
class EnvoiMapper
{
public function envoiSqlToEntity(array $data): array
{
$envoiEntities = [];
foreach ($data as $envoiData) {
$envoi = new EnvoiEntity();
if (isset($envoiData['idNotif'])) {
$envoi->setIdNotif($envoiData['idNotif']);
}
if (isset($envoiData['idAthlete'])) {
$envoi->setMessage($envoiData['idAthlete']);
}
$envoiEntities[] = $envoi;
}
return $envoiEntities;
}
public function envoiEntityToModel(EnvoiEntity $envoiEntity): Envoi
{
$date = new DateTime($envoiEntity->getDate());
return new envoi(
$envoiEntity->getIdAthlete(),
$envoiEntity->getIdNotif(),
);
}
public function envoiToEntity(Envoi $envoi): EnvoiEntity
{
$notif = new envoiEntity();
$notif->setIdAthlete($envoi->getIdAthlete());
$notif->setIdNotif($envoi->getIdNotif());
return $notif;
}
}

@ -0,0 +1,64 @@
<?php
namespace Database;
use Shared\Log;
class NotificationEntity
{
private $idNotif;
private $message;
private $date;
private $statut;
private $urgence;
private $idAthlete;
public function getIdNotif()
{
return $this->idNotif;
}
public function getMessage()
{
return $this->message;
}
public function getDate()
{
return $this->date;
}
public function getStatut()
{
return $this->statut;
}
public function getUrgence()
{
return $this->urgence;
}
public function getIdAthlete()
{
return $this->idAthlete;
}
public function setIdNotif($idNotif)
{
$this->idNotif = $idNotif;
}
public function setMessage($message)
{
$this->message = $message;
}
public function setDate($date)
{
$this->date = $date;
}
public function setStatut($statut)
{
$this->statut = $statut;
}
public function setUrgence($urgence)
{
$this->urgence = $urgence;
}
public function setIdAthlete($idAthlete)
{
$this->idAthlete = $idAthlete;
}
}

@ -0,0 +1,27 @@
<?php
namespace Database;
use Shared\Log;
class NotificationGateway
{
private Connexion $connection;
public function __construct(Connexion $connection) {
$this->connection = $connection;
}
public function getNotifications(): array
{
$query = "SELECT * FROM Notification";
$res = $this->connection->executeWithErrorHandling($query);
return $res;
}
public function addNotification(NotificationEntity $notif){
$query = "INSERT INTO Notification (message, date, statut, urgence, athleteid) VALUES (:message, :date, :statut, :urgence, :idAthlete)";
$params = [':message'=>$notif->getMessage(), ':date'=>$notif->getDate(), ':statut'=>$notif->getStatut(), ':urgence'=>$notif->getUrgence(), ':idAthlete'=>$notif->getIdAthlete()];
return $this->connection->executeWithErrorHandling($query, $params);
}
}

@ -0,0 +1,74 @@
<?php
namespace Database;
use DateTime;
use Model\Notification;
use Model\Training;
use Shared\Log;
class NotificationMapper
{
public function notificationSqlToEntity(array $data): array
{
$notificationEntities = [];
foreach ($data as $notificationData) {
$notification = new NotificationEntity();
if (isset($notificationData['idNotif'])) {
$notification->setIdNotif($notificationData['idNotif']);
}
if (isset($notificationData['message'])) {
$notification->setMessage($notificationData['message']);
}
if (isset($notificationData['date'])) {
$notification->setDate($notificationData['date']);
}
if (isset($notificationData['statut'])) {
$notification->setStatut($notificationData['statut']);
}
if (isset($notificationData['urgence'])) {
$notification->setUrgence($notificationData['urgence']);
}
if (isset($notificationData['athleteId'])) {
$notification->setIdAthlete($notificationData['athleteId']);
}
$notificationEntities[] = $notification;
}
return $notificationEntities;
}
public function notificationEntityToModel(NotificationEntity $notificationEntity): Notification
{
$date = new DateTime($notificationEntity->getDate());
return new Notification(
$notificationEntity->getIdNotif(),
$notificationEntity->getMessage(),
$date,
$notificationEntity->getStatut(),
$notificationEntity->getUrgence(),
$notificationEntity->getIdAthlete()
);
}
public function notificationToEntity(Notification $notification): NotificationEntity
{
$notif = new NotificationEntity();
$notif->setIdNotif($notification->getId());
$notif->setMessage($notification->getMessage());
$notif->setDate($notification->getDate()->format('Y-m-d H:i:s'));
$notif->setStatut($notification->getStatut());
$notif->setUrgence($notification->getUrgence());
$notif->setIdAthlete($notification->getToUserId());
return $notif;
}
}

@ -0,0 +1,6 @@
INSERT INTO Athlete (idAthlete, username, nom, prenom, email, sexe, taille, poids, motDePasse, dateNaissance, isCoach) VALUES
(1, 'johnD63', 'Doe', 'John', 'john.doe@example.com', 'M', 1.80, 70, 'password123', '1990-01-01', FALSE),
(2, 'janeS03', 'Smith', 'Jane', 'jane.smith@example.com', 'F', 1.65, 60, 'password456', '1992-02-02', TRUE),
(3, 'bryanO', 'OConner', 'Bryan', 'bryan.oconner@example.com', 'M', 1.88, 86, 'password789', '1973-09-12', FALSE),
(4, 'dominicT', 'Toretto', 'Dominic', 'dominic.toretto@example.com', 'M', 1.83, 94, 'password987', '1967-07-18', TRUE),
(5, 'miaT', 'Toretto', 'Mia', 'mia.toretto@example.com', 'F', 1.70, 56, 'password654', '1980-04-26', FALSE);

@ -0,0 +1,21 @@
INSERT INTO FrequenceCardiaque VALUES(1, 100, '08:15:00', 15, 130, 45.75771709151474, 3.113484980409329, 1);
INSERT INTO FrequenceCardiaque VALUES
(2, ROUND(RANDOM() * 10 + 90), '08:16:00', ROUND(RANDOM() * 5 + 10), ROUND(RANDOM() * 20 + 110), 45.75772709151474, 3.113494980409329, 1),
(3, ROUND(RANDOM() * 10 + 90), '08:17:00', ROUND(RANDOM() * 5 + 10), ROUND(RANDOM() * 20 + 110), 45.75773709151474, 3.113504980409329, 1),
(4, ROUND(RANDOM() * 10 + 90), '08:18:00', ROUND(RANDOM() * 5 + 10), ROUND(RANDOM() * 20 + 110), 45.75774709151474, 3.113514980409329, 1),
(5, ROUND(RANDOM() * 10 + 90), '08:19:00', ROUND(RANDOM() * 5 + 10), ROUND(RANDOM() * 20 + 110), 45.75775709151474, 3.113524980409329, 1),
(6, ROUND(RANDOM() * 10 + 90), '08:20:00', ROUND(RANDOM() * 5 + 10), ROUND(RANDOM() * 20 + 110), 45.75776709151474, 3.113534980409329, 1),
(7, ROUND(RANDOM() * 10 + 90), '08:21:00', ROUND(RANDOM() * 5 + 10), ROUND(RANDOM() * 20 + 110), 45.75777709151474, 3.113544980409329, 1),
(8, ROUND(RANDOM() * 10 + 90), '08:22:00', ROUND(RANDOM() * 5 + 10), ROUND(RANDOM() * 20 + 110), 45.75778709151474, 3.113554980409329, 1),
(9, ROUND(RANDOM() * 10 + 90), '08:23:00', ROUND(RANDOM() * 5 + 10), ROUND(RANDOM() * 20 + 110), 45.75779709151474, 3.113564980409329, 1),
(10, ROUND(RANDOM() * 10 + 90), '08:24:00', ROUND(RANDOM() * 5 + 10), ROUND(RANDOM() * 20 + 110), 45.75780709151474, 3.113574980409329, 1),
(11, ROUND(RANDOM() * 10 + 90), '08:25:00', ROUND(RANDOM() * 5 + 10), ROUND(RANDOM() * 20 + 110), 45.75781709151474, 3.113584980409329, 1),
(12, ROUND(RANDOM() * 10 + 90), '08:26:00', ROUND(RANDOM() * 5 + 10), ROUND(RANDOM() * 20 + 110), 45.75782709151474, 3.113594980409329, 1),
(13, ROUND(RANDOM() * 10 + 90), '08:27:00', ROUND(RANDOM() * 5 + 10), ROUND(RANDOM() * 20 + 110), 45.75783709151474, 3.113604980409329, 1),
(14, ROUND(RANDOM() * 10 + 90), '08:28:00', ROUND(RANDOM() * 5 + 10), ROUND(RANDOM() * 20 + 110), 45.75784709151474, 3.113614980409329, 1),
(15, ROUND(RANDOM() * 10 + 90), '08:29:00', ROUND(RANDOM() * 5 + 10), ROUND(RANDOM() * 20 + 110), 45.75785709151474, 3.113624980409329, 1),
(16, ROUND(RANDOM() * 10 + 90), '08:30:00', ROUND(RANDOM() * 5 + 10), ROUND(RANDOM() * 20 + 110), 45.75786709151474, 3.113634980409329, 1),
(17, ROUND(RANDOM() * 10 + 90), '08:31:00', ROUND(RANDOM() * 5 + 10), ROUND(RANDOM() * 20 + 110), 45.75787709151474, 3.113644980409329, 1),
(18, ROUND(RANDOM() * 10 + 90), '08:32:00', ROUND(RANDOM() * 5 + 10), ROUND(RANDOM() * 20 + 110), 45.75788709151474, 3.113654980409329, 1),
(19, ROUND(RANDOM() * 10 + 90), '08:33:00', ROUND(RANDOM() * 5 + 10), ROUND(RANDOM() * 20 + 110), 45.75789709151474, 3.113664980409329, 1),
(20, ROUND(RANDOM() * 10 + 90), '08:34:00', ROUND(RANDOM() * 5 + 10), ROUND(RANDOM() * 20 + 110), 45.75790709151474, 3.113674980409329, 1);

@ -0,0 +1,29 @@
INSERT INTO Friendship (idAthlete1, idAthlete2, debut) VALUES
(3, 4, '2023-01-01'),
(3, 5, '2023-01-12');
INSERT INTO Notification (idNotif, message, date, statut, urgence, athleteId) VALUES
(1, 'Training session at 10 AM', '2023-03-10', TRUE, 1, 1),
(2, 'Training session at 3 PM', '2023-05-10', TRUE, 1, 2);
INSERT INTO Statistique (idStatistique, poids, fcMoyenne, fcMax, caloriesBruleesMoy, date, athleteId) VALUES
(1, 70, 80, 150, 500, '2023-03-10', 1),
(2, 86, 95, 170, 896, '2023-04-13', 3);
INSERT INTO Entrainement (idEntrainement, date, description, latitude, longitude, feedback, athleteId) VALUES
(1, '2023-03-10', 'Long run in the park', 40.7128, -74.0060, 'Good effort', 1),
(2, '2023-04-13', 'Long run in the forest', 44.7128, -70.0060, 'Pretty good effort', 3);
INSERT INTO Participe (athleteId, entrainementId) VALUES
(1, 1),
(3, 2);
INSERT INTO SourceDonnee (idSource, type, modele, precision2, athleteId) VALUES
(1, 'Heart Rate Monitor', 'HRM-Pro', 98.5, 1);
INSERT INTO Activite (idActivite, type, date, heureDeDebut, heureDeFin, effortRessent, variabilite, variance, ecartType, moyenne, maximum, minimum, temperatureMoyenne, athleteId, sourceId) VALUES
(1, 'Running', '2023-03-10', '08:00:00', '09:00:00', 3, 0.5, 1, 0.1, 140, 160, 120, 20, 1, 1),
(2, 'Running Forest', '2023-04-13', '10:00:00', '12:00:00', 5, 0.5, 1, 0.1, 140, 160, 120, 20, 1, 1);
INSERT INTO FrequenceCardiaque (idFc, altitude, temps, temperature, bpm, longitude, latitude, activiteId) VALUES
(1, 100, '08:15:00', 15, 130, -74.0060, 40.7128, 1);

@ -0,0 +1,107 @@
DROP TABLE IF EXISTS Athlete, Friendship, Notification, Statistique, Entrainement, Participe, SourceDonnee, Activite, FrequenceCardiaque CASCADE;
CREATE TABLE Athlete (
idAthlete SERIAL PRIMARY KEY,
nom VARCHAR(255),
prenom VARCHAR(255),
email VARCHAR(255) UNIQUE,
sexe CHAR(1),
taille DECIMAL,
poids DECIMAL,
motDePasse VARCHAR(255),
dateNaissance DATE,
isCoach BOOLEAN
);
CREATE TABLE Friendship (
idAthlete1 INT,
idAthlete2 INT,
debut DATE,
PRIMARY KEY (idAthlete1, idAthlete2),
FOREIGN KEY (idAthlete1) REFERENCES Athlete(idAthlete),
FOREIGN KEY (idAthlete2) REFERENCES Athlete(idAthlete)
);
CREATE TABLE Notification (
idNotif INT PRIMARY KEY,
message TEXT,
date DATE,
statut BOOLEAN,
urgence INT,
athleteId INT,
FOREIGN KEY (athleteId) REFERENCES Athlete(idAthlete)
);
CREATE TABLE Statistique (
idStatistique INT PRIMARY KEY,
poids DECIMAL,
fcMoyenne DECIMAL,
fcMax DECIMAL,
caloriesBruleesMoy DECIMAL,
date DATE,
athleteId INT,
FOREIGN KEY (athleteId) REFERENCES Athlete(idAthlete)
);
CREATE TABLE Entrainement (
idEntrainement INT PRIMARY KEY,
date DATE,
description TEXT,
latitude DECIMAL,
longitude DECIMAL,
feedback TEXT,
athleteId INT,
FOREIGN KEY (athleteId) REFERENCES Athlete(idAthlete)
);
CREATE TABLE Participe (
athleteId INT,
entrainementId INT,
PRIMARY KEY (athleteId, entrainementId),
FOREIGN KEY (athleteId) REFERENCES Athlete(idAthlete),
FOREIGN KEY (entrainementId) REFERENCES Entrainement(idEntrainement)
);
CREATE TABLE SourceDonnee (
idSource INT PRIMARY KEY,
type VARCHAR(255),
modele VARCHAR(255),
precision2 DECIMAL,
athleteId INT,
FOREIGN KEY (athleteId) REFERENCES Athlete(idAthlete)
);
CREATE TABLE Activite (
idActivite INT PRIMARY KEY,
type VARCHAR(255),
date DATE,
heureDeDebut TIME,
heureDeFin TIME,
effortRessent DECIMAL,
variabilite DECIMAL,
variance DECIMAL,
ecartType DECIMAL,
moyenne DECIMAL,
maximum DECIMAL,
minimum DECIMAL,
temperatureMoyenne DECIMAL,
athleteId INT,
sourceId INT,
FOREIGN KEY (athleteId) REFERENCES Athlete(idAthlete),
FOREIGN KEY (sourceId) REFERENCES SourceDonnee(idSource)
);
CREATE TABLE FrequenceCardiaque (
idFc INT PRIMARY KEY,
altitude DECIMAL,
temps TIME,
temperature DECIMAL,
bpm INT,
longitude DECIMAL,
latitude DECIMAL,
activiteId INT,
FOREIGN KEY (activiteId) REFERENCES Activite(idActivite)
);
\i athlete.sql
\i friendship.sql

@ -1,158 +0,0 @@
-- Athlete Table
CREATE TABLE Athlete (
idAthlete SERIAL PRIMARY KEY,
nom VARCHAR(255),
prenom VARCHAR(255),
email VARCHAR(255) UNIQUE,
sexe CHAR(1),
taille DECIMAL,
poids DECIMAL,
motDePasse VARCHAR(255),
dateNaissance DATE
);
-- Friendship Table
CREATE TABLE Friendship (
idAthlete1 INT,
idAthlete2 INT,
debut DATE,
PRIMARY KEY (idAthlete1, idAthlete2),
FOREIGN KEY (idAthlete1) REFERENCES Athlete (idAthlete),
FOREIGN KEY (idAthlete2) REFERENCES Athlete (idAthlete)
);
-- Notification Table
CREATE TABLE Notification (
idNotif SERIAL PRIMARY KEY,
message TEXT,
date DATE,
statut BOOLEAN,
urgence INT,
athleteId INT,
FOREIGN KEY (athleteId) REFERENCES Athlete (idAthlete)
);
-- Coach Table
CREATE TABLE Coach (
idCoach SERIAL PRIMARY KEY,
athleteId INT,
FOREIGN KEY (athleteId) REFERENCES Athlete (idAthlete)
);
-- Statistique Table
CREATE TABLE Statistique (
idStatistique SERIAL PRIMARY KEY,
poids DECIMAL,
fcMoyenne DECIMAL,
fcMax DECIMAL,
caloriesBruleesMoy DECIMAL,
date DATE,
athleteId INT,
FOREIGN KEY (athleteId) REFERENCES Athlete (idAthlete)
);
-- Entrainement Table
CREATE TABLE Entrainement (
idEntrainement SERIAL PRIMARY KEY,
date DATE,
description TEXT,
latitude DECIMAL,
longitude DECIMAL,
feedback TEXT,
coachId INT,
FOREIGN KEY (coachId) REFERENCES Coach (idCoach)
);
-- Participe Table
CREATE TABLE Participe (
athleteId INT,
entrainementId INT,
PRIMARY KEY (athleteId, entrainementId),
FOREIGN KEY (athleteId) REFERENCES Athlete (idAthlete),
FOREIGN KEY (entrainementId) REFERENCES Entrainement (idEntrainement)
);
-- SourceDonnee Table
CREATE TABLE SourceDonnee (
idSource SERIAL PRIMARY KEY,
type VARCHAR(255),
modele VARCHAR(255),
precision DECIMAL,
athleteId INT,
FOREIGN KEY (athleteId) REFERENCES Athlete (idAthlete)
);
-- Activite Table
CREATE TABLE Activite (
idActivite SERIAL PRIMARY KEY,
type VARCHAR(255),
date DATE,
heureDeDebut TIME,
heureDeFin TIME,
effortRessent DECIMAL,
variabilite DECIMAL,
variance DECIMAL,
ecartType DECIMAL,
moyenne DECIMAL,
maximum DECIMAL,
minimum DECIMAL,
temperatureMoyenne DECIMAL,
athleteId INT,
sourceId INT,
FOREIGN KEY (athleteId) REFERENCES Athlete (idAthlete),
FOREIGN KEY (sourceId) REFERENCES SourceDonnee (idSource)
);
-- FrequenceCardiaque Table
CREATE TABLE FrequenceCardiaque (
idFc SERIAL PRIMARY KEY,
altitude DECIMAL,
temps TIME,
temperature DECIMAL,
bpm INT,
longitude DECIMAL,
latitude DECIMAL,
activiteId INT,
FOREIGN KEY (activiteId) REFERENCES Activite (idActivite)
);
-- Insertion de données dans la table Athlete
INSERT INTO Athlete (nom, prenom, email, sexe, taille, poids, motDePasse, dateNaissance) VALUES
('Doe', 'John', 'john.doe@example.com', 'M', 1.80, 70, 'password123', '1990-01-01'),
('Smith', 'Jane', 'jane.smith@example.com', 'F', 1.65, 60, 'password456', '1992-02-02');
-- Insertion de données dans la table Friendship
INSERT INTO Friendship (idAthlete1, idAthlete2, debut) VALUES
(1, 2, '2023-01-01');
-- Insertion de données dans la table Notification
INSERT INTO Notification (message, date, statut, urgence, athleteId) VALUES
('Training session at 10 AM', '2023-03-10', TRUE, 1, 1);
-- Insertion de données dans la table Coach
INSERT INTO Coach (athleteId) VALUES
(1);
-- Insertion de données dans la table Statistique
INSERT INTO Statistique (poids, fcMoyenne, fcMax, caloriesBruleesMoy, date, athleteId) VALUES
(70, 80, 150, 500, '2023-03-10', 1);
-- Insertion de données dans la table Entrainement
INSERT INTO Entrainement (date, description, latitude, longitude, feedback, coachId) VALUES
('2023-03-12', 'Long run in the park', 40.7128, -74.0060, 'Good effort', 1);
-- Insertion de données dans la table Participe
INSERT INTO Participe (athleteId, entrainementId) VALUES
(1, 1);
-- Insertion de données dans la table SourceDonnee
INSERT INTO SourceDonnee (type, modele, precision, athleteId) VALUES
('Heart Rate Monitor', 'HRM-Pro', 98.5, 1);
-- Insertion de données dans la table Activite
INSERT INTO Activite (type, date, heureDeDebut, heureDeFin, effortRessent, variabilite, variance, ecartType, moyenne, maximum, minimum, temperatureMoyenne, athleteId, sourceId) VALUES
('Running', '2023-03-10', '08:00:00', '09:00:00', 7, 0.5, 1, 0.1, 140, 160, 120, 20, 1, 1);
-- Insertion de données dans la table FrequenceCardiaque
INSERT INTO FrequenceCardiaque (altitude, temps, temperature, bpm, longitude, latitude, activiteId) VALUES
(100, '08:15:00', 15, 130, -74.0060, 40.7128, 1);

@ -53,6 +53,7 @@ class Activity
* @throws \Exception Si l'effort ressenti n'est pas compris entre 0 et 5. * @throws \Exception Si l'effort ressenti n'est pas compris entre 0 et 5.
*/ */
public function __construct( public function __construct(
int $idActivity,
String $type, String $type,
\DateTime $date, \DateTime $date,
\DateTime $heureDebut, \DateTime $heureDebut,
@ -67,7 +68,7 @@ class Activity
float $avrTemperature, float $avrTemperature,
bool $hasPause bool $hasPause
) { ) {
$this->idActivity = self::generateId(); $this->idActivity = $idActivity;
$this->type = $type; $this->type = $type;
$this->date = $date; $this->date = $date;
$this->heureDebut = $heureDebut; $this->heureDebut = $heureDebut;

@ -2,8 +2,41 @@
namespace Model; namespace Model;
use DateTime;
class Notification class Notification
{ {
private int $idNotif;
private string $message;
private \DateTime $date;
private bool $statut;
private string $urgence;
private int $toUserId;
/**
* @param string $type
* @param string $message
*/
public function __construct(
int $idNotif,
string $message,
DateTime $date,
string $statut,
string $urgence,
int $toUserId
)
{
$this->idNotif = $idNotif;
$this->message = $message;
$this->date = $date;
$this->statut = $statut;
$this->urgence = $urgence;
$this->toUserId =$toUserId;
}
public function getId(){ return $this->idNotif;}
public function getDate(){ return $this->date;}
public function getStatut(){ return $this->statut;}
public function getUrgence(){ return $this->urgence;}
/** /**
* @return string * @return string
*/ */
@ -36,10 +69,6 @@ class Notification
$this->message = $message; $this->message = $message;
} }
private string $type;
private string $message;
private int $toUserId;
/** /**
* @return int * @return int
*/ */
@ -55,16 +84,6 @@ class Notification
{ {
$this->toUserId = $toUserId; $this->toUserId = $toUserId;
} }
/**
* @param string $type
* @param string $message
*/
public function __construct(int $toUserId,string $type, string $message)
{
$this->type = $type;
$this->toUserId =$toUserId;
$this->message = $message;
}
public function __toString(): string public function __toString(): string
{ {
return var_export($this, true); return var_export($this, true);

@ -33,7 +33,13 @@ class Training
return $this->date; return $this->date;
} }
public function getLocation(): String { public function getLocation(): String {
return $this->longitude . $this->latitude; return $this->longitude . ", " . $this->latitude;
}
public function getLatitude(): float {
return $this->latitude;
}
public function getLongitude(): float {
return $this->longitude;
} }
public function getDescription(): String public function getDescription(): String
{ {

@ -28,6 +28,7 @@ class User {
private \DateTime $dateNaissance; private \DateTime $dateNaissance;
private Role $role; private Role $role;
protected array $notifications = []; protected array $notifications = [];
private array $listFriend = [];
/** /**
* @return array * @return array
@ -50,7 +51,9 @@ class User {
* @param \DateTime $dateNaissance * @param \DateTime $dateNaissance
* @param \Model\Role $role * @param \Model\Role $role
*/ */
public function __construct(int $id, string $nom, string $prenom, string $username, string $email, string $motDePasse, string $sexe, float $taille, float $poids, \DateTime $dateNaissance, Role $role) public function __construct(int $id, string $nom, string $prenom, string $username, string $email,
string $motDePasse, string $sexe, float $taille, float $poids, \DateTime $dateNaissance,
Role $role)
{ {
$this->id = $id; $this->id = $id;
$this->nom = $nom; $this->nom = $nom;
@ -289,5 +292,23 @@ class User {
public function __toString() { public function __toString() {
return "Athlete [ID: {$this->id}, Username : $this->username, Nom: {$this->nom}, Prénom: {$this->prenom}, Email: {$this->email}]"; return "Athlete [ID: {$this->id}, Username : $this->username, Nom: {$this->nom}, Prénom: {$this->prenom}, Email: {$this->email}]";
} }
/**
* Donne la liste des amis de l'utilisateur
*
* @return string Les amis de l'utilisateur.
*/
public function getListFriend(): array {
return $this->listFriend;
}
/**
* Ajoute un utilisateur a sa liste d'amis.
*
* @param User L'utilisateur a ajouter.
*/
public function addFriend(User $user){
array_push($this->listFriend, $user);
}
} }
?> ?>

@ -39,6 +39,7 @@ class UserManager
$this->relationshipService = $relationshipService; $this->relationshipService = $relationshipService;
} }
public function getCurrentUser(): ?User public function getCurrentUser(): ?User
{ {
return $this->currentUser; return $this->currentUser;
@ -81,7 +82,7 @@ class UserManager
} }
public function addFriend(string $newFriend): bool /*public function addFriend(string $newFriend): bool
{ {
$newFriend = $this->dataManager->userRepository->getItemByName($newFriend, 0, 1); $newFriend = $this->dataManager->userRepository->getItemByName($newFriend, 0, 1);
if ($newFriend === null) { if ($newFriend === null) {
@ -91,11 +92,15 @@ class UserManager
if (in_array($newFriend, $this->currentUser->getRole()->getUsersList())) { if (in_array($newFriend, $this->currentUser->getRole()->getUsersList())) {
throw new \Exception("Already friend"); throw new \Exception("Already friend");
} }
var_dump("====================1=========================");
if($this->relationshipService->sendRequest($this->currentUser, $newFriend)){ if($this->relationshipService->sendRequest($this->currentUser, $newFriend)){
return true; return true;
}; };
return false; return false;
}*/
public function addFriend(User $user1, User $user2)
{
$this->dataManager->userRepository->addFriend($user1, $user2);
} }
public function respondToFriendRequest(int $requestId, bool $choice): bool public function respondToFriendRequest(int $requestId, bool $choice): bool
@ -134,8 +139,15 @@ class UserManager
return $this->dataManager->userRepository->getItemsByName($name, 0, 10); return $this->dataManager->userRepository->getItemsByName($name, 0, 10);
} }
public function searchUserByName(string $name): ?User
{
return $this->dataManager->userRepository->getItemByName($name, 0, 10);
}
public function getFriends(): array { public function getFriends(): array {
return $this->currentUser->getRole()->getUsersList(); $user=$this->dataManager->userRepository->getItemById(1);
return $user->getListFriend();
//return $this->currentUser->getRole()->getUsersList();
} }
// NEED TO PERSIST // NEED TO PERSIST
@ -210,5 +222,9 @@ class UserManager
return false; return false;
} }
public function getUserById(int $id): ?User {
return $this->dataManager->userRepository->getItemById($id);
}
} }
?> ?>

@ -1,9 +1,10 @@
<?php <?php
namespace Repository; namespace Repository;
use Model\User;
interface IUserRepository extends IGenericRepository { interface IUserRepository extends IGenericRepository {
public function addFriend(int $user1,int $user2); public function addFriend(User $user1,user $user2);
public function deleteFriend(int $user1,int $user2); public function deleteFriend(User $user1,User $user2);
} }

@ -2,6 +2,7 @@
namespace Stub; namespace Stub;
use DateTime;
use Repository\INotificationRepository; use Repository\INotificationRepository;
use Model\Notification; use Model\Notification;
@ -10,13 +11,13 @@ class NotificationRepository implements INotificationRepository
private $notifications = []; // Array to store notifications private $notifications = []; // Array to store notifications
public function __construct() public function __construct()
{ {
$date = DateTime::createFromFormat('d/m/Y', date('d/m/Y'));
// Initialize with some sample notifications for user IDs 1, 2, and 3 // Initialize with some sample notifications for user IDs 1, 2, and 3
$this->notifications[] = new Notification(1, 'info', 'Welcome to our service!'); $this->notifications[] = new Notification(1, 'info', $date,'Welcome to our service!', '1', 1);
$this->notifications[] = new Notification(2, 'alert', 'Your subscription is about to expire.'); $this->notifications[] = new Notification(2, 'info', $date,'Welcome to our service!', '1', 1);
$this->notifications[] = new Notification(3, 'info', 'New features available.'); $this->notifications[] = new Notification(3, 'info', $date,'Welcome to our service!', '1', 1);
$this->notifications[] = new Notification(1, 'reminder', 'Dont forget your upcoming appointment.'); $this->notifications[] = new Notification(1, 'info', $date,'Welcome to our service!', '1', 1);
$this->notifications[] = new Notification(2, 'update', 'Service update completed.'); $this->notifications[] = new Notification(2, 'info', $date,'Welcome to our service!', '1', 1);
// Add more notifications as needed
} }
public function getItemById(int $id) public function getItemById(int $id)
{ {

@ -32,6 +32,7 @@ class UserRepository implements IUserRepository {
$this->users[] = new User(3, "Martin", "Paul","Martin", "paul.martin@example.com", "super789", 'M', 1.75, 68, new \DateTime("1988-08-20"), new CoachAthlete()); $this->users[] = new User(3, "Martin", "Paul","Martin", "paul.martin@example.com", "super789", 'M', 1.75, 68, new \DateTime("1988-08-20"), new CoachAthlete());
$this->users[] = new User(4, "Brown", "Anna","Brown", "anna.brown@example.com", "test000", 'F', 1.70, 58, new \DateTime("1992-11-25"), new Athlete()); $this->users[] = new User(4, "Brown", "Anna","Brown", "anna.brown@example.com", "test000", 'F', 1.70, 58, new \DateTime("1992-11-25"), new Athlete());
$this->users[] = new User(5, "Lee", "Bruce","Lee", "bruce.lee@example.com", "hello321", 'M', 1.72, 70, new \DateTime("1970-02-05"), new Athlete()); $this->users[] = new User(5, "Lee", "Bruce","Lee", "bruce.lee@example.com", "hello321", 'M', 1.72, 70, new \DateTime("1970-02-05"), new Athlete());
$this->users[] = new User(6, "Truc", "Bruce","Truc", "bruce.lee@example.com", "hello321", 'M', 1.72, 70, new \DateTime("1970-02-05"), new Athlete());
} }
/** /**
@ -163,15 +164,15 @@ class UserRepository implements IUserRepository {
return false; return false;
} }
public function addFriend(int $user1, int $user2)
public function deleteFriend(User $user1, User $user2)
{ {
return true; return true;
} }
public function addFriend(User $user1, User $user2)
public function deleteFriend(int $user1, int $user2)
{ {
return true; $user1->addFriend($user2);
} }
} }
?> ?>

@ -0,0 +1,215 @@
<?php
use PHPUnit\Framework\TestCase;
//use Database\{Connexion, AthleteGateway,AthleteEntity};
use Database\AthleteEntity;
use Database\AthleteGateway;
use Database\Connexion;
use Database\AthleteMapper;
use Database\CoachGateway;
use Database\CoachEntity;
use Database\CoachMapper;
class GatewayTest extends TestCase {
//Partie concernant les Athlètes
public function testGetAthlete() {
//$dsn = "pgsql:host=londres;port=8888;dbname=dbkemonteiro2;user=kemonteiro2;password=Mdp";
require "loginDatabase.php";
$connexion = new Connexion($dsn,$username,$password);
$athleteGateway = new AthleteGateway($connexion);
$result = $athleteGateway->getAthlete();
//var_dump($result);
}
/* Fonctionne mais en commentaire pour pas add et del a chaque fois
public function testAddAthlete(){
$dsn = "mysql:host=londres;dbname=dbkemonteiro2;";
$username = "kemonteiro2";
$password = "#Phpmyadmin63";
$connexion = new Connexion($dsn,$username,$password);
$athleteGateway = new AthleteGateway($connexion);
$dateSpecifique = "2023-11-26";
$timestamp = strtotime($dateSpecifique);
$dateSQL = date("Y-m-d", $timestamp);
$athleteEntity = new AthleteEntity();
$athleteEntity->setNom('John');
$athleteEntity->setPrenom('Doe');
$athleteEntity->setIdAthlete(1234);
$athleteEntity->setEmail('kevin.monteiro@gmail.fr');
$athleteEntity->setSexe('H');
$athleteEntity->setTaille(169);
$athleteEntity->setPoids(69);
$athleteEntity->setMotDePasse('motdepasse');
$athleteEntity->setDateNaissance($dateSQL);
$result2 = $athleteGateway->addAthlete($athleteEntity);
}
public function testDeleteAthlete(){
$dsn = "mysql:host=londres;dbname=dbkemonteiro2;";
$username = "kemonteiro2";
$password = "#Phpmyadmin63";
$connexion = new Connexion($dsn,$username,$password);
$athleteGateway = new AthleteGateway($connexion);
$result = $athleteGateway->deleteAthlete( //idAthlete );
var_dump($result);
}*/
public function testUpdateAthlete(){
$dsn = "mysql:host=londres;dbname=dbkemonteiro2;";
$username = "kemonteiro2";
$password = "#Phpmyadmin63";
$connexion = new Connexion($dsn,$username,$password);
$athleteGateway = new AthleteGateway($connexion);
$dateSpecifique = "2004-08-26";
$timestamp = strtotime($dateSpecifique);
$dateSQL = date("Y-m-d", $timestamp);
$athleteEntity = new AthleteEntity();
$athleteEntity->setNom('John');
$athleteEntity->setPrenom('Doe');
$athleteEntity->setIdAthlete(13);
$athleteEntity->setEmail('kevin.monteiro@gmail.fr');
$athleteEntity->setSexe('H');
$athleteEntity->setTaille(169);
$athleteEntity->setPoids(69);
$athleteEntity->setMotDePasse('motdepasse');
$athleteEntity->setDateNaissance($dateSQL);
$athleteEntity->setIsCoach(FALSE);
$athleteEntity->setCoachId(NULL);
$athleteEntity2 = new AthleteEntity();
$athleteEntity2->setNom('Monteiro');
$athleteEntity2->setPrenom('Kevin');
$athleteEntity2->setIdAthlete(13);
$athleteEntity2->setEmail('kevin.monteiro@gmail.fr');
$athleteEntity2->setSexe('H');
$athleteEntity2->setTaille(169);
$athleteEntity2->setPoids(69);
$athleteEntity2->setMotDePasse('motdepasse');
$athleteEntity2->setDateNaissance($dateSQL);
$athleteEntity2->setIsCoach(TRUE);
$athleteEntity2->setCoachId(1);
$result = $athleteGateway->updateAthlete($athleteEntity, $athleteEntity2);
}
//Partie concernant les Coachs
public function testGetCoach() {
//$dsn = "pgsql:host=londres;port=8888;dbname=dbkemonteiro2;user=kemonteiro2;password=Mdp";
$dsn = "mysql:host=londres;dbname=dbkemonteiro2;";
$username = "kemonteiro2";
$password = "#Phpmyadmin63";
$connexion = new Connexion($dsn,$username,$password);
$coachGateway = new CoachGateway($connexion);
$result = $coachGateway->getCoach();
var_dump($result);
}
/*
//Fonctionne PAS A PARTIR DE LA
public function testAddCoach(){
$dsn = "mysql:host=londres;dbname=dbkemonteiro2;";
$username = "kemonteiro2";
$password = "#Phpmyadmin63";
$connexion = new Connexion($dsn,$username,$password);
$coachGateway = new CoachGateway($connexion);
$dateSpecifique = "2023-11-26";
$timestamp = strtotime($dateSpecifique);
$dateSQL = date("Y-m-d", $timestamp);
$coachEntity = new CoachEntity();
$coachEntity->setNom('John');
$coachEntity->setPrenom('Doe');
$coachEntity->setIdCoach(1234);
$coachEntity->setEmail('kevin.monteiro@gmail.fr');
$coachEntity->setSexe('H');
$coachEntity->setTaille(169);
$coachEntity->setPoids(69);
$coachEntity->setMotDePasse('motdepasse');
$coachEntity->setDateNaissance($dateSQL);
$result2 = $coachGateway->addCoach($coachEntity);
}
public function testDeleteAthlete(){
$dsn = "mysql:host=londres;dbname=dbkemonteiro2;";
$username = "kemonteiro2";
$password = "#Phpmyadmin63";
$connexion = new Connexion($dsn,$username,$password);
$athleteGateway = new AthleteGateway($connexion);
$result = $athleteGateway->deleteAthlete( //idAthlete );
var_dump($result);
}*/
/*
public function testUpdateAthlete(){
$dsn = "mysql:host=londres;dbname=dbkemonteiro2;";
$username = "kemonteiro2";
$password = "#Phpmyadmin63";
$connexion = new Connexion($dsn,$username,$password);
$athleteGateway = new AthleteGateway($connexion);
$dateSpecifique = "2004-08-26";
$timestamp = strtotime($dateSpecifique);
$dateSQL = date("Y-m-d", $timestamp);
$athleteEntity = new AthleteEntity();
$athleteEntity->setNom('John');
$athleteEntity->setPrenom('Doe');
$athleteEntity->setIdAthlete(13);
$athleteEntity->setEmail('kevin.monteiro@gmail.fr');
$athleteEntity->setSexe('H');
$athleteEntity->setTaille(169);
$athleteEntity->setPoids(69);
$athleteEntity->setMotDePasse('motdepasse');
$athleteEntity->setDateNaissance($dateSQL);
$athleteEntity2 = new AthleteEntity();
$athleteEntity2->setNom('Monteiro');
$athleteEntity2->setPrenom('Kevin');
$athleteEntity2->setIdAthlete(13);
$athleteEntity2->setEmail('kevin.monteiro@gmail.fr');
$athleteEntity2->setSexe('H');
$athleteEntity2->setTaille(169);
$athleteEntity2->setPoids(69);
$athleteEntity2->setMotDePasse('motdepasse');
$athleteEntity2->setDateNaissance($dateSQL);
$result = $athleteGateway->updateAthlete($athleteEntity, $athleteEntity2);
}*/
}

@ -0,0 +1,43 @@
<?php
use PHPUnit\Framework\TestCase;
use Model\User;
use Database\AthleteEntity;
use Database\AthleteGateway;
use Database\Connexion;
use Database\AthleteMapper;
class MapperTest extends TestCase {
public function testMapperAthlete() {
//$dsn = "pgsql:host=londres;port=8888;dbname=dbkemonteiro2;user=kemonteiro2;password=Mdp";
$dsn = "mysql:host=londres;dbname=dbkemonteiro2;";
$username = "kemonteiro2";
$password = "#Phpmyadmin63";
$connexion = new Connexion($dsn,$username,$password);
$athleteGateway = new AthleteGateway($connexion);
$result = $athleteGateway->getAthlete();
$map = new AthleteMapper ();
//SQL To AthleteEntity
$athleteEntity = $map->athleteSqlToEntity($result);
foreach($athleteEntity as $ath){
$result = $ath->getNom();
var_dump($result);
//Pour chaque AthleteEntity : Athlete Entity To User avec Role Athlete(Model)
$user = $map->athleteEntityToModel($ath);
var_dump($user->getId());
//Pour chaque Athlete du Model -> Athlete Entity
$res = $map->athleteToEntity($user);
var_dump($res->getIdAthlete());
}
}
}

@ -0,0 +1,7 @@
<?php
$dsn = "psql:host=localhost;dbname=sae_3;";
$username = "Perederii";
$password = "";
?>

@ -430,7 +430,6 @@ return array(
'PHPUnit\\Framework\\MockObject\\Stub\\ReturnValueMap' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/ReturnValueMap.php', 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnValueMap' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/ReturnValueMap.php',
'PHPUnit\\Framework\\MockObject\\Stub\\Stub' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/Stub.php', 'PHPUnit\\Framework\\MockObject\\Stub\\Stub' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/Stub.php',
'PHPUnit\\Framework\\NoChildTestSuiteException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/NoChildTestSuiteException.php', 'PHPUnit\\Framework\\NoChildTestSuiteException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/NoChildTestSuiteException.php',
'PHPUnit\\Framework\\PhptAssertionFailedError' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/PhptAssertionFailedError.php',
'PHPUnit\\Framework\\ProcessIsolationException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/ProcessIsolationException.php', 'PHPUnit\\Framework\\ProcessIsolationException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/ProcessIsolationException.php',
'PHPUnit\\Framework\\Reorderable' => $vendorDir . '/phpunit/phpunit/src/Framework/Reorderable.php', 'PHPUnit\\Framework\\Reorderable' => $vendorDir . '/phpunit/phpunit/src/Framework/Reorderable.php',
'PHPUnit\\Framework\\SelfDescribing' => $vendorDir . '/phpunit/phpunit/src/Framework/SelfDescribing.php', 'PHPUnit\\Framework\\SelfDescribing' => $vendorDir . '/phpunit/phpunit/src/Framework/SelfDescribing.php',
@ -956,93 +955,6 @@ return array(
'PharIo\\Version\\VersionConstraintValue' => $vendorDir . '/phar-io/version/src/VersionConstraintValue.php', 'PharIo\\Version\\VersionConstraintValue' => $vendorDir . '/phar-io/version/src/VersionConstraintValue.php',
'PharIo\\Version\\VersionNumber' => $vendorDir . '/phar-io/version/src/VersionNumber.php', 'PharIo\\Version\\VersionNumber' => $vendorDir . '/phar-io/version/src/VersionNumber.php',
'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
'SebastianBergmann\\CliParser\\AmbiguousOptionException' => $vendorDir . '/sebastian/cli-parser/src/exceptions/AmbiguousOptionException.php',
'SebastianBergmann\\CliParser\\Exception' => $vendorDir . '/sebastian/cli-parser/src/exceptions/Exception.php',
'SebastianBergmann\\CliParser\\OptionDoesNotAllowArgumentException' => $vendorDir . '/sebastian/cli-parser/src/exceptions/OptionDoesNotAllowArgumentException.php',
'SebastianBergmann\\CliParser\\Parser' => $vendorDir . '/sebastian/cli-parser/src/Parser.php',
'SebastianBergmann\\CliParser\\RequiredOptionArgumentMissingException' => $vendorDir . '/sebastian/cli-parser/src/exceptions/RequiredOptionArgumentMissingException.php',
'SebastianBergmann\\CliParser\\UnknownOptionException' => $vendorDir . '/sebastian/cli-parser/src/exceptions/UnknownOptionException.php',
'SebastianBergmann\\CodeCoverage\\BranchAndPathCoverageNotSupportedException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/BranchAndPathCoverageNotSupportedException.php',
'SebastianBergmann\\CodeCoverage\\CodeCoverage' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage.php',
'SebastianBergmann\\CodeCoverage\\Data\\ProcessedCodeCoverageData' => $vendorDir . '/phpunit/php-code-coverage/src/Data/ProcessedCodeCoverageData.php',
'SebastianBergmann\\CodeCoverage\\Data\\RawCodeCoverageData' => $vendorDir . '/phpunit/php-code-coverage/src/Data/RawCodeCoverageData.php',
'SebastianBergmann\\CodeCoverage\\DeadCodeDetectionNotSupportedException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/DeadCodeDetectionNotSupportedException.php',
'SebastianBergmann\\CodeCoverage\\Driver\\Driver' => $vendorDir . '/phpunit/php-code-coverage/src/Driver/Driver.php',
'SebastianBergmann\\CodeCoverage\\Driver\\PathExistsButIsNotDirectoryException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/PathExistsButIsNotDirectoryException.php',
'SebastianBergmann\\CodeCoverage\\Driver\\PcovDriver' => $vendorDir . '/phpunit/php-code-coverage/src/Driver/PcovDriver.php',
'SebastianBergmann\\CodeCoverage\\Driver\\PcovNotAvailableException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/PcovNotAvailableException.php',
'SebastianBergmann\\CodeCoverage\\Driver\\Selector' => $vendorDir . '/phpunit/php-code-coverage/src/Driver/Selector.php',
'SebastianBergmann\\CodeCoverage\\Driver\\WriteOperationFailedException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/WriteOperationFailedException.php',
'SebastianBergmann\\CodeCoverage\\Driver\\XdebugDriver' => $vendorDir . '/phpunit/php-code-coverage/src/Driver/XdebugDriver.php',
'SebastianBergmann\\CodeCoverage\\Driver\\XdebugNotAvailableException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/XdebugNotAvailableException.php',
'SebastianBergmann\\CodeCoverage\\Driver\\XdebugNotEnabledException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/XdebugNotEnabledException.php',
'SebastianBergmann\\CodeCoverage\\Exception' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/Exception.php',
'SebastianBergmann\\CodeCoverage\\FileCouldNotBeWrittenException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/FileCouldNotBeWrittenException.php',
'SebastianBergmann\\CodeCoverage\\Filter' => $vendorDir . '/phpunit/php-code-coverage/src/Filter.php',
'SebastianBergmann\\CodeCoverage\\InvalidArgumentException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/InvalidArgumentException.php',
'SebastianBergmann\\CodeCoverage\\NoCodeCoverageDriverAvailableException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/NoCodeCoverageDriverAvailableException.php',
'SebastianBergmann\\CodeCoverage\\NoCodeCoverageDriverWithPathCoverageSupportAvailableException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/NoCodeCoverageDriverWithPathCoverageSupportAvailableException.php',
'SebastianBergmann\\CodeCoverage\\Node\\AbstractNode' => $vendorDir . '/phpunit/php-code-coverage/src/Node/AbstractNode.php',
'SebastianBergmann\\CodeCoverage\\Node\\Builder' => $vendorDir . '/phpunit/php-code-coverage/src/Node/Builder.php',
'SebastianBergmann\\CodeCoverage\\Node\\CrapIndex' => $vendorDir . '/phpunit/php-code-coverage/src/Node/CrapIndex.php',
'SebastianBergmann\\CodeCoverage\\Node\\Directory' => $vendorDir . '/phpunit/php-code-coverage/src/Node/Directory.php',
'SebastianBergmann\\CodeCoverage\\Node\\File' => $vendorDir . '/phpunit/php-code-coverage/src/Node/File.php',
'SebastianBergmann\\CodeCoverage\\Node\\Iterator' => $vendorDir . '/phpunit/php-code-coverage/src/Node/Iterator.php',
'SebastianBergmann\\CodeCoverage\\ParserException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/ParserException.php',
'SebastianBergmann\\CodeCoverage\\ReflectionException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/ReflectionException.php',
'SebastianBergmann\\CodeCoverage\\ReportAlreadyFinalizedException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/ReportAlreadyFinalizedException.php',
'SebastianBergmann\\CodeCoverage\\Report\\Clover' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Clover.php',
'SebastianBergmann\\CodeCoverage\\Report\\Cobertura' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Cobertura.php',
'SebastianBergmann\\CodeCoverage\\Report\\Crap4j' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Crap4j.php',
'SebastianBergmann\\CodeCoverage\\Report\\Html\\Colors' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Html/Colors.php',
'SebastianBergmann\\CodeCoverage\\Report\\Html\\CustomCssFile' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Html/CustomCssFile.php',
'SebastianBergmann\\CodeCoverage\\Report\\Html\\Dashboard' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php',
'SebastianBergmann\\CodeCoverage\\Report\\Html\\Directory' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Html/Renderer/Directory.php',
'SebastianBergmann\\CodeCoverage\\Report\\Html\\Facade' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Html/Facade.php',
'SebastianBergmann\\CodeCoverage\\Report\\Html\\File' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php',
'SebastianBergmann\\CodeCoverage\\Report\\Html\\Renderer' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Html/Renderer.php',
'SebastianBergmann\\CodeCoverage\\Report\\PHP' => $vendorDir . '/phpunit/php-code-coverage/src/Report/PHP.php',
'SebastianBergmann\\CodeCoverage\\Report\\Text' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Text.php',
'SebastianBergmann\\CodeCoverage\\Report\\Thresholds' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Thresholds.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\BuildInformation' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/BuildInformation.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Coverage' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Coverage.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Directory' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Directory.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Facade' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Facade.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\File' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/File.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Method' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Method.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Node' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Node.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Project' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Project.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Report' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Report.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Source' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Source.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Tests' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Tests.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Totals' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Totals.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Unit' => $vendorDir . '/phpunit/php-code-coverage/src/Report/Xml/Unit.php',
'SebastianBergmann\\CodeCoverage\\StaticAnalysisCacheNotConfiguredException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/StaticAnalysisCacheNotConfiguredException.php',
'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\CacheWarmer' => $vendorDir . '/phpunit/php-code-coverage/src/StaticAnalysis/CacheWarmer.php',
'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\CachingFileAnalyser' => $vendorDir . '/phpunit/php-code-coverage/src/StaticAnalysis/CachingFileAnalyser.php',
'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\CodeUnitFindingVisitor' => $vendorDir . '/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php',
'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\ExecutableLinesFindingVisitor' => $vendorDir . '/phpunit/php-code-coverage/src/StaticAnalysis/ExecutableLinesFindingVisitor.php',
'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\FileAnalyser' => $vendorDir . '/phpunit/php-code-coverage/src/StaticAnalysis/FileAnalyser.php',
'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\IgnoredLinesFindingVisitor' => $vendorDir . '/phpunit/php-code-coverage/src/StaticAnalysis/IgnoredLinesFindingVisitor.php',
'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\ParsingFileAnalyser' => $vendorDir . '/phpunit/php-code-coverage/src/StaticAnalysis/ParsingFileAnalyser.php',
'SebastianBergmann\\CodeCoverage\\TestIdMissingException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/TestIdMissingException.php',
'SebastianBergmann\\CodeCoverage\\Test\\TestSize\\Known' => $vendorDir . '/phpunit/php-code-coverage/src/TestSize/Known.php',
'SebastianBergmann\\CodeCoverage\\Test\\TestSize\\Large' => $vendorDir . '/phpunit/php-code-coverage/src/TestSize/Large.php',
'SebastianBergmann\\CodeCoverage\\Test\\TestSize\\Medium' => $vendorDir . '/phpunit/php-code-coverage/src/TestSize/Medium.php',
'SebastianBergmann\\CodeCoverage\\Test\\TestSize\\Small' => $vendorDir . '/phpunit/php-code-coverage/src/TestSize/Small.php',
'SebastianBergmann\\CodeCoverage\\Test\\TestSize\\TestSize' => $vendorDir . '/phpunit/php-code-coverage/src/TestSize/TestSize.php',
'SebastianBergmann\\CodeCoverage\\Test\\TestSize\\Unknown' => $vendorDir . '/phpunit/php-code-coverage/src/TestSize/Unknown.php',
'SebastianBergmann\\CodeCoverage\\Test\\TestStatus\\Failure' => $vendorDir . '/phpunit/php-code-coverage/src/TestStatus/Failure.php',
'SebastianBergmann\\CodeCoverage\\Test\\TestStatus\\Known' => $vendorDir . '/phpunit/php-code-coverage/src/TestStatus/Known.php',
'SebastianBergmann\\CodeCoverage\\Test\\TestStatus\\Success' => $vendorDir . '/phpunit/php-code-coverage/src/TestStatus/Success.php',
'SebastianBergmann\\CodeCoverage\\Test\\TestStatus\\TestStatus' => $vendorDir . '/phpunit/php-code-coverage/src/TestStatus/TestStatus.php',
'SebastianBergmann\\CodeCoverage\\Test\\TestStatus\\Unknown' => $vendorDir . '/phpunit/php-code-coverage/src/TestStatus/Unknown.php',
'SebastianBergmann\\CodeCoverage\\UnintentionallyCoveredCodeException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/UnintentionallyCoveredCodeException.php',
'SebastianBergmann\\CodeCoverage\\Util\\DirectoryCouldNotBeCreatedException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/DirectoryCouldNotBeCreatedException.php',
'SebastianBergmann\\CodeCoverage\\Util\\Filesystem' => $vendorDir . '/phpunit/php-code-coverage/src/Util/Filesystem.php',
'SebastianBergmann\\CodeCoverage\\Util\\Percentage' => $vendorDir . '/phpunit/php-code-coverage/src/Util/Percentage.php',
'SebastianBergmann\\CodeCoverage\\Version' => $vendorDir . '/phpunit/php-code-coverage/src/Version.php',
'SebastianBergmann\\CodeCoverage\\XmlException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/XmlException.php',
'SebastianBergmann\\CodeUnitReverseLookup\\Wizard' => $vendorDir . '/sebastian/code-unit-reverse-lookup/src/Wizard.php', 'SebastianBergmann\\CodeUnitReverseLookup\\Wizard' => $vendorDir . '/sebastian/code-unit-reverse-lookup/src/Wizard.php',
'SebastianBergmann\\CodeUnit\\ClassMethodUnit' => $vendorDir . '/sebastian/code-unit/src/ClassMethodUnit.php', 'SebastianBergmann\\CodeUnit\\ClassMethodUnit' => $vendorDir . '/sebastian/code-unit/src/ClassMethodUnit.php',
'SebastianBergmann\\CodeUnit\\ClassUnit' => $vendorDir . '/sebastian/code-unit/src/ClassUnit.php', 'SebastianBergmann\\CodeUnit\\ClassUnit' => $vendorDir . '/sebastian/code-unit/src/ClassUnit.php',

@ -12,24 +12,21 @@ return array(
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'), 'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'),
'Stub\\' => array($baseDir . '/src/data/stub', $baseDir . '/src/data/stub/service', $baseDir . '/src/data/stub/repository'), 'Stub\\' => array($baseDir . '/src/data/stub', $baseDir . '/src/data/stub/service', $baseDir . '/src/data/stub/repository'),
'Repository\\' => array($baseDir . '/src/data/model/repository'),
'Network\\' => array($baseDir . '/src/data/core/network'),
'Model\\' => array($baseDir . '/src/data/model'),
'Manager\\' => array($baseDir . '/src/data/model/manager'),
'Dotenv\\' => array($vendorDir . '/vlucas/phpdotenv/src'),
'Data\\' => array($baseDir . '/src/data'),
'Shared\\Exception\\' => array($baseDir . '/src/shared/exception'), 'Shared\\Exception\\' => array($baseDir . '/src/shared/exception'),
'Shared\\Attributes\\' => array($baseDir . '/src/shared/attributes'), 'Shared\\Attributes\\' => array($baseDir . '/src/shared/attributes'),
'Shared\\' => array($baseDir . '/src/shared'), 'Shared\\' => array($baseDir . '/src/shared'),
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
'PhpParser\\' => array($vendorDir . '/nikic/php-parser/lib/PhpParser'),
'PhpOption\\' => array($vendorDir . '/phpoption/phpoption/src/PhpOption'),
'Repository\\' => array($baseDir . '/src/data/model/repository'), 'Repository\\' => array($baseDir . '/src/data/model/repository'),
'Psr\\Container\\' => array($vendorDir . '/psr/container/src', $vendorDir . '/sebastian/cli-parser/src'),
'PhpParser\\' => array($vendorDir . '/nikic/php-parser/lib/PhpParser'),
'PhpOption\\' => array($vendorDir . '/phpoption/phpoption/src/PhpOption', $vendorDir . '/phpunit/php-code-coverage/src/PhpOption'),
'Network\\' => array($baseDir . '/src/data/core/network'), 'Network\\' => array($baseDir . '/src/data/core/network'),
'Model\\' => array($baseDir . '/src/data/model'),
'Manager\\' => array($baseDir . '/src/data/model/manager'),
'Hearttrack\\' => array($baseDir . '/src'), 'Hearttrack\\' => array($baseDir . '/src'),
'GrahamCampbell\\ResultType\\' => array($vendorDir . '/graham-campbell/result-type/src'), 'GrahamCampbell\\ResultType\\' => array($vendorDir . '/graham-campbell/result-type/src'),
'Dotenv\\' => array($vendorDir . '/vlucas/phpdotenv/src'), 'Dotenv\\' => array($vendorDir . '/vlucas/phpdotenv/src'),
'DeepCopy\\' => array($vendorDir . '/myclabs/deep-copy/src/DeepCopy'), 'DeepCopy\\' => array($vendorDir . '/myclabs/deep-copy/src/DeepCopy'),
'Database\\' => array($baseDir . '/src/data/core/database'),
'Data\\Core\\' => array($baseDir . '/src/data/core'), 'Data\\Core\\' => array($baseDir . '/src/data/core'),
'Data\\' => array($baseDir . '/src/data'), 'Data\\' => array($baseDir . '/src/data'),
'Console\\' => array($baseDir . '/src/console'), 'Console\\' => array($baseDir . '/src/console'),

@ -63,10 +63,10 @@ class ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1
'D' => 'D' =>
array ( array (
'Dotenv\\' => 7, 'Dotenv\\' => 7,
'Data\\' => 5,
'Doctrine\\Instantiator\\' => 22,
'DeepCopy\\' => 9, 'DeepCopy\\' => 9,
'Database\\' => 9,
'Data\\Core\\' => 10, 'Data\\Core\\' => 10,
'Data\\' => 5,
), ),
'C' => 'C' =>
array ( array (
@ -130,6 +130,7 @@ class ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1
'Psr\\Container\\' => 'Psr\\Container\\' =>
array ( array (
0 => __DIR__ . '/..' . '/psr/container/src', 0 => __DIR__ . '/..' . '/psr/container/src',
1 => __DIR__ . '/..' . '/sebastian/cli-parser/src',
), ),
'PhpParser\\' => 'PhpParser\\' =>
array ( array (
@ -138,6 +139,7 @@ class ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1
'PhpOption\\' => 'PhpOption\\' =>
array ( array (
0 => __DIR__ . '/..' . '/phpoption/phpoption/src/PhpOption', 0 => __DIR__ . '/..' . '/phpoption/phpoption/src/PhpOption',
1 => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/PhpOption',
), ),
'Network\\' => 'Network\\' =>
array ( array (
@ -163,18 +165,14 @@ class ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1
array ( array (
0 => __DIR__ . '/..' . '/vlucas/phpdotenv/src', 0 => __DIR__ . '/..' . '/vlucas/phpdotenv/src',
), ),
'Doctrine\\Instantiator\\' =>
array (
0 => __DIR__ . '/..' . '/graham-campbell/result-type/src',
),
'Dotenv\\' =>
array (
0 => __DIR__ . '/..' . '/vlucas/phpdotenv/src',
),
'DeepCopy\\' => 'DeepCopy\\' =>
array ( array (
0 => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy', 0 => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy',
), ),
'Database\\' =>
array (
0 => __DIR__ . '/../..' . '/src/data/core/database',
),
'Data\\Core\\' => 'Data\\Core\\' =>
array ( array (
0 => __DIR__ . '/../..' . '/src/data/core', 0 => __DIR__ . '/../..' . '/src/data/core',
@ -642,7 +640,6 @@ class ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1
'PHPUnit\\Framework\\MockObject\\Stub\\ReturnValueMap' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/ReturnValueMap.php', 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnValueMap' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/ReturnValueMap.php',
'PHPUnit\\Framework\\MockObject\\Stub\\Stub' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/Stub.php', 'PHPUnit\\Framework\\MockObject\\Stub\\Stub' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/Stub.php',
'PHPUnit\\Framework\\NoChildTestSuiteException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/NoChildTestSuiteException.php', 'PHPUnit\\Framework\\NoChildTestSuiteException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/NoChildTestSuiteException.php',
'PHPUnit\\Framework\\PhptAssertionFailedError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/PhptAssertionFailedError.php',
'PHPUnit\\Framework\\ProcessIsolationException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/ProcessIsolationException.php', 'PHPUnit\\Framework\\ProcessIsolationException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/ProcessIsolationException.php',
'PHPUnit\\Framework\\Reorderable' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Reorderable.php', 'PHPUnit\\Framework\\Reorderable' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Reorderable.php',
'PHPUnit\\Framework\\SelfDescribing' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/SelfDescribing.php', 'PHPUnit\\Framework\\SelfDescribing' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/SelfDescribing.php',
@ -1168,93 +1165,6 @@ class ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1
'PharIo\\Version\\VersionConstraintValue' => __DIR__ . '/..' . '/phar-io/version/src/VersionConstraintValue.php', 'PharIo\\Version\\VersionConstraintValue' => __DIR__ . '/..' . '/phar-io/version/src/VersionConstraintValue.php',
'PharIo\\Version\\VersionNumber' => __DIR__ . '/..' . '/phar-io/version/src/VersionNumber.php', 'PharIo\\Version\\VersionNumber' => __DIR__ . '/..' . '/phar-io/version/src/VersionNumber.php',
'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
'SebastianBergmann\\CliParser\\AmbiguousOptionException' => __DIR__ . '/..' . '/sebastian/cli-parser/src/exceptions/AmbiguousOptionException.php',
'SebastianBergmann\\CliParser\\Exception' => __DIR__ . '/..' . '/sebastian/cli-parser/src/exceptions/Exception.php',
'SebastianBergmann\\CliParser\\OptionDoesNotAllowArgumentException' => __DIR__ . '/..' . '/sebastian/cli-parser/src/exceptions/OptionDoesNotAllowArgumentException.php',
'SebastianBergmann\\CliParser\\Parser' => __DIR__ . '/..' . '/sebastian/cli-parser/src/Parser.php',
'SebastianBergmann\\CliParser\\RequiredOptionArgumentMissingException' => __DIR__ . '/..' . '/sebastian/cli-parser/src/exceptions/RequiredOptionArgumentMissingException.php',
'SebastianBergmann\\CliParser\\UnknownOptionException' => __DIR__ . '/..' . '/sebastian/cli-parser/src/exceptions/UnknownOptionException.php',
'SebastianBergmann\\CodeCoverage\\BranchAndPathCoverageNotSupportedException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/BranchAndPathCoverageNotSupportedException.php',
'SebastianBergmann\\CodeCoverage\\CodeCoverage' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage.php',
'SebastianBergmann\\CodeCoverage\\Data\\ProcessedCodeCoverageData' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Data/ProcessedCodeCoverageData.php',
'SebastianBergmann\\CodeCoverage\\Data\\RawCodeCoverageData' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Data/RawCodeCoverageData.php',
'SebastianBergmann\\CodeCoverage\\DeadCodeDetectionNotSupportedException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/DeadCodeDetectionNotSupportedException.php',
'SebastianBergmann\\CodeCoverage\\Driver\\Driver' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Driver/Driver.php',
'SebastianBergmann\\CodeCoverage\\Driver\\PathExistsButIsNotDirectoryException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/PathExistsButIsNotDirectoryException.php',
'SebastianBergmann\\CodeCoverage\\Driver\\PcovDriver' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Driver/PcovDriver.php',
'SebastianBergmann\\CodeCoverage\\Driver\\PcovNotAvailableException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/PcovNotAvailableException.php',
'SebastianBergmann\\CodeCoverage\\Driver\\Selector' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Driver/Selector.php',
'SebastianBergmann\\CodeCoverage\\Driver\\WriteOperationFailedException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/WriteOperationFailedException.php',
'SebastianBergmann\\CodeCoverage\\Driver\\XdebugDriver' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Driver/XdebugDriver.php',
'SebastianBergmann\\CodeCoverage\\Driver\\XdebugNotAvailableException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/XdebugNotAvailableException.php',
'SebastianBergmann\\CodeCoverage\\Driver\\XdebugNotEnabledException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/XdebugNotEnabledException.php',
'SebastianBergmann\\CodeCoverage\\Exception' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/Exception.php',
'SebastianBergmann\\CodeCoverage\\FileCouldNotBeWrittenException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/FileCouldNotBeWrittenException.php',
'SebastianBergmann\\CodeCoverage\\Filter' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Filter.php',
'SebastianBergmann\\CodeCoverage\\InvalidArgumentException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/InvalidArgumentException.php',
'SebastianBergmann\\CodeCoverage\\NoCodeCoverageDriverAvailableException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/NoCodeCoverageDriverAvailableException.php',
'SebastianBergmann\\CodeCoverage\\NoCodeCoverageDriverWithPathCoverageSupportAvailableException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/NoCodeCoverageDriverWithPathCoverageSupportAvailableException.php',
'SebastianBergmann\\CodeCoverage\\Node\\AbstractNode' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Node/AbstractNode.php',
'SebastianBergmann\\CodeCoverage\\Node\\Builder' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Node/Builder.php',
'SebastianBergmann\\CodeCoverage\\Node\\CrapIndex' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Node/CrapIndex.php',
'SebastianBergmann\\CodeCoverage\\Node\\Directory' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Node/Directory.php',
'SebastianBergmann\\CodeCoverage\\Node\\File' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Node/File.php',
'SebastianBergmann\\CodeCoverage\\Node\\Iterator' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Node/Iterator.php',
'SebastianBergmann\\CodeCoverage\\ParserException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/ParserException.php',
'SebastianBergmann\\CodeCoverage\\ReflectionException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/ReflectionException.php',
'SebastianBergmann\\CodeCoverage\\ReportAlreadyFinalizedException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/ReportAlreadyFinalizedException.php',
'SebastianBergmann\\CodeCoverage\\Report\\Clover' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Clover.php',
'SebastianBergmann\\CodeCoverage\\Report\\Cobertura' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Cobertura.php',
'SebastianBergmann\\CodeCoverage\\Report\\Crap4j' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Crap4j.php',
'SebastianBergmann\\CodeCoverage\\Report\\Html\\Colors' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Html/Colors.php',
'SebastianBergmann\\CodeCoverage\\Report\\Html\\CustomCssFile' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Html/CustomCssFile.php',
'SebastianBergmann\\CodeCoverage\\Report\\Html\\Dashboard' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php',
'SebastianBergmann\\CodeCoverage\\Report\\Html\\Directory' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Html/Renderer/Directory.php',
'SebastianBergmann\\CodeCoverage\\Report\\Html\\Facade' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Html/Facade.php',
'SebastianBergmann\\CodeCoverage\\Report\\Html\\File' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php',
'SebastianBergmann\\CodeCoverage\\Report\\Html\\Renderer' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Html/Renderer.php',
'SebastianBergmann\\CodeCoverage\\Report\\PHP' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/PHP.php',
'SebastianBergmann\\CodeCoverage\\Report\\Text' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Text.php',
'SebastianBergmann\\CodeCoverage\\Report\\Thresholds' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Thresholds.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\BuildInformation' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/BuildInformation.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Coverage' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Coverage.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Directory' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Directory.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Facade' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Facade.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\File' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/File.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Method' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Method.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Node' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Node.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Project' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Project.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Report' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Report.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Source' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Source.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Tests' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Tests.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Totals' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Totals.php',
'SebastianBergmann\\CodeCoverage\\Report\\Xml\\Unit' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Report/Xml/Unit.php',
'SebastianBergmann\\CodeCoverage\\StaticAnalysisCacheNotConfiguredException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/StaticAnalysisCacheNotConfiguredException.php',
'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\CacheWarmer' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/StaticAnalysis/CacheWarmer.php',
'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\CachingFileAnalyser' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/StaticAnalysis/CachingFileAnalyser.php',
'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\CodeUnitFindingVisitor' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php',
'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\ExecutableLinesFindingVisitor' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/StaticAnalysis/ExecutableLinesFindingVisitor.php',
'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\FileAnalyser' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/StaticAnalysis/FileAnalyser.php',
'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\IgnoredLinesFindingVisitor' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/StaticAnalysis/IgnoredLinesFindingVisitor.php',
'SebastianBergmann\\CodeCoverage\\StaticAnalysis\\ParsingFileAnalyser' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/StaticAnalysis/ParsingFileAnalyser.php',
'SebastianBergmann\\CodeCoverage\\TestIdMissingException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/TestIdMissingException.php',
'SebastianBergmann\\CodeCoverage\\Test\\TestSize\\Known' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/TestSize/Known.php',
'SebastianBergmann\\CodeCoverage\\Test\\TestSize\\Large' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/TestSize/Large.php',
'SebastianBergmann\\CodeCoverage\\Test\\TestSize\\Medium' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/TestSize/Medium.php',
'SebastianBergmann\\CodeCoverage\\Test\\TestSize\\Small' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/TestSize/Small.php',
'SebastianBergmann\\CodeCoverage\\Test\\TestSize\\TestSize' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/TestSize/TestSize.php',
'SebastianBergmann\\CodeCoverage\\Test\\TestSize\\Unknown' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/TestSize/Unknown.php',
'SebastianBergmann\\CodeCoverage\\Test\\TestStatus\\Failure' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/TestStatus/Failure.php',
'SebastianBergmann\\CodeCoverage\\Test\\TestStatus\\Known' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/TestStatus/Known.php',
'SebastianBergmann\\CodeCoverage\\Test\\TestStatus\\Success' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/TestStatus/Success.php',
'SebastianBergmann\\CodeCoverage\\Test\\TestStatus\\TestStatus' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/TestStatus/TestStatus.php',
'SebastianBergmann\\CodeCoverage\\Test\\TestStatus\\Unknown' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/TestStatus/Unknown.php',
'SebastianBergmann\\CodeCoverage\\UnintentionallyCoveredCodeException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/UnintentionallyCoveredCodeException.php',
'SebastianBergmann\\CodeCoverage\\Util\\DirectoryCouldNotBeCreatedException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/DirectoryCouldNotBeCreatedException.php',
'SebastianBergmann\\CodeCoverage\\Util\\Filesystem' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Util/Filesystem.php',
'SebastianBergmann\\CodeCoverage\\Util\\Percentage' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Util/Percentage.php',
'SebastianBergmann\\CodeCoverage\\Version' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Version.php',
'SebastianBergmann\\CodeCoverage\\XmlException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/XmlException.php',
'SebastianBergmann\\CodeUnitReverseLookup\\Wizard' => __DIR__ . '/..' . '/sebastian/code-unit-reverse-lookup/src/Wizard.php', 'SebastianBergmann\\CodeUnitReverseLookup\\Wizard' => __DIR__ . '/..' . '/sebastian/code-unit-reverse-lookup/src/Wizard.php',
'SebastianBergmann\\CodeUnit\\ClassMethodUnit' => __DIR__ . '/..' . '/sebastian/code-unit/src/ClassMethodUnit.php', 'SebastianBergmann\\CodeUnit\\ClassMethodUnit' => __DIR__ . '/..' . '/sebastian/code-unit/src/ClassMethodUnit.php',
'SebastianBergmann\\CodeUnit\\ClassUnit' => __DIR__ . '/..' . '/sebastian/code-unit/src/ClassUnit.php', 'SebastianBergmann\\CodeUnit\\ClassUnit' => __DIR__ . '/..' . '/sebastian/code-unit/src/ClassUnit.php',

28
package-lock.json generated

@ -0,0 +1,28 @@
{
"name": "Web",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"dependencies": {
"chart.js": "^4.4.1"
}
},
"node_modules/@kurkle/color": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.2.tgz",
"integrity": "sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw=="
},
"node_modules/chart.js": {
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.1.tgz",
"integrity": "sha512-C74QN1bxwV1v2PEujhmKjOZ7iUM4w6BWs23Md/6aOZZSlwMzeCIDGuZay++rBgChYru7/+QFeoQW0fQoP534Dg==",
"dependencies": {
"@kurkle/color": "^0.3.0"
},
"engines": {
"pnpm": ">=7"
}
}
}
}

@ -0,0 +1,5 @@
{
"dependencies": {
"chart.js": "^4.4.1"
}
}
Loading…
Cancel
Save