Compare commits
7 Commits
master
...
Expérience
Author | SHA1 | Date |
---|---|---|
thomas muzard | 41042dc3be | 1 year ago |
thomas muzard | 8458f989a4 | 1 year ago |
thomas muzard | e8e947db5e | 1 year ago |
thomas muzard | dbb002924d | 1 year ago |
thomas muzard | 3948db64dc | 1 year ago |
thomas muzard | be693be91e | 1 year ago |
thomas muzard | 12f1078968 | 1 year ago |
@ -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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -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)
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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>
|
@ -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…
Reference in new issue