|
|
@ -4,6 +4,7 @@ namespace App\controleur;
|
|
|
|
use App\config\Validation;
|
|
|
|
use App\config\Validation;
|
|
|
|
use App\gateway\ImageManager;
|
|
|
|
use App\gateway\ImageManager;
|
|
|
|
use App\modele\MembreModele;
|
|
|
|
use App\modele\MembreModele;
|
|
|
|
|
|
|
|
use Exception;
|
|
|
|
|
|
|
|
|
|
|
|
class MembreControleur extends UtilisateurControleur
|
|
|
|
class MembreControleur extends UtilisateurControleur
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -135,11 +136,18 @@ class MembreControleur extends UtilisateurControleur
|
|
|
|
{
|
|
|
|
{
|
|
|
|
global $twig;
|
|
|
|
global $twig;
|
|
|
|
$profilModel = new MembreModele();
|
|
|
|
$profilModel = new MembreModele();
|
|
|
|
$profil = $profilModel->getFormationByProfil($_SESSION["id"]);
|
|
|
|
$experienceModel = new MembreModele();
|
|
|
|
var_dump($profil);
|
|
|
|
$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))
|
|
|
|
if(isset($profil))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
echo $twig->render("monProfil.html",['profil' => $profil]);
|
|
|
|
echo $twig->render("monProfil.html",['profil' => $profil, 'experience' => $exp, 'formation'=>$form]);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -150,6 +158,7 @@ class MembreControleur extends UtilisateurControleur
|
|
|
|
$formationModel = new MembreModele();
|
|
|
|
$formationModel = new MembreModele();
|
|
|
|
$form = $formationModel->getFormationByProfil($_SESSION["id"]);
|
|
|
|
$form = $formationModel->getFormationByProfil($_SESSION["id"]);
|
|
|
|
var_dump($form);
|
|
|
|
var_dump($form);
|
|
|
|
|
|
|
|
echo "Je rentre dans la formation";
|
|
|
|
if(isset($form))
|
|
|
|
if(isset($form))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
echo $twig->render("detailFormation.html",['formation' => $form]);
|
|
|
|
echo $twig->render("detailFormation.html",['formation' => $form]);
|
|
|
@ -166,25 +175,36 @@ class MembreControleur extends UtilisateurControleur
|
|
|
|
public function addFormation()
|
|
|
|
public function addFormation()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
global $twig;
|
|
|
|
global $twig;
|
|
|
|
|
|
|
|
try {
|
|
|
|
if (!Validation::validerFormation($_SESSION["id"], $_POST["nom"], $_POST["ville"], $_POST["dateDeb"], $_POST["dateFin"], $_POST["currentFormation"])) {
|
|
|
|
if (Validation::validerFormation($_SESSION["id"], $_POST["nom"], $_POST["ville"], $_POST["dateDeb"], $_POST["dateFin"], $_POST["currentFormation"])) {
|
|
|
|
$modele = new MembreModele();
|
|
|
|
$modele = new MembreModele();
|
|
|
|
$form = $modele->addExperience($_SESSION["id"], $_POST["nom"], $_POST["ville"], $_POST["dateDeb"], $_POST["dateFin"], $_POST["currentFormation"]);
|
|
|
|
$form = $modele->addExperience($_SESSION["id"], $_POST["nom"], $_POST["ville"], $_POST["dateDeb"], $_POST["dateFin"], $_POST["currentFormation"]);
|
|
|
|
var_dump($form);
|
|
|
|
var_dump($form);
|
|
|
|
$this->displayExperience($_SESSION["id"]);
|
|
|
|
$this->displayProfil($_SESSION["id"]);
|
|
|
|
echo $twig->render('creerFormation.html', ['formation' => $form]);
|
|
|
|
echo $twig->render('creerFormation.html', ['formation' => $form]);
|
|
|
|
} else {
|
|
|
|
} 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";
|
|
|
|
$dVueErreur[] ="Erreur lors de la création de la formation";
|
|
|
|
echo $twig->render("erreur.html",['dVueErreur' => $dVueErreur]);
|
|
|
|
echo $twig->render("erreur.html",['dVueErreur' => $dVueErreur]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function deleteFormation(?array $params)
|
|
|
|
public function deleteFormation(?array $params)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
global $twing;
|
|
|
|
global $twig;
|
|
|
|
|
|
|
|
try {
|
|
|
|
$mdl = new MembreModele();
|
|
|
|
$mdl = new MembreModele();
|
|
|
|
$mdl->deleteFormation($params['id2']);
|
|
|
|
$mdl->deleteFormation($params['id']);
|
|
|
|
$this->displayFormation($_SESSION["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()
|
|
|
|
public function displayExperience()
|
|
|
@ -192,7 +212,8 @@ class MembreControleur extends UtilisateurControleur
|
|
|
|
global $twig;
|
|
|
|
global $twig;
|
|
|
|
$experienceModel = new MembreModele();
|
|
|
|
$experienceModel = new MembreModele();
|
|
|
|
$exp = $experienceModel->getExperienceByProfil($_SESSION["id"]);
|
|
|
|
$exp = $experienceModel->getExperienceByProfil($_SESSION["id"]);
|
|
|
|
//var_dump($exp);
|
|
|
|
var_dump($exp);
|
|
|
|
|
|
|
|
echo "Je rentres dans les expériences";
|
|
|
|
if(isset($exp))
|
|
|
|
if(isset($exp))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
echo $twig->render("detailExperience.html",['experience' => $exp]);
|
|
|
|
echo $twig->render("detailExperience.html",['experience' => $exp]);
|
|
|
@ -209,26 +230,37 @@ class MembreControleur extends UtilisateurControleur
|
|
|
|
public function addExperience()
|
|
|
|
public function addExperience()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
global $twig;
|
|
|
|
global $twig;
|
|
|
|
|
|
|
|
try {
|
|
|
|
if (!Validation::validerExperience($_SESSION["id"], $_POST["intitule"], $_POST["dateDeb"], $_POST["dateFin"], $_POST["nomEntreprise"], $_POST["currentJob"])) {
|
|
|
|
if (Validation::validerExperience($_SESSION["id"], $_POST["intitule"], $_POST["dateDeb"], $_POST["dateFin"], $_POST["nomEntreprise"], $_POST["currentJob"]?? null)) {
|
|
|
|
$modele = new MembreModele();
|
|
|
|
$modele = new MembreModele();
|
|
|
|
$exp = $modele->addExperience($_SESSION["id"], $_POST["intitule"], $_POST["dateDeb"], $_POST["dateFin"], $_POST["nomEntreprise"], $_POST["currentJob"]);
|
|
|
|
$exp = $modele->addExperience($_SESSION["id"], $_POST["intitule"], $_POST["dateDeb"], $_POST["dateFin"], $_POST["nomEntreprise"], $_POST["currentJob"]?? null);
|
|
|
|
var_dump($exp);
|
|
|
|
// var_dump($exp);
|
|
|
|
$this->displayExperience($_SESSION["id"]);
|
|
|
|
$this->displayProfil($_SESSION["id"]);
|
|
|
|
echo $twig->render('creerExperience.html', ['experience' => $exp]);
|
|
|
|
echo $twig->render('creerExperience.html', ['experience' => $exp]);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$dVueErreur[] ="Erreur lors de la création de l'évènement";
|
|
|
|
$dVueErreur[] ="Veillez entrer des valeurs correctes";
|
|
|
|
echo $twig->render("erreur.html",['dVueErreur' => $dVueErreur]);
|
|
|
|
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)
|
|
|
|
public function deleteExperience(?array $params)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
global $twing;
|
|
|
|
global $twig;
|
|
|
|
|
|
|
|
try {
|
|
|
|
$mdl = new MembreModele();
|
|
|
|
$mdl = new MembreModele();
|
|
|
|
$mdl->deleteExperience($params['id2']);
|
|
|
|
$mdl->deleteExperience($params['id']);
|
|
|
|
$this->displayExperience($_SESSION["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]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|