Compare commits
89 Commits
@ -0,0 +1,276 @@
|
|||||||
|
[retour au README.md](../../../README.md)
|
||||||
|
[Retour aux Documents](../../README_DOCUMENTS.md)
|
||||||
|
[Retour au diagramme de classes](../README_DIAGRAMMES.md)
|
||||||
|
|
||||||
|
# BDD
|
||||||
|
|
||||||
|
## Modèle Logique de Données (MLD)
|
||||||
|
|
||||||
|
Le MLD représente la structure de données de l'application, décrivant les entités et les relations entre elles. Voici un aperçu des principales entités du MLD :
|
||||||
|
|
||||||
|
### Athlète (Athlete)
|
||||||
|
|
||||||
|
L'entité principale représentant un athlète avec ces informations propre à lui telles que l'identifiant, le nom, le prénom, l'email, etc. Les athlètes peuvent être coach avec le boolean idCoach et être liés par des amitiés, ou par un coaching via la table `Amitie`.
|
||||||
|
|
||||||
|
### Amitié (Friendship)
|
||||||
|
|
||||||
|
Une entité qui modélise les relations d'amitié entre les athlètes et de coaching entre les athlètes et les coachs. Elle stocke les identifiants des deux utilisateurs impliqués.
|
||||||
|
|
||||||
|
### Notification (Notification)
|
||||||
|
|
||||||
|
L'entité qui stocke les notifications destinées aux athlètes, avec des détails tels que le message, la date, le statut, et le degré d'urgence.
|
||||||
|
|
||||||
|
### Envoi de Notification (SendNotification)
|
||||||
|
|
||||||
|
Une entité de liaison entre les athlètes et les notifications, indiquant quel athlète ou coach a envoyé quelle notification. Cela peut-être utile lors d'une notification d'ajout d'amie par exemple.
|
||||||
|
|
||||||
|
### Statistique (Statistic)
|
||||||
|
|
||||||
|
Les statistiques relatives à un athlètes, y compris le poids, la fréquence cardiaque moyenne, la fréquence cardiaque maximale, etc.
|
||||||
|
|
||||||
|
### Entraînement (Training)
|
||||||
|
|
||||||
|
Détails sur les sessions d'entraînement planifiés par un coach pour ses athlètes, comprenant la date, la description, la localisation, etc. Les athlètes peuvent participer à des entraînements et donner leur feedback sur l'entrainement donné.
|
||||||
|
|
||||||
|
### Participation (Participate)
|
||||||
|
|
||||||
|
Une entité de liaison entre les athlètes et les entraînements, indiquant quels athlètes participent à quels entraînements.
|
||||||
|
|
||||||
|
### Don (GiveParticipation)
|
||||||
|
|
||||||
|
Une entité de liaison entre les coachs et les entraînements, indiquant quels coachs ont attribué quels entraînements.
|
||||||
|
|
||||||
|
### Source de Données (DataSource)
|
||||||
|
|
||||||
|
L'entité représentant la source des données des enregistrements sportif, telle que le type, le modèle, la précision, etc., utilisée par les athlètes pour enregistrer une ou des activités.
|
||||||
|
|
||||||
|
### Activité (Activity)
|
||||||
|
|
||||||
|
Les détails des activités des athlètes, y compris le type, la date, les heures de début et de fin, l'effort ressenti, etc.
|
||||||
|
|
||||||
|
### Fréquence Cardiaque (HeartRate)
|
||||||
|
|
||||||
|
Les données de fréquence cardiaque enregistrées pendant les activités, avec des informations telles que l'altitude, la température, etc.
|
||||||
|
|
||||||
|
Ce MLD forme la base de données sous-jacente pour l'application, offrant une structure organisée pour stocker et récupérer les informations relatives aux athlètes et à leurs activités.
|
||||||
|
|
||||||
|
```plantuml
|
||||||
|
@startuml
|
||||||
|
skinparam classAttributeIconSize 0
|
||||||
|
package MLD{
|
||||||
|
entity "Athlete" as athlete {
|
||||||
|
{static} idAthlete
|
||||||
|
username
|
||||||
|
nom
|
||||||
|
prenom
|
||||||
|
email
|
||||||
|
sexe
|
||||||
|
taille
|
||||||
|
poids
|
||||||
|
motDePasse
|
||||||
|
dateNaissance
|
||||||
|
isCoach
|
||||||
|
}
|
||||||
|
|
||||||
|
entity "Amitie" as friendship{
|
||||||
|
{static}# idAthlete1
|
||||||
|
{static}# idAthlete2
|
||||||
|
début
|
||||||
|
}
|
||||||
|
|
||||||
|
entity "Notification" as notif {
|
||||||
|
{static} idNotif
|
||||||
|
message
|
||||||
|
date
|
||||||
|
statut
|
||||||
|
urgence
|
||||||
|
#athleteId
|
||||||
|
}
|
||||||
|
|
||||||
|
entity "Envoi" as sendNotif{
|
||||||
|
{static}# idAthlete
|
||||||
|
{static}# idNotif
|
||||||
|
}
|
||||||
|
|
||||||
|
entity "Statistique" as stats {
|
||||||
|
{static} idStatistique
|
||||||
|
poids
|
||||||
|
fcMoyenne
|
||||||
|
fcMax
|
||||||
|
caloriesBruleesMoy
|
||||||
|
date
|
||||||
|
#athleteId
|
||||||
|
}
|
||||||
|
|
||||||
|
entity "Entrainement" as training {
|
||||||
|
{static} idEntrainement
|
||||||
|
date
|
||||||
|
description
|
||||||
|
latitude
|
||||||
|
longitude
|
||||||
|
feedback
|
||||||
|
#athleteId
|
||||||
|
}
|
||||||
|
|
||||||
|
entity "Participe" as takepart {
|
||||||
|
{static} #athleteId
|
||||||
|
{static} #entrainementId
|
||||||
|
}
|
||||||
|
|
||||||
|
entity "Donne" as givepart {
|
||||||
|
{static} #coachId
|
||||||
|
{static} #entrainementId
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
entity "SourceDonnee" as source {
|
||||||
|
{static} idSource
|
||||||
|
type
|
||||||
|
modele
|
||||||
|
precision
|
||||||
|
#athleteId
|
||||||
|
}
|
||||||
|
|
||||||
|
entity "Activite" as activity {
|
||||||
|
{static} idActivité
|
||||||
|
type
|
||||||
|
date
|
||||||
|
heureDeDebut
|
||||||
|
heureDeFin
|
||||||
|
effortRessent
|
||||||
|
variabilite
|
||||||
|
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
|
||||||
|
athlete <-- source
|
||||||
|
stats --> athlete
|
||||||
|
takepart --> athlete
|
||||||
|
takepart --> training
|
||||||
|
givepart --> athlete
|
||||||
|
givepart --> training
|
||||||
|
sendNotif --> athlete
|
||||||
|
sendNotif --> notif
|
||||||
|
friendship --> athlete
|
||||||
|
notif --> athlete
|
||||||
|
athlete <-- friendship
|
||||||
|
@enduml
|
||||||
|
```
|
||||||
|
|
||||||
|
```plantuml
|
||||||
|
@startuml
|
||||||
|
skinparam classAttributeIconSize 0
|
||||||
|
package MCD{
|
||||||
|
entity "Athlete" as athlete {
|
||||||
|
{static} idAthlete
|
||||||
|
username
|
||||||
|
nom
|
||||||
|
prenom
|
||||||
|
email
|
||||||
|
sexe
|
||||||
|
taille
|
||||||
|
poids
|
||||||
|
motDePasse
|
||||||
|
dateNaissance
|
||||||
|
isCoach
|
||||||
|
}
|
||||||
|
|
||||||
|
entity "Notification" as notif {
|
||||||
|
{static} idNotif
|
||||||
|
message
|
||||||
|
date
|
||||||
|
statut
|
||||||
|
urgence
|
||||||
|
#athleteId
|
||||||
|
}
|
||||||
|
|
||||||
|
entity "Statistique" as stats {
|
||||||
|
{static} idStatistique
|
||||||
|
poids
|
||||||
|
fcMoyenne
|
||||||
|
fcMax
|
||||||
|
caloriesBruleesMoy
|
||||||
|
date
|
||||||
|
#athleteId
|
||||||
|
}
|
||||||
|
|
||||||
|
entity "Entrainement" as training {
|
||||||
|
{static} idEntrainement
|
||||||
|
date
|
||||||
|
description
|
||||||
|
latitude
|
||||||
|
longitude
|
||||||
|
feedback
|
||||||
|
#athleteId
|
||||||
|
}
|
||||||
|
|
||||||
|
entity "SourceDonnee" as source {
|
||||||
|
{static} idSource
|
||||||
|
type
|
||||||
|
modele
|
||||||
|
precision
|
||||||
|
#athleteId
|
||||||
|
}
|
||||||
|
|
||||||
|
entity "Activite" as activity {
|
||||||
|
{static} idActivité
|
||||||
|
type
|
||||||
|
date
|
||||||
|
heureDeDebut
|
||||||
|
heureDeFin
|
||||||
|
effortRessent
|
||||||
|
variabilite
|
||||||
|
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 "0..n" --- "1..1" athlete : réalise
|
||||||
|
activity "1..n" --- "1..1" source : possede
|
||||||
|
activity "1..1" --- "1..n" fc : enregistre
|
||||||
|
athlete "1..n" --- "0..1" source : possede
|
||||||
|
stats "0..n" --- "1..1" athlete : possede
|
||||||
|
training "0..n" --- "1..n" athlete : participe
|
||||||
|
training "0..n" --- "1..1" athlete : donne
|
||||||
|
athlete "0..n" --- "1..n" athlete : est ami
|
||||||
|
notif "0..n" --- "1..n" athlete : recoit
|
||||||
|
notif "0..n" --- "1..1" athlete : envoie
|
||||||
|
@enduml
|
||||||
|
```
|
@ -0,0 +1,2 @@
|
|||||||
|
AddType text/css .css
|
||||||
|
AddType application/javascript .js
|
@ -1,17 +1,31 @@
|
|||||||
FROM php:8.2-fpm
|
FROM php:8.2-apache as base
|
||||||
# Installation de dépendances nécessaires pour Composer
|
# Installation de dépendances nécessaires pour Composer
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
git \
|
git \
|
||||||
unzip
|
unzip
|
||||||
|
|
||||||
# Installation de Composer
|
# Installation de Composer
|
||||||
# TODO : should use a image with composer install
|
|
||||||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||||
|
|
||||||
RUN docker-php-ext-install pdo pdo_mysql
|
RUN docker-php-ext-install pdo pdo_mysql
|
||||||
|
|
||||||
COPY . /var/www/
|
# Copy configs
|
||||||
|
COPY ./config/virtual-host.conf /etc/apache2/sites-available/000-default.conf
|
||||||
|
COPY ./config/httpd.conf /etc/apache2/httpd.conf
|
||||||
|
|
||||||
|
# Setup App
|
||||||
|
RUN mkdir -p /app/public && chown -R www-data:www-data /app
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# add sources code
|
||||||
|
COPY . /app
|
||||||
|
|
||||||
|
ENV VOLUME_PATH /app/public
|
||||||
|
|
||||||
|
RUN composer install
|
||||||
|
|
||||||
WORKDIR /var/www/
|
EXPOSE 80
|
||||||
|
|
||||||
RUN composer install
|
CMD ["apache2-foreground"]
|
@ -0,0 +1 @@
|
|||||||
|
SetEnv ASSET_PREFIX containers/HeartDev-web/
|
@ -1,28 +1,19 @@
|
|||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
index index.php;
|
index index.php index.html index.htm;
|
||||||
root /var/www/public;
|
root /usr/share/nginx/html;
|
||||||
error_page 404 /index.php;
|
error_page 404 /index.php;
|
||||||
|
|
||||||
location ~ ^/(images|javascript|js|css|flash|media|static)/ {
|
|
||||||
root /var/www/public;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
fastcgi_pass web:9000; # service name defined in docker-compose.yml file like web
|
|
||||||
fastcgi_param REQUEST_METHOD $request_method;
|
fastcgi_param REQUEST_METHOD $request_method;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
}
|
}
|
||||||
location ~ /\. {
|
|
||||||
deny all;
|
|
||||||
access_log off;
|
|
||||||
log_not_found off;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.php?$query_string;
|
root /usr/share/nginx/html;
|
||||||
|
try_files $uri /index.php;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
<VirtualHost *:80>
|
||||||
|
ServerName default
|
||||||
|
|
||||||
|
<Directory />
|
||||||
|
Options FollowSymLinks
|
||||||
|
AllowOverride None
|
||||||
|
Require all denied
|
||||||
|
</Directory>
|
||||||
|
|
||||||
|
<Directory ${VOLUME_PATH}>
|
||||||
|
AllowOverride All
|
||||||
|
Require all granted
|
||||||
|
</Directory>
|
||||||
|
|
||||||
|
DocumentRoot ${VOLUME_PATH}
|
||||||
|
|
||||||
|
AccessFileName .htaccess
|
||||||
|
<FilesMatch "^\.ht">
|
||||||
|
Require all denied
|
||||||
|
</FilesMatch>
|
||||||
|
|
||||||
|
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
|
||||||
|
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
|
||||||
|
LogFormat "%h %l %u %t \"%r\" %>s %O" common
|
||||||
|
LogFormat "%{Referer}i -> %U" referer
|
||||||
|
LogFormat "%{User-agent}i" agent
|
||||||
|
|
||||||
|
CustomLog /proc/self/fd/1 combined
|
||||||
|
|
||||||
|
<FilesMatch \.php$>
|
||||||
|
SetHandler application/x-httpd-php
|
||||||
|
</FilesMatch>
|
||||||
|
|
||||||
|
# Multiple DirectoryIndex directives within the same context will add
|
||||||
|
# to the list of resources to look for rather than replace
|
||||||
|
# https://httpd.apache.org/docs/current/mod/mod_dir.html#directoryindex
|
||||||
|
DirectoryIndex disabled
|
||||||
|
DirectoryIndex index.php index.html
|
||||||
|
</VirtualHost>
|
@ -1,563 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Controller;
|
|
||||||
|
|
||||||
use App\Container;
|
|
||||||
use App\Router\Request\IRequest;
|
|
||||||
use App\Router\Response\Response;
|
|
||||||
use Shared\Attributes\Route;
|
|
||||||
use Twig\Environment;
|
|
||||||
use Data\Core\Preferences;
|
|
||||||
use Shared\Log;
|
|
||||||
|
|
||||||
// TODO : Remove this BaseClass
|
|
||||||
class Controller extends BaseController
|
|
||||||
{
|
|
||||||
private Environment $twig;
|
|
||||||
protected Preferences $preference;
|
|
||||||
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
session_start();
|
|
||||||
$this->preference = new Preferences();
|
|
||||||
}
|
|
||||||
|
|
||||||
#[Route(path: '/', name: 'home', methods: ['GET'])]
|
|
||||||
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: '/analyses', name: 'analyses', methods: ['GET'])]
|
|
||||||
public function analyses(): Response
|
|
||||||
{
|
|
||||||
return $this->render('./page/analyze.html.twig',[
|
|
||||||
'css' => $this->preference->getCookie(),
|
|
||||||
'pp' => "test2",
|
|
||||||
'user' => "Doe",
|
|
||||||
'role' => "Athlète",
|
|
||||||
'friendship' => [],
|
|
||||||
'analyzes' => [],
|
|
||||||
'mails' => [],
|
|
||||||
'users' => [],
|
|
||||||
'infoUser' => [],
|
|
||||||
'exos' => [],
|
|
||||||
'member' => []
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[Route(path: '/activity', name: 'activity', methods: ['GET'])]
|
|
||||||
public function activity(): Response
|
|
||||||
{
|
|
||||||
return $this->render('./page/activity.html.twig',[
|
|
||||||
'css' => $this->preference->getCookie(),
|
|
||||||
'pp' => "test2",
|
|
||||||
'user' => "Doe",
|
|
||||||
'role' => "Athlète",
|
|
||||||
'friendship' => [],
|
|
||||||
'analyzes' => [],
|
|
||||||
'mails' => [],
|
|
||||||
'users' => [],
|
|
||||||
'infoUser' => [],
|
|
||||||
'exos' => [],
|
|
||||||
'member' => []
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#[Route(path: '/exercices', name: 'exercices', methods: ['POST'])] // 8
|
|
||||||
public function exercices(String $type, String $intensite, String $date, IRequest $req): Response
|
|
||||||
{
|
|
||||||
$exercicesArray = [
|
|
||||||
[
|
|
||||||
'date' => $date,
|
|
||||||
'type' => $type,
|
|
||||||
'intensite' => $intensite,
|
|
||||||
'status' => 'A venur',
|
|
||||||
]
|
|
||||||
];
|
|
||||||
return $this->render('./page/exercice.html.twig',[
|
|
||||||
'css' => $this->preference->getCookie(),
|
|
||||||
'pp' => "test2",
|
|
||||||
'user' => "Doe",
|
|
||||||
'role' => "Athlète",
|
|
||||||
'friendship' => [],
|
|
||||||
'analyzes' => [],
|
|
||||||
'mails' => [],
|
|
||||||
'users' => [],
|
|
||||||
'infoUser' => [],
|
|
||||||
'exos' => $exercicesArray,
|
|
||||||
'member' => []
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[Route(path: '/search-user', name: 'search-user', methods: ['GET'])]
|
|
||||||
public function searchUser(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/addfriend.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: '/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: '/add-member', name: 'add-member', methods: ['POST'])]
|
|
||||||
public function addmember(string $username, IRequest $req): Response
|
|
||||||
{
|
|
||||||
$taberror = [];
|
|
||||||
$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: '/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(path: '/friendlist', name: 'friendlist', methods: ['POST'])]
|
|
||||||
public function friendlist(string $username, IRequest $req): Response
|
|
||||||
{
|
|
||||||
$utiliArray = [
|
|
||||||
[
|
|
||||||
'nom' => 'John',
|
|
||||||
'prenom' => 'Doe',
|
|
||||||
'img' => 'john_doe',
|
|
||||||
'username' => 'johndoe',
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'nom' => 'Alice',
|
|
||||||
'prenom' => 'Smith',
|
|
||||||
'img' => 'alice_smith',
|
|
||||||
'username' => 'alicesmith',
|
|
||||||
],
|
|
||||||
];
|
|
||||||
/* TODO */
|
|
||||||
|
|
||||||
// -> Enlever ou bloquer un utilisateur en fonction de son username
|
|
||||||
|
|
||||||
return $this->render('./page/friend.html.twig',[
|
|
||||||
'css' => $this->preference->getCookie(),
|
|
||||||
'pp' => "test2",
|
|
||||||
'user' => "Doe",
|
|
||||||
'role' => "Athlète",
|
|
||||||
'friendship' => $utiliArray,
|
|
||||||
'analyzes' => [],
|
|
||||||
'mails' => [],
|
|
||||||
'users' => [],
|
|
||||||
'infoUser' => [],
|
|
||||||
'exos' => [],
|
|
||||||
'member' => [],
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[Route(path: '/friendlist', name: 'friendlist2', methods: ['GET'])]
|
|
||||||
public function friendlist2(): Response
|
|
||||||
{
|
|
||||||
$utiliArray = [
|
|
||||||
[
|
|
||||||
'nom' => 'John',
|
|
||||||
'prenom' => 'Doe',
|
|
||||||
'img' => 'test',
|
|
||||||
'status' => 'johndoe',
|
|
||||||
'username' => 'jdoe',
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'nom' => 'Alice',
|
|
||||||
'prenom' => 'Smith',
|
|
||||||
'img' => 'test2',
|
|
||||||
'status' => 'alicesmith',
|
|
||||||
'username' => 'asmith',
|
|
||||||
],
|
|
||||||
];
|
|
||||||
return $this->render('./page/friend.html.twig',[
|
|
||||||
'css' => $this->preference->getCookie(),
|
|
||||||
'pp' => "test2",
|
|
||||||
'user' => "Doe",
|
|
||||||
'role' => "Athlète",
|
|
||||||
'friendship' => $utiliArray,
|
|
||||||
'analyzes' => [],
|
|
||||||
'mails' => [],
|
|
||||||
'users' => [],
|
|
||||||
'infoUser' => [],
|
|
||||||
'exos' => [],
|
|
||||||
'member' => [],
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[Route(path: '/coaching', name: 'coaching', methods: ['GET'])]
|
|
||||||
public function coaching(): Response
|
|
||||||
{
|
|
||||||
return $this->render('./page/coaching.html.twig',[
|
|
||||||
'css' => $this->preference->getCookie(),
|
|
||||||
'pp' => "test2",
|
|
||||||
'user' => "Doe",
|
|
||||||
'role' => "Athlète",
|
|
||||||
'friendship' => [],
|
|
||||||
'analyzes' => [],
|
|
||||||
'mails' => [],
|
|
||||||
'users' => [],
|
|
||||||
'infoUser' => [],
|
|
||||||
'exos' => [],
|
|
||||||
'member' => []
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[Route(path: '/mail', name: 'mail', methods: ['GET'])]
|
|
||||||
public function mail(): Response
|
|
||||||
{
|
|
||||||
return $this->render('./page/mail.html.twig',[
|
|
||||||
'css' => $this->preference->getCookie(),
|
|
||||||
'pp' => "test2",
|
|
||||||
'user' => "Doe",
|
|
||||||
'role' => "Athlète",
|
|
||||||
'friendship' => [],
|
|
||||||
'analyzes' => [],
|
|
||||||
'mails' => [],
|
|
||||||
'users' => [],
|
|
||||||
'infoUser' => [],
|
|
||||||
'exos' => [],
|
|
||||||
'member' => []
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[Route(path: '/import', name: 'import', methods: ['GET'])]
|
|
||||||
public function import(): Response
|
|
||||||
{
|
|
||||||
return $this->render('./page/import.html.twig',[
|
|
||||||
'css' => $this->preference->getCookie(),
|
|
||||||
'pp' => "test2",
|
|
||||||
'user' => "Doe",
|
|
||||||
'role' => "Athlète",
|
|
||||||
'friendship' => [],
|
|
||||||
'analyzes' => [],
|
|
||||||
'mails' => [],
|
|
||||||
'users' => [],
|
|
||||||
'infoUser' => [],
|
|
||||||
'exos' => [],
|
|
||||||
'member' => []
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#[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: '/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: '/login', name: 'login', methods: ['POST'])]
|
|
||||||
public function login(string $username,string $mdp, IRequest $req): Response
|
|
||||||
{
|
|
||||||
|
|
||||||
// CONFIRMER LES DONNESS !!!!! IMPORTANT
|
|
||||||
|
|
||||||
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(path: '/log', name: 'log', methods: ['GET'])]
|
|
||||||
public function login2(): Response
|
|
||||||
{
|
|
||||||
|
|
||||||
// CONFIRMER LES DONNESS !!!!! IMPORTANT
|
|
||||||
|
|
||||||
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: '/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(),
|
|
||||||
'pp' => "test2",
|
|
||||||
'user' => "Doe",
|
|
||||||
'role' => "Athlète",
|
|
||||||
'friendship' => [],
|
|
||||||
'analyzes' => [],
|
|
||||||
'mails' => [],
|
|
||||||
'users' => [],
|
|
||||||
'infoUser' => [],
|
|
||||||
'exos' => [],
|
|
||||||
'member' => []
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[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(),
|
|
||||||
'pp' => "test2",
|
|
||||||
'user' => "Doe",
|
|
||||||
'role' => "Athlète",
|
|
||||||
'friendship' => [],
|
|
||||||
'analyzes' => [],
|
|
||||||
'mails' => [],
|
|
||||||
'users' => [],
|
|
||||||
'infoUser' => [],
|
|
||||||
'exos' => [],
|
|
||||||
'member' => []
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[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(),
|
|
||||||
'pp' => "test2",
|
|
||||||
'user' => "Doe",
|
|
||||||
'role' => "Athlète",
|
|
||||||
'friendship' => [],
|
|
||||||
'analyzes' => [],
|
|
||||||
'mails' => [],
|
|
||||||
'users' => [],
|
|
||||||
'infoUser' => [],
|
|
||||||
'exos' => [],
|
|
||||||
'member' => []
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[Route(path: '/password', name: 'password', methods: ['POST'])]
|
|
||||||
public function password(string $email, IRequest $req): Response
|
|
||||||
{
|
|
||||||
|
|
||||||
// CONFIRMER LES DONNESS !!!!! IMPORTANT
|
|
||||||
|
|
||||||
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' => []
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in new issue