Finition de link route/controller
continuous-integration/drone/push Build is failing Details

issue_031_Controlers
Antoine PINAGOT 1 year ago
parent 35cb501e47
commit c201ee9bff

@ -1,257 +1,300 @@
<?php <?php
// namespace App\Controller; namespace App\Controller;
// use App\Container; use App\Container;
// use App\Router\Request\IRequest; use App\Router\Request\IRequest;
// use App\Router\Response\Response; use App\Router\Response\Response;
// use Shared\Attributes\Route; use Shared\Attributes\Route;
// use Twig\Environment; use Twig\Environment;
// use Data\Core\Preferences; use Data\Core\Preferences;
// use Shared\Log; use Shared\Log;
// class AthleteController extends BaseController class AthleteController extends BaseController
// { {
// private Environment $twig; private Environment $twig;
// private Preferences $preference; private Preferences $preference;
// public function __construct() public function __construct()
// { {
// session_start(); session_start();
// $this->preference = new Preferences(); $this->preference = new Preferences();
// } }
// #[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 = [];
// $utiliArray = [ $utiliArray = [
// [ [
// 'nom' => 'John', 'nom' => 'John',
// 'prenom' => 'Doe', 'prenom' => 'Doe',
// 'img' => 'john_doe', 'img' => 'john_doe',
// 'username' => 'johndoe', 'username' => 'johndoe',
// ], ],
// [ [
// 'nom' => 'Alice', 'nom' => 'Alice',
// 'prenom' => 'Smith', 'prenom' => 'Smith',
// 'img' => 'alice_smith', 'img' => 'alice_smith',
// 'username' => 'alicesmith', 'username' => 'alicesmith',
// ], ],
// ]; ];
// // if(!Validation::val_string($name)){ // if(!Validation::val_string($name)){
// try { try {
// //code... //code...
// // $model->userMgr->getUser($name); // $model->userMgr->getUser($name);
// 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",
// 'user' => "Doe", 'user' => "Doe",
// 'role' => "Athlète", 'role' => "Athlète",
// 'friendship' => [], 'friendship' => [],
// 'analyzes' => [], 'analyzes' => [],
// 'mails' => [], 'mails' => [],
// 'users' => $utiliArray, 'users' => $utiliArray,
// 'infoUser' => [], 'infoUser' => [],
// 'exos' => [], 'exos' => [],
// 'member' => [], 'member' => [],
// 'responce' => "Notification d'ajout envoyée à $username" 'responce' => "Notification d'ajout envoyée à $username"
// ]); ]);
// } catch (\Throwable $th) { } catch (\Throwable $th) {
// //throw $th; //throw $th;
// // return $this->render("addfriend.html.twig", ['tabError' => $taberror ]); // return $this->render("addfriend.html.twig", ['tabError' => $taberror ]);
}
// } // }
// // }
// } }
#[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: '/analyses', name: 'analyses', methods: ['GET'])] #[Route(path: '/activity', name: 'activity', methods: ['GET'])]
// public function analyses(): Response public function activity(): Response
// { {
// return $this->render('./page/analyze.html.twig',[ return $this->render('./page/activity.html.twig',[
// 'css' => $this->preference->getCookie(), 'css' => $this->preference->getCookie(),
// 'pp' => "test2", 'pp' => "test2",
// 'user' => "Doe", 'user' => "Doe",
// 'role' => "Athlète", 'role' => "Athlète",
// 'friendship' => [], 'friendship' => [],
// 'analyzes' => [], 'analyzes' => [],
// 'mails' => [], 'mails' => [],
// 'users' => [], 'users' => [],
// 'infoUser' => [], 'infoUser' => [],
// 'exos' => [], 'exos' => [],
// 'member' => [] '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
// { {
// return $this->render('./page/exercice.html.twig',[ return $this->render('./page/exercice.html.twig',[
// 'css' => $this->preference->getCookie(), 'css' => $this->preference->getCookie(),
// 'pp' => "test2", 'pp' => "test2",
// 'user' => "Doe", 'user' => "Doe",
// 'role' => "Athlète", 'role' => "Athlète",
// 'friendship' => [], 'friendship' => [],
// 'analyzes' => [], 'analyzes' => [],
// 'mails' => [], 'mails' => [],
// 'users' => [], 'users' => [],
// 'infoUser' => [], 'infoUser' => [],
// 'exos' => [], 'exos' => [],
// 'member' => [] 'member' => []
// ]); ]);
// } }
// #[Route(path: '/add-friend', name: 'add-friend', methods: ['POST'])] #[Route(path: '/exercices', name: 'exercices', methods: ['POST'])] // 8
// public function addFriend(string $username, IRequest $req): Response public function exercices(String $type, String $intensite, String $date, IRequest $req): Response
// { {
// $taberror = []; $exercicesArray = [
// $utiliArray = [ [
// [ 'date' => $date,
// 'nom' => 'John', 'type' => $type,
// 'prenom' => 'Doe', 'intensite' => $intensite,
// 'img' => 'john_doe', 'status' => 'A venur',
// 'username' => 'johndoe', ]
// ], ];
// [ return $this->render('./page/exercice.html.twig',[
// 'nom' => 'Alice', 'css' => $this->preference->getCookie(),
// 'prenom' => 'Smith', 'pp' => "test2",
// 'img' => 'alice_smith', 'user' => "Doe",
// 'username' => 'alicesmith', 'role' => "Athlète",
// ], 'friendship' => [],
// ]; 'analyzes' => [],
// // if(!Validation::val_string($name)){ 'mails' => [],
// try { 'users' => [],
// //code... 'infoUser' => [],
// // $model->userMgr->addFriend($name); 'exos' => $exercicesArray,
// return $this->render('./page/addfriend.html.twig',[ 'member' => []
// '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-friend', name: 'add-friend', methods: ['POST'])]
public function addFriend(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/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: '/delete-friend', name: 'delete-friend', methods: ['POST'])] }
#[Route(path: '/friend', name: 'friend', methods: ['GET'])]
public function friend(): Response
{
$utiliArray = [
[
'nom' => 'John',
'prenom' => 'Doe',
'img' => 'john_doe',
'username' => 'johndoe',
],
[
'nom' => 'Alice',
'prenom' => 'Smith',
'img' => 'alice_smith',
'username' => 'alicesmith',
],
];
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' => [],
]);
}
// #[Route(path: '/friend', name: 'friend', methods: ['GET'])] #[Route(path: '/friendlist', name: 'friendlist', methods: ['POST'])]
// public function friend(): Response public function friendlist(string $username, IRequest $req): Response
// { {
// $utiliArray = [ $utiliArray = [
// [ [
// 'nom' => 'John', 'nom' => 'John',
// 'prenom' => 'Doe', 'prenom' => 'Doe',
// 'img' => 'john_doe', 'img' => 'john_doe',
// 'username' => 'johndoe', 'username' => 'johndoe',
// ], ],
// [ [
// 'nom' => 'Alice', 'nom' => 'Alice',
// 'prenom' => 'Smith', 'prenom' => 'Smith',
// 'img' => 'alice_smith', 'img' => 'alice_smith',
// 'username' => 'alicesmith', 'username' => 'alicesmith',
// ], ],
// ]; ];
// return $this->render('./page/addfriend.html.twig',[ /* TODO */
// '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'])] // -> Enlever ou bloquer un utilisateur en fonction de son username
// 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' => [],
]);
}
// return $this->render('./page/friend.html.twig',[ #[Route(path: '/friendlist', name: 'friendlist2', methods: ['GET'])]
// 'css' => $this->preference->getCookie(), public function friendlist2(): Response
// 'pp' => "test2", {
// 'user' => "Doe", $utiliArray = [
// 'role' => "Athlète", [
// 'friendship' => $utiliArray, 'nom' => 'John',
// 'analyzes' => [], 'prenom' => 'Doe',
// 'mails' => [], 'img' => 'test',
// 'users' => [], 'status' => 'johndoe',
// 'infoUser' => [], 'username' => 'jdoe',
// 'exos' => [], ],
// 'member' => [], [
// ]); '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: '/friendlist', name: 'friendlist2', methods: ['GET'])] // #[Route(path: '/delete-friend', name: 'delete-friend', methods: ['POST'])]
// 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' => [],
// ]);
// }
// } }
?> ?>

@ -12,6 +12,13 @@ use Shared\Log;
class AuthController extends BaseController class AuthController extends BaseController
{ {
private Preferences $preference;
public function __construct(){
$this->preference = new Preferences();
}
#[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 {
// if user is already logged in, don't display the login page again // if user is already logged in, don't display the login page again
@ -98,6 +105,69 @@ class AuthController extends BaseController
} }
#[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: '/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: '/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' => []
]);
}
} }

@ -1,26 +1,26 @@
<?php <?php
namespace App\Controller; // namespace App\Controller;
use App\Container; // use App\Container;
use App\Router\Request\IRequest; // use App\Router\Request\IRequest;
use App\Router\Response\Response; // use App\Router\Response\Response;
use Shared\Attributes\Route; // use Shared\Attributes\Route;
use Twig\Environment; // use Twig\Environment;
use Data\Core\Preferences; // use Data\Core\Preferences;
use Shared\Log; // use Shared\Log;
// TODO : Remove this BaseClass // // TODO : Remove this BaseClass
class Controller extends BaseController // class Controller extends BaseController
{ // {
private Environment $twig; // private Environment $twig;
private Preferences $preference; // private Preferences $preference;
public function __construct() // public function __construct()
{ // {
session_start(); // session_start();
$this->preference = new Preferences(); // $this->preference = new Preferences();
} // }
// #[Route(path: '/', name: 'index', methods: ['GET'])] // #[Route(path: '/', name: 'index', methods: ['GET'])]
// public function index(): Response // public function index(): Response
@ -58,85 +58,85 @@ class Controller 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',[ // return $this->render('./page/analyze.html.twig',[
'css' => $this->preference->getCookie(), // 'css' => $this->preference->getCookie(),
'pp' => "test2", // 'pp' => "test2",
'user' => "Doe", // 'user' => "Doe",
'role' => "Athlète", // 'role' => "Athlète",
'friendship' => [], // 'friendship' => [],
'analyzes' => [], // 'analyzes' => [],
'mails' => [], // 'mails' => [],
'users' => [], // 'users' => [],
'infoUser' => [], // 'infoUser' => [],
'exos' => [], // 'exos' => [],
'member' => [] // 'member' => []
]); // ]);
} // }
#[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',[ // return $this->render('./page/activity.html.twig',[
'css' => $this->preference->getCookie(), // 'css' => $this->preference->getCookie(),
'pp' => "test2", // 'pp' => "test2",
'user' => "Doe", // 'user' => "Doe",
'role' => "Athlète", // 'role' => "Athlète",
'friendship' => [], // 'friendship' => [],
'analyzes' => [], // 'analyzes' => [],
'mails' => [], // 'mails' => [],
'users' => [], // 'users' => [],
'infoUser' => [], // 'infoUser' => [],
'exos' => [], // 'exos' => [],
'member' => [] // '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
{ // {
return $this->render('./page/exercice.html.twig',[ // return $this->render('./page/exercice.html.twig',[
'css' => $this->preference->getCookie(), // 'css' => $this->preference->getCookie(),
'pp' => "test2", // 'pp' => "test2",
'user' => "Doe", // 'user' => "Doe",
'role' => "Athlète", // 'role' => "Athlète",
'friendship' => [], // 'friendship' => [],
'analyzes' => [], // 'analyzes' => [],
'mails' => [], // 'mails' => [],
'users' => [], // 'users' => [],
'infoUser' => [], // 'infoUser' => [],
'exos' => [], // 'exos' => [],
'member' => [] // 'member' => []
]); // ]);
} // }
#[Route(path: '/exercices', name: 'exercices', methods: ['POST'])] // 8 // #[Route(path: '/exercices', name: 'exercices', methods: ['POST'])] // 8
public function exercices(String $type, String $intensite, String $date, IRequest $req): Response // public function exercices(String $type, String $intensite, String $date, IRequest $req): Response
{ // {
$exercicesArray = [ // $exercicesArray = [
[ // [
'date' => $date, // 'date' => $date,
'type' => $type, // 'type' => $type,
'intensite' => $intensite, // 'intensite' => $intensite,
'status' => 'A venur', // 'status' => 'A venur',
] // ]
]; // ];
return $this->render('./page/exercice.html.twig',[ // return $this->render('./page/exercice.html.twig',[
'css' => $this->preference->getCookie(), // 'css' => $this->preference->getCookie(),
'pp' => "test2", // 'pp' => "test2",
'user' => "Doe", // 'user' => "Doe",
'role' => "Athlète", // 'role' => "Athlète",
'friendship' => [], // 'friendship' => [],
'analyzes' => [], // 'analyzes' => [],
'mails' => [], // 'mails' => [],
'users' => [], // 'users' => [],
'infoUser' => [], // 'infoUser' => [],
'exos' => $exercicesArray, // 'exos' => $exercicesArray,
'member' => [] // '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
@ -304,151 +304,151 @@ class Controller 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
{ // {
$taberror = []; // $taberror = [];
$utiliArray = [ // $utiliArray = [
[ // [
'nom' => 'John', // 'nom' => 'John',
'prenom' => 'Doe', // 'prenom' => 'Doe',
'img' => 'john_doe', // 'img' => 'john_doe',
'username' => 'johndoe', // 'username' => 'johndoe',
], // ],
[ // [
'nom' => 'Alice', // 'nom' => 'Alice',
'prenom' => 'Smith', // 'prenom' => 'Smith',
'img' => 'alice_smith', // 'img' => 'alice_smith',
'username' => 'alicesmith', // 'username' => 'alicesmith',
], // ],
]; // ];
// if(!Validation::val_string($name)){ // // if(!Validation::val_string($name)){
try { // try {
//code... // //code...
// $model->userMgr->addFriend($name); // // $model->userMgr->addFriend($name);
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",
'user' => "Doe", // 'user' => "Doe",
'role' => "Athlète", // 'role' => "Athlète",
'friendship' => [], // 'friendship' => [],
'analyzes' => [], // 'analyzes' => [],
'mails' => [], // 'mails' => [],
'users' => $utiliArray, // 'users' => $utiliArray,
'infoUser' => [], // 'infoUser' => [],
'exos' => [], // 'exos' => [],
'member' => [], // 'member' => [],
'responce' => "Notification d'ajout envoyée à $username" // 'responce' => "Notification d'ajout envoyée à $username"
]); // ]);
} catch (\Throwable $th) { // } catch (\Throwable $th) {
//throw $th; // //throw $th;
// return $this->render("addfriend.html.twig", ['tabError' => $taberror ]); // // return $this->render("addfriend.html.twig", ['tabError' => $taberror ]);
} // }
// } // // }
} // }
#[Route(path: '/friend', name: 'friend', methods: ['GET'])] // #[Route(path: '/friend', name: 'friend', methods: ['GET'])]
public function friend(): Response // public function friend(): Response
{ // {
$utiliArray = [ // $utiliArray = [
[ // [
'nom' => 'John', // 'nom' => 'John',
'prenom' => 'Doe', // 'prenom' => 'Doe',
'img' => 'john_doe', // 'img' => 'john_doe',
'username' => 'johndoe', // 'username' => 'johndoe',
], // ],
[ // [
'nom' => 'Alice', // 'nom' => 'Alice',
'prenom' => 'Smith', // 'prenom' => 'Smith',
'img' => 'alice_smith', // 'img' => 'alice_smith',
'username' => 'alicesmith', // 'username' => 'alicesmith',
], // ],
]; // ];
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",
'user' => "Doe", // 'user' => "Doe",
'role' => "Athlète", // 'role' => "Athlète",
'friendship' => [], // 'friendship' => [],
'analyzes' => [], // 'analyzes' => [],
'mails' => [], // 'mails' => [],
'users' => $utiliArray, // 'users' => $utiliArray,
'infoUser' => [], // 'infoUser' => [],
'exos' => [], // 'exos' => [],
'member' => [], // 'member' => [],
]); // ]);
} // }
#[Route(path: '/friendlist', name: 'friendlist', methods: ['POST'])] // #[Route(path: '/friendlist', name: 'friendlist', methods: ['POST'])]
public function friendlist(string $username, IRequest $req): Response // public function friendlist(string $username, IRequest $req): Response
{ // {
$utiliArray = [ // $utiliArray = [
[ // [
'nom' => 'John', // 'nom' => 'John',
'prenom' => 'Doe', // 'prenom' => 'Doe',
'img' => 'john_doe', // 'img' => 'john_doe',
'username' => 'johndoe', // 'username' => 'johndoe',
], // ],
[ // [
'nom' => 'Alice', // 'nom' => 'Alice',
'prenom' => 'Smith', // 'prenom' => 'Smith',
'img' => 'alice_smith', // 'img' => 'alice_smith',
'username' => 'alicesmith', // 'username' => 'alicesmith',
], // ],
]; // ];
/* TODO */ // /* TODO */
// -> Enlever ou bloquer un utilisateur en fonction de son username // // -> Enlever ou bloquer un utilisateur en fonction de son username
return $this->render('./page/friend.html.twig',[ // return $this->render('./page/friend.html.twig',[
'css' => $this->preference->getCookie(), // 'css' => $this->preference->getCookie(),
'pp' => "test2", // 'pp' => "test2",
'user' => "Doe", // 'user' => "Doe",
'role' => "Athlète", // 'role' => "Athlète",
'friendship' => $utiliArray, // 'friendship' => $utiliArray,
'analyzes' => [], // 'analyzes' => [],
'mails' => [], // 'mails' => [],
'users' => [], // 'users' => [],
'infoUser' => [], // 'infoUser' => [],
'exos' => [], // 'exos' => [],
'member' => [], // 'member' => [],
]); // ]);
} // }
#[Route(path: '/friendlist', name: 'friendlist2', methods: ['GET'])] // #[Route(path: '/friendlist', name: 'friendlist2', methods: ['GET'])]
public function friendlist2(): Response // public function friendlist2(): Response
{ // {
$utiliArray = [ // $utiliArray = [
[ // [
'nom' => 'John', // 'nom' => 'John',
'prenom' => 'Doe', // 'prenom' => 'Doe',
'img' => 'test', // 'img' => 'test',
'status' => 'johndoe', // 'status' => 'johndoe',
'username' => 'jdoe', // 'username' => 'jdoe',
], // ],
[ // [
'nom' => 'Alice', // 'nom' => 'Alice',
'prenom' => 'Smith', // 'prenom' => 'Smith',
'img' => 'test2', // 'img' => 'test2',
'status' => 'alicesmith', // 'status' => 'alicesmith',
'username' => 'asmith', // 'username' => 'asmith',
], // ],
]; // ];
return $this->render('./page/friend.html.twig',[ // return $this->render('./page/friend.html.twig',[
'css' => $this->preference->getCookie(), // 'css' => $this->preference->getCookie(),
'pp' => "test2", // 'pp' => "test2",
'user' => "Doe", // 'user' => "Doe",
'role' => "Athlète", // 'role' => "Athlète",
'friendship' => $utiliArray, // 'friendship' => $utiliArray,
'analyzes' => [], // 'analyzes' => [],
'mails' => [], // 'mails' => [],
'users' => [], // 'users' => [],
'infoUser' => [], // 'infoUser' => [],
'exos' => [], // 'exos' => [],
'member' => [], // 'member' => [],
]); // ]);
} // }
// #[Route(path: '/coaching', name: 'coaching', methods: ['GET'])] // #[Route(path: '/coaching', name: 'coaching', methods: ['GET'])]
// public function coaching(): Response // public function coaching(): Response
@ -625,92 +625,92 @@ class Controller extends BaseController
// ]); // ]);
// } // }
#[Route(path: '/log', name: 'log', methods: ['GET'])] // #[Route(path: '/log', name: 'log', methods: ['GET'])]
public function login2(): Response // public function login2(): Response
{ // {
// CONFIRMER LES DONNESS !!!!! IMPORTANT // // CONFIRMER LES DONNESS !!!!! IMPORTANT
return $this->render('./page/login.html.twig',[ // return $this->render('./page/login.html.twig',[
'css' => $this->preference->getCookie(), // 'css' => $this->preference->getCookie(),
'pp' => "test2", // 'pp' => "test2",
'user' => "Doe", // 'user' => "Doe",
'role' => "Athlète", // 'role' => "Athlète",
'friendship' => [], // 'friendship' => [],
'analyzes' => [], // 'analyzes' => [],
'mails' => [], // 'mails' => [],
'users' => [], // 'users' => [],
'infoUser' => [], // 'infoUser' => [],
'exos' => [], // 'exos' => [],
'member' => [] // 'member' => []
]); // ]);
} // }
#[Route(path: '/register', name: 'register', methods: ['POST'])] // #[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 // 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 // // CONFIRMER LES DONNESS !!!!! IMPORTANT
return $this->render('./page/home.html.twig',[ // return $this->render('./page/home.html.twig',[
'css' => $this->preference->getCookie() // 'css' => $this->preference->getCookie()
]); // ]);
} // }
#[Route(path: '/regist', name: 'regist', methods: ['GET'])] // #[Route(path: '/regist', name: 'regist', methods: ['GET'])]
public function register2(): Response // public function register2(): Response
{ // {
// CONFIRMER LES DONNESS !!!!! IMPORTANT // // CONFIRMER LES DONNESS !!!!! IMPORTANT
return $this->render('./page/register.html.twig',[ // return $this->render('./page/register.html.twig',[
'css' => $this->preference->getCookie() // 'css' => $this->preference->getCookie()
]); // ]);
} // }
#[Route(path: '/pass', name: 'pass', methods: ['GET'])] // #[Route(path: '/pass', name: 'pass', methods: ['GET'])]
public function pass(): Response // public function pass(): Response
{ // {
// CONFIRMER LES DONNESS !!!!! IMPORTANT // // CONFIRMER LES DONNESS !!!!! IMPORTANT
return $this->render('./page/password.html.twig',[ // return $this->render('./page/password.html.twig',[
'css' => $this->preference->getCookie(), // 'css' => $this->preference->getCookie(),
'pp' => "test2", // 'pp' => "test2",
'user' => "Doe", // 'user' => "Doe",
'role' => "Athlète", // 'role' => "Athlète",
'friendship' => [], // 'friendship' => [],
'analyzes' => [], // 'analyzes' => [],
'mails' => [], // 'mails' => [],
'users' => [], // 'users' => [],
'infoUser' => [], // 'infoUser' => [],
'exos' => [], // 'exos' => [],
'member' => [] // 'member' => []
]); // ]);
} // }
#[Route(path: '/password', name: 'password', methods: ['POST'])] // #[Route(path: '/password', name: 'password', methods: ['POST'])]
public function password(string $email, IRequest $req): Response // public function password(string $email, IRequest $req): Response
{ // {
// CONFIRMER LES DONNESS !!!!! IMPORTANT // // CONFIRMER LES DONNESS !!!!! IMPORTANT
return $this->render('./page/login.html.twig',[ // return $this->render('./page/login.html.twig',[
'css' => $this->preference->getCookie(), // 'css' => $this->preference->getCookie(),
'pp' => "test2", // 'pp' => "test2",
'user' => "Doe", // 'user' => "Doe",
'role' => "Athlète", // 'role' => "Athlète",
'friendship' => [], // 'friendship' => [],
'analyzes' => [], // 'analyzes' => [],
'mails' => [], // 'mails' => [],
'users' => [], // 'users' => [],
'infoUser' => [], // 'infoUser' => [],
'exos' => [], // 'exos' => [],
'member' => [] // 'member' => []
]); // ]);
} // }
} //}

Loading…
Cancel
Save