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
RewriteBase /php/public/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]

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

@ -12,14 +12,27 @@ class ImageSaver
public static function SaveImage(string $filename) : array
{
try {
$return=[];
$return = [];
$name = substr($_FILES[$filename]["name"], 0, 45);
$name = self::getId().$name;
$originalName = $_FILES[$filename]["name"];
$name = substr($originalName, 0, 45);
$name = self::getId() . $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[] = $name;
move_uploaded_file($_FILES[$filename]['tmp_name'], "../public/uploads/$name");
$return[]=true;
$return[]=$name;
return $return;
} catch (\Exception $e) {
$return[] = false;
@ -27,4 +40,5 @@ class ImageSaver
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;
use App\gateway\Connection;
use App\gateway\OffreGateway;
use App\metier\Alumni;
use App\metier\Offre;
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
@ -15,6 +26,8 @@ class MembreModele extends UtilisateurModele
return false;
}
/**
* @description ajouter formation
*/
@ -62,6 +75,53 @@ class MembreModele extends UtilisateurModele
// TO DO
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
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
{
/**
@ -12,6 +19,13 @@ class UtilisateurModele
return [];
}
private OffreGateway $offreGw;
public function __construct()
{
$this->offreGw = new OffreGateway(new Connection("mysql:host=localhost;dbname=dbAlica", "Dev", "Dev"));
}
/**
* @description se connecter
* @param string email
@ -104,4 +118,132 @@ class UtilisateurModele
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>
<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 rel="stylesheet" href="css/offres.css">
<link rel="stylesheet" href="public/css/offres.css">
</head>
<body>
<header>
@ -14,13 +14,13 @@
<div class="container mt-4 d-flex align-content-center ">
<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 class="container mt-4">
<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>
<div class="form-group mr-3 flex-column justify-content-left">
@ -79,7 +79,7 @@
</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>
@ -93,7 +93,7 @@
{% for offre in offres %}
<article class="mb-4">
<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>
</div>
<div class="row2">
@ -102,11 +102,11 @@
</div>
<div class="row3">
<img src="assets/location.png" alt="location">
<img src="public/assets/location.png" alt="location">
<p>{{offre.getVille()}}</p>
</div>
<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>
</article>
@ -121,9 +121,9 @@
<!--
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 %}
<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 %}
{% endfor %}
{% endif %}

@ -17,8 +17,8 @@
<ul class="list-group">
<!-- 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"><img src="uploads/{{offre.getImg()}}" alt="Offer Image" class="img-fluid"></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="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>Offreur:</strong> {{ offre.getOffreur().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">
<strong>Full Remote :</strong>
{% if offre.isRemote() %}
Oui
{% else %}
Non
{% endif %}

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<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>
</head>

@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<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>
<body>
<div class="container">
@ -37,7 +37,7 @@
</form>
<div class="CadreInput">
<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">
</form>
</div>

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<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>
</head>
@ -21,8 +21,6 @@
<p>{{value}}</p>
{% endfor %}
{% endif %}
<form action="../public/index.php" method="POST">
<input type="submit" value="Retourner à l'accueil">
</form>
<a href=".">Retourner à l'accueil<a/>
</body>
</html>

@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<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>
<body>
<div class="container">
@ -62,7 +62,7 @@
</form>
<div class="CadreInput">
<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">
</form>
</div>

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

@ -1,13 +1,13 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<link rel="stylesheet" type="text/css" href="css/menu.css">
<link rel="stylesheet" type="text/css" href="public/css/menu.css">
</head>
<nav class="navbar-container">
<div class="logo-container">
<a href="index.php">
<img src="assets/logo.png" alt="Logo" height="70px">
<a href=".">
<img src="public/assets/logo.png" alt="Logo" height="70px">
</a>
</div>
<div class="bars">
@ -19,18 +19,18 @@
<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="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>
</ul>
<ul class="nav-items">
<!-- Afficher boutons de connexion et d'inscription -->
{% if nom and prenom %}
<!-- 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 %}
<div class="login-register">
<a href="index.php?action=connection" class="button">Connexion</a>
<a href="index.php?action=inscription" class="button button2">Inscription</a>
<a href="/?action=connection" class="button">Connexion</a>
<a href="/?action=inscription" class="button button2">Inscription</a>
</div>
{% endif %}

@ -12,9 +12,9 @@
</header>
<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>
<img src="assets/location.png">
<img src="public/assets/location.png">
<p>Paris</p>
<div id="key" class="row justify-content-center">

Loading…
Cancel
Save