diff --git a/Sources/public/assets/img/account.png b/Sources/public/assets/img/account.png new file mode 100644 index 00000000..86846d8f Binary files /dev/null and b/Sources/public/assets/img/account.png differ diff --git a/Sources/public/assets/img/block.png b/Sources/public/assets/img/block.png new file mode 100644 index 00000000..742d5af4 Binary files /dev/null and b/Sources/public/assets/img/block.png differ diff --git a/Sources/public/assets/img/delete.png b/Sources/public/assets/img/delete.png new file mode 100644 index 00000000..22b7348f Binary files /dev/null and b/Sources/public/assets/img/delete.png differ diff --git a/Sources/public/assets/img/menu.png b/Sources/public/assets/img/menu.png new file mode 100644 index 00000000..2af8a45e Binary files /dev/null and b/Sources/public/assets/img/menu.png differ diff --git a/Sources/public/assets/img/msg.png b/Sources/public/assets/img/msg.png new file mode 100644 index 00000000..ab66a4d9 Binary files /dev/null and b/Sources/public/assets/img/msg.png differ diff --git a/Sources/public/assets/img/person/test.png b/Sources/public/assets/img/person/test.png new file mode 100644 index 00000000..6567a547 Binary files /dev/null and b/Sources/public/assets/img/person/test.png differ diff --git a/Sources/public/assets/img/person/test2.png b/Sources/public/assets/img/person/test2.png new file mode 100644 index 00000000..8cdeb44d Binary files /dev/null and b/Sources/public/assets/img/person/test2.png differ diff --git a/Sources/public/assets/img/person/test3.png b/Sources/public/assets/img/person/test3.png new file mode 100644 index 00000000..57d9b7e0 Binary files /dev/null and b/Sources/public/assets/img/person/test3.png differ diff --git a/Sources/public/assets/img/verif/false.png b/Sources/public/assets/img/verif/false.png new file mode 100644 index 00000000..33e38466 Binary files /dev/null and b/Sources/public/assets/img/verif/false.png differ diff --git a/Sources/public/assets/img/verif/true.png b/Sources/public/assets/img/verif/true.png new file mode 100644 index 00000000..d5dfe276 Binary files /dev/null and b/Sources/public/assets/img/verif/true.png differ diff --git a/Sources/src/app/home.php b/Sources/src/app/home.php index ac9048b7..d5e3ca3e 100755 --- a/Sources/src/app/home.php +++ b/Sources/src/app/home.php @@ -1,9 +1,30 @@ array("img" => "test","nom" => "Kilou", "prenom" => "Clément", "status" => "En ligne"), + "b" => array("img" => "test2","nom" => "Kilou", "prenom" => "Frédérique", "status" => "En ligne"), + "c" => array("img" => "test3","nom" => "Kilou", "prenom" => "Hugo", "status" => "Hors ligne") + ); + $listA= array ( + "a" => array("date" => "29/11/18","type" => "Nage", "bpm" => "116", "kmh" => "3.0","distance" => "0.6"), + "b" => array("date" => "27/11/18","type" => "Sprint", "bpm" => "143", "kmh" => "19.0","distance" => "4.2"), + "c" => array("date" => "23/11/18","type" => "Cyclisme", "bpm" => "126", "kmh" => "27.0","distance" => "30.0") + ); + + $listM= array ( + "a" => array("lu" => "false","nom" => "Julien", "prenom" => "Clément", "message" => "Sale connard de végan"), + "b" => array("lu" => "true","nom" => "Ferdiloi", "prenom" => "Frédérique", "message" => "3.0"), + "c" => array("lu" => "true","nom" => "liekrgn", "prenom" => "kqerzrg", "message" => "3.0") + ); $loader = new \Twig\Loader\FilesystemLoader(__DIR__.'/views/Templates'); $twig = new \Twig\Environment($loader); $template=$twig->load('./page/mail.html.twig'); - $template->display(); + $template->display([ + 'user' => "Antoine", + 'friendship' => $listF, + 'analyzes' => $listA, + 'mails' => $listM + ]); ?> \ No newline at end of file diff --git a/Sources/src/app/views/Templates/page/analyze.html.twig b/Sources/src/app/views/Templates/page/analyze.html.twig index 86c7a4a7..1b4a7bed 100755 --- a/Sources/src/app/views/Templates/page/analyze.html.twig +++ b/Sources/src/app/views/Templates/page/analyze.html.twig @@ -2,7 +2,7 @@ {% block title %}Analyses - HearthTrack{% endblock %} -{% block user %}Abdul Admin{% endblock %} +{% block user %}Admin{% endblock %} {% block body %}
@@ -35,102 +35,16 @@ + {% for analyze in analyzes %} - 2023/11/03 - Nage - 116 - 3.0 - 600 m - En savoir plus - - - 2023/11/03 - Nage - 116 - 3.0 - 600 m - En savoir plus - - - 2023/11/03 - Nage - 116 - 3.0 - 600 m - En savoir plus - - - 2023/11/03 - Nage - 116 - 3.0 - 600 m - En savoir plus - - - 2023/11/03 - Nage - 116 - 3.0 - 600 m - En savoir plus - - - 2023/11/03 - Nage - 116 - 3.0 - 600 m - En savoir plus - - - 2023/11/03 - Nage - 116 - 3.0 - 600 m - En savoir plus - - - 2023/11/03 - Nage - 116 - 3.0 - 600 m - En savoir plus - - - 2023/11/03 - Nage - 116 - 3.0 - 600 m - En savoir plus - - - 2023/11/03 - Nage - 116 - 3.0 - 600 m - En savoir plus - - - 2023/11/03 - Nage - 116 - 3.0 - 600 m - En savoir plus - - - 2023/11/03 - Nage - 116 - 3.0 - 600 m + {{analyze.date}} + {{analyze.type}} + {{analyze.bpm}} + {{analyze.kmh}} Km/H + {{analyze.distance}} Km En savoir plus + {% endfor %}
diff --git a/Sources/src/app/views/Templates/page/coaching.html.twig b/Sources/src/app/views/Templates/page/coaching.html.twig index 6f76f4e3..9da5ed84 100755 --- a/Sources/src/app/views/Templates/page/coaching.html.twig +++ b/Sources/src/app/views/Templates/page/coaching.html.twig @@ -2,4 +2,4 @@ {% block title %}Coaching - HearthTrack{% endblock %} -{% block user %}Abdul Admin{% endblock %} \ No newline at end of file +{% block user %}Admin{% endblock %} \ No newline at end of file diff --git a/Sources/src/app/views/Templates/page/exercice.html.twig b/Sources/src/app/views/Templates/page/exercice.html.twig index 484889a0..2fc253c7 100755 --- a/Sources/src/app/views/Templates/page/exercice.html.twig +++ b/Sources/src/app/views/Templates/page/exercice.html.twig @@ -2,4 +2,4 @@ {% block title %}Exercices - HearthTrack{% endblock %} -{% block user %}Abdul Admin{% endblock %} \ No newline at end of file +{% block user %}Admin{% endblock %} \ No newline at end of file diff --git a/Sources/src/app/views/Templates/page/friend.html.twig b/Sources/src/app/views/Templates/page/friend.html.twig index 18cadc43..22759741 100755 --- a/Sources/src/app/views/Templates/page/friend.html.twig +++ b/Sources/src/app/views/Templates/page/friend.html.twig @@ -2,7 +2,7 @@ {% block title %}Amis - HearthTrack{% endblock %} -{% block user %}Abdul Admin{% endblock %} +{% block user %}{{user}}{% endblock %} {% block body %}
@@ -16,34 +16,28 @@ + - - - + {% for ami in friendship %} - - - - - - - - - - - - - - - - + + + + + + {% endfor %}
Nom Prénom Status
GautierThéophileEn ligne(Profil)(Message)(Supprimer)(Bloquer)
FrancisFrançoisEn ligne(Profil)(Message)(Supprimer)(Bloquer) + {{ami.nom}}{{ami.prenom}}{{ami.status}} + + + +
(??) -> Logo diff --git a/Sources/src/app/views/Templates/page/home.html.twig b/Sources/src/app/views/Templates/page/home.html.twig index 2e9c0f8b..dc1fdb1b 100755 --- a/Sources/src/app/views/Templates/page/home.html.twig +++ b/Sources/src/app/views/Templates/page/home.html.twig @@ -2,7 +2,7 @@ {% block title %}Accueil - HearthTrack{% endblock %} -{% block user %}Abdul Admin{% endblock %} +{% block user %}{{user}}{% endblock %} {% block body %}
diff --git a/Sources/src/app/views/Templates/page/mail.html.twig b/Sources/src/app/views/Templates/page/mail.html.twig index dd61ad38..af692aad 100755 --- a/Sources/src/app/views/Templates/page/mail.html.twig +++ b/Sources/src/app/views/Templates/page/mail.html.twig @@ -2,7 +2,7 @@ {% block title %}Messagerie - HearthTrack{% endblock %} -{% block user %}Abdul Admin{% endblock %} +{% block user %}Admin{% endblock %} {% block body %}
@@ -22,15 +22,13 @@ + {% for mail in mails %} - F - Théophile - Demande d'exercices - - T - François - Partage d'analyse + + {{mail.nom}} {{mail.prenom}} + {{mail.message}} + {% endfor %} (??) -> Logo diff --git a/Sources/src/data/core/database/db.sql b/Sources/src/data/core/database/db.sql new file mode 100644 index 00000000..f0e29770 --- /dev/null +++ b/Sources/src/data/core/database/db.sql @@ -0,0 +1,158 @@ +-- 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);