You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
2.1 KiB
84 lines
2.1 KiB
<?php
|
|
|
|
namespace App\modele;
|
|
|
|
use App\gateway\Connection;
|
|
use App\gateway\OffreGateway;
|
|
use App\metier\Alumni;
|
|
use App\metier\TypeContrat;
|
|
use App\metier\niveauEtudes;
|
|
use App\metier\Offre;
|
|
|
|
class OffreModele
|
|
{
|
|
|
|
private OffreGateway $offreGw;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->offreGw = new OffreGateway(new Connection("mysql:host=localhost;dbname=dbAlica", "test", "test"));
|
|
}
|
|
|
|
public function publierOffre($imgId)
|
|
{
|
|
|
|
$desc = $_POST["description"];
|
|
$descposte = $_POST["descriptPoste"];
|
|
$nom = $_POST["name"];
|
|
$ville = $_POST["ville"];
|
|
$entreprise = $_POST["entreprise"];
|
|
$profilRecherche = $_POST["profilRecherche"];
|
|
$mail = $_POST["mail"];
|
|
$num = $_POST["num"];
|
|
$site = $_POST["site"];
|
|
$exp = $_POST["choixExp"];
|
|
|
|
$typeContrat = $_POST["typeContrat"];
|
|
/* $typeContrat = match ($_POST["typeContrat"]) {
|
|
"Stage" => TypeContrat::Stage,
|
|
"CDI" => TypeContrat::CDI,
|
|
"CDD" => TypeContrat::CDD,
|
|
"Alternance" => TypeContrat::Alternance,
|
|
default => TypeContrat::CDD,
|
|
};*/
|
|
|
|
$niveauEtudes = $_POST["education"];
|
|
/* $niveauEtudes = match ($_POST["education"]) {
|
|
"Bac+2" => NiveauEtudes::Bac2,
|
|
"Bac+3" => NiveauEtudes::Bac3,
|
|
"Bac+5" => NiveauEtudes::Bac5,
|
|
default => NiveauEtudes::Indifferent,
|
|
};*/
|
|
|
|
if(isset($_POST["fullRemote"]))
|
|
{
|
|
$remote = true;
|
|
}
|
|
else {
|
|
$remote = false;
|
|
}
|
|
|
|
// à la place de NULL passer id utilisateur créateur offre
|
|
$offre = new Offre($this->offreGw->getMaxid(),
|
|
new Alumni(12,"test.mail@icloud.fr","password","admin"),
|
|
$nom,
|
|
$desc,
|
|
$imgId,
|
|
$typeContrat,
|
|
$ville,
|
|
$entreprise,
|
|
$descposte,
|
|
$profilRecherche,
|
|
$exp,
|
|
$niveauEtudes,
|
|
$mail,
|
|
$num,
|
|
$site,
|
|
$remote);
|
|
|
|
$this->offreGw->ajouterOffre($offre);
|
|
|
|
echo "offre inséerée";
|
|
}
|
|
|
|
} |