|
|
@ -2,6 +2,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
namespace App\Controller;
|
|
|
|
namespace App\Controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use Database\ActivityEntity;
|
|
|
|
|
|
|
|
use Database\ActivityGateway;
|
|
|
|
|
|
|
|
use Database\ActivityMapper;
|
|
|
|
use Database\AthleteMapper;
|
|
|
|
use Database\AthleteMapper;
|
|
|
|
use Database\EntrainementGateway;
|
|
|
|
use Database\EntrainementGateway;
|
|
|
|
use Database\EntrainementMapper;
|
|
|
|
use Database\EntrainementMapper;
|
|
|
@ -116,7 +119,24 @@ 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("pgsql:host=localhost;dbname=sae_3", "Perederii", ""));
|
|
|
|
|
|
|
|
$listSearch = $activityGateway->getActivity();
|
|
|
|
|
|
|
|
$map = new ActivityMapper();
|
|
|
|
|
|
|
|
$activityGateway = $map->activitySqlToEntity($listSearch);
|
|
|
|
|
|
|
|
$listActivity = [];
|
|
|
|
|
|
|
|
$i = 0;
|
|
|
|
|
|
|
|
foreach ($activityGateway as $entity) {
|
|
|
|
|
|
|
|
$activity = $map->activityEntityToModel($entity);
|
|
|
|
|
|
|
|
$listActivity[$i] = ['idactivity' => number_format($activity->getIdActivity(), 1), 'type' => $activity->getType(),
|
|
|
|
|
|
|
|
'date' => $activity->getDate(), 'heureDebut' => $activity->getHeureDebut(), 'heureFin' => $activity->getHeureFin(),
|
|
|
|
|
|
|
|
'effortRessenti' => $activity->getEffortRessenti(), 'variabilite' => $activity->getVariabilite(), 'variance' => $activity->getVariance(),
|
|
|
|
|
|
|
|
'ecartType' => $activity->getStandardDeviation(), 'moyenne' => $activity->getAverage(),
|
|
|
|
|
|
|
|
'max' => $activity->getMaximum(), 'min' => $activity->getMinimum(), 'temperature' =>$activity->getAvrTemperature()];
|
|
|
|
|
|
|
|
$i++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$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(),
|
|
|
@ -129,6 +149,11 @@ class AthleteController extends BaseController
|
|
|
|
'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'])]
|
|
|
|