Formulaire de données
continuous-integration/drone/push Build is failing Details

issue_022_AjoutAmis
Antoine PINAGOT 1 year ago
parent f7c8793301
commit 4970a10c5f

@ -58,6 +58,24 @@ class Controller extends BaseController
]); ]);
} }
#[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: '/exercice', name: 'exercice', methods: ['GET'])] // 8 #[Route(path: '/exercice', name: 'exercice', methods: ['GET'])] // 8
public function exercice(): Response public function exercice(): Response
{ {
@ -75,10 +93,38 @@ class Controller extends BaseController
'member' => [] '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'])] #[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 = [];
// FILTER
$utiliArray = [ $utiliArray = [
[ [
'nom' => 'John', 'nom' => 'John',
@ -119,6 +165,127 @@ class Controller extends BaseController
} }
#[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: '/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
{ {
@ -195,6 +362,76 @@ class Controller extends BaseController
]); ]);
} }
#[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'])] #[Route(path: '/coaching', name: 'coaching', methods: ['GET'])]
public function coaching(): Response public function coaching(): Response
{ {
@ -267,6 +504,24 @@ class Controller 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
{ {
@ -290,6 +545,47 @@ class Controller 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' => []
]);
}
} }

@ -65,7 +65,7 @@ class FrontController {
throw new \LogicException('You cannot use the "renderView" method if the Twig Bundle is not available. Try running "composer require symfony/twig-bundle".'); throw new \LogicException('You cannot use the "renderView" method if the Twig Bundle is not available. Try running "composer require symfony/twig-bundle".');
} }
$response = new Response($this->container->get(\Twig\Environment::class)->render('./errorbase.html.twig',['title'=> $message , "nb" => $statusCode, "name" => $message, "descr" => $message ]),$statusCode); $response = new Response($this->container->get(\Twig\Environment::class)->render('./error/error.html.twig',['title'=> $message , "code" => $statusCode, "name" => $message, "descr" => $message ]),$statusCode);
$response->send(); $response->send();
} }

@ -60,7 +60,7 @@
Analyses Analyses
</a> </a>
<div class="sb-sidenav-menu-heading">Social</div> <div class="sb-sidenav-menu-heading">Social</div>
<a class="nav-link" href="/friend"> <a class="nav-link" href="/friendlist">
<div class="sb-nav-link-icon"><img src="/assets/img/group.png"></div> <div class="sb-nav-link-icon"><img src="/assets/img/group.png"></div>
Amis Amis
</a> </a>

@ -0,0 +1,7 @@
{% extends "errorbase.html.twig" %}
{% block title %}{{code}} : {{title}}{% endblock %}
{% block nb %}<h1 class="display-1">{{code}}</h1>{% endblock %}
{% block descr %}{{descr}}{% endblock %}

@ -0,0 +1,33 @@
{% extends "base.html.twig" %}
{% block pp %}{{pp}}{% endblock %}
{% block css %}{{css}}{% endblock %}
{% block title %}Exercices - HearthTrack{% endblock %}
{% block user %}{{user}} - {{role}}{% endblock %}
{% block body %}
<div class="container-fluid px-4">
<h1 class="mt-4">Exercices</h1>
<ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a href="/">Accueil</a></li>
<li class="breadcrumb-item active">Exercices</li>
</ol>
<div class="card-body">
<div class="datatable-container">
<form method="post" action="/exercices">
Type : <input type="text" name="type"/>
Intensité : <input type="text" name="intensite"/>
Date : <input type="text" name="date"/>
<button class="btn btn-primary btn-mrg" id="btnNavbarSearch" type="submit">Ajouter l'exercice</button>
</form>
</div>
</div>
</div>
</div>
</div>
<h1>{{responce}}</h1>
{% endblock %}

@ -27,10 +27,10 @@
<th style=" <th style="
padding-left: 42%; padding-left: 42%;
"> ">
<form class="d-none d-md-inline-block form-inline ms-auto me-0 me-md-3 my-2 my-md-0"> <form class="d-none d-md-inline-block form-inline ms-auto me-0 me-md-3 my-2 my-md-0" method="get" action="/search-user">
<div class="input-group"> <div class="input-group">
<input class="form-control" type="text" placeholder="Rechercher..." aria-label="Rechercher..." aria-describedby="btnNavbarSearch" /> <input class="form-control" name="username" type="text" placeholder="Rechercher..." aria-label="Rechercher..." aria-describedby="btnNavbarSearch" />
<button class="btn btn-primary" id="btnNavbarSearch" type="button"><i class="fas fa-search"></i></button> <button class="btn btn-primary" id="btnNavbarSearch" type="submit"><i class="fas fa-search"></i></button>
</div> </div>
</form> </form>
</th> </th>
@ -52,11 +52,7 @@
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
{% if responce is defined %}
<p>{{ responce }}</p>
{% endif %}
</tbody> </tbody>
</table> </table>
</div> </div>
@ -64,4 +60,5 @@
</div> </div>
</div> </div>
</div> </div>
<h1>{{responce}}</h1>
{% endblock %} {% endblock %}

@ -0,0 +1,64 @@
{% extends "base.html.twig" %}
{% block pp %}{{pp}}{% endblock %}
{% block css %}{{css}}{% endblock %}
{% block title %}Coaching - HearthTrack{% endblock %}
{% block user %}{{user}} - {{role}}{% endblock %}
{% block body %}
<div class="container-fluid px-4">
<h1 class="mt-4">Coaching</h1>
<ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a href="/">Accueil</a></li>
<li class="breadcrumb-item active">Coaching</li>
</ol>
<div class="card-body">
<div class="datatable-container">
<table id="datatablesSimple" class="datatable-table">
<thead>
<tr>
<th></th>
<th>Nom</th>
<th>Prénom</th>
<th style="
padding-left: 42%;
">
<form class="d-none d-md-inline-block form-inline ms-auto me-0 me-md-3 my-2 my-md-0" method="get" action="/search-member">
<div class="input-group">
<input class="form-control" name="username" type="text" placeholder="Rechercher..." aria-label="Rechercher..." aria-describedby="btnNavbarSearch" />
<button class="btn btn-primary" id="btnNavbarSearch" type="submit"><i class="fas fa-search"></i></button>
</div>
</form>
</th>
</tr>
</thead>
<tbody>
{% for utili in users %}
<tr>
<td><style> .image-ronde{ clip-path:ellipse(50% 50%); } </style>
<img src="/assets/img/person/{{utili.img}}.png" width="35px" height="35px" class="image-ronde"></td>
<td>{{utili.nom}}</td>
<td>{{utili.prenom}}</td>
<td style="
padding-left: 45%;">
<form method="post" action="/add-member">
<input type="hidden" name="username" value="{{ utili.username }}">
<button class="btn btn-primary" type="submit">Ajouter un membre</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<h1>{{responce}}</h1>
{% endblock %}

@ -17,7 +17,9 @@
<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>
<button class="btn btn-primary btn-mrg" id="btnNavbarSearch" type="button">Ajouter un membre</button> <form method="get" action="/member">
<button class="btn btn-primary btn-mrg" id="btnNavbarSearch" type="submit">Ajouter un membre</button>
</form>
<div class="card-body"> <div class="card-body">
<div class="datatable-container"> <div class="datatable-container">
@ -27,7 +29,7 @@
<th></th> <th></th>
<th>Nom</th> <th>Nom</th>
<th>Prénom</th> <th>Prénom</th>
<th>Status</th> <th>Identifiant</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
@ -40,9 +42,17 @@
<td>{{ath.prenom}}</td> <td>{{ath.prenom}}</td>
<td>{{ath.status}}</td> <td>{{ath.status}}</td>
<td> <td>
<a href="#"><img src="/assets/img/msg.png"></a> <div >
<a href="#"><img src="/assets/img/block.png"></a> <form method="get" action="/mail">
<a href="#"><img src="/assets/img/delete.png"></a> <input type="hidden" name="username" value="{{ ami.username }}"><button class="btn" type="submit"><img src="/assets/img/msg.png"></button></input>
</form>
<form method="post" action="/friendlist">
<input type="hidden" name="username" value="{{ ami.username }}"><button class="btn" type="submit"><img src="/assets/img/block.png"></button></input>
</form>
<form method="post" action="/friendlist">
<input type="hidden" name="username" value="{{ ami.username }}"><button class="btn" type="submit"><img src="/assets/img/delete.png"></button></input>
</form>
</div>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}

@ -16,7 +16,9 @@
<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>
<button class="btn btn-primary btn-mrg" id="btnNavbarSearch" type="button">Ajouter un exercice</button> <form method="get" action="/activity">
<button class="btn btn-primary btn-mrg" id="btnNavbarSearch" type="submit">Ajouter un exercice</button>
</form>
<div class="card-body"> <div class="card-body">
<div class="datatable-container"> <div class="datatable-container">
<table id="datatablesSimple" class="datatable-table"> <table id="datatablesSimple" class="datatable-table">
@ -26,7 +28,6 @@
<th>Type</th> <th>Type</th>
<th>Intensité prévue</th> <th>Intensité prévue</th>
<th>Status</th> <th>Status</th>
<th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -36,9 +37,6 @@
<td>{{exo.type}}</td> <td>{{exo.type}}</td>
<td>{{exo.intensite}}</td> <td>{{exo.intensite}}</td>
<td>{{exo.status}}</td> <td>{{exo.status}}</td>
<td>
<a href="#"><img src="/assets/img/delete.png"></a>
</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>

@ -12,11 +12,14 @@
<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="home.html">Accueil</a></li> <li class="breadcrumb-item"><a href="/">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>
<button class="btn btn-primary btn-mrg" id="btnNavbarSearch" type="button">Ajouter un ami</button> <form method="get" action="/friend">
<button class="btn btn-primary btn-mrg" id="btnNavbarSearch" type="submit">Ajouter un ami</button>
</form>
<div class="card-body"> <div class="card-body">
<div class="datatable-container"> <div class="datatable-container">
@ -29,7 +32,7 @@
<th></th> <th></th>
<th>Nom</th> <th>Nom</th>
<th>Prénom</th> <th>Prénom</th>
<th>Status</th> <th>Identifiant</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
@ -42,9 +45,17 @@
<td>{{ami.prenom}}</td> <td>{{ami.prenom}}</td>
<td>{{ami.status}}</td> <td>{{ami.status}}</td>
<td> <td>
<a href="#"><img src="/assets/img/msg.png"></a> <div >
<a href="#"><img src="/assets/img/block.png"></a> <form method="get" action="/mail">
<a href="#"><img src="/assets/img/delete.png"></a> <input type="hidden" name="username" value="{{ ami.username }}"><button class="btn" type="submit"><img src="/assets/img/msg.png"></button></input>
</form>
<form method="post" action="/friendlist">
<input type="hidden" name="username" value="{{ ami.username }}"><button class="btn" type="submit"><img src="/assets/img/block.png"></button></input>
</form>
<form method="post" action="/friendlist">
<input type="hidden" name="username" value="{{ ami.username }}"><button class="btn" type="submit"><img src="/assets/img/delete.png"></button></input>
</form>
</div>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}

@ -29,8 +29,10 @@
<label for="file-input"> <label for="file-input">
<img src="/assets/img/uploadW.svg"/> <img src="/assets/img/uploadW.svg"/>
</label> </label>
<form action="/analyses" method="post">
<input id="file-input" type="file" style="visibility:hidden; width:0; height:0;"/> <input id="file-input" type="file" name="fileToUpload" value=""style="visibility: hidden; width:0; height:0;"/>
<input type="submit" value="Soumettre le fichier" name="submit"/>
</form>
</div> </div>
</div> </div>
</div> </div>

@ -39,10 +39,10 @@
Date de naissance : {{infoUser.dateNaiss}} Date de naissance : {{infoUser.dateNaiss}}
</div> </div>
<div style="text-align:center"> <div style="text-align:center">
Sport favori : {{infoUser.favSport}} Email : {{infoUser.favSport}}
</div> </div>
<div style="text-align:center; margin-bottom: 15px;"> <div style="text-align:center; margin-bottom: 15px;">
Coach : {{infoUser.coach}} Numéro de téléphone : {{infoUser.coach}}
</div> </div>
</div> </div>
</div> </div>
@ -70,7 +70,53 @@
</div> </div>
<button type="submit" id="saveButton" class="btn btn-primary">Enregistrer</button> <button type="submit" id="saveButton" class="btn btn-primary">Enregistrer</button>
</form> </form>
<h1></h1>
<form action="/mdp" method="post">
<div>
<label for="ancienMotDePasse">Ancien mot de passe:</label>
<input type="password" id="ancienMotDePasse" name="ancienMotDePasse" required>
</div>
<div>
<label for="nouveauMotDePasse">Nouveau mot de passe:</label>
<input type="password" id="nouveauMotDePasse" name="nouveauMotDePasse" required>
</div>
<div>
<label for="confirmerMotDePasse">Confirmer le nouveau mot de passe:</label>
<input type="password" id="confirmerMotDePasse" name="confirmerMotDePasse" required>
</div>
<div>
<button type="submit" class="btn btn-primary">Enregistrer</button>
</div>
</form>
<h1></h1>
<form action="/psettings" method="post">
<div>
<label for="nom">Nom:</label>
<input type="text" id="nom" name="nom" required>
</div>
<div>
<label for="prenom">Prénom:</label>
<input type="text" id="prenom" name="prenom" required>
</div>
<div>
<label for="dateNaissance">Date de naissance:</label>
<input type="date" id="dateNaissance" name="dateNaissance" required>
</div>
<div>
<label for="email">Email:</label>
<input type="email" id="mail" name="mail" required>
</div>
<div>
<label for="numeroTelephone">Numéro de téléphone:</label>
<input type="tel" id="tel" name="tel" required>
</div>
<div>
<button type="submit" class="btn btn-primary">Modifier les informations personnelles</button>
</div> </div>
</form>
</div>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save