Skip to content

Commit

Permalink
debut profil php
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanCESI committed Mar 25, 2024
1 parent bc0c505 commit bb5611d
Show file tree
Hide file tree
Showing 912 changed files with 3,788 additions and 2,734 deletions.
34 changes: 33 additions & 1 deletion app/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use App\Controller\InternshipController;
use App\Entity\Appliement_WishList;
use App\Entity\Internship;
use App\Controller\ProfileController;
use App\Entity\Users;

use Doctrine\ORM\EntityManager;
use Psr\Http\Message\ResponseInterface as Response;
Expand Down Expand Up @@ -88,9 +90,39 @@
} else {
return $response->withStatus(404)->getBody()->write('Stage introuvable');
}
});

//----------- DEBUT PROFIL --------------//
$app->get('/Profile', function (Request $request, Response $response) use ($twig, $container){
$controller = new ProfileController($twig);
$profileResponse = $controller->Profile($request, $response,[], $container);
return $profileResponse;
});

$app->get('/Profile/{i}', function (Request $request, Response $response, array $args) use ($container) {

$entityManager = $container->get(EntityManager::class);
$User = $entityManager->getRepository(Users::class)->findOneBy(['ID_users' => $args['i']]);
if ($User != null) {
$data = [
'ID_users' => $User->getIDUsers(),
'Name' => $User->getName(),
'Surname' => $User->getSurname(),
'Birth_date' => $User->getBirthDate(),
'Profile_Description' => $User->getProfileDescription(),
'Email' => $User->getEmail(),
];
$payload = json_encode($data);

$response->getBody()->write($payload);
return $response->withHeader('Content-Type', 'application/json');
} else {
return $response->withStatus(404)->getBody()->write('Erreur d affichage du profil');
}

});
/*$app->group('/users', function (Group $group) {
$group->get('', ListUsersAction::class);
$group->get('/{id}', ViewUserAction::class);
});*/
};
};
2 changes: 1 addition & 1 deletion node_modules/@isaacs/cliui/index.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions node_modules/@nodelib/fs.scandir/out/index.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions node_modules/@nodelib/fs.scandir/out/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions node_modules/@nodelib/fs.scandir/out/providers/async.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions node_modules/@nodelib/fs.scandir/out/providers/async.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions node_modules/@nodelib/fs.scandir/out/providers/sync.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/@nodelib/fs.scandir/out/settings.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/@nodelib/fs.scandir/out/settings.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/@nodelib/fs.scandir/out/utils/index.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/@nodelib/fs.scandir/out/utils/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions node_modules/@nodelib/fs.stat/out/index.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions node_modules/@nodelib/fs.stat/out/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions node_modules/@nodelib/fs.stat/out/providers/async.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions node_modules/@nodelib/fs.stat/out/providers/sync.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/@nodelib/fs.stat/out/settings.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/@nodelib/fs.stat/out/settings.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions node_modules/@nodelib/fs.walk/out/index.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions node_modules/@nodelib/fs.walk/out/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions node_modules/@nodelib/fs.walk/out/providers/async.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/@nodelib/fs.walk/out/providers/async.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions node_modules/@nodelib/fs.walk/out/providers/index.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions node_modules/@nodelib/fs.walk/out/providers/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions node_modules/@nodelib/fs.walk/out/providers/stream.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/@nodelib/fs.walk/out/providers/stream.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions node_modules/@nodelib/fs.walk/out/providers/sync.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/@nodelib/fs.walk/out/providers/sync.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bb5611d

Please sign in to comment.