update vues with database

merging_APE
Antoine PEREDERII 1 year ago
parent 6e935ce864
commit 0093f21b81

@ -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,10 +2,17 @@
namespace App\Controller; namespace App\Controller;
use Database\ActivityGateway;
use Database\ActivityMapper;
use Database\AthleteEntity; use Database\AthleteEntity;
use Database\AthleteMapper; use Database\AthleteMapper;
use Database\EntrainementGateway; use Database\EntrainementGateway;
use Database\EntrainementMapper; use Database\EntrainementMapper;
use Database\NotificationEntity;
use Database\NotificationGateway;
use Database\NotificationMapper;
use DateTime;
use Model\Notification;
use Shared\Validation; use Shared\Validation;
use App\Container; use App\Container;
use App\Router\Request\IRequest; use App\Router\Request\IRequest;
@ -23,11 +30,12 @@ class AthleteController extends BaseController
private Environment $twig; private Environment $twig;
protected Preferences $preference; protected Preferences $preference;
// private UserManager $userMgr;
public function __construct() public function __construct()
{ {
//session_start();
$this->preference = new Preferences(); $this->preference = new Preferences();
// $this->userMgr = $manager;
} }
// #[Route(path: '/search-user', name: 'search-user', methods: ['GET'])] // #[Route(path: '/search-user', name: 'search-user', methods: ['GET'])]
@ -87,21 +95,19 @@ class AthleteController extends BaseController
$athleteEntity = $map->athleteSqlToEntity($listSearch); $athleteEntity = $map->athleteSqlToEntity($listSearch);
$listUsers = []; $listUsers = [];
$i = 0;
foreach ($athleteEntity as $entity) { foreach ($athleteEntity as $entity) {
$user = $map->athleteEntityToModel($entity); $user = $map->athleteEntityToModel($entity);
$listUsers[$i] = ['idathlete' => number_format($user->getId(), 1), 'nom' => $user->getNom(), $listUsers[] = ['idathlete' => number_format($user->getId(), 1), 'nom' => $user->getNom(),
'prenom' => $user->getPrenom(),'email' => $user->getEmail(), 'sexe' => $user->getSexe(), 'prenom' => $user->getPrenom(),'email' => $user->getEmail(), 'sexe' => $user->getSexe(),
'taille' => $user->getTaille(), 'poids' => $user->getPoids(), 'motdepasse' => $user->getMotDePasse(), 'taille' => $user->getTaille(), 'poids' => $user->getPoids(), 'motdepasse' => $user->getMotDePasse(),
'datenaissance' => $user->getDateNaissance(), 'iscoach' => $user->getRole(), 'img' => 'test', 'datenaissance' => $user->getDateNaissance(), 'iscoach' => $user->getRole(), 'img' => 'test',
'username' => $user->getUsername()]; 'username' => $user->getUsername()];
$i++;
} }
$response = $this->render('./page/addfriend.html.twig',[ $response = $this->render('./page/addfriend.html.twig',[
'css' => $_COOKIE['preferences'], 'css' => $_COOKIE['preferences'],
'pp' => 'test', 'pp' => 'test',
'user' => 'johndoe',//$currentUser->getUsername(), 'user' => 'John',//$currentUser->getUsername(),
'role' => 'Athlete',//$currentUser->getRole(), 'role' => 'Athlete',//$currentUser->getRole(),
'users' => $listUsers 'users' => $listUsers
]); ]);
@ -117,39 +123,78 @@ class AthleteController extends BaseController
#[Route(path: '/analyses', name: 'analyses', methods: ['GET'])] #[Route(path: '/analyses', name: 'analyses', methods: ['GET'])]
public function analyses(): Response public function analyses(): Response
{ {
return $this->render('./page/analyze.html.twig',[ 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(), 'css' => $this->preference->getCookie(),
'pp' => "test2", 'pp' => "test2",
'user' => 'johndoe',//$currentUser->getUsername(), 'user' => 'johndoe',//$currentUser->getUsername(),
'role' => 'Athlete',//$currentUser->getRole(), '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: '/activity', name: 'activity', methods: ['GET'])] #[Route(path: '/activity', name: 'activity', methods: ['GET'])]
public function activity(): Response public function activity(): Response
{ {
return $this->render('./page/activity.html.twig',[ 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/activity.html.twig', [
'css' => $this->preference->getCookie(), 'css' => $this->preference->getCookie(),
'pp' => "test", 'pp' => "test2",
'user' => 'johndoe',//$currentUser->getUsername(), 'user' => 'johndoe',//$currentUser->getUsername(),
'role' => 'Athlete',//$currentUser->getRole(), '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
@ -161,13 +206,11 @@ class AthleteController extends BaseController
$entrainementEntity = $map->entrainementSqlToEntity($listSearch); $entrainementEntity = $map->entrainementSqlToEntity($listSearch);
$listUsers = []; $listUsers = [];
$i = 0;
foreach ($entrainementEntity as $entity) { foreach ($entrainementEntity as $entity) {
$training = $map->entrainementEntityToModel($entity); $training = $map->entrainementEntityToModel($entity);
$listUsers[$i] = ['idTraining' => number_format($training->getId(), 1), 'date' => $training->getDate()->format("D j F Y"), $listUsers[] = ['idTraining' => number_format($training->getId(), 1), 'date' => $training->getDate()->format("D j F Y"),
'location' => $training->getLocation(), 'description' => $training->getDescription(), 'location' => $training->getLocation(), 'description' => $training->getDescription(),
'feedback' => $training->getFeedback()]; 'feedback' => $training->getFeedback()];
$i++;
} }
$response = $this->render('./page/exercice.html.twig',[ $response = $this->render('./page/exercice.html.twig',[
@ -220,23 +263,58 @@ class AthleteController extends BaseController
#[Route(path: '/add-friend', name: 'add-friend', methods: ['POST'])] #[Route(path: '/add-friend', name: 'add-friend', methods: ['POST'])]
public function addFriend(string $username, IRequest $req): Response public function addFriend(string $username, IRequest $req): Response
{ {
try { try {/*
$athleteGateway = new AthleteGateway(new Connexion(DSN, DB_USER, DB_PASSWORD)); $athleteGateway = new AthleteGateway(new Connexion(DSN, DB_USER, DB_PASSWORD));
$map=new AthleteMapper(); $map=new AthleteMapper();
$userSearched=$athleteGateway->getAthleteByFirstName($username); $friendEntity = $athleteGateway->getListIdFriends(1);
$currentUser=$map->athleteEntityToModel(new AthleteEntity($athleteGateway->getAthleteById(1)));
foreach($userSearched as $user) { foreach($friendEntity as $users) {
$listUser[] = $map->athleteEntityToModel(new AthleteEntity($user)); if ($users['idathlete1']==1){
} $user=(int)$users['idathlete2'];
if ($listUser!=null) { } else {
foreach ($userSearched as $user) { $user=(int)$users['idathlete1'];
$currentUser->addFriend($user);
$users = ['nom' => $user->getNom(), 'prenom' => $user->getPrenom(), 'img' => 'test', 'username' => $user->getUsername()];
} }
$listUserEntity[] = $map->athleteSqlToEntity($athleteGateway->getAthleteById(1));
} }
else{ 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->getAthleteByFirstName("Bryan");
$athleteEntity = $map->athleteSqlToEntity($userSearched);
// $user = $athleteGateway->getAthleteById(1);
// $currentUser = $map->athleteToEntity($user);
// Log::dd($currentUser);
// foreach($userSearched as $user) {
// $listUser[] = $map->athleteToEntity($user);
// }
$users=[]; $users=[];
foreach ($athleteEntity as $user) {
// $this->userMgr->getCurrentUser()->addFriend($user);
// $currentUser->addFriend($user);
$users = ['nom' => $user->getNom(), 'prenom' => $user->getPrenom(), 'img' => 'test', 'username' => $user->getUsername()];
} }
$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['nom'], $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",
@ -311,10 +389,12 @@ class AthleteController extends BaseController
try { try {
$athleteGateway = new AthleteGateway(new Connexion(DSN, DB_USER, DB_PASSWORD)); $athleteGateway = new AthleteGateway(new Connexion(DSN, DB_USER, DB_PASSWORD));
$map=new AthleteMapper(); $map=new AthleteMapper();
$friendEntity = $athleteGateway->getListIdFriends(1/*currentUser->getId()*/); $friendEntity = $athleteGateway->getListIdFriends(1/*$currentUser->getId()*/);
$friendList = [];
$listUserEntity = [];
foreach($friendEntity as $users) { foreach($friendEntity as $users) {
if ($users['idathlete1']==1/*currentUser->getId()*/){ if ($users['idathlete1']==1/*$currentUser->getId()*/){
$user=(int)$users['idathlete2']; $user=(int)$users['idathlete2'];
} else { } else {
$user=(int)$users['idathlete1']; $user=(int)$users['idathlete1'];
@ -331,12 +411,6 @@ class AthleteController extends BaseController
'user' => "Doe", 'user' => "Doe",
'role' => "Athlète", 'role' => "Athlète",
'friendship' => $friendList, 'friendship' => $friendList,
'analyzes' => [],
'mails' => [],
'users' => $users,
'infoUser' => [],
'exos' => [],
'member' => [],
]); ]);
} catch (\Throwable $th) { } catch (\Throwable $th) {

@ -18,6 +18,19 @@ class AuthController extends BaseController
public function __construct(){ public function __construct(){
$this->preference = new Preferences(); $this->preference = new Preferences();
} }
// ! private UserManager $userMgr;
// public function __construct(UserManager $manager){
// parent::__construct();
// $this->userMgr = $manager;
// }
#[Route('/login', name: 'login')] #[Route('/login', name: 'login')]
public function login(?string $username, ?string $password ,IRequest $request): Response { public function login(?string $username, ?string $password ,IRequest $request): Response {

@ -17,17 +17,12 @@ use Shared\Log;
class SocialController extends BaseController class SocialController extends BaseController
{ {
private Environment $twig;
protected Preferences $preference; protected Preferences $preference;
public function __construct() public function __construct(){
{
session_start();
$this->preference = new Preferences(); $this->preference = new Preferences();
} }
#[Route(path: '/notification', name: 'notification', methods: ['GET'])] #[Route(path: '/notification', name: 'notification', methods: ['GET'])]
public function mail(): Response public function mail(): Response
{ {
@ -42,7 +37,7 @@ class SocialController extends BaseController
foreach ($notificationEntity as $entity) { foreach ($notificationEntity as $entity) {
$notification = $map->notificationEntityToModel($entity); $notification = $map->notificationEntityToModel($entity);
$listUsers[] = ['idnotif' => $notification->getId(), 'message' => $notification->getMessage(), $listUsers[] = ['idnotif' => $notification->getId(), 'message' => $notification->getMessage(),
'date' => $notification->getDate(),'statut' => $notification->getStatut(), 'urgence' => $notification->getUrgence(), 'date' => $notification->getDate()->format("D j F Y"),'statut' => $notification->getStatut(), 'urgence' => $notification->getUrgence(),
'idathlete' => $notification->getToUserId()]; 'idathlete' => $notification->getToUserId()];
} }
@ -62,7 +57,7 @@ class SocialController extends BaseController
} catch (\Throwable $th) { } catch (\Throwable $th) {
throw $th; throw $th;
return $this->render("addfriend.html.twig", ['tabError' => $taberror]); return $this->render("notification.html.twig", ['tabError' => $taberror]);
} }
return $response; return $response;
} }

@ -18,7 +18,6 @@ class UserController extends BaseController
public function __construct() public function __construct()
{ {
session_start();
$this->preference = new Preferences(); $this->preference = new Preferences();
} }

@ -10,6 +10,7 @@
<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 %}styles{% 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">
@ -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>

@ -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,85 @@
{% 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></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>
</tr><tr></tr>
</tfoot>
<tbody>
{% for analyze in analyzes %}
<tr>
<td>{{analyze.date}}</td>
<td>{{analyze.heureDebut}}</td>
<td>{{analyze.heureFin}}</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><a href="{{ path('analyze_details', {'id': analyze.id}) }}">En savoir plus</a></td>#}
<td><a href="/analyses">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>

@ -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,47 @@
{% 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>
</ol> </ol>
<div class="card-body"> <div class="card-body">
<div class="datatable-container"> <div class="datatable-container">
<table id="datatablesSimple" class="datatable-table"> <form method="post" action="/exercices">
<thead> Type : <input type="text" name="type"/>
<tr> Intensité : <input type="text" name="intensite"/>
<th>Date</th> Date : <input type="text" name="date"/>
<th>Type</th> <button class="btn btn-primary btn-mrg" id="btnNavbarSearch" type="submit">Ajouter l'exercice</button>
<th>BMP</th> </form>
<th>KM/H</th> </div>
<th>Distance</th>
<th></th>
</tr>
</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 %}
<tr> <tr>
<td>{{analyze.date}}</td> <td>{{analyze.date}}</td>
<td>{{analyze.heureDebut}}</td>
<td>{{analyze.heureFin}}</td>
<td>{{analyze.type}}</td> <td>{{analyze.type}}</td>
<td>{{analyze.bpm}}</td> <td>{{analyze.effortRessenti}}</td>
<td>{{analyze.kmh}} Km/H</td> <td>{{analyze.variabilite}}</td>
<td>{{analyze.distance}} Km</td> <td>{{analyze.variance}}</td>
<td><a href="#about">En savoir plus</a></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><a href="/analyses">En savoir plus</a></td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody>
</table>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{% endblock %} <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>
@ -31,11 +32,32 @@
</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.description }}</td> <td>{{ exo.description }}</td>
<td>{{exo.location}}</td> <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> <td>{{ exo.feedback }}</td>
</tr> </tr>
{% endfor %} {% endfor %}

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

@ -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.idnotif}}.png" width="25px" height="25px"></td> <td><img src="/assets/img/verif/{{mail.idnotif}}.png" width="25px" height="25px"></td>
<td>{{mail.urgence}} {{mail.statut}}</td> <td>{{mail.idathlete}}</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>

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

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

@ -42,7 +42,7 @@ class ActivityEntity {
return $this->effortRessenti; return $this->effortRessenti;
} }
public function getVariabilite() { public function getVariability() {
return $this->variabilite; return $this->variabilite;
} }

@ -1,7 +1,9 @@
<?php <?php
namespace Database; namespace Database;
use DateTime;
use Model\Activity; use Model\Activity;
use Shared\Log;
class ActivityMapper { class ActivityMapper {
public function activitySqlToEntity(array $data):array public function activitySqlToEntity(array $data):array
@ -11,61 +13,60 @@ class ActivityMapper {
foreach ($data as $activityData) { foreach ($data as $activityData) {
$activity = new ActivityEntity(); $activity = new ActivityEntity();
if (isset($activityData['idActivity'])) { if (isset($activityData['idactivite'])) {
$activity->setIdActivity($data['idActivity']); $activity->setIdActivity($activityData['idactivite']);
} }
if (isset($activityData['type'])) { if (isset($activityData['type'])) {
$activity->setType($data['type']); $activity->setType($activityData['type']);
} }
if (isset($activityData['date'])) { if (isset($activityData['date'])) {
$activity->setDate($data['date']); $activity->setDate($activityData['date']);
} }
if (isset($activityData['heureDebut'])) { if (isset($activityData['heurededebut'])) {
$activity->setHeureDebut($data['heureDebut']); $activity->setHeureDebut($activityData['heurededebut']);
} }
if (isset($activityData['heureFin'])) { if (isset($activityData['heuredefin'])) {
$activity->setHeureFin($data['heureFin']); $activity->setHeureFin($activityData['heuredefin']);
} }
if (isset($activityData['effortRessenti'])) { if (isset($activityData['effortressent'])) {
$activity->setEffortRessenti($data['effortRessenti']); $activity->setEffortRessenti($activityData['effortressent']);
} }
if (isset($activityData['variabilite'])) { if (isset($activityData['variabilite'])) {
$activity->setVariabilite($data['variabilite']); $activity->setVariabilite($activityData['variabilite']);
} }
if (isset($activityData['variance'])) { if (isset($activityData['variance'])) {
$activity->setVariance($data['variance']); $activity->setVariance($activityData['variance']);
} }
if (isset($activityData['ecartType'])) { if (isset($activityData['ecarttype'])) {
$activity->setEcartType($data['ecartType']); $activity->setEcartType($activityData['ecarttype']);
} }
if (isset($activityData['moyenne'])) { if (isset($activityData['moyenne'])) {
$activity->setMoyenne($data['moyenne']); $activity->setMoyenne($activityData['moyenne']);
} }
if (isset($activityData['maximum'])) { if (isset($activityData['maximum'])) {
$activity->setMaximum($data['maximum']); $activity->setMaximum($activityData['maximum']);
} }
if (isset($activityData['minimum'])) { if (isset($activityData['minimum'])) {
$activity->setMinimum($data['minimum']); $activity->setMinimum($activityData['minimum']);
} }
if (isset($activityData['temperatureMoyenne'])) { if (isset($activityData['temperaturemoyenne'])) {
$activity->setTemperatureMoyenne($data['temperatureMoyenne']); $activity->setTemperatureMoyenne($activityData['temperaturemoyenne']);
} }
$activityEntities[] = $activity; $activityEntities[] = $activity;
} }
return $activityEntities; return $activityEntities;
} }
@ -73,21 +74,29 @@ class ActivityMapper {
* @throws \Exception * @throws \Exception
*/ */
public function ActivityEntityToModel(ActivityEntity $activiteEntity):Activity { 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( $act = new Activity(
$activiteEntity->getIdActivity(), $activiteEntity->getIdActivity(),
$activiteEntity->getType(), $activiteEntity->getType(),
$activiteEntity->getDate(), $date,
$activiteEntity->getHeureDebut(), $heureDebut,
$activiteEntity->getHeureFin(), $heureFin,
$activiteEntity->getEffortRessenti(), $effortRessenti,
$activiteEntity->getVariabilite(), $variability,
$activiteEntity->getVariance(), $variance,
$activiteEntity->getEcartType(), $ecartType,
$activiteEntity->getMoyenne(), $activiteEntity->getMoyenne(),
$activiteEntity->getMaximum(), $activiteEntity->getMaximum(),
$activiteEntity->getMinimum(), $activiteEntity->getMinimum(),
$activiteEntity->getTemperatureMoyenne() $activiteEntity->getTemperatureMoyenne(),
'false'
); );
return $act; return $act;
@ -103,7 +112,7 @@ class ActivityMapper {
$act->setHeureDebut($act->getHeureDebut()); $act->setHeureDebut($act->getHeureDebut());
$act->setHeureFin($act->getHeureFin()); $act->setHeureFin($act->getHeureFin());
$act->setEffortRessenti($act->getEffortRessenti()); $act->setEffortRessenti($act->getEffortRessenti());
$act->setVariabilite($act->getVariabilite()); $act->setVariabilite($act->getVariability());
$act->setVariance($act->getVariance()); $act->setVariance($act->getVariance());
$act->setEcartType($act->getEcartType()); $act->setEcartType($act->getEcartType());
$act->setMoyenne($act->getMoyenne()); $act->setMoyenne($act->getMoyenne());

@ -6,6 +6,7 @@ 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;
@ -27,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;
} }
@ -55,6 +60,7 @@ class AthleteEntity {
return $this->isCoach; return $this->isCoach;
} }
// Setters // Setters
public function setIdAthlete($idAthlete) { public function setIdAthlete($idAthlete) {
$this->idAthlete = $idAthlete; $this->idAthlete = $idAthlete;
@ -68,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;
} }

@ -37,21 +37,21 @@ class AthleteGateway {
public function getAthleteByFirstName(string $firstName): array public function getAthleteByFirstName(string $firstName): array
{ {
$query = "SELECT * FROM Athlete WHERE prenom = :firstName AND isCoach=FALSE"; $query = "SELECT * FROM Athlete WHERE prenom = :firstName AND isCoach=FALSE";
$params = [':firstName' => [$firstName, PDO::PARAM_STR]]; $params = [':firstName' => $firstName];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function getAthleteByEmail(string $email): array public function getAthleteByEmail(string $email): array
{ {
$query = "SELECT * FROM Athlete WHERE email = :email AND isCoach=FALSE"; $query = "SELECT * FROM Athlete WHERE email = :email AND isCoach=FALSE";
$params = [':email' => [$email, PDO::PARAM_STR]]; $params = [':email' => $email];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }
public function getAthleteByGender(string $gender): array public function getAthleteByGender(string $gender): array
{ {
$query = "SELECT * FROM Athlete WHERE sexe = :gender AND isCoach=FALSE"; $query = "SELECT * FROM Athlete WHERE sexe = :gender AND isCoach=FALSE";
$params = [':gender' => [$gender, PDO::PARAM_STR]]; $params = [':gender' => $gender];
return $this->connection->executeWithErrorHandling($query, $params); return $this->connection->executeWithErrorHandling($query, $params);
} }

@ -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']);
} }
@ -63,16 +67,19 @@ 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()); $date = new DateTime($athleteEntity->getDateNaissance());
$poids = floatval($athleteEntity->getPoids());
$taille = floatval($athleteEntity->getTaille());
$user = new User( $user = new User(
$athleteEntity->getIdAthlete(), $athleteEntity->getIdAthlete(),
$athleteEntity->getNom(), $athleteEntity->getNom(),
$athleteEntity->getPrenom(), $athleteEntity->getPrenom(),
"myUsername", $athleteEntity->getUsername(),
$athleteEntity->getEmail(), $athleteEntity->getEmail(),
$athleteEntity->getMotDePasse(), $athleteEntity->getMotDePasse(),
$athleteEntity->getSexe(), $athleteEntity->getSexe(),
$athleteEntity->getTaille(), $taille,
$athleteEntity->getPoids(), $poids,
$date, $date,
$role $role
); );
@ -86,6 +93,7 @@ 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());

@ -44,26 +44,7 @@ class Connexion extends \PDO {
} }
public function getResults(): array { public function getResults(): array {
$results = $this->stmt->fetchAll(\PDO::FETCH_ASSOC); return $this->stmt->fetchAll(\PDO::FETCH_ASSOC);
// Convertissez les colonnes "taille" et "poids" en nombres
foreach ($results as &$row) {
if($row['identrainement']) {
$row['identrainement'] = floatval(($row['identrainement']));
}
if($row['latitude']) {
$row['latitude'] = floatval(($row['latitude']));
}
if($row['longitude']) {
$row['longitude'] = floatval(($row['longitude']));
}
if($row['taille']) {
$row['taille'] = floatval($row['taille']);
}
if($row['poids']) {
$row['poids'] = floatval($row['poids']);
}
}
return $results;
} }
} }
?> ?>

@ -52,11 +52,15 @@ class EntrainementMapper
public function entrainementEntityToModel(EntrainementEntity $entrainementEntity): Training { public function entrainementEntityToModel(EntrainementEntity $entrainementEntity): Training {
$date = new DateTime($entrainementEntity->getDate()); $date = new DateTime($entrainementEntity->getDate());
$idTraining = intval($entrainementEntity->getIdEntrainement());
$latitude = floatval($entrainementEntity->getLatitude());
$longitude = floatval($entrainementEntity->getLongitude());
return new Training( return new Training(
$entrainementEntity->getIdEntrainement(), $idTraining,
$date, $date,
$entrainementEntity->getLatitude(), $latitude,
$entrainementEntity->getLongitude(), $longitude,
$entrainementEntity->getDescription(), $entrainementEntity->getDescription(),
$entrainementEntity->getFeedback() $entrainementEntity->getFeedback()
); );

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

@ -2,6 +2,8 @@
namespace Database; namespace Database;
use Shared\Log;
class NotificationGateway class NotificationGateway
{ {
private Connexion $connection; private Connexion $connection;
@ -16,4 +18,10 @@ class NotificationGateway
$res = $this->connection->executeWithErrorHandling($query); $res = $this->connection->executeWithErrorHandling($query);
return $res; return $res;
} }
public function addNotification(NotificationEntity $notif){
$query = "INSERT INTO Notification (idnotif, message, date, statut, urgence, athleteid) VALUES (:idNotif, :message, :date, :statut, :urgence, :idAthlete)";
$params = [':idNotif'=>$notif->getIdNotif(), ':message'=>$notif->getMessage(), ':date'=>$notif->getDate(), ':statut'=>$notif->getStatut(), ':urgence'=>$notif->getUrgence(), ':idAthlete'=>$notif->getIdAthlete()];
return $this->connection->executeWithErrorHandling($query, $params);
}
} }

@ -64,7 +64,7 @@ class NotificationMapper
$notif = new NotificationEntity(); $notif = new NotificationEntity();
$notif->setIdNotif($notification->getId()); $notif->setIdNotif($notification->getId());
$notif->setMessage($notification->getMessage()); $notif->setMessage($notification->getMessage());
$notif->setDate($notification->getDate()); $notif->setDate($notification->getDate()->format('Y-m-d H:i:s'));
$notif->setStatut($notification->getStatut()); $notif->setStatut($notification->getStatut());
$notif->setUrgence($notification->getUrgence()); $notif->setUrgence($notification->getUrgence());
$notif->setIdAthlete($notification->getToUserId()); $notif->setIdAthlete($notification->getToUserId());

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

@ -9,7 +9,7 @@ class Notification
private int $idNotif; private int $idNotif;
private string $message; private string $message;
private \DateTime $date; private \DateTime $date;
private string $statut; private bool $statut;
private string $urgence; private string $urgence;
private int $toUserId; private int $toUserId;
/** /**

@ -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)
{ {

Loading…
Cancel
Save