parent
e8e947db5e
commit
8458f989a4
@ -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\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 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">Job 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,35 @@
|
||||
<!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>
|
||||
</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/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,50 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
{% if profil %}
|
||||
<title>{profil.getNom()} {profil.getprenom()} </title>
|
||||
{% endif %}
|
||||
<link rel="stylesheet" href="">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header>
|
||||
{% include "menu.html" %}
|
||||
</header>
|
||||
|
||||
<div>
|
||||
{% if profil %}
|
||||
<h1>Profil de : {{ profil.nom }} {{ profil.prenom }}</h1>
|
||||
<div>
|
||||
<p><strong>Nom :</strong> {{ profil.nom }}</p>
|
||||
<p><strong>Prenom :</strong> {{ profil.prenom }}</p>
|
||||
<p><strong> :</strong> </p>
|
||||
<p><strong> :</strong> </p>
|
||||
|
||||
<!-- Modification du profil -->
|
||||
<a href="{{dir}}/user/displayProfil">Modifier profil</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<p>Error Profil</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<!-- Partie expérience de l'utilisateur -->
|
||||
{% include "detailExperience.html" %}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<!-- 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