Compare commits

...

7 Commits

@ -0,0 +1,48 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 0,
"runtimeArgs": [
"-dxdebug.start_with_request=yes"
],
"env": {
"XDEBUG_MODE": "debug,develop",
"XDEBUG_CONFIG": "client_port=${port}"
}
},
{
"name": "Launch Built-in web server",
"type": "php",
"request": "launch",
"runtimeArgs": [
"-dxdebug.mode=debug",
"-dxdebug.start_with_request=yes",
"-S",
"localhost:0"
],
"program": "",
"cwd": "${workspaceRoot}",
"port": 9003,
"serverReadyAction": {
"pattern": "Development Server \\(http://localhost:([0-9]+)\\) started",
"uriFormat": "http://localhost:%s",
"action": "openExternally"
}
}
]
}

@ -96,6 +96,50 @@ class Validation
return false;
}
public static function validerExperience(int $idProfil, string $intitule, string $dateDeb, ?string $dateFin, string $nomEntreprise, ?bool $currendJob)
{
if(!empty($idProfil) && !empty($intitule) && !empty($dateDeb) && !empty($nomEntreprise))
{
self::nettoyerString($intitule, $dateDeb, $nomEntreprise);
if ($currendJob == false) {
if (!empty($dateFin)) {
self::nettoyerString($dateFin);
return true;
}
return false;
/*} else {
if (empty($dateFin)) {
return true;
}
return false;
*/}
return true;
}
return false;
}
public static function validerFormation(int $idProfil, string $nom, string $ville, string $dateDeb, ?string $dateFin, ?bool $currendFormation)
{
if(!empty($idProfil) && !empty($nom)&& !empty($ville) && !empty($dateDeb))
{
self::nettoyerString($nom, $dateDeb, $ville);
if ($currendFormation == false) {
if (!empty($dateFin)) {
self::nettoyerString($dateFin);
return true;
}
return false;
} else {
if (empty($dateFin)) {
return true;
}
return false;
}
return true;
}
return false;
}
public static function validateNumber($number) : bool
{
if(preg_match("/^[0-9]{10}$/", $number))
@ -154,5 +198,4 @@ class Validation
}
return null;
}
}

@ -5,6 +5,7 @@ namespace App\controleur;
use App\router\AltoRouter;
use App\controleur\Error;
use ErrorException;
class FrontControleur
{
@ -18,7 +19,7 @@ class FrontControleur
$_SESSION['nom'] = NULL;
$_SESSION['prenom'] = NULL;
$_SESSION['role'] = "guest";
$_SESSION['id'] = NULL;
$_SESSION['id'] = "ttttttttttttttttttttt";
}
else{
$twig->addGlobal('nom', $_SESSION['nom']);
@ -117,14 +118,14 @@ class FrontControleur
echo $twig->render('accueil.html');
}
} catch (Error $error) {
} catch (ErrorException $error) {
$dVueErreur = ['Erreur : Action inconnue'];
echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]);
}
}
}
catch(Error $e)
catch(ErrorException $e)
{
$dVueErreur = ['Erreur : Action inconnue'];

@ -4,6 +4,7 @@ namespace App\controleur;
use App\config\Validation;
use App\gateway\ImageManager;
use App\modele\MembreModele;
use Exception;
class MembreControleur extends UtilisateurControleur
{
@ -12,13 +13,13 @@ class MembreControleur extends UtilisateurControleur
public function deconnexion()
{
global $twig;
session_unset();
session_destroy();
header("Location: /SAE_2A_FA-Reseau_ALICA/php/");
exit();
}
public function createOfferForm()
{
global $twig;
@ -101,7 +102,7 @@ class MembreControleur extends UtilisateurControleur
$MemberModel->deleteOffer($offre);
}
$this->consultOffers();
$this->consultOffers(null);
/*$offre = $MemberModel->getOfferFromId($id);
@ -115,20 +116,152 @@ class MembreControleur extends UtilisateurControleur
}
public function proposerOffre()
{
//TODO
}
public function consulterProfil()
{
//TODO
}
public function modifierProfil()
{
//TODO
}
public function signaler()
{
//TODO
echo "not implement yet";
}
public function displayProfil()
{
global $twig;
$profilModel = new MembreModele();
$experienceModel = new MembreModele();
$formationModel = new MembreModele();
$profil = $profilModel->getProfilById($_SESSION["id"]);
//var_dump($profil);
$exp = $experienceModel->getExperienceByProfil($_SESSION["id"]);
//var_dump($exp);
$form = $formationModel->getFormationByProfil($_SESSION["id"]);
// var_dump($profil);
if(isset($profil))
{
echo $twig->render("monProfil.html",['profil' => $profil, 'experience' => $exp, 'formation'=>$form]);
return;
}
}
public function displayFormation()
{
global $twig;
$formationModel = new MembreModele();
$form = $formationModel->getFormationByProfil($_SESSION["id"]);
var_dump($form);
echo "Je rentre dans la formation";
if(isset($form))
{
echo $twig->render("detailFormation.html",['formation' => $form]);
return;
}
}
public function formationForm()
{
global $twig;
echo $twig->render("creerFormation.html", []);
}
public function addFormation()
{
global $twig;
try {
if (Validation::validerFormation($_SESSION["id"], $_POST["nom"], $_POST["ville"], $_POST["dateDeb"], $_POST["dateFin"], $_POST["currentFormation"])) {
$modele = new MembreModele();
$form = $modele->addExperience($_SESSION["id"], $_POST["nom"], $_POST["ville"], $_POST["dateDeb"], $_POST["dateFin"], $_POST["currentFormation"]);
var_dump($form);
$this->displayProfil($_SESSION["id"]);
echo $twig->render('creerFormation.html', ['formation' => $form]);
} else {
$dVueErreur[] ="Veillez entrer des valeurs correctes";
echo $twig->render("erreur.html",['dVueErreur' => $dVueErreur]);
}
} catch(Exception $e) {
$dVueErreur[] ="Erreur lors de la création de la formation";
echo $twig->render("erreur.html",['dVueErreur' => $dVueErreur]);
}
}
}
public function deleteFormation(?array $params)
{
global $twig;
try {
$mdl = new MembreModele();
$mdl->deleteFormation($params['id']);
$this->displayProfil($_SESSION["id"]);
} catch(Exception $e) {
$dVueErreur[] ="Erreur lors de la supression de la formation";
echo $twig->render("erreur.html",['dVueErreur' => $dVueErreur]);
}
}
public function displayExperience()
{
global $twig;
$experienceModel = new MembreModele();
$exp = $experienceModel->getExperienceByProfil($_SESSION["id"]);
var_dump($exp);
echo "Je rentres dans les expériences";
if(isset($exp))
{
echo $twig->render("detailExperience.html",['experience' => $exp]);
return;
}
}
public function experienceForm()
{
global $twig;
echo $twig->render("creerExperience.html", []);
}
public function addExperience()
{
global $twig;
try {
if (Validation::validerExperience($_SESSION["id"], $_POST["intitule"], $_POST["dateDeb"], $_POST["dateFin"], $_POST["nomEntreprise"], $_POST["currentJob"]?? null)) {
$modele = new MembreModele();
$exp = $modele->addExperience($_SESSION["id"], $_POST["intitule"], $_POST["dateDeb"], $_POST["dateFin"], $_POST["nomEntreprise"], $_POST["currentJob"]?? null);
// var_dump($exp);
$this->displayProfil($_SESSION["id"]);
echo $twig->render('creerExperience.html', ['experience' => $exp]);
} else {
$dVueErreur[] ="Veillez entrer des valeurs correctes";
echo $twig->render("erreur.html",['dVueErreur' => $dVueErreur]);
}
} catch (Exception $e){
$dVueErreur[] ="Erreur lors de la création de l'expérience";
echo $twig->render("erreur.html",['dVueErreur' => $dVueErreur]);
}
}
public function deleteExperience(?array $params)
{
global $twig;
try {
$mdl = new MembreModele();
$mdl->deleteExperience($params['id']);
$this->displayProfil($_SESSION["id"]);
} catch(Exception $e) {
$dVueErreur[] ="Erreur lors de la supression de l'expérience ";
echo $twig->render("erreur.html",['dVueErreur' => $dVueErreur]);
}
}
}

@ -186,7 +186,7 @@ class UtilisateurControleur
{
global $twig;
if (isset($params['id']) && intval($params['id']) != null)
if (isset($params['id']) && ($params['id']) != null)
{
$uttilsMdl = new UtilisateurModele();
$offre = $uttilsMdl->getOfferFromId(intval($params["id"]));

@ -0,0 +1,78 @@
<?php
namespace App\gateway;
use App\metier\Profil;
use App\metier\Experience;
class ExperienceGateway
{
private \App\gateway\Connection $con;
/**
* @param $con
*/
public function __construct(\App\gateway\Connection $con){
$this->con = $con;
}
public function getNewId() : int
{
$query='SELECT MAX(id) FROM Experience';
$this->con->executeQuery($query);
$res=$this->con->getResults();
return $res[0]['MAX(id)']+1;
}
public function getNbExperience(): int
{
$query = 'SELECT COUNT(*) FROM Experience';
$this->con->executeQuery($query, array());
$res = $this->con->getResults();
return intval($res[0]['COUNT(*)']);
}
public function getExperienceFromId(int $id) : array
{
$query = "SELECT * FROM experience WHERE id=:id";
$this->con->executeQuery($query, array(
':id' => array($id, \PDO::PARAM_INT)
));
return $this->con->getResults();
}
public function getExperienceFromProfil(int $profil) : array
{
$query = "SELECT * FROM experience WHERE profil=:profil" ;
$this->con->executeQuery($query, array(
':profil' => array($profil, \PDO::PARAM_INT)
));
// var_dump($profil);
// var_dump($this->con->getResults());
return $this->con->getResults();
}
public function addExperience(Experience $exp)
{
$query = 'INSERT INTO experience VALUES (:id, :profil, :intitule, :dateBegin, :dateEnd, :nameIndustry, :currentJobb)';
$this->con->executeQuery($query, array(
':id' => array($exp->getId(), \PDO::PARAM_INT),
//':profil' => array($exp->getProfil(), \PDO::PARAM_INT),
':profil' => array(33,\PDO::PARAM_INT),
':intitule' => array($exp->getIntitule(), \PDO::PARAM_STR),
':dateBegin' => array($exp->getDateDebut(), \PDO::PARAM_STR),
':dateEnd' => array($exp->getDateFin(), \PDO::PARAM_STR),
':nameIndustry' => array($exp->getNomEntreprise(), \PDO::PARAM_STR),
':currentJobb' => array($exp->isTravailActuel(), \PDO::PARAM_BOOL),
));
}
public function deleteExperience(int $id)
{
$query = 'DELETE FROM experience WHERE id=:id';
$this->con->executeQuery($query, array(
':id' => array($id, \PDO::PARAM_INT)
));
}
}

@ -0,0 +1,78 @@
<?php
namespace App\gateway;
use App\metier\Profil;
use App\metier\Formation;
class FormationGateway
{
private \App\gateway\Connection $con;
/**
* @param $con
*/
public function __construct(\App\gateway\Connection $con){
$this->con = $con;
}
public function getNewId() : int
{
$query='SELECT MAX(id) FROM Formation';
$this->con->executeQuery($query);
$res=$this->con->getResults();
return $res[0]['MAX(id)']+1;
}
public function getNbFormation(): int
{
$query = 'SELECT COUNT(*) FROM Formation';
$this->con->executeQuery($query, array());
$res = $this->con->getResults();
return intval($res[0]['COUNT(*)']);
}
public function getFormationFromId(int $id) : array
{
$query = "SELECT * FROM Formation WHERE id=:id";
$this->con->executeQuery($query, array(
':id' => array($id, \PDO::PARAM_INT)
));
return $this->con->getResults();
}
public function getFormationFromProfil(int $profil) : array
{
$query = "SELECT * FROM Formation WHERE profil=:profil" ;
$this->con->executeQuery($query, array(
':profil' => array($profil, \PDO::PARAM_INT)
));
// var_dump($profil);
// var_dump($this->con->getResults());
return $this->con->getResults();
}
public function addFormation(Formation $form)
{
$query = 'INSERT INTO Formation VALUES (:id, :profil, :nom, :ville,:dateDeb, :dateFin, :currentFormation)';
$this->con->executeQuery($query, array(
':id' => array($form->getId(), \PDO::PARAM_INT),
//':profil' => array($exp->getProfil(), \PDO::PARAM_INT),
':profil' => array(33,\PDO::PARAM_INT),
':nom' => array($form->getNom(), \PDO::PARAM_STR),
':ville' => array($form->getville(), \PDO::PARAM_STR),
':dateBegin' => array($form->getDateDebut(), \PDO::PARAM_STR),
':dateEnd' => array($form->getDateFin(), \PDO::PARAM_STR),
':currentFormation' => array($form->isFormationActuelle(), \PDO::PARAM_BOOL),
));
}
public function deleteFormation(int $id)
{
$query = 'DELETE FROM Formation WHERE id=:id';
$this->con->executeQuery($query, array(
':id' => array($id, \PDO::PARAM_INT)
));
}
}

@ -11,7 +11,7 @@ class Experience
/**
* @var Profil profil
*/
private Profil $profil;
private int $profil;
/**
* @var string Intitule
@ -34,20 +34,20 @@ class Experience
private string $nomEntreprise;
/**
* @var bool Travail Actuel
* @var ?bool Travail Actuel
*/
private bool $travailActuel;
private ?bool $travailActuel;
/**
* @param int $id
* @param Profil $profil
* @param int $profil
* @param string $intitule
* @param string $dateDebut
* @param string $dateFin
* @param string $nomEntreprise
* @param bool $travailActuel
*/
public function __construct(int $id, Profil $profil, string $intitule, string $dateDebut, string $dateFin, string $nomEntreprise, bool $travailActuel)
public function __construct(int $id, int $profil, string $intitule, string $dateDebut, string $dateFin, string $nomEntreprise, ?bool $travailActuel)
{
$this->id = $id;
$this->profil = $profil;
@ -63,9 +63,14 @@ class Experience
return $this->id;
}
public function getProfil(): Profil
/*public function getProfil(): Profil
{
return $this->profil;
}*/
public function getProfilId(): int
{
return $this->profil->getId();
}
public function getIntitule(): string
@ -88,8 +93,8 @@ class Experience
return $this->nomEntreprise;
}
public function isTravailActuel(): bool
public function isTravailActuel(): ?bool
{
return $this->travailActuel;
return $this->travailActuel ?? null;
}
}

@ -11,7 +11,7 @@ class Formation
/**
* @var Profil profil
*/
private Profil $profil;
private int $profil;
/**
* @var string Nom
@ -36,18 +36,18 @@ class Formation
/**
* @var bool Formation Actuelle
*/
private bool $formationActuelle;
private ?bool $formationActuelle;
/**
* @param int $id
* @param Profil $profil
* @param int $profil
* @param string $nom
* @param string $ville
* @param string $dateDebut
* @param string $dateFin
* @param bool $formationActuelle
*/
public function __construct(int $id, Profil $profil, string $nom, string $ville, string $dateDebut, string $dateFin, bool $formationActuelle)
public function __construct(int $id, int $profil, string $nom, string $ville, string $dateDebut, string $dateFin, bool $formationActuelle)
{
$this->id = $id;
$this->profil = $profil;
@ -63,10 +63,17 @@ class Formation
return $this->id;
}
/*
public function getProfil(): Profil
{
return $this->profil;
}
*/
public function getProfilId(): int
{
return $this->profil->getId();
}
public function getNom(): string
{
@ -88,8 +95,8 @@ class Formation
return $this->dateFin;
}
public function isFormationActuelle(): bool
public function isFormationActuelle(): ?bool
{
return $this->formationActuelle;
return $this->formationActuelle ?? null;
}
}

@ -1,6 +1,8 @@
<?php
namespace App\metier;
use App\metier\Alumni;
class Profil
{
/**
@ -8,18 +10,16 @@ class Profil
*/
private int $id;
/**
* @var string CV
*/
private string $cv;
private ?string $cv;
/**
* @var string Nom
*/
private string $nom;
/**
* @var string Prenom
*/
@ -31,17 +31,27 @@ class Profil
*/
//image can be null
private ?string $image;
private string $linkedinUrl;
private ?string $linkedinUrl;
/**
* @var string Url github
*/
private string $githubUrl;
private ?string $githubUrl;
/**
* @var string Url du portfolio
*/
private string $portfolioUrl;
private ?string $portfolioUrl;
/**
*@var array liste des formation d'un profil
*/
// private array $listeFormation;
/**
* @var array liste des expériences d'un profil
*/
// private array $listeExperience;
/**
* @param string $cv
@ -51,9 +61,9 @@ class Profil
* @param string $githubUrl
* @param string $portfolioUrl
*/
public function __construct(int $alumni,string $nom, string $prenom, string $email, ?string $image,string $cv, string $linkedinUrl, string $githubUrl, string $portfolioUrl)
public function __construct(int $idProfil,string $nom, string $prenom, string $email, ?string $image, ?string $cv, ?string $linkedinUrl, ?string $githubUrl, ?string $portfolioUrl)
{
$this->id = $alumni;
$this->id = $idProfil;
$this->nom = $nom;
$this->prenom = $prenom;
$this->image = $image;
@ -62,6 +72,8 @@ class Profil
$this->linkedinUrl = $linkedinUrl;
$this->githubUrl = $githubUrl;
$this->portfolioUrl = $portfolioUrl;
// $this->listeFormation = null;
// $this->listeExperience = null;
}
@ -69,13 +81,20 @@ class Profil
{
return $this->id;
}
/*public function getAlmuni(): Alumni
{
return $this->alumni;
}*/
public function getImage(): ?string
{
return $this->image ?? 'logo.png';
}
public function getCv(): string
public function getCv(): ?string
{
return $this->cv;
return $this->cv ?? null;
}
public function getNom(): string
@ -88,22 +107,22 @@ class Profil
return $this->prenom;
}
public function getLinkedinUrl(): string
public function getLinkedinUrl(): ?string
{
return $this->linkedinUrl;
return $this->linkedinUrl ?? null;
}
public function getGithubUrl(): string
public function getGithubUrl(): ?string
{
return $this->githubUrl;
return $this->githubUrl ?? null;
}
public function getEmail(): string
{
return $this->email;
}
public function getPortfolioUrl(): string
public function getPortfolioUrl(): ?string
{
return $this->portfolioUrl;
return $this->portfolioUrl ?? null;
}
}

@ -5,10 +5,29 @@ namespace App\modele;
use App\gateway\ImageManager;
use App\metier\Alumni;
use App\metier\Offre;
use App\metier\Experience;
use App\metier\Formation;
use App\metier\Profil;
use App\gateway\Connection;
use App\gateway\ExperienceGateway;
use App\gateway\FormationGateway;
use App\gateway\ProfilGateway;
class MembreModele extends UtilisateurModele
{
private $con;
protected $experienceGw;
protected $formationGw;
protected $profilGw;
public function __construct()
{
$this->con = new Connection(DB_HOST,DB_USER,DB_PASS);
$this->experienceGw = new ExperienceGateway($this->con);
$this->formationGw = new FormationGateway($this->con);
$this->profilGw = new ProfilGateway($this->con);
}
/**
* @description modifier photo de profil
@ -19,38 +38,170 @@ class MembreModele extends UtilisateurModele
return false;
}
/**
* @description ajouter formation
* @description modifier formation
*
*/
public function addFormation() : bool
public function updateFormation() : bool
{
// TO DO
return false;
}
public function getProfilById($idProfil) : ?array
{
$data = $this->profilGw->getProfilById($idProfil);
$profil = array();
foreach($data as $row)
{
$profil[] = new Profil(
$row['id'],
$row['nom'],
$row['prenom'],
$row['email'],
$row['image'] ?? null,
$row['cv'] ?? null,
$row['linkedinURL'] ?? null,
$row['githubURL'] ?? null,
$row['portfolioURL'] ?? null
);
}
return $profil;
}
/**
* @description modifier formation
* @description Récupérer l'expériences en fonction de l'id
*/
public function updateFormation() : bool
public function getExperienceById($idProfil) : ?array
{
// TO DO
return false;
$data = $this->experienceGw->getExperienceFromId($idProfil);
$experience = array();
foreach($data as $row)
{
$experience[] = new Experience(
$row['id'],
$row['profil'],
$row['intitule'],
$row['dateBegin'],
$row['dateEnd'],
$row['industryName'],
$row['currentJob']
);
}
return $experience;
}
/**
* @description Récupérer les expériences de l'utilisateurs en cours
*/
public function getExperienceByProfil($idProfil) : ?array
{
$data = $this->experienceGw->getExperienceFromProfil($idProfil);
$experience = array();
// var_dump($data);
foreach($data as $row)
{
$experience[] = new Experience(
$row['id'],
$row['profil'],
$row['intitule'],
$row['dateDebut'],
$row['dateFin'],
$row['nomEntreprise'],
$row['currentJob']
);
}
// var_dump($experience);
return $experience;
}
/**
* @description ajouter Experience
*/
public function addExperience() : bool
public function addExperience($idExperience, string $intitule, string $dateDeb, string $dateFin, string $nomEntreprise, ?string $currentJob)
{
// TO DO
return false;
$exp = new Experience(
$this->experienceGw->getNewId(),
$idExperience,
$intitule,
$dateDeb,
$dateFin,
$nomEntreprise,
$currentJob
);
var_dump($exp);
$this->experienceGw->addExperience($exp);
}
/**
* @description supprimer une expérience
*/
public function deleteExperience($id)
{
$this->experienceGw->deleteExperience($id);
}
/**
* @description Récupérer les formations de l'utilisateurs en cours
*/
public function getFormationByProfil($idProfil) : ?array
{
$data = $this->formationGw->getFormationFromProfil($idProfil);
$formation = array();
// var_dump($data);
foreach($data as $row)
{
$formation[] = new Formation(
$row['id'],
$row['profil'],
$row['nom'],
$row['ville'],
$row['dateDeb'],
$row['dateFin'],
$row['currentFormation']
);
}
// var_dump($formation);
return $formation;
}
/**
* @description ajouter une formation
*/
public function addFormation($idExperience, string $nom, string $ville, string $dateDeb, string $dateFin, ?string $currentFormation)
{
$form = new Formation(
$this->experienceGw->getNewId(),
$idExperience,
$nom,
$ville,
$dateDeb,
$dateFin,
$currentFormation
);
$this->formationGw->addFormation($form);
}
/**
* @description supprimer une formation
*/
public function deleteFormation($id)
{
$this->formationGw->deleteFormation($id);
}
/**
* @description modifier experience
*/
public function updateExpereience() : bool
public function updateExperience() : bool
{
// TO DO
return false;

@ -0,0 +1,52 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ajouter une expérience</title>
<link rel="stylesheet" href="">
</head>
<body>
<div>
<h1>Ajouter une expérience</h1>
<form action="{{dir}}/user/addExperience" method="POST" enctype="multipart/form-data">
<div>
<label for="intitule">Intitule :</label>
<input type="text" id="intitule" name="intitule" required>
</div>
<div>
<label for="dateDeb">Date de début :</label>
<input type="date" id="dateDeb" name="dateDeb" required>
</div>
<div>
<label for="dateFin">Date de fin :</label>
<input type="date" id="dateFin" name="dateFin">
</div>
<div>
<label for="nomEntreprise">Nom de l'entreprise :</label>
<input type="text" id="nomEntreprise" name="nomEntreprise" required>
</div>
<div>
<label for="currentJob">Job en cours ? :</label>
<input type="checkbox" name="currentJob" id="currentJob">
</div>
<div>
<input type="submit" value="user/addExperience">
</div>
</form>
<a href="{{dir}}/user/displayExperience">Retour</a>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.3/dist/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>

@ -0,0 +1,52 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ajouter une foramtion</title>
<link rel="stylesheet" href="">
</head>
<body>
<div>
<h1>Ajouter une formation</h1>
<form action="{{dir}}/user/addFormation" method="POST" enctype="multipart/form-data">
<div>
<label for="nom">Nom :</label>
<input type="text" id="nom" name="nom" required>
</div>
<div>
<label for="ville">Ville :</label>
<input type="text" id="ville" name="ville" required>
</div>
<div>
<label for="dateDeb">Date de début :</label>
<input type="date" id="dateDeb" name="dateDeb" required>
</div>
<div>
<label for="dateFin">Date de fin :</label>
<input type="date" id="dateFin" name="dateFin">
</div>
<div>
<label for="currentFormation">Formation en cours ? :</label>
<input type="checkbox" name="currentFormation" id="currentFormation">
</div>
<div>
<input type="submit" value="addFormation">
</div>
</form>
<a href="{{dir}}/user/displayFormation">Retour</a>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.3/dist/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Experience</title>
<link rel="stylesheet" href="">
</head>
<body>
<div>
{% if experience %}
{% for exp in experience %}
<h2>Détails de l'expérience : {{exp.getIntitule()}}</h2>
<div>
<p><strong>nom de l'entreprise :</strong> {{ exp.getNomEntreprise() }}</p>
<p><strong>Date de début :</strong> {{ exp.getDateDebut() }}</p>
<p><strong>Date de fin :</strong> {{ exp.getDateFin }}</p>
<p><strong>Job en cours ? :</strong> {{ exp.isTravailActuel() }}</p>
</div>
<a href="{{dir}}/user/{{exp.getId}}/deleteExperience">Supprimer cette experience</a>
{% endfor %}
{% else %}
<p>Aucune expérience n'a été ajouté</p>
{% endif %}
</div>
<div>
<a href="{{dir}}/user/experienceForm">Ajouter Experience</a>
<br>
<a href="{{dir}}/user/displayProfil">Retour</a>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.3/dist/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Formation</title>
<link rel="stylesheet" href="">
</head>
<body>
<div>
{% if formation %}
{% for form in formation %}
<h2>Détails de la formation : {{form.getNom()}}</h2>
<div>
<p><strong>ville :</strong> {{ form.getVille() }}</p>
<p><strong>Date de début :</strong> {{ form.getDateDebut() }}</p>
<p><strong>Date de fin :</strong> {{ form.getDateFin }}</p>
<p><strong>Formation en cours ? :</strong> {{ form.isFormationActuelle() }}</p>
<a href="{{dir}}/user/{{form.getId}}/deleteFormation">Supprimer cette formation</a>
</div>
{% endfor %}
{% else %}
<p>Aucune formation n'a été ajouté.</p>
{% endif %}
</div>
<div>
<a href="{{dir}}/user/FormationForm">Ajouter Formation</a>
<br>
<a href="{{dir}}/user/displayProfil">Retour</a>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.3/dist/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>

@ -0,0 +1,51 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Mes Expérience(s)</title>
<link rel="stylesheet" href="">
</head>
<body>
<header>
{% include "menu.html" %}
</header>
<div>
<div>
<h1>Mes Expériences</h1>
<a href="../public/index.php?action=ajouterExperience">Ajouter une expérience</a>
</div>
<ul>
{% if experience is not empty %}
{% for experience in experiences %}
<li>
<div>
<h2>{{ experience.intitule }}</h2>
<p> <strong>nom de l'entreprise :</strong> {{ experience.getNomEntreprise() }}</p>
<p><strong>Date début :</strong> {{ experience.getDateDebut }}</p>
<p><strong>Date de fin:</strong> {{ experience.getDateFin }}</p>
<p><strong>Travail actuel :</strong> {{ experience.isTravailActuel }}</p>
</div>
<form action="../public/index.php?action=supprimerExperience&id={{ experience.id }}" method="POST">
<button type="submit" id="deleteButton">
<img src="assets/close.png" alt="Supprimer" width="20px">
</button>
</form>
</li>
{% endfor %}
{% else %}
<li>Aucun événement trouvé.</li>
{% endif %}
</ul>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.3/dist/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>

@ -27,7 +27,7 @@
<!-- Afficher boutons de connexion et d'inscription -->
{% if nom and prenom %}
<!-- Afficher bouton de déconnexion -->
<a href="index.php?action=displayExperience">Mon profil</a>
<a href="{{dir}}/user/displayProfil">Mon profil</a>
<a href="{{dir}}/user/deconnexion" class="button">Déconnexion</a>
{% else %}
<div class="login-register">

@ -0,0 +1,52 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title> Mon profil </title>
<link rel="stylesheet" href="">
</head>
<body>
<header>
{% include "menu.html" %}
</header>
<div>
{% if profil %}
<!-- <p>{{ dump(profil) }}</p> -->
<!-- By Thomas -->
<!-- Je ne comprends pas pourquoi le contenu du profil ne s'affiche pas -->
<h1>Profil de : {{ profil.getNom() }} {{ profil.getPrenom() }}</h1>
<div>
<p><strong>Mail :</strong> {{ profil.getEmail() }}</p>
<p><strong>Linkedin :</strong> {{ profil.getLinkedinUrl() }}</p>
<p><strong>Git :</strong> {{ profil.getGithubUrl() }}</p>
<p><strong>Portforlio :</strong> {{ profil.getPortfolioUrl() }}</p>
<!-- Modification du profil -->
</div>
{% else %}
<p>Error Profil</p>
{% endif %}
</div>
<div>
<h1> Mes expériences </h1>
<!-- Partie expérience de l'utilisateur -->
{% include "detailExperience.html" %}
</div>
<div>
<h1> Mes formations </h1>
<!-- Partie formation de l'utilisateur -->
{% include "detailFormation.html" %}
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.3/dist/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>
Loading…
Cancel
Save