modification image saver gestion cas image nom existant

offres2
Baptiste D 1 year ago
parent 803f898499
commit b4127bb330

@ -1,6 +1,3 @@
<IfModule mod_rewrite.c> RewriteEngine on
RewriteEngine On
RewriteBase /php/public/
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L] RewriteRule . index.php [L]
</IfModule>

@ -0,0 +1,15 @@
<?php
/** PC IUT - PHP 8.1 */
/** Chargement config */
require_once __DIR__ . '/src/config/config.php';
require __DIR__ . '/vendor/autoload.php';
/** Configuration twig */
$loader = new \Twig\Loader\FilesystemLoader(__DIR__ . '/templates');
$twig = new \Twig\Environment($loader, [
'cache' => false,
'debug' => true
]);
$twig->addExtension(new \Twig\Extension\DebugExtension());
$cont = new \App\controleur\FrontControleur();

@ -1,16 +0,0 @@
<?php
/** PC IUT - PHP 8.1 */
/** Chargement config */
require_once __DIR__ . '/../src/config/config.php';
require __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../src/TwigExtensions.php'; // utile pour les images à supprimer sinon
/** Configuration twig */
$loader = new \Twig\Loader\FilesystemLoader(__DIR__ . '/../templates');
$twig = new \Twig\Environment($loader, [
'cache' => false,
'debug' => true
]);
$twig->addExtension(new \Twig\Extension\DebugExtension());
$cont = new \App\controleur\FrontControleur();

@ -1,24 +0,0 @@
<?php
namespace App;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
class TwigExtensions extends AbstractExtension
{
public function getFilters()
{
return [
new TwigFilter('base64', [$this, 'twig_base64_filter']),
];
}
public function twig_base64_filter($source)
{
if ($source !== null) {
return base64_encode($source);
}
return '';
}
}

@ -4,22 +4,22 @@ namespace App\controleur;
use App\config\Validation; use App\config\Validation;
use App\gateway\Connection; use App\gateway\Connection;
use App\gateway\ImageGateway;
use App\gateway\ImageSaver; use App\gateway\ImageSaver;
use App\gateway\OffreGateway; use App\gateway\OffreGateway;
use App\metier\Image; use App\modele\UtilisateurModele;
use App\modele\OffreModele;
use App\modele\ImageModele;
use App\TwigExtensions;
use APp\config; use App\config;
class UtilisateurControleur class UtilisateurControleur
{ {
private \App\modele\UtilisateurModele $userModel;
public function __construct() public function __construct()
{ {
global $twig; global $twig;
$this->userModel = new \App\modele\UtilisateurModele();
if (!isset($_REQUEST["action"])) { if (!isset($_REQUEST["action"])) {
//$action = NULL; //$action = NULL;
$action = "consultOffers"; $action = "consultOffers";
@ -160,7 +160,7 @@ class UtilisateurControleur
protected function consultOffers() protected function consultOffers()
{ {
$offerMdl = new OffreModele();
global $twig; global $twig;
@ -183,14 +183,14 @@ class UtilisateurControleur
} }
if ($niveauEtudes == null && $typeContrat == null && $exp == null) { if ($niveauEtudes == null && $typeContrat == null && $exp == null) {
$totalOffers = $offerMdl->getNbOffers(); $totalOffers = $this->userModel->getNbOffers();
} else { } else {
$params = array( $params = array(
'typeContrat' => $typeContrat, 'typeContrat' => $typeContrat,
'exp' => $exp, 'exp' => $exp,
'niveauEtudes' => $niveauEtudes, 'niveauEtudes' => $niveauEtudes,
); );
$offers = $offerMdl->getOffersWithFilters($params); $offers = $this->userModel->getOffersWithFilters($params);
$totalOffers = count($offers); $totalOffers = count($offers);
} }
@ -217,11 +217,11 @@ class UtilisateurControleur
$start = intval(($page - 1) * 5); $start = intval(($page - 1) * 5);
if ($niveauEtudes == null && $typeContrat == null && $exp == null) { if ($niveauEtudes == null && $typeContrat == null && $exp == null) {
$offers = $offerMdl->getOfferLimit($start, $nbOffers); $offers = $this->userModel->getOfferLimit($start, $nbOffers);
} else { } else {
$params['start'] = $start; $params['start'] = $start;
$params['nbOffers'] = 5; $params['nbOffers'] = 5;
$offers = $offerMdl->getOffersWithFilters($params); $offers = $this->userModel->getOffersWithFilters($params);
} }
/* echo "filtre :".$niveauEtudes."<br>"; /* echo "filtre :".$niveauEtudes."<br>";
@ -303,10 +303,8 @@ class UtilisateurControleur
$saveImg1 = ImageSaver::SaveImage("image"); $saveImg1 = ImageSaver::SaveImage("image");
$saveImg2 = ImageSaver::SaveImage("logo"); $saveImg2 = ImageSaver::SaveImage("logo");
if($saveImg1[0] && $saveImg2[0]) { if($saveImg1[0] && $saveImg2[0]) {
$offreMdl = new OffreModele();
$offre = $offreMdl->publishOffer($saveImg1[1], $saveImg2[1]); $offre = $this->userModel->publishOffer($saveImg1[1], $saveImg2[1]);
echo $twig->render("OffreDetailTest.html", ['offre' => $offre]); echo $twig->render("OffreDetailTest.html", ['offre' => $offre]);
} }
@ -324,8 +322,7 @@ class UtilisateurControleur
if (isset($_GET["id"]) && intval($_GET["id"]) != null) if (isset($_GET["id"]) && intval($_GET["id"]) != null)
{ {
$offreMdl = new OffreModele(); $offre = $this->userModel->getOfferFromId(intval($_GET["id"]));
$offre = $offreMdl->getOfferFromId(intval($_GET["id"]));
if($offre != NULL) if($offre != NULL)
{ {
echo $twig->render("OffreDetailTest.html",['offre' => $offre]); echo $twig->render("OffreDetailTest.html",['offre' => $offre]);

@ -1,74 +0,0 @@
<?php
namespace App\gateway;
use App\metier\Image;
use PDO;
class ImageGateway
{
private Connection $con;
/**
* @param $con
*/
public function __construct(Connection $con)
{
$this->con = $con;
}
public function insertImage(Image $img)
{
$query = "INSERT INTO Image (`nom`, `taille`, `type`, `blob`) VALUES ( :n, :t, :ty, :b)";
$this->con->executeQuery($query, array(
':n' => array($img->getName(), PDO::PARAM_STR),
':t' => array($img->getTaille(), PDO::PARAM_STR),
':ty' => array($img->getType(), PDO::PARAM_STR),
':b' => array($img->getBlob(), PDO::PARAM_STR)
));
}
public function delete(int $id)
{
$query = 'DELETE FROM Image WHERE id=:i';
$this->con->executeQuery($query, array(
':i' => array($id, PDO::PARAM_INT)
));
}
public function getFromId(int $id) : array
{
$query = 'SELECT * FROM Image WHERE id=:i';
$this->con->executeQuery($query, array(
':i' => array($id, PDO::PARAM_INT)
));
return $this->con->getResults();
}
public function getNewId() : int
{
$query = 'SELECT MAX(id) FROM Image';
$this->con->executeQuery($query);
$res = $this->con->getResults();
if ($res[0]['MAX(id)'] === null) {
return 1;
}
return intval($res[0]['MAX(id)'])+1;
}
public function obtenirToutesImages()
{
$query = 'SELECT * FROM Image';
$this->con->executeQuery($query);
$res = $this->con->getResults();
$array = [];
foreach ($res as $r) {
$array[] = new Image($this->getNewId(),$r['nom'], $r['taille'], $r['type'], $r['blob']);
}
return $array;
}
}
?>

@ -14,12 +14,25 @@ class ImageSaver
try { try {
$return = []; $return = [];
$name = substr($_FILES[$filename]["name"], 0, 45); $originalName = $_FILES[$filename]["name"];
$name = substr($originalName, 0, 45);
$name = self::getId() . $name; $name = self::getId() . $name;
move_uploaded_file($_FILES[$filename]['tmp_name'], "../public/uploads/$name"); $uploadDir = "public/uploads/";
$targetPath = $uploadDir . $name;
$counter = 1;
while (file_exists($targetPath)) {
$name = self::getId() . $counter . $originalName;
$targetPath = $uploadDir . $name;
$counter++;
}
move_uploaded_file($_FILES[$filename]['tmp_name'], $targetPath);
$return[] = true; $return[] = true;
$return[] = $name; $return[] = $name;
return $return; return $return;
} catch (\Exception $e) { } catch (\Exception $e) {
$return[] = false; $return[] = false;
@ -27,4 +40,5 @@ class ImageSaver
return $return; return $return;
} }
} }
} }

@ -1,63 +0,0 @@
<?php
namespace App\metier;
class Image
{
private int $id;
private string $name;
private string $taille;
private string $type;
private string $blob;
/**
* @param int $id
* @param string $name
* @param string $taille
* @param string $type
* @param string $blob
*/
public function __construct(int $id, string $name, string $taille, string $type, string $blob)
{
$this->id = $id;
$this->name = $name;
$this->taille = $taille;
$this->type = $type;
$this->blob = $blob;
}
public function getName(): string
{
return $this->name;
}
public function getTaille(): string
{
return $this->taille;
}
public function getType(): string
{
return $this->type;
}
public function getBlob(): string
{
return $this->blob;
}
public function getId() : string
{
return $this->id;
}
public function toString() : string {
return "Image : " . $this->name . " " . $this->taille . " " . $this->type . " blob " . $this->blob;
}
}

@ -1,52 +0,0 @@
<?php
namespace App\modele;
use App\gateway\Connection;
use App\metier\Image;
use App\gateway\ImageGateway;
class ImageModele
{
private ImageGateway $gw;
public function __construct()
{
$this->gw = new ImageGateway(new Connection("mysql:host=localhost;dbname=dbAlica","test","test"));
}
public function publierImage(string $file) : Image
{
$img = new Image($this->gw->getNewId(),
$_FILES[$file]["name"],
$_FILES[$file]["size"],
$_FILES[$file]["type"],
file_get_contents($_FILES[$file]["tmp_name"]));
$this->insertImage($img);
return $img;
}
public function insertImage(Image $img)
{
$this->gw->insertImage($img);
}
public function obtenirParId(int $id)
{
$this->gw->getFromId($id);
$res = $this->gw->getResults();
return new Image($this->gw->getNewId(),$res[0]['nom'], $res[0]['taille'], $res[0]['type'], $res[0]['blob']);
}
public function obtenirToutesImages() : array
{
$this->gw->obtenirToutesImages();
$res = $this->gw->getResults();
foreach ($res as $r) {
$array[] = new Image($this->gw->getNewId(),$r['nom'], $r['taille'], $r['type'], $r['blob']);
}
return $array;
}
}

@ -2,9 +2,20 @@
namespace App\modele; namespace App\modele;
use App\gateway\Connection;
use App\gateway\OffreGateway;
use App\metier\Alumni;
use App\metier\Offre;
class MembreModele extends UtilisateurModele class MembreModele extends UtilisateurModele
{ {
private OffreGateway $offreGw;
public function __construct()
{
$this->offreGw = new OffreGateway(new Connection("mysql:host=localhost;dbname=dbAlica", "Dev", "Dev"));
}
/** /**
* @description modifier photo de profil * @description modifier photo de profil
@ -15,6 +26,8 @@ class MembreModele extends UtilisateurModele
return false; return false;
} }
/** /**
* @description ajouter formation * @description ajouter formation
*/ */
@ -62,6 +75,53 @@ class MembreModele extends UtilisateurModele
// TO DO // TO DO
return false; return false;
} }
public function publishOffer(string $img,string $logo)
{
$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"];
$niveauEtudes = $_POST["education"];
$date = new \DateTime();
if(isset($_POST["fullRemote"]))
{
$remote = true;
}
else $remote = false;
// à la place de NULL passer id utilisateur créateur offre
$offre = new Offre($this->offreGw->getNewId(),
new Alumni("test.mail@icloud.fr","password","admin","prenom","nom"),
$nom,
$desc,
$img,
$logo,
$typeContrat,
$ville,
$entreprise,
$descposte,
$profilRecherche,
$exp,
$niveauEtudes,
$mail,
$num,
$site,
$remote,
$date);
$this->offreGw->addOffers($offre);
return $offre;
}

@ -1,145 +0,0 @@
<?php
namespace App\modele;
use App\gateway\AlumniGateway;
use App\gateway\Connection;
use App\gateway\ImageGateway;
use App\gateway\OffreGateway;
use App\gateway\ProfilGateway;
use App\metier\Alumni;
use App\metier\Offre;
use App\metier\Image;
use mysql_xdevapi\Exception;
class OffreModele
{
private OffreGateway $offreGw;
public function __construct()
{
$this->offreGw = new OffreGateway(new Connection("mysql:host=localhost;dbname=dbAlica", "test", "test"));
}
public function publishOffer(string $img, string $logo)
{
$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"];
$niveauEtudes = $_POST["education"];
$date = new \DateTime();
if(isset($_POST["fullRemote"]))
{
$remote = true;
}
else $remote = false;
// à la place de NULL passer id utilisateur créateur offre
$offre = new Offre($this->offreGw->getNewId(),
new Alumni("test.mail@icloud.fr","password","admin","prenom","nom"),
$nom,
$desc,
$img,
$logo,
$typeContrat,
$ville,
$entreprise,
$descposte,
$profilRecherche,
$exp,
$niveauEtudes,
$mail,
$num,
$site,
$remote,
$date);
$this->offreGw->addOffers($offre);
return $offre;
}
public function getOffers() : array
{
$res = $this->offreGw->getOffers();
$offers = $this->CreateOffersFromGw($res);
return $offers;
}
public function getOfferFromId(int $id) : ?Offre
{
$res = $this->offreGw->getOfferFromId($id);
if($res != null)
return $this->CreateOffersFromGw($res)[0];
return null;
}
public function CreateOffersFromGw($res) : array
{
$alGw = new AlumniGateway(new Connection("mysql:host=localhost;dbname=dbAlica", "test", "test"));
$offers=[];
foreach ($res as $row)
{
$resal = $alGw->ObtenirById($row['offreur']);
$profilGw = new ProfilGateway(new Connection("mysql:host=localhost;dbname=dbAlica", "Dev", "Dev"));
$resProfl = $profilGw->getProfilById($row['offreur']);
$alumni = new Alumni($resal[0]['mail'],$resal[0]['mdp'],$resal[0]['role'],$resProfl[0]['nom'],$resProfl[0]["prenom"]);
$date = \DateTime::createFromFormat('Y-m-d', $row['date']);
$offers[]=new Offre(
$row['id'],
$alumni,
$row['titre'],
$row['description'],
$row["image"],
$row["logo"],
$row['typeContrat'],
$row['ville'],
$row["entreprise"],
$row['descriptifPoste'],
$row['profil'],
$row['experience'],
$row['niveauEtudes'],
$row['mailContact'],
$row['numero'],
$row['websiteURL'],
$row['remote'],
$date);
}
return $offers;
}
public function getOfferLimit($start, $nbOffers): array
{
$res = $this->offreGw->getOfferLimit($start, $nbOffers);
return $this->CreateOffersFromGw($res);
}
public function getNbOffers() : int
{
return $this->offreGw->getNbOffers();
}
public function getOffersWithFilters($params) : array
{
return $this->offreGw->getOffersWithFilters($params);
}
}

@ -1,5 +1,12 @@
<?php <?php
namespace App\modele; namespace App\modele;
use App\gateway\AlumniGateway;
use App\gateway\Connection;
use App\gateway\OffreGateway;
use App\gateway\ProfilGateway;
use App\metier\Alumni;
use App\metier\Offre;
class UtilisateurModele class UtilisateurModele
{ {
/** /**
@ -12,6 +19,13 @@ class UtilisateurModele
return []; return [];
} }
private OffreGateway $offreGw;
public function __construct()
{
$this->offreGw = new OffreGateway(new Connection("mysql:host=localhost;dbname=dbAlica", "Dev", "Dev"));
}
/** /**
* @description se connecter * @description se connecter
* @param string email * @param string email
@ -104,4 +118,132 @@ class UtilisateurModele
return null; return null;
} }
} }
public function getOffers() : array
{
$res = $this->offreGw->getOffers();
$offers = $this->CreateOffersFromGw($res);
return $offers;
}
public function getOfferFromId(int $id) : ?Offre
{
$res = $this->offreGw->getOfferFromId($id);
if($res != null)
return $this->CreateOffersFromGw($res)[0];
return null;
}
public function CreateOffersFromGw($res) : array
{
$alGw = new AlumniGateway(new Connection("mysql:host=localhost;dbname=dbAlica", "test", "test"));
$offers=[];
foreach ($res as $row)
{
$resal = $alGw->ObtenirById($row['offreur']);
$profilGw = new ProfilGateway(new Connection("mysql:host=localhost;dbname=dbAlica", "Dev", "Dev"));
$resProfl = $profilGw->getProfilById($row['offreur']);
$alumni = new Alumni($resal[0]['mail'],$resal[0]['mdp'],$resal[0]['role'],$resProfl[0]['nom'],$resProfl[0]["prenom"]);
$date = \DateTime::createFromFormat('Y-m-d', $row['date']);
$offers[]=new Offre(
$row['id'],
$alumni,
$row['titre'],
$row['description'],
$row["image"],
$row["logo"],
$row['typeContrat'],
$row['ville'],
$row["entreprise"],
$row['descriptifPoste'],
$row['profil'],
$row['experience'],
$row['niveauEtudes'],
$row['mailContact'],
$row['numero'],
$row['websiteURL'],
$row['remote'],
$date);
}
return $offers;
}
public function getOfferLimit($start, $nbOffers): array
{
$res = $this->offreGw->getOfferLimit($start, $nbOffers);
return $this->CreateOffersFromGw($res);
}
public function getNbOffers() : int
{
return $this->offreGw->getNbOffers();
}
public function getOffersWithFilters($params) : array
{
return $this->offreGw->getOffersWithFilters($params);
}
public function publishOffer(string $img,string $logo)
{
$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"];
$niveauEtudes = $_POST["education"];
$date = new \DateTime();
if(isset($_POST["fullRemote"]))
{
$remote = true;
}
else $remote = false;
// à la place de NULL passer id utilisateur créateur offre
$offre = new Offre($this->offreGw->getNewId(),
new Alumni("test.mail@icloud.fr","password","admin","prenom","nom"),
$nom,
$desc,
$img,
$logo,
$typeContrat,
$ville,
$entreprise,
$descposte,
$profilRecherche,
$exp,
$niveauEtudes,
$mail,
$num,
$site,
$remote,
$date);
$this->offreGw->addOffers($offre);
return $offre;
}
} }

@ -5,7 +5,7 @@
<title>Alica - Offres</title> <title>Alica - Offres</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link rel="stylesheet" href="css/offres.css"> <link rel="stylesheet" href="public/css/offres.css">
</head> </head>
<body> <body>
<header> <header>
@ -14,13 +14,13 @@
<div class="container mt-4 d-flex align-content-center "> <div class="container mt-4 d-flex align-content-center ">
<div> <div>
<a href="index.php?action=createOfferForm" type="button" class="btn btn-outline-success mb-4">Publier une offre</a> <a href="?action=createOfferForm" type="button" class="btn btn-outline-success mb-4">Publier une offre</a>
</div> </div>
<div class="container mt-4"> <div class="container mt-4">
<div class="d-flex flex-column align-items-center"> <div class="d-flex flex-column align-items-center">
<form action="index.php" method="get" class="form-inline flex-wrap mb-4"> <form action="/?createOffer" method="get" class="form-inline flex-wrap mb-4">
<h2 class="mr-3">Filtrer les offres</h2> <h2 class="mr-3">Filtrer les offres</h2>
<div class="form-group mr-3 flex-column justify-content-left"> <div class="form-group mr-3 flex-column justify-content-left">
@ -79,7 +79,7 @@
</div> </div>
<div> <div>
<a href="index.php?action=consultOffers" class="btn btn-info">Réinitialiser les filtres</a> <a href="?action=consultOffers" class="btn btn-info">Réinitialiser les filtres</a>
</div> </div>
</div> </div>
@ -93,7 +93,7 @@
{% for offre in offres %} {% for offre in offres %}
<article class="mb-4"> <article class="mb-4">
<div class="row1"> <div class="row1">
<img src="uploads/{{offre.getLogo()}}" class="img-fluid rounded" alt="logo"> <!-- Ajoutez la classe "rounded" pour arrondir les coins --> <img src="public/uploads/{{offre.getLogo()}}" class="img-fluid rounded" alt="logo"> <!-- Ajoutez la classe "rounded" pour arrondir les coins -->
<h4>{{ offre.getNom() }}</h4> <h4>{{ offre.getNom() }}</h4>
</div> </div>
<div class="row2"> <div class="row2">
@ -102,11 +102,11 @@
</div> </div>
<div class="row3"> <div class="row3">
<img src="assets/location.png" alt="location"> <img src="public/assets/location.png" alt="location">
<p>{{offre.getVille()}}</p> <p>{{offre.getVille()}}</p>
</div> </div>
<button type="button" class="btn btn-outline-primary btn-sm mb-2 custom-button" <button type="button" class="btn btn-outline-primary btn-sm mb-2 custom-button"
onclick="window.location.href = 'index.php?action=displayOffer&id={{offre.getId()}}';">En savoir plus > onclick="window.location.href = '?action=displayOffer&id={{offre.getId()}}';">En savoir plus >
</button> </button>
</article> </article>
@ -121,9 +121,9 @@
<!-- <!--
index.php?action=consultOffers&page={{ i }}&typeContrat={{ typeContrat }}&experience={{ experience }}&niveauEtudes={{ niveauEtudes }} index.php?action=consultOffers&page={{ i }}&typeContrat={{ typeContrat }}&experience={{ experience }}&niveauEtudes={{ niveauEtudes }}
--> -->
<a href="index.php?action=consultOffers&page={{ i }}&{{valContrat}}{{valExp}}{{ValEtudes}}" class="active bg-danger">{{ i }}</a> <a href="?action=consultOffers&page={{ i }}&{{valContrat}}{{valExp}}{{ValEtudes}}" class="active bg-danger">{{ i }}</a>
{% else %} {% else %}
<a href="index.php?action=consultOffers&page={{ i }}&{{valContrat}}{{valExp}}{{ValEtudes}}">{{ i }}</a> <a href="?action=consultOffers&page={{ i }}&{{valContrat}}{{valExp}}{{ValEtudes}}">{{ i }}</a>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}

@ -17,8 +17,8 @@
<ul class="list-group"> <ul class="list-group">
<!-- Add an image related to the offer --> <!-- Add an image related to the offer -->
<li class="list-group-item"></li><img src="uploads/{{offre.getLogo()}}" alt="Logo" class="img-thumbnail" style="max-height: 50px; max-width: 50px;"</li> <li class="list-group-item"></li><img src="public/uploads/{{offre.getLogo()}}" alt="Logo" class="img-thumbnail" style="max-height: 50px; max-width: 50px;"</li>
<li class="list-group-item"><img src="uploads/{{offre.getImg()}}" alt="Offer Image" class="img-fluid"></li> <li class="list-group-item"><img src="public/uploads/{{offre.getImg()}}" alt="Offer Image" class="img-fluid"></li>
<!--<li class="list-group-item"><strong>ID:</strong> {{ offre.getId() }}</li> --> <!--<li class="list-group-item"><strong>ID:</strong> {{ offre.getId() }}</li> -->
<li class="list-group-item"><strong>Offreur:</strong> {{ offre.getOffreur().getNom() }}</li> <li class="list-group-item"><strong>Offreur:</strong> {{ offre.getOffreur().getNom() }}</li>
<li class="list-group-item"><strong>Nom de l'offre:</strong> {{ offre.getNom() }}</li> <li class="list-group-item"><strong>Nom de l'offre:</strong> {{ offre.getNom() }}</li>
@ -37,7 +37,7 @@
<li class="list-group-item"> <li class="list-group-item">
<strong>Full Remote :</strong> <strong>Full Remote :</strong>
{% if offre.isRemote() %} {% if offre.isRemote() %}
Oui
{% else %} {% else %}
Non Non
{% endif %} {% endif %}

@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="css/accueil.css"> <link rel="stylesheet" type="text/css" href="/css/accueil.css">
<title>Alica - Accueil</title> <title>Alica - Accueil</title>
</head> </head>

@ -4,7 +4,7 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Alica - Connexion</title> <title>Alica - Connexion</title>
<link rel="stylesheet" type="text/css" href="../public/css/connexion.css"> <link rel="stylesheet" type="text/css" href="public/css/connexion.css">
</head> </head>
<body> <body>
<div class="container"> <div class="container">
@ -37,7 +37,7 @@
</form> </form>
<div class="CadreInput"> <div class="CadreInput">
<div class="box"> <div class="box">
<form action="../public/index.php?action=inscription" method="POST"> <form action="/?action=inscription" method="POST">
<input type="submit" class="other" value="S'inscrire"> <input type="submit" class="other" value="S'inscrire">
</form> </form>
</div> </div>

@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="../public/css/erreur.css"> <link rel="stylesheet" type="text/css" href="public/css/erreur.css">
<title>Alica - Erreur</title> <title>Alica - Erreur</title>
</head> </head>
@ -21,8 +21,6 @@
<p>{{value}}</p> <p>{{value}}</p>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
<form action="../public/index.php" method="POST"> <a href=".">Retourner à l'accueil<a/>
<input type="submit" value="Retourner à l'accueil">
</form>
</body> </body>
</html> </html>

@ -4,7 +4,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Alica - Inscription</title> <title>Alica - Inscription</title>
<link rel="stylesheet" type="text/css" href="../public/css/inscription.css"> <link rel="stylesheet" type="text/css" href="public/css/inscription.css">
</head> </head>
<body> <body>
<div class="container"> <div class="container">
@ -62,7 +62,7 @@
</form> </form>
<div class="CadreInput"> <div class="CadreInput">
<div class="box"> <div class="box">
<form action="../public/index.php?action=connection" method="POST"> <form action="/?action=connection" method="POST">
<input class="other" type="submit" value="Se connecter"> <input class="other" type="submit" value="Se connecter">
</form> </form>
</div> </div>

@ -15,7 +15,7 @@
</div> </div>
<script> <script>
setTimeout(function () { setTimeout(function () {
window.location.href = "../public/index.php?action=connection"; window.location.href = "../index.php";
}, 5000); }, 5000);
</script> </script>

@ -1,13 +1,13 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="fr">
<head> <head>
<link rel="stylesheet" type="text/css" href="css/menu.css"> <link rel="stylesheet" type="text/css" href="public/css/menu.css">
</head> </head>
<nav class="navbar-container"> <nav class="navbar-container">
<div class="logo-container"> <div class="logo-container">
<a href="index.php"> <a href=".">
<img src="assets/logo.png" alt="Logo" height="70px"> <img src="public/assets/logo.png" alt="Logo" height="70px">
</a> </a>
</div> </div>
<div class="bars"> <div class="bars">
@ -19,18 +19,18 @@
<li class="nav-link"><a href="#">A propos</a></li> <li class="nav-link"><a href="#">A propos</a></li>
<li class="nav-link"><a href="#">Evenements</a></li> <li class="nav-link"><a href="#">Evenements</a></li>
<li class="nav-link"><a href="index.php?action=consultOffers">Offres</a></li> <li class="nav-link"><a href="?action=consultOffers">Offres</a></li>
<li class="nav-link"><a href="#">Nous contacter</a></li> <li class="nav-link"><a href="#">Nous contacter</a></li>
</ul> </ul>
<ul class="nav-items"> <ul class="nav-items">
<!-- Afficher boutons de connexion et d'inscription --> <!-- Afficher boutons de connexion et d'inscription -->
{% if nom and prenom %} {% if nom and prenom %}
<!-- Afficher bouton de déconnexion --> <!-- Afficher bouton de déconnexion -->
<a href="index.php?action=deconnexion" class="button">Déconnexion</a> <a href="../?action=deconnexion" class="button">Déconnexion</a>
{% else %} {% else %}
<div class="login-register"> <div class="login-register">
<a href="index.php?action=connection" class="button">Connexion</a> <a href="/?action=connection" class="button">Connexion</a>
<a href="index.php?action=inscription" class="button button2">Inscription</a> <a href="/?action=inscription" class="button button2">Inscription</a>
</div> </div>
{% endif %} {% endif %}

@ -12,9 +12,9 @@
</header> </header>
<div id="titleDiv" class="jumbotron text-center"> <div id="titleDiv" class="jumbotron text-center">
<img src="assets/michelin.png" alt="Logo" height="70px"> <img src="public/assets/michelin.png" alt="Logo" height="70px">
<h1>Developpeur Fullstack</h1> <h1>Developpeur Fullstack</h1>
<img src="assets/location.png"> <img src="public/assets/location.png">
<p>Paris</p> <p>Paris</p>
<div id="key" class="row justify-content-center"> <div id="key" class="row justify-content-center">

Loading…
Cancel
Save