Compare commits

...

31 Commits

Author SHA1 Message Date
Thomas MUZARD c60f579a25 Transférer les fichiers vers ''
1 year ago
Clément Verdoire 776993ce23 gestion images
1 year ago
Baptiste D 4c3e3571a9 push avant évaluation
1 year ago
Baptiste D 1d3486d9ba Merge branch 'master' of codefirst.iut.uca.fr:leo.tuaillon/SAE_2A_FA-Reseau_ALICA
1 year ago
Baptiste D 02048befd8 correction bug filtres offres
1 year ago
thomas muzard 13eb6be744 bouton profil connecté
1 year ago
Baptiste D e6f5518ebc merge from server
1 year ago
Baptiste D 03371c34ad offres 100% fonctionnelles
1 year ago
Clément Verdoire 941296e44c Merge branch 'master' of codefirst.iut.uca.fr:leo.tuaillon/SAE_2A_FA-Reseau_ALICA
1 year ago
Clément Verdoire 60dff089bb modif verif event
1 year ago
Baptiste D ef2ff36190 Merge branch 'master' of codefirst.iut.uca.fr:leo.tuaillon/SAE_2A_FA-Reseau_ALICA
1 year ago
Baptiste D 132d41e1db 100 eme push
1 year ago
Clément Verdoire 9176e6cb03 ajout modification image
1 year ago
Clément Verdoire 14479cf2a3 Merge branch 'master' of codefirst.iut.uca.fr:leo.tuaillon/SAE_2A_FA-Reseau_ALICA
1 year ago
Clément Verdoire 39bae853c9 last changes
1 year ago
Baptiste D 9271f53d47 resolution pb offres
1 year ago
Clément Verdoire 4031f71acb changes Controler
1 year ago
Baptiste D 406cde7784 résolution bug création offre
1 year ago
Baptiste D cebb1aac3a Merge branch 'master' of codefirst.iut.uca.fr:leo.tuaillon/SAE_2A_FA-Reseau_ALICA
1 year ago
Baptiste D 6aa6dabb26 commit
1 year ago
Leo TUAILLON 3d0267bb61 profils ban set
1 year ago
Leo TUAILLON 849663f143 premice deleteUser
1 year ago
Clément Verdoire 1e4aaf41b8 m
1 year ago
Leo TUAILLON a2f805cba2 Modo controleur (my bad)
1 year ago
Leo TUAILLON ce5fb022b9 remplacement du header de redirection par un twig->render
1 year ago
Leo TUAILLON b5d91b5ac3 fix session variables
1 year ago
Baptiste D a32a224099 résolution issue connection
1 year ago
Baptiste D 090bb42cbd resolution bug
1 year ago
Clément Verdoire 7f85096c7b resol bug
1 year ago
Baptiste D 43729cfd59 resolution bug deco
1 year ago
Leo TUAILLON ed00c99894 Merge pull request 'AffichageProfil' (#45) from AffichageProfil into master
1 year ago

BIN
.DS_Store vendored

Binary file not shown.

2
.gitignore vendored

@ -438,4 +438,4 @@ php/composer.lock
php/.idea/ php/.idea/
##### Images : ##### Images :
php/public/uploads/ ###php/public/uploads/

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

@ -0,0 +1,372 @@
-- phpMyAdmin SQL Dump
-- version 5.2.0
-- https://www.phpmyadmin.net/
--
-- Hôte : localhost:8889
-- Généré le : lun. 20 nov. 2023 à 20:05
-- Version du serveur : 5.7.39
-- Version de PHP : 8.2.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de données : `dbAlica`
--
-- --------------------------------------------------------
--
-- Structure de la table `Alumni`
--
CREATE TABLE `Alumni` (
`id` int(11) NOT NULL,
`mail` varchar(128) NOT NULL,
`mdp` varchar(256) NOT NULL,
`role` varchar(16) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `Alumni`
--
INSERT INTO `Alumni` (`id`, `mail`, `mdp`, `role`) VALUES
(1, 'test', 'test', 'admin'),
(4, 'Admin@alica.com', '$2y$10$f2z.qWTtGhp.nZo0zBlw8Og9GpcQYcBOTIfqAj3UP2MEiN5uXS1Ue', 'Admin'),
(5, 'john@doe', '$2y$10$oOMH01Zxkz4yQPVs44fkHODMc78m8eeIOaSMF84K1w4ikPyUAiwwy', 'Membre'),
(6, 'jack@doe', '$2y$10$sFeUX9.evOansuqwj4nFuOLy9n3j6tkAFHmsL1kTDuUxhgF6WZRZy', 'Membre'),
(7, 'test@gmail.com', '$2y$10$41F6OQz9V1cr2D1rYX9np.5fTKe68dYrJlLpZf7t5G9c8g2mgOF9K', 'Membre'),
(8, 'admin@test', '$2y$10$mHKhDhpN7.Z1UyvE3..ZIuGPbjtmUa9QDhmuQyU1h68d/2z25DUDK', 'Admin'),
(9, 'membre@test', '$2y$10$hVS.BcHq.b/oneN0KiJI3u6CXGeb2UXRw5mJtvZByJG1./mIG4QbK', 'Membre'),
(10, 'test@e', '$2y$10$K3LBNsukXWvBqsbEid5Px.PnNQmomNa0tlnNvFlxDxRYdSbfOWdcK', 'Membre'),
(11, 'emma.dupont@email.com', '$2y$10$eg7ARpvdTqnpJ1tMi.AhcufFZtBQxkhnE8GF1/z4RRrTg3C1wpCsC', 'Membre'),
(12, 'lucas.martin@email.com', '$2y$10$yk7/MCHif6niCjqWrFxA2u1C69ThVb9tpduyTZtcDjnW.V.gM51Iu', 'Membre'),
(13, 'chloe.bernard@mail', '$2y$10$p0BjmKiuFbd3zBzBo6sWJ.tZi./2J7c3MZ9unCn/OkW6LBBvnC.FC', 'Membre'),
(14, 'ines.leroy@email.com', '$2y$10$QDoHq2B7m6WseAPe6kH6MuoaCREBWqChO95NxUVMrZDH1aShHD7zW', 'Membre'),
(15, 'te@te', '$2y$10$.kM.SFMvZnDEGuE8rxclc.UaJbKYesqzNNkE5VdE7NAPEwWOTS4u6', 'Membre'),
(16, 'lea.simon@email.com', '$2y$10$AckHtFDM3C.O.ACQlqh5FuVqSr3bB2.IjcPmdrrM/fYRYU6lU6OdW', 'Membre'),
(17, 'gabriel.michel@email.com', '$2y$10$bNoO9pNylyCL2hznrZ7OyO7aWVJUrZieda2uwnYo/Ly8TB7Nl7fLS', 'Membre'),
(18, 'Sarah@email', '$2y$10$50o/3cFzapPB90apopD5b.tWrRxCG0sYOni6TinI41cwHCzYFiUFO', 'Membre'),
(19, 'raphael.garcia@email.fr', '$2y$10$m2dHfABuizTRBGymKfO60eyzo13BPTSSH/EdEhXcDkauzuRuk7HR.', 'Membre'),
(20, 'Alice@a', '$2y$10$atRfojz7W0mQzv9l0IgRhOF5WWn7FjTRZtSbZkzQveYdInMsy5RrS', 'Membre'),
(21, 'maxime.pichon@email.com', '$2y$10$sA3N6D01ATFdCKqJ6fflNe484KMKejFIfaTYHGOH9AoPHOnRmSvi2', 'Membre'),
(22, 'zoe.Gauthier@gmail.com', '$2y$10$bVaPrdlcYOHcclq0OjZUTOwoLkmMXLw9Ww6OTSDnhFAujDL4nqBqG', 'Membre');
-- --------------------------------------------------------
--
-- Structure de la table `Article`
--
CREATE TABLE `Article` (
`id` int(11) NOT NULL,
`auteur` int(11) NOT NULL,
`Titre` varchar(64) NOT NULL,
`sousTitre` varchar(64) NOT NULL,
`description` varchar(1024) NOT NULL,
`image` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Structure de la table `Evenement`
--
CREATE TABLE `Evenement` (
`id` int(11) NOT NULL,
`organisateur` int(11) NOT NULL,
`titre` varchar(64) NOT NULL,
`description` varchar(512) NOT NULL,
`image` varchar(256) NOT NULL,
`date` date NOT NULL,
`nbPlaceMax` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `Evenement`
--
INSERT INTO `Evenement` (`id`, `organisateur`, `titre`, `description`, `image`, `date`, `nbPlaceMax`) VALUES
(1, 1, 'Laser Game', 'Evement laser game avec tous les membres du réseau ALICA, vous êtes la bienvenue..', '18044Laser Game PBOB9302.jpg', '2023-11-18', 20),
(2, 1, 'Rencontre Annuelle des Anciens d\'Alica', 'Un rassemblement annuel pour tous les anciens étudiants, avec des discours inspirants, des ateliers de réseautage et un dîner de gala\r\nLieu : Centre de conférence de l\'IUT dAubière', '16494Bandeau CreerAsso.jpg', '2023-11-24', 30);
-- --------------------------------------------------------
--
-- Structure de la table `Experience`
--
CREATE TABLE `Experience` (
`id` int(11) NOT NULL,
`profil` int(11) NOT NULL,
`intitule` varchar(256) NOT NULL,
`dateDebut` date NOT NULL,
`dateFin` date NOT NULL,
`nomEntreprise` varchar(64) NOT NULL,
`currentJob` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Structure de la table `Formation`
--
CREATE TABLE `Formation` (
`id` int(11) NOT NULL,
`profil` int(11) NOT NULL,
`nom` varchar(64) NOT NULL,
`ville` varchar(32) NOT NULL,
`dateDeb` date NOT NULL,
`dateFin` date NOT NULL,
`currentFormation` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Structure de la table `Image`
--
CREATE TABLE `Image` (
`id` int(5) NOT NULL,
`nom` varchar(50) NOT NULL,
`taille` varchar(25) NOT NULL,
`type` varchar(25) NOT NULL,
`blob` longblob NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Structure de la table `Offre`
--
CREATE TABLE `Offre` (
`id` int(11) NOT NULL,
`offreur` int(11) NOT NULL,
`titre` varchar(128) NOT NULL,
`description` varchar(1024) NOT NULL,
`image` varchar(100) NOT NULL,
`logo` varchar(100) NOT NULL,
`typeContrat` varchar(16) NOT NULL,
`ville` varchar(64) NOT NULL,
`entreprise` varchar(64) NOT NULL,
`descriptifPoste` varchar(2028) NOT NULL,
`profil` varchar(2028) NOT NULL,
`experience` varchar(512) NOT NULL,
`niveauEtudes` varchar(16) NOT NULL,
`mailContact` varchar(128) NOT NULL,
`numero` varchar(12) NOT NULL,
`websiteURL` varchar(256) NOT NULL,
`remote` tinyint(1) NOT NULL,
`date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Structure de la table `Participer`
--
CREATE TABLE `Participer` (
`alumni` int(11) NOT NULL,
`evenement` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Structure de la table `Profil`
--
CREATE TABLE `Profil` (
`id` int(11) NOT NULL,
`alumni` int(11) NOT NULL,
`email` varchar(128) NOT NULL,
`cv` varchar(256) DEFAULT NULL,
`nom` varchar(64) NOT NULL,
`prenom` varchar(32) NOT NULL,
`linkedinURL` varchar(256) DEFAULT NULL,
`githubURL` varchar(256) DEFAULT NULL,
`portfolioURL` varchar(256) DEFAULT NULL,
`image` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `Profil`
--
INSERT INTO `Profil` (`id`, `alumni`, `email`, `cv`, `nom`, `prenom`, `linkedinURL`, `githubURL`, `portfolioURL`, `image`) VALUES
(4, 4, 'Admin@alica.com', NULL, 'TUAILLON', 'Leo', NULL, NULL, NULL, '19879.png'),
(5, 5, 'john@doe', NULL, 'Doe', 'John', NULL, NULL, NULL, '2.jpg'),
(6, 6, 'jack@doe', NULL, 'Doe', 'Jack', NULL, NULL, NULL, NULL),
(7, 7, 'test@gmail.com', NULL, 'test', 'test', NULL, NULL, NULL, NULL),
(8, 8, 'admin@test', NULL, 'Admin', 'CompteTest', NULL, NULL, NULL, '1.png'),
(9, 9, 'membre@test', NULL, 'Membre', 'compteTest', NULL, NULL, NULL, '3.jpg'),
(10, 10, 'test@e', NULL, 'nom', 'prénom', NULL, NULL, NULL, NULL),
(11, 11, 'emma.dupont@email.com', NULL, 'Dupont', 'Emma', NULL, NULL, NULL, NULL),
(12, 12, 'lucas.martin@email.com', NULL, 'Martin', 'Lucas', NULL, NULL, NULL, NULL),
(13, 13, 'chloe.bernard@mail', NULL, 'Bernard', 'Chloé', NULL, NULL, NULL, '1.png'),
(14, 14, 'ines.leroy@email.com', NULL, 'Leroy', 'Ines', NULL, NULL, NULL, NULL),
(15, 15, 'te@te', NULL, 'Moreau', 'Alexandre', NULL, NULL, NULL, NULL),
(16, 16, 'lea.simon@email.com', NULL, 'Simon', 'Léa', NULL, NULL, NULL, '3.jpg'),
(17, 17, 'gabriel.michel@email.com', NULL, 'Michel', 'Gabriel', NULL, NULL, NULL, NULL),
(18, 18, 'Sarah@email', NULL, 'Lefevre', 'Sarah', NULL, NULL, NULL, NULL),
(19, 19, 'raphael.garcia@email.fr', NULL, 'Garcia', 'Raphaël', NULL, NULL, NULL, NULL),
(20, 20, 'Alice@a', NULL, 'Alice', 'Alice', NULL, NULL, NULL, '2.jpg'),
(21, 21, 'maxime.pichon@email.com', NULL, 'Pichon', 'Maxime', NULL, NULL, NULL, NULL),
(22, 22, 'zoe.Gauthier@gmail.com', NULL, 'Gauthier', 'zoé', NULL, NULL, NULL, '3.jpg');
--
-- Index pour les tables déchargées
--
--
-- Index pour la table `Alumni`
--
ALTER TABLE `Alumni`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `mail` (`mail`);
--
-- Index pour la table `Article`
--
ALTER TABLE `Article`
ADD PRIMARY KEY (`id`),
ADD KEY `image` (`image`),
ADD KEY `auteur` (`auteur`);
--
-- Index pour la table `Evenement`
--
ALTER TABLE `Evenement`
ADD PRIMARY KEY (`id`),
ADD KEY `organisateur` (`organisateur`);
--
-- Index pour la table `Experience`
--
ALTER TABLE `Experience`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `Formation`
--
ALTER TABLE `Formation`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `Image`
--
ALTER TABLE `Image`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `Offre`
--
ALTER TABLE `Offre`
ADD PRIMARY KEY (`id`),
ADD KEY `offreur` (`offreur`);
--
-- Index pour la table `Profil`
--
ALTER TABLE `Profil`
ADD PRIMARY KEY (`id`),
ADD KEY `alumni` (`alumni`);
--
-- AUTO_INCREMENT pour les tables déchargées
--
--
-- AUTO_INCREMENT pour la table `Alumni`
--
ALTER TABLE `Alumni`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;
--
-- AUTO_INCREMENT pour la table `Article`
--
ALTER TABLE `Article`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT pour la table `Evenement`
--
ALTER TABLE `Evenement`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT pour la table `Experience`
--
ALTER TABLE `Experience`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT pour la table `Formation`
--
ALTER TABLE `Formation`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT pour la table `Image`
--
ALTER TABLE `Image`
MODIFY `id` int(5) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT pour la table `Offre`
--
ALTER TABLE `Offre`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT pour la table `Profil`
--
ALTER TABLE `Profil`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;
--
-- Contraintes pour les tables déchargées
--
--
-- Contraintes pour la table `Article`
--
ALTER TABLE `Article`
ADD CONSTRAINT `article_ibfk_1` FOREIGN KEY (`image`) REFERENCES `Image` (`id`),
ADD CONSTRAINT `article_ibfk_2` FOREIGN KEY (`auteur`) REFERENCES `Alumni` (`id`);
--
-- Contraintes pour la table `Evenement`
--
ALTER TABLE `Evenement`
ADD CONSTRAINT `evenement_ibfk_1` FOREIGN KEY (`organisateur`) REFERENCES `Alumni` (`id`);
--
-- Contraintes pour la table `Offre`
--
ALTER TABLE `Offre`
ADD CONSTRAINT `offre_ibfk_1` FOREIGN KEY (`offreur`) REFERENCES `Alumni` (`id`);
--
-- Contraintes pour la table `Profil`
--
ALTER TABLE `Profil`
ADD CONSTRAINT `fk_profil_alumni` FOREIGN KEY (`alumni`) REFERENCES `Alumni` (`id`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

BIN
php/.DS_Store vendored

Binary file not shown.

@ -12,8 +12,8 @@
} }
.custom-button { .custom-button {
background-color: #00DBFF; background-color: #7fb4bd;
border-color: #00DBFF; border-color: #7fb4bd;
color: #fff; color: #fff;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 467 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

@ -81,9 +81,9 @@ class Validation
return false; return false;
} }
public static function validerEvenement(string $titre, string $description, string $date, int $nbPlaceMax, string $img) : bool public static function validerEvenement(int $idOrganisateur, string $titre, string $description, string $date, int $nbPlaceMax, string $img) : bool
{ {
if(!empty($titre) && !empty($description) && !empty($date) && !empty($nbPlaceMax) && !empty($img)) if(!empty($idOrganisateur) && !empty($titre) && !empty($description) && !empty($date) && !empty($nbPlaceMax) && !empty($img))
{ {
if(self::validerIntPossitif($nbPlaceMax)) if(self::validerIntPossitif($nbPlaceMax))
{ {

@ -1,41 +1,36 @@
<?php <?php
namespace App\controleur; namespace App\controleur;
use App\gateway\ImageManager;
use App\config\Validation;
use App\modele\AdminModele;
use Exception;
class AdminControleur extends ModerateurControleur class AdminControleur extends ModerateurControleur
{ {
public function __construct() public function supprimerCompte(?array $params)
{ {
global $twig; global $twig;
if (!isset($_REQUEST["action"])) { $adminModel = new AdminModele();
$action = NULL; $dVueErreur = [];
if (isset($params['id'])) {
$profilId = Validation::validerIntPossitif($params['id']);
try{
$adminModel->deleteAccount($profilId);
echo $twig->render('profil.html', []);
} catch (Exception $e) {
$dVueErreur[] = "Erreur lors de la suppression du compte";
echo $twig->render("erreur.html", ['dVueErreur' => $dVueErreur]);
}
} else { } else {
$action = \App\config\Validation::nettoyerString($_REQUEST["action"]); $dVueErreur[] = "ID du profil non spécifié.";
echo $twig->render("erreur.html", ['dVueErreur' => $dVueErreur]);
} }
switch ($action) {
case "supprimerCompte":
$this->supprimerCompte();
break;
case "consulterSignalement":
$this->consulterSignalement();
break;
case "creerEvenement":
$this->creerEvenement();
break;
case "supprimerEvenement":
$this->supprimerEvenement();
break;
case "supprimerOffre":
$this->supprimerOffre();
break;
default:
parent::__construct();
}
}
protected function supprimerCompte()
{
//TODO
} }
protected function consulterSignalement() protected function consulterSignalement()
@ -43,14 +38,33 @@ class AdminControleur extends ModerateurControleur
//TODO //TODO
} }
protected function creerEvenement() public function creerEvenement()
{ {
//TODO global $twig;
if (isset($_FILES["image"])) {
$img = ImageManager::SaveImage('image');
if (!Validation::validerEvenement($_SESSION["id"], $_POST["titre"], $_POST["description"], $_POST["date"], $_POST["nbPlaceMax"], $img[1])) {
$mdl = new AdminModele();
$mdl->ajouterEvenement($_SESSION["id"], $_POST["titre"], $_POST["description"], $_POST["date"], $_POST["nbPlaceMax"], $img[1]);
$this->listerEvenement();
} else {
$dVueErreur[] ="Erreur lors de la création de l'évènement";
echo $twig->render("erreur.html",['dVueErreur' => $dVueErreur]);
}
} else {
echo $twig->render('creerEvenement.html', []);
}
} }
protected function supprimerEvenement() public function supprimerEvenement(?array $params)
{ {
//TODO $mdl = new AdminModele();
$mdl->deleteEvenement($params["id2"]);
$this->listerEvenement();
} }
protected function supprimerOffre() protected function supprimerOffre()

@ -4,26 +4,30 @@
namespace App\controleur; namespace App\controleur;
use App\router\AltoRouter; use App\router\AltoRouter;
use App\metier\Alumni; use App\controleur\Error;
use App\controleur\UtilisateurControleur;
use App\controleur\MembreControleur;
use App\controleur\AdminControleur;
class FrontControleur class FrontControleur
{ {
public function __construct() public function __construct()
{ {
global $twig; global $twig;
session_start(); session_start();
if($_SESSION["utilisateur"]){
$twig->addGlobal('nom', $_SESSION["utilisateur"]->getNom()); if(!isset($_SESSION['nom']) && !isset($_SESSION['prenom']) && !isset($_SESSION['role']) && !isset($_SESSION['id']))
$twig->addGlobal('prenom', $_SESSION["utilisateur"]->getPrenom()); {
$twig->addGlobal('role', $_SESSION["utilisateur"]->getRole()); $_SESSION['nom'] = NULL;
$twig->addGlobal('id', $_SESSION["utilisateur"]->getId()); $_SESSION['prenom'] = NULL;
$_SESSION['role'] = "guest";
$_SESSION['id'] = NULL;
} }
else{
$twig->addGlobal('nom', $_SESSION['nom']);
$twig->addGlobal('prenom', $_SESSION['prenom']);
$twig->addGlobal('role', $_SESSION['role']);
$twig->addGlobal('id', $_SESSION['id']);
}
$router = new AltoRouter(); $router = new AltoRouter();
$router->setBasePath('/SAE_2A_FA-Reseau_ALICA/php'); $router->setBasePath('/SAE_2A_FA-Reseau_ALICA/php');
@ -34,12 +38,19 @@ class FrontControleur
$router->map('POST','/[a:action]?','UtilisateurControleur'); $router->map('POST','/[a:action]?','UtilisateurControleur');
$router->map('GET','/[a:action]/[i:id]?','UtilisateurControleur'); $router->map('GET|POST','/[a:action]/[i:id]?','UtilisateurControleur');
$router->map('GET|POST', '/user/[a:action]?', 'MembreControleur');
$router->map('GET|POST', '/user/[i:id]/[a:action]?', 'MembreControleur'); $router->map('GET|POST', '/user/[i:id]/[a:action]?', 'MembreControleur');
$router->map('GET|POST', '/user/[i:id]/[a:action]/[i:id2]?', 'MembreControleur');
$router->map('GET|POST', '/admin/[i:id]/[a:action]?', 'AdminControleur'); $router->map('GET|POST', '/admin/[i:id]/[a:action]?', 'AdminControleur');
$router->map('GET|POST', '/admin/[i:id]/[a:action]/[i:id2]?', 'AdminControleur');
$id = 0; $id = 0;
$match = $router->match(); $match = $router->match();
@ -48,63 +59,78 @@ class FrontControleur
$id = array(); $id = array();
$twig->render("accueil.html",[]); try{
if (!$match) {
if (!$match) { $dVueErreur[] = "Error 404 Page not found";
echo $twig->render("erreur.html", ['dVueErreur' => $dVueErreur]);
}
$dVueErreur[] = "Error 404 Page not found"; if ($match) {
echo $twig->render("erreur.html", ['dVueErreur' => $dVueErreur]);
}
if ($match) { $controller = $match['target'] ?? NULL;
$action = $match['params']['action'] ?? NULL;
$id = $match['params']['id'] ?? NULL;
$controller = $match['target'] ?? NULL; $namespace = 'App\\controleur\\';
$action = $match['params']['action'] ?? NULL;
$id = $match['params']['id'] ?? NULL;
//var_dump($match); try {
if ($controller == "MembreControleur") {
if ($_SESSION["role"] != "Membre" && $_SESSION["role"] != "Admin") {
try { echo $twig->render("connection.html", ['msg' => 'Vous devez vous connecter pour effectuer cette action']);
if ($controller == "MembreControleur") { } else {
if ($_SESSION["utilisateur"]->getRole() != "Admin" || $_SESSION["utilisateur"]->getRole() != "Membre") { $controller = "MembreControleur";
$controller = $namespace . $controller;
//echo "controller : ".$controller;
$controller = new $controller();
echo $twig->render("connection.html",['msg' => 'Vous devez vous connecter pour effectuer cette action']); }
} }
}
if ($controller == "AdminControleur") { if ($controller == "AdminControleur") {
$Alumni = $_SESSION["utilisateur"]; if ($_SESSION["role"] != "Admin") {
if ($Alumni->getRole() != "Admin") { $dVueErreur = ["Erreur : Vous n'avez pas les privileges pour cette action"];
$dVueErreur = ["Erreur : Vous n'avez pas les privileges pour cette action"];
global $twig;
echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]);
return;
} else {
$controller = "AdminControleur";
$controller = $namespace . $controller;
$controller = new $controller();
}
}
global $twig; if ($controller == "UtilisateurControleur") {
echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]); $controller = $namespace . $controller;
return; $controller = new $controller();
} }
} else {
$namespace = 'App\\Controleur\\';
$controller = $namespace . $controller;
$controller = new $controller();
}
if (is_callable(array($controller, $action))) { if (is_callable(array($controller, $action))) {
call_user_func(array($controller, $action), $match['params']);
} else {
call_user_func(array($controller, $action), $match['params']);
} else {
echo $twig->render('accueil.html');
}
} catch (Error $error) {
$dVueErreur = ['Erreur : Action inconnue']; $dVueErreur = ['Erreur : Action inconnue'];
echo $twig->render('accueil.html', ['dVueErreur' => $dVueErreur]); echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]);
} }
}
}
catch(Error $e)
{
$dVueErreur = ['Erreur : Action inconnue'];
} catch (Error $error) { echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]);
$dVueErreur = ['Erreur : Action inconnue']; }
}
echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]);
}
}
}
} }

@ -1,36 +1,123 @@
<?php <?php
namespace App\controleur; namespace App\controleur;
use App\config\Validation;
use App\gateway\ImageManager;
use App\modele\MembreModele;
class MembreControleur extends UtilisateurControleur class MembreControleur extends UtilisateurControleur
{ {
public function __construct() public function __construct()
{ {}
}
protected function deconnexion() public function deconnexion()
{ {
global $twig;
session_unset();
session_destroy(); session_destroy();
echo "on est passes ici";
header('Location: index.php?action=accueil'); header("Location: /SAE_2A_FA-Reseau_ALICA/php/");
exit(); exit();
} }
public function createOfferForm()
{
global $twig;
echo $twig->render("CreateOffer.html", []);
}
protected function proposerOffre() public function createOffer()
{ {
//TODO global $twig;
$taberror = [];
$requiredFields = ['name', 'entreprise', 'description','typeContrat', 'descriptPoste', 'profilRecherche', 'choixExp', 'education', 'mail', 'num'];
$error = false;
foreach ($requiredFields as $field) {
if (empty($_POST[$field])) {
$error = true;
$taberror[] = "Le champ {$field} est requis !";
}
}
if($error)
{
echo $twig->render("CreateOffer.html", ['tabError' => $taberror ]);
return;
}
if(!Validation::verifierEmail($_POST["mail"]))
{
$taberror[] = "Email non valide !";
}
if(!Validation::validateNumber($_POST["num"]))
{
$taberror[] = "Numero non valide !";
}
if (!Validation::validateImage("image"))
{
$taberror[] = "Image non valide !";
}
if(!Validation::validateImage("logo")) {
$taberror[] = "Logo non valide !";
}
if(count($taberror) > 0)
{
echo $twig->render("CreateOffer.html", ['tabError' => $taberror ]);
}
else{
$saveImg1 = ImageManager::SaveImage("image");
$saveImg2 = ImageManager::SaveImage("logo");
if($saveImg1[0] != NULL && $saveImg2[0] != NULL)
{
$mbrModel = new MembreModele();
$offre = $mbrModel->publishOffer($saveImg1[1], $saveImg2[1]);
echo $twig->render("OffreDetail.html", ['offre' => $offre]);
}
else
{
$taberror[] = "Erreur lors de l'upload des images";
echo $twig->render("CreateOffer.html", ['tabError' => $taberror ]);
}
}
} }
protected function consulterProfil()
public function deleteOffer(?array $params)
{ {
//TODO global $twig;
$id = $params['id2'];
$MemberModel = new MembreModele();
$offre = $MemberModel->getOfferFromId($id);
if($offre != NULL)
{
$MemberModel->deleteOffer($offre);
}
$this->consultOffers(NULL);
} }
protected function modifierProfil() public function proposerOffre()
{ {
//TODO //TODO
} }
public function consulterProfil()
protected function signaler() {
//TODO
}
public function modifierProfil()
{
//TODO
}
public function signaler()
{ {
//TODO //TODO
} }

@ -3,7 +3,7 @@
namespace App\controleur; namespace App\controleur;
use App\config\Validation; use App\config\Validation;
use App\gateway\ImageSaver; use App\gateway\ImageManager;
use App\metier\Alumni; use App\metier\Alumni;
use App\modele\OffreModele; use App\modele\OffreModele;
use App\modele\UtilisateurModele; use App\modele\UtilisateurModele;
@ -27,8 +27,18 @@ class UtilisateurControleur
$utilisateur = $userModel->connection($email, $motDePasse); $utilisateur = $userModel->connection($email, $motDePasse);
if ($utilisateur instanceof Alumni) { if ($utilisateur instanceof Alumni) {
$_SESSION['utilisateur'] = $utilisateur; $_SESSION['nom'] = $utilisateur->getNom();
echo $twig->render('accueil.html'); $_SESSION['prenom'] = $utilisateur->getPrenom();
$_SESSION['role'] = $utilisateur->getRole();
$_SESSION['id'] = $utilisateur->getId();
echo $twig->render('accueil.html',[
'nom' => $_SESSION['nom'],
'prenom' => $_SESSION['prenom'],
'role' => $_SESSION['role'],
'id' => $_SESSION['id'
]]);
return; return;
} else { } else {
$dVueErreur[] = "L'adresse email ou le mot de passe est incorrect."; $dVueErreur[] = "L'adresse email ou le mot de passe est incorrect.";
@ -74,7 +84,7 @@ class UtilisateurControleur
echo $twig->render('inscription.html', ['dVueErreur' => $dVueErreur]); echo $twig->render('inscription.html', ['dVueErreur' => $dVueErreur]);
} }
protected function accueil() public function accueil()
{ {
global $twig; global $twig;
// Ajout d'un var_dump pour déboguer // Ajout d'un var_dump pour déboguer
@ -94,36 +104,59 @@ class UtilisateurControleur
echo 'not implemented yet'; echo 'not implemented yet';
} }
public function consultOffers() /**
* @return void
* @description afficher la liste des offres
*/
public function resetFilters()
{ {
unset($_SESSION["niveauEtudes"]);
unset($_SESSION["typeContrat"]);
unset($_SESSION["experience"]);
$this->consultOffers(null);
}
/**
* @param array|null $params paramètres / filtres de la rehcerhce
* @return void
* @description afficher la liste des offres
*/
public function consultOffers(?array $params)
{
$userMdl = new UtilisateurModele(); $userMdl = new UtilisateurModele();
global $twig; global $twig;
$niveauEtudes=null; $niveauEtudes = NULL;
$typeContrat=null; $typeContrat = NULL;
$exp = null; $exp = NULL;
$msg = NULL;
$role = NULL;
if(isset($_SESSION['utilisateur']))
{
$role = $_SESSION['utilisateur']->getRole() ;
}
$nbOffers = 5 ; $nbOffers = 5 ;
if(isset($_GET["niveauEtudes"]) && Validation::validateTypeStudies($_GET["niveauEtudes"])) { if(isset($_POST["niveauEtudes"]) && Validation::validateTypeStudies($_POST["niveauEtudes"])) {
$niveauEtudes = $_GET["niveauEtudes"]; //$niveauEtudes = $_POST["niveauEtudes"];
$_SESSION["niveauEtudes"] = $_POST["niveauEtudes"];
$niveauEtudes = $_SESSION["niveauEtudes"];
} }
else if(isset($_SESSION["niveauEtudes"]))
{$niveauEtudes = $_SESSION["niveauEtudes"];}
if(isset($_GET["typeContrat"]) && Validation::validateTypeContract($_GET["typeContrat"])) { if(isset($_POST["typeContrat"]) && Validation::validateTypeContract($_POST["typeContrat"])) {
$typeContrat = $_GET["typeContrat"]; //$typeContrat = $_POST["typeContrat"];
$_SESSION["typeContrat"] = $_POST["typeContrat"];
$typeContrat = $_SESSION["typeContrat"];
} }
else if(isset($_SESSION["typeContrat"]))
{$typeContrat = $_SESSION["typeContrat"];}
if(isset($_GET["experience"]) && Validation::validateExperience($_GET["experience"])) { if(isset($_POST["experience"]) && Validation::validateExperience($_POST["experience"])) {
$exp = $_GET["experience"]; //$exp = $_POST["experience"];
$_SESSION["experience"] = $_POST["experience"];
$exp = $_SESSION["experience"];
} }
else if(isset($_SESSION["experience"]))
{$exp = $_SESSION["experience"];}
if ($niveauEtudes == null && $typeContrat == null && $exp == null) { if ($niveauEtudes == null && $typeContrat == null && $exp == null) {
$totalOffers = $userMdl->getNbOffers(); $totalOffers = $userMdl->getNbOffers();
@ -131,22 +164,24 @@ class UtilisateurControleur
$params = array( $params = array(
'typeContrat' => $typeContrat, 'typeContrat' => $typeContrat,
'exp' => $exp, 'exp' => $exp,
'niveauEtudes' => $niveauEtudes, 'niveauEtudes' => $niveauEtudes
'role' => $role
); );
$offers = $userMdl->getOffersWithFilters($params); //$offers = $userMdl->getOffersWithFilters($params);
$totalOffers = count($offers); //var_dump($offers);
//$totalOffers = count($offers);
$totalOffers = count($userMdl->getOffersWithFilters($params));
} }
$numberPages = ceil($totalOffers / 5); $numberPages = ceil($totalOffers / 5);
$msg = NULL; //var_dump($params);
if($numberPages == 0 ) { //echo "page : ".$params["id"];
$msg = 'Aucune Offre Trouvée'; /*if (isset($params["id"]) && intval($params["id"]) != null)*/
} if(isset($_GET['id']) && intval($_GET['id']) != null)
{
$page = intval($_GET['id']);
if (isset($_GET["page"]) && intval($_GET["page"]) != null) { //echo "page : ".$page;
$page = intval($_GET["page"]);
if ($page > $numberPages || $page < 1) { if ($page > $numberPages || $page < 1) {
$dVueErreur[] = "Page introuvable"; $dVueErreur[] = "Page introuvable";
echo $twig->render("erreur.html", ['dVueErreur' => $dVueErreur ]); echo $twig->render("erreur.html", ['dVueErreur' => $dVueErreur ]);
@ -158,17 +193,16 @@ class UtilisateurControleur
$start = intval(($page - 1) * 5); $start = intval(($page - 1) * 5);
$offers = [];
if ($niveauEtudes == null && $typeContrat == null && $exp == null) { if ($niveauEtudes == null && $typeContrat == null && $exp == null) {
$offers = $userMdl->getOfferLimit($start, $nbOffers); $offers = $userMdl->getOfferLimit($start, $nbOffers);
} else { } else {
$params['start'] = $start; $params['start'] = $start;
$params['nbOffers'] = 5; $params['nbOffers'] = 5;
$offers = $userMdl->getOffersWithFilters($params); $offers = $userMdl->getOffersWithFilters($params);
}
/* echo "filtre :".$niveauEtudes."<br>"; }
echo "filtre :".$typeContrat."<br>";
echo "filtre :".$exp."<br>";*/
echo $twig->render('OffersList.html', [ echo $twig->render('OffersList.html', [
'msg' => $msg, 'msg' => $msg,
@ -180,85 +214,15 @@ class UtilisateurControleur
'niveauEtudes' => (($niveauEtudes != null) ? $niveauEtudes : ""), 'niveauEtudes' => (($niveauEtudes != null) ? $niveauEtudes : ""),
'valContrat' => (($typeContrat != null) ? "&typeContrat=".$typeContrat : ""), 'valContrat' => (($typeContrat != null) ? "&typeContrat=".$typeContrat : ""),
'valExp' => (($exp != null) ? "&experience=".$exp : ""), 'valExp' => (($exp != null) ? "&experience=".$exp : ""),
'valEtudes' => (($niveauEtudes != null) ? "&niveauEtudes=".$niveauEtudes : ""), 'valEtudes' => (($niveauEtudes != null) ? "&niveauEtudes=".$niveauEtudes : "")
'role' => $role
]); ]);
} }
public function createOfferForm() /**
{ * @param array|null $params paramètres
global $twig; * @return void
echo $twig->render("CreerOffre.html", []); * @description afficher le détail d'une offre
} */
public function createOffer()
{
global $twig;
$taberror = [];
$requiredFields = ['name', 'entreprise', 'description','typeContrat', 'descriptPoste', 'profilRecherche', 'choixExp', 'education', 'mail', 'num'];
$error = false;
foreach ($requiredFields as $field) {
if (empty($_POST[$field])) {
$error = true;
$taberror[] = "Le champ {$field} est requis !";
}
}
if($error)
{
echo $twig->render("CreerOffre.html", ['tabError' => $taberror ]);
return;
}
if(!Validation::verifierEmail($_POST["mail"]))
{
//echo $twig->render("CreerOffre.html", ['errMsg' => "Email non valide !" ]);
$taberror[] = "Email non valide !";
}
if(!Validation::validateNumber($_POST["num"]))
{
$taberror[] = "Numero non valide !";
//echo $twig->render("CreerOffre.html", ['errMsg' => "Numero non valide !" ]);
}
if (!Validation::validateImage("image"))
{
if(isset($_FILES['image']['name'])) {$taberror[] = "Image non valide !";}
else {$taberror[] = "Inserez une image !";}
}
if(!Validation::validateImage("logo")) {
if(isset($_FILES['logo']['name'])) {$taberror[] = "Logo non valide !";}
else {$taberror[] = "Inserez un logo !";}
return;
}
if(count($taberror) > 0)
{
echo $twig->render("CreerOffre.html", ['tabError' => $taberror ]);
}
else{
$saveImg1 = ImageSaver::SaveImage("image");
$saveImg2 = ImageSaver::SaveImage("logo");
if($saveImg1[0] && $saveImg2[0]) {
$mbrModel = new MembreModele();
$offre = $mbrModel->publishOffer($saveImg1[1], $saveImg2[1]);
echo $twig->render("OffreDetailTest.html", ['offre' => $offre]);
}
else
{
$taberror[] = "Erreur lors de l'upload des images";
echo $twig->render("CreerOffre.html", ['tabError' => $taberror ]);
}
}
}
public function displayOffer(?array $params) public function displayOffer(?array $params)
{ {
global $twig; global $twig;
@ -269,7 +233,7 @@ class UtilisateurControleur
$offre = $uttilsMdl->getOfferFromId(intval($params["id"])); $offre = $uttilsMdl->getOfferFromId(intval($params["id"]));
if($offre != NULL) if($offre != NULL)
{ {
echo $twig->render("OffreDetailTest.html",['offre' => $offre]); echo $twig->render("OffreDetail.html",['offre' => $offre]);
return; return;
} }
} }
@ -285,35 +249,6 @@ class UtilisateurControleur
echo $twig->render('evenement.html', ['evenements' => $evenements]); echo $twig->render('evenement.html', ['evenements' => $evenements]);
} }
public function creerEvenement()
{
global $twig;
if (isset($_FILES["image"])) {
$img = ImageSaver::SaveImage('image');
if (!Validation::validerEvenement($_POST["titre"], $_POST["description"], $_POST["date"], $_POST["nbPlaceMax"], $img[1])) {
$mdl = new UtilisateurModele();
$mdl->ajouterEvenement($_POST["titre"], $_POST["description"], $_POST["date"], $_POST["nbPlaceMax"], $img[1]);
$this->listerEvenement();
} else {
$dVueErreur[] ="Erreur lors de la création de l'évènement";
echo $twig->render("erreur.html",['dVueErreur' => $dVueErreur]);
}
} else {
echo $twig->render('creerEvenement.html', []);
}
}
public function supprimerEvenement(?array $params)
{
$mdl = new UtilisateurModele();
$mdl->deleteEvenement($params["id"]);
$this->listerEvenement();
}
public function avoirDetailEvenement(?array $params) public function avoirDetailEvenement(?array $params)
{ {
@ -352,7 +287,7 @@ class UtilisateurControleur
global $twig; global $twig;
$dVueErreur = []; // Tableau pour stocker les erreurs, le cas échéant $dVueErreur = []; // Tableau pour stocker les erreurs, le cas échéant
$userModel = new UtilisateurModele(); $userModel = new UtilisateurModele();
$nbParPage = 10; $nbParPage = 6;
$nombreTotalPages = ceil(($userModel->getNbTotalPages())/$nbParPage); $nombreTotalPages = ceil(($userModel->getNbTotalPages())/$nbParPage);
if (isset($params['id'] ) && $params['id'] != null) { if (isset($params['id'] ) && $params['id'] != null) {
$page = Validation::validerIntPossitif($params['id']); $page = Validation::validerIntPossitif($params['id']);

@ -76,5 +76,26 @@ class AlumniGateway
return $res[0]['id']; return $res[0]['id'];
} }
public function deleteUser(int $accountId)
{
// Supprimer les enregistrements liés dans AutreTable
$query = 'DELETE FROM Profil WHERE alumni=:i';
$this->con->executeQuery($query, array(
':i' => array($accountId, PDO::PARAM_INT)
));
$query = 'DELETE FROM Offre WHERE offreur=:i';
$this->con->executeQuery($query, array(
':i' => array($accountId, PDO::PARAM_INT)
));
// Ensuite, supprimer l'enregistrement dans Alumni
$query = 'DELETE FROM Alumni WHERE id=:i';
$this->con->executeQuery($query, array(
':i' => array($accountId, PDO::PARAM_INT)
));
return $this->con->getResults();
}
} }

@ -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;
}
}
?>

@ -0,0 +1,62 @@
<?php
namespace App\gateway;
class ImageManager
{
/**
* @return int id aléatoire
* @description générer un id aléatoire
*/
public static function getId() : int
{
return rand(10000,19999);
}
/**
* @description sauvegarder une image
* @param string $filename
* @return array [bool,string] tableau de retour avec le booléen et le nom de l'image
*/
public static function SaveImage(string $filename) : array
{
try {
$return=[];
$name = $_FILES[$filename]["name"];
$path = "public/uploads/".$name;
while(file_exists($path))
{
$name = substr($_FILES[$filename]["name"], 0, 45);
$name = self::getId().$name;
$path = "public/uploads/".$name;
}
move_uploaded_file($_FILES[$filename]['tmp_name'], "public/uploads/$name");
$return[]=true;
$return[]=$name;
return $return;
} catch (\Exception $e) {
$return[] = false;
$return[] = "";
return $return;
}
}
/**
* @param string $img
* @return bool true si l'image a été supprimée, false sinon
* @description supprimer une image
*/
public static function deleteImg(string $img) : bool
{
$path = "public/uploads/$img";
if (file_exists($path)) {
unlink($path);
return true;
} else {
return false;
}
}
}

@ -1,30 +0,0 @@
<?php
namespace App\gateway;
class ImageSaver
{
public static function getId() : int
{
return rand(10000,19999);
}
public static function SaveImage(string $filename) : array
{
try {
$return=[];
$name = substr($_FILES[$filename]["name"], 0, 45);
$name = self::getId().$name;
move_uploaded_file($_FILES[$filename]['tmp_name'], "public/uploads/$name");
$return[]=true;
$return[]=$name;
return $return;
} catch (\Exception $e) {
$return[] = false;
$return[] = "";
return $return;
}
}
}

@ -53,8 +53,7 @@ class OffreGateway
$query = 'INSERT INTO Offre VALUES (:i, :o, :t, :d, :img, :logo, :ty, :v, :e, :desc, :pro, :exp, :niv, :mail, :num, :web, :remote, :date)'; $query = 'INSERT INTO Offre VALUES (:i, :o, :t, :d, :img, :logo, :ty, :v, :e, :desc, :pro, :exp, :niv, :mail, :num, :web, :remote, :date)';
$this->con->executeQuery($query, array( $this->con->executeQuery($query, array(
':i' => array($offre->getId(), \PDO::PARAM_INT), ':i' => array($offre->getId(), \PDO::PARAM_INT),
//':o' => array($offre->getOffreurId(), \PDO::PARAM_STR), ':o' => array($offre->getOffreurId(), \PDO::PARAM_INT),
':o' => array(1,\PDO::PARAM_INT),
':t' => array($offre->getNom(), \PDO::PARAM_STR), ':t' => array($offre->getNom(), \PDO::PARAM_STR),
':d' => array($offre->getDescription(), \PDO::PARAM_STR), ':d' => array($offre->getDescription(), \PDO::PARAM_STR),
'img' => array($offre->getImg(), \PDO::PARAM_STR), 'img' => array($offre->getImg(), \PDO::PARAM_STR),
@ -136,5 +135,14 @@ class OffreGateway
return intval($res[0]['COUNT(*)']); return intval($res[0]['COUNT(*)']);
} }
public function deleteOffer($id)
{
$query = 'DELETE FROM OFFRE WHERE id=:i';
$this->con->executeQuery($query,array(
':i' => array($id,\PDO::PARAM_INT)
)
);
}
} }

@ -34,7 +34,7 @@ class Alumni{
$this->email = $email; $this->email = $email;
$this->motDePasse = $motDePasse; $this->motDePasse = $motDePasse;
$this->role = $role; $this->role = $role;
$this->profil = new Profil($nom, $prenom, $email, "","", "", "",""); $this->profil = new Profil($id,$nom, $prenom, $email, "","", "", "","");
} }
/** /**

@ -51,9 +51,9 @@ class Profil
* @param string $githubUrl * @param string $githubUrl
* @param string $portfolioUrl * @param string $portfolioUrl
*/ */
public function __construct(string $nom, string $prenom, string $email, ?string $image,string $cv, string $linkedinUrl, string $githubUrl, string $portfolioUrl) public function __construct(int $alumni,string $nom, string $prenom, string $email, ?string $image,string $cv, string $linkedinUrl, string $githubUrl, string $portfolioUrl)
{ {
$this->id = $alumni;
$this->nom = $nom; $this->nom = $nom;
$this->prenom = $prenom; $this->prenom = $prenom;
$this->image = $image; $this->image = $image;
@ -65,7 +65,10 @@ class Profil
} }
public function getId(): int
{
return $this->id;
}
public function getImage(): ?string public function getImage(): ?string
{ {
return $this->image ?? 'logo.png'; return $this->image ?? 'logo.png';

@ -2,7 +2,9 @@
namespace App\modele; namespace App\modele;
use App\gateway\Connection;
use App\metier\Alumni; use App\metier\Alumni;
use App\metier\Evenement;
class AdminModele extends MembreModele class AdminModele extends MembreModele
{ {
@ -10,9 +12,21 @@ class AdminModele extends MembreModele
* @description supprimer un compte * @description supprimer un compte
* @param Alumni $account compte à supprimer * @param Alumni $account compte à supprimer
*/ */
public function deleteAccount(\App\metier\Alumni $account) public function deleteAccount(int $accountId)
{ {
// TO DO global $twig;
$dVueErreur = [];
$con = new Connection(DB_HOST, DB_USER, DB_PASS);
$gate = new \App\gateway\AlumniGateway($con);
$result = $gate->deleteUser($accountId);
/* try {
var_dump($result);
} catch (\Exception $e) {
$dVueErreur[] = "Erreur lors de la suppression du compte";
echo $twig->render("erreur.html", ['dVueErreur' => $dVueErreur]);
}*/
} }
/** /**
@ -29,30 +43,33 @@ class AdminModele extends MembreModele
* @description supprimer une offre spécifique * @description supprimer une offre spécifique
* @param Offre $offer offre à supprimer * @param Offre $offer offre à supprimer
*/ */
public function deleteOffer(Offre $offer)
{
// TO DO
}
/** /**
* @description créer un évènement * @description créer un évènement
* @return \Evenement évènement créé * @return \Evenement évènement créé
*/ */
public function createEvent() : \Evenement public function ajouterEvenement(int $idOrganisateur, string $titre, string $description, string $date, int $nbPlaceMax, string $img)
{ {
$event = new \Evenement("","",null); $evenement = new Evenement(
// TO DO $this->eventGw->getNewId(),
$idOrganisateur,
$titre,
$description,
$date,
$nbPlaceMax,
$img
);
return $event; $this->eventGw->insertEvenement($evenement);
} }
/** /**
* @description suppression d'un évènement * @description suppression d'un évènement
* @param \Evenement $event évènement à supprimer * @param \Evenement $event évènement à supprimer
*/ */
public function deleteEvent(\Evenement $event) public function deleteEvenement(int $id)
{ {
// TO DO $this->eventGw->deleteEvenement($id);
} }
/** /**

@ -2,6 +2,7 @@
namespace App\modele; namespace App\modele;
use App\gateway\ImageManager;
use App\metier\Alumni; use App\metier\Alumni;
use App\metier\Offre; use App\metier\Offre;
@ -66,8 +67,11 @@ class MembreModele extends UtilisateurModele
return false; return false;
} }
/**
* @param string $img url de l'image
* @param string $logo url du logo
* @description publier une offre
*/
public function publishOffer(string $img, string $logo) public function publishOffer(string $img, string $logo)
{ {
$desc = $_POST["description"]; $desc = $_POST["description"];
@ -92,7 +96,7 @@ class MembreModele extends UtilisateurModele
// à la place de NULL passer id utilisateur créateur offre // à la place de NULL passer id utilisateur créateur offre
$offre = new Offre($this->offreGw->getNewId(), $offre = new Offre($this->offreGw->getNewId(),
new Alumni("test.mail@icloud.fr","password","admin","prenom","nom"), new Alumni(intval($_SESSION['id']),"test.mail@icloud.fr","",$_SESSION['role'],$_SESSION['nom'],$_SESSION['prenom']),
$nom, $nom,
$desc, $desc,
$img, $img,
@ -113,6 +117,18 @@ class MembreModele extends UtilisateurModele
$this->offreGw->addOffers($offre); $this->offreGw->addOffers($offre);
return $offre; return $offre;
}
/**
* @param Offre $offre offre à supprimer
* @description supprimer une offre
* @return void
*/
public function deleteOffer(Offre $offre)
{
$this->offreGw->deleteOffer($offre->getId());
ImageManager::deleteImg($offre->getImg());
ImageManager::deleteImg($offre->getLogo());
} }

@ -16,12 +16,14 @@ class UtilisateurModele
{ {
private $con; private $con;
protected $offreGw; protected $offreGw;
protected $eventGw;
public function __construct() public function __construct()
{ {
$this->con = new Connection(DB_HOST,DB_USER,DB_PASS); $this->con = new Connection(DB_HOST,DB_USER,DB_PASS);
$this->offreGw = new OffreGateway($this->con); $this->offreGw = new OffreGateway($this->con);
$this->eventGw = new EvenementGateway($this->con);
} }
/** /**
@ -88,9 +90,9 @@ class UtilisateurModele
$gate = new AlumniGateway($con); $gate = new AlumniGateway($con);
// Récupérez l'utilisateur avec l'email donné en utilisant AlumniGateway // Récupérez l'utilisateur avec l'email donné en utilisant AlumniGateway
$utilisateur = $gate->findByEmail($email); $utilisateur = $gate->findByEmail($email);
if ($utilisateur instanceof Alumni) { if (isset($utilisateur[0])) {
// L'utilisateur existe, retournez-le // L'utilisateur existe, retournez-le
return $utilisateur; return new Alumni($utilisateur[0]['id'],$utilisateur[0]['mail'], $utilisateur[0]['mdp'], $utilisateur[0]['role'],$utilisateur[0]['nom'],$utilisateur[0]['prenom']);
} else { } else {
// L'utilisateur n'existe pas, renvoyez null // L'utilisateur n'existe pas, renvoyez null
return null; return null;
@ -119,29 +121,6 @@ class UtilisateurModele
return $evenement; return $evenement;
} }
public function ajouterEvenement(string $titre, string $description, string $date, int $nbPlaceMax, string $img)
{
$gate = new EvenementGateway($this->con);
$evenement = new Evenement(
$gate->getNewId(),
'1', //TODO : Ajouter l'ID de l'admin connecté
$titre,
$description,
$date,
$nbPlaceMax,
$img
);
$gate->insertEvenement($evenement);
}
public function deleteEvenement(int $id)
{
$gate = new EvenementGateway($this->con);
$gate->deleteEvenement($id);
}
public function getEvenementById(int $id) : Evenement public function getEvenementById(int $id) : Evenement
{ {
$gate = new EvenementGateway($this->con); $gate = new EvenementGateway($this->con);
@ -196,6 +175,7 @@ class UtilisateurModele
$profils = array(); $profils = array();
foreach ($data as $row) { foreach ($data as $row) {
$profils[] = new Profil( $profils[] = new Profil(
$row['alumni'],
$row['nom'], $row['nom'],
$row['prenom'], $row['prenom'],
$row['email'], $row['email'],
@ -212,6 +192,11 @@ class UtilisateurModele
} }
/**
* @param int $id identifiant d'offre
* @return Offre|null offre trouvée
* @description récupérer une offre depuis son id
*/
public function getOfferFromId(int $id) : ?Offre public function getOfferFromId(int $id) : ?Offre
{ {
$res = $this->offreGw->getOfferFromId($id); $res = $this->offreGw->getOfferFromId($id);
@ -223,6 +208,11 @@ class UtilisateurModele
/**
* @description créer une offre depuis un tableau de retour de Gw
* @param array $res tableau de retour de Gw
* @return array tableau d'offres
*/
public function CreateOffersFromGw($res) : array public function CreateOffersFromGw($res) : array
{ {
$alGw = new AlumniGateway(new Connection(DB_HOST,DB_USER,DB_PASS)); $alGw = new AlumniGateway(new Connection(DB_HOST,DB_USER,DB_PASS));
@ -231,10 +221,9 @@ class UtilisateurModele
foreach ($res as $row) foreach ($res as $row)
{ {
$resal = $alGw->ObtenirById($row['offreur']); $resal = $alGw->ObtenirById($row['offreur']);
$profilGw = new ProfilGateway(new Connection(DB_HOST,DB_USER,DB_PASS)); $profilGw = new ProfilGateway(new Connection(DB_HOST,DB_USER,DB_PASS));
$resProfl = $profilGw->getProfilById($row['offreur']); $resProfl = $profilGw->getProfilById($resal[0]['id']);
$alumni = new Alumni(intval($resal[0]['id']),$resal[0]['mail'],$resal[0]['mdp'],$resal[0]['role'],$resProfl[0]['nom'],$resProfl[0]["prenom"]); $alumni = new Alumni(intval($resal[0]['id']),$resal[0]['mail'],$resal[0]['mdp'],$resal[0]['role'],$resProfl[0]['nom'],$resProfl[0]["prenom"]);
@ -265,24 +254,37 @@ class UtilisateurModele
return $offers; return $offers;
} }
/**
* @param $start int de départ pour la reqûete sql
* @param $nbOffers nombre d'offres à récupérer
* @return array tableau d'offres
*/
public function getOfferLimit($start, $nbOffers): array public function getOfferLimit($start, $nbOffers): array
{ {
$res = $this->offreGw->getOfferLimit($start, $nbOffers); $res = $this->offreGw->getOfferLimit($start, $nbOffers);
return $this->CreateOffersFromGw($res); return $this->CreateOffersFromGw($res);
} }
/**
* @return int nombre d'offres
*/
public function getNbOffers() : int public function getNbOffers() : int
{ {
return $this->offreGw->getNbOffers(); return $this->offreGw->getNbOffers();
} }
/**
* @param $params array filtres de la recherche
* @return array tableau d'offres
*/
public function getOffersWithFilters($params) : array public function getOffersWithFilters($params) : array
{ {
return $this->offreGw->getOffersWithFilters($params); return $this->CreateOffersFromGw($this->offreGw->getOffersWithFilters($params));
} }
/**
* @return array tableau de toutes les offres
*/
public function getOffers() : array public function getOffers() : array
{ {
$res = $this->offreGw->getOffers(); $res = $this->offreGw->getOffers();
@ -294,6 +296,4 @@ class UtilisateurModele
{ {
return $this->offreGw->getNbTotalPages(); return $this->offreGw->getNbTotalPages();
} }
}
}

@ -14,17 +14,18 @@
<div class="container mt-4 d-flex align-content-center "> <div class="container mt-4 d-flex align-content-center ">
<div> <div>
{% if role == 'Membre' or role == 'Admin' %} {% if role == 'Membre' or role == 'Admin' %}
<a href="{{dir}}/createOfferForm" type="button" class="btn btn-outline-success mb-4">Publier une offre</a> <a href="{{dir}}/user/{{id}}/createOfferForm" type="button" class="btn btn-outline-success mb-4">Publier une offre</a>
{% else %}
<a type="button" class="btn btn-outline-light mb-4">Publier une offre</a>
<p><i>Connectez vous pour publier une offre</i></p>
{% endif %} {% endif %}
</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="{{dir}}/consultOffers" method="get" class="form-inline flex-wrap mb-4"> <form action="{{dir}}/consultOffers" method="post" 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">
@ -47,8 +48,6 @@
</div> </div>
</div> </div>
<div class="form-group mr-3 flex-column"> <div class="form-group mr-3 flex-column">
<label for="experience">Expérience :</label> <label for="experience">Expérience :</label>
<div class="form-check"> <div class="form-check">
@ -83,7 +82,7 @@
</div> </div>
<div> <div>
<a href="{{dir}}/consultOffers" class="btn btn-info">Réinitialiser les filtres</a> <a href="{{dir}}/resetFilters" class="btn btn-info">Réinitialiser les filtres</a>
</div> </div>
</div> </div>
@ -97,53 +96,58 @@
<div class="col-md-8 offset-md-2"> <div class="col-md-8 offset-md-2">
{% for offre in offres %}
<article class="mb-4">
<div class="row1">
<img src="{{dir}}/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">
<p class="authorDate"><strong>{{offre.getOffreur().Prenom()}}, {{offre.getOffreur().getNom() }} | {{ offre.getDateStringFr()}}</strong></p>
<p>{{ offre.getDescription() }}</p>
</div>
<div class="row3"> {% if offres %}
<img src="public/assets/location.png" alt="location"> {% for offre in offres %}
<p>{{offre.getVille()}}</p> <article class="list-group-item">
</div> <div class="row1">
<button type="button" class="btn btn-outline-primary btn-sm mb-2 custom-button" <img src="{{dir}}/public/uploads/{{offre.getLogo()}}" class="img-fluid rounded" alt="logo"> <!-- Ajoutez la classe "rounded" pour arrondir les coins -->
onclick="window.location.href = '{{dir}}/displayOffer/{{offre.getId()}}'">En savoir plus</button> <h4>{{ offre.getNom() }}</h4>
</article> </div>
<div class="row2">
{% endfor %} <p class="authorDate"><strong>{{offre.getOffreur().Prenom()}}, {{offre.getOffreur().getNom() }} | {{ offre.getDateStringFr()}}</strong></p>
<p>{{ offre.getDescription() }}</p>
<nav style="text-align: center;"> </div>
<nav style="text-align: center;">
{% if numberPages is defined %}
{% if numberPages > 1 %}
{% if currentPage is defined %}
{% for i in 1..numberPages %}
{% if i == currentPage %}
<!--
index.php?action=consultOffers&page={{ i }}&typeContrat={{ typeContrat }}&experience={{ experience }}&niveauEtudes={{ niveauEtudes }}
-->
<a href="{{dir}}/consultOffers?page={{i}}{{valContrat}}{{valExp}}{{ValEtudes}}" class="current">{{ i }}</a>
{% else %}
<a href="{{dir}}/consultOffers?page={{i}}{{valContrat}}{{valExp}}{{ValEtudes}}">{{ i }}</a>
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endif %}
</nav>
<div class="row3">
<img src="{{dir}}/public/assets/location.png" alt="location">
<p>{{offre.getVille()}}</p>
</div>
<div class="d-flex justify-content-around">
<button type="button" class="btn btn-outline-primary btn-sm mb-2 custom-button"
onclick="window.location.href = '{{dir}}/displayOffer/{{offre.getId()}}'">En savoir plus</button>
{% if role == 'Admin' or id == offre.getOffreur().getId() %}
<button class="btn btn-outline-danger mb-2" onclick="window.location.href='{{dir}}/user/{{id}}/deleteOffer/{{offre.getId()}}'">Supprimer</button>
{% endif %}
</div>
</article>
{% endfor %}
{% else %}
<li class="list-group-item">Aucune offre trouvée.</li>
{% endif %}
<nav class="pagination justify-content-center">
{% if numberPages is defined %}
{% if numberPages > 1 %}
{% if currentPage is defined %}
{% for i in 1..numberPages %}
{% if i == currentPage %}
<a href="{{ dir }}/consultOffers?id={{ i }}" class="page-item page-link current">{{ i }}</a>
{% else %}
<a href="{{ dir }}/consultOffers?id={{ i }}" class="page-item page-link">{{ i }}</a>
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endif %}
</nav> </nav>
</div> </div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script> <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>

@ -9,31 +9,35 @@
<header> <header>
<!-- Add your logo here --> <!-- Add your logo here -->
{% include "menu.html" %} {% include "menu.html" %}
</header> </header>
<div class="container mt-5"> <div class="container mt-5">
<h1 class="display-4">Détails de l'Offre</h1> <h1 class="display-4">Détails de l'Offre</h1>
<a href="{{dir}}/ConsultOffers" class="btn btn-primary mb-4">Retour</a>
<ul class="list-group"> <ul class="list-group">
<!-- Add an image related to the offer -->
<li class="list-group-item"></li><img src="{{dir}}/public/uploads/{{offre.getLogo()}}" alt="Logo" class="img-thumbnail" style="max-height: 50px; max-width: 50px;"></li>
{% if role == 'Admin' or id == offre.getOffreur().getId() %}
<button class="btn btn-outline-danger mb-2" onclick="window.location.href='{{dir}}/user/{{id}}/deleteOffer/{{offre.getId()}}'">Supprimer</button>
{% endif %}
<img src="{{dir}}/public/uploads/{{offre.getLogo()}}" alt="Logo" class="img-thumbnail" style="max-height: 50px; max-width: 50px;"></li>
<li class="list-group-item"><img src="{{dir}}/public/uploads/{{offre.getImg()}}" alt="Offer Image" class="img-fluid"></li> <li class="list-group-item"><img src="{{dir}}/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().Prenom()}} {{offre.getOffreur().getNom() }}</li> <li class="list-group-item"><strong>Offreur:</strong> {{offre.getOffreur().Prenom()}} {{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>
<li class="list-group-item"><strong>Entreprise :</strong> {{ offre.getEntreprise() }}</li> <li class="list-group-item"><strong>Entreprise :</strong> {{ offre.getEntreprise() }}</li>
<li class="list-group-item"><strong>Description:</strong> {{ offre.getDescription() }}</li> <li class="list-group-item"><strong>Description:</strong> {{ offre.getDescription() }}</li>
<li class="list-group-item"><strong>Type de contrat:</strong> {{ offre.getTypeContrat() }}</li> <li class="list-group-item"><strong>Type de contrat:</strong> {{ offre.getTypeContrat() }}</li>
<li class="list-group-item"><strong>Niveau d'études :</strong> {{ offre.getNiveauEtudes() }}</li> <li class="list-group-item"><strong>Niveau d'études :</strong> {{ offre.getNiveauEtudes() }}</li>
<li class="list-group-item"><strong>Experience Recherchée :</strong> {{ offre.getExperience() }}</li>
<li class="list-group-item"><strong>Ville:</strong> {{ offre.getVille() }}</li> <li class="list-group-item"><strong>Ville:</strong> {{ offre.getVille() }}</li>
<li class="list-group-item"><strong>Date de publication:</strong> {{ offre.getDateStringFr() }}</li> <li class="list-group-item"><strong>Date de publication:</strong> {{ offre.getDateStringFr() }}</li>
<li class="list-group-item"><strong>Descriptif Poste :</strong> {{ offre.getDescriptifPoste() }}</li> <li class="list-group-item"><strong>Descriptif Poste :</strong> {{ offre.getDescriptifPoste() }}</li>
<li class="list-group-item"><strong>Profil recherché :</strong> {{ offre.getProfilSearched() }}</li> <li class="list-group-item"><strong>Profil recherché :</strong> {{ offre.getProfilSearched() }}</li>
<li class="list-group-item"><strong>Site de L'annonce :</strong> {{ offre.getSiteUrl() }}</li> <li class="list-group-item"><strong>Site de L'annonce :</strong><a href="{{offre.getSiteUrl()}}" target="_blank">{{ offre.getSiteUrl() }}</a></li>
<li class="list-group-item"><strong>Mail de Contact : :</strong> {{ offre.getMailContact() }}</li> <li class="list-group-item"><strong>Mail de Contact : :</strong> {{ offre.getMailContact() }}</li>
<li class="list-group-item"><strong>Numéro de Contact :</strong> {{ offre.getNumero() }}</li> <li class="list-group-item"><strong>Numéro de Contact :</strong> {{ offre.getNumero() }}</li>
<li class="list-group-item"> <li class="list-group-item">
<strong>Full Remote :</strong> <strong>Full Remote :</strong>
{% if offre.isRemote() %} {% if offre.isRemote() %}

@ -1,52 +1,52 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="fr">
<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" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<title>Alica - Accueil</title> <link rel="stylesheet" type="text/css" href="{{dir}}/public/css/accueil.css">
</head> <title>Alica - Accueil</title>
</head>
<body>
<header>
{% include 'menu.html' %}
</header>
<div class="container mt-5">
<h1 class="text-center">Accueil</h1>
<p class="text-center">
{% if prenom and nom %}
Bienvenue, {{ prenom }} {{ nom }} {{id}} {{role}}!
{% else %}
Bienvenue, invité!
{% endif %}
</p>
<!-- balise center provisoire c'est pour mes yeux -->
<body>
<header>
{% include 'menu.html' %}
</header>
<h1>Accueil</h1>
<!-- Bienvenu suivie du mail des informations sessions de l'utilisateur -->
<p>{% if prenom and nom %}
Bienvenue, {{ prenom }} {{ nom }} {{id}}!
{% else %}
Bienvenue, invité!
{% endif %}</p>
<p>Vous êtes sur la page d'accueil</p>
{% if dVueErreur is not empty %} {% if dVueErreur is not empty %}
<div class="CadreInput"> <div class="alert alert-danger">
<div class="box"> <ul>
<div class="error"> {% for erreur in dVueErreur %}
<ul> <li>{{ erreur }}</li>
{% for erreur in dVueErreur %} {% endfor %}
<li>{{ erreur }}</li> </ul>
{% endfor %}
</ul>
</div>
</div>
</div> </div>
{% endif %} {% endif %}
<div class="main">
<div class="banner"> <div class="row">
<img class="banner-img" src="assets/bandeau.png"> <div class="col-md-12">
<div class="title-banner"> <div class="banner">
<div class="subtitle">Le réseau Alica te souhaite la bienvenue !</div> <img class="img-fluid" src="{{dir}}/public/assets/bandeau.png">
<div class="title">Alica Info</div> <div class="banner-content">
<div class="description">Nous sommes danciens étudiants à lIUT dAubière qui aimerions créer un réseau d'anciens étudiants au travers d'un réseau alumni du département Informatique.</div> <h2>Le réseau Alica te souhaite la bienvenue !</h2>
<p>Nous sommes danciens étudiants à lIUT dAubière qui aimerions créer un réseau d'anciens étudiants au travers d'un réseau alumni du département Informatique.</p>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="slideshow-container" id="evenements"> <!--
<div class="slideshow-container" id="evenements">
{% for event in eventsList %} {% for event in eventsList %}
<div class="slide"> <div class="slide">
<div class="slide-img"> <div class="slide-img">
@ -56,7 +56,6 @@
<div class="slide-date">{{event.date}}</div> <div class="slide-date">{{event.date}}</div>
<div class="slide-title">{{event.titre}}</div> <div class="slide-title">{{event.titre}}</div>
<div class="slide-description">{{event.description}}</div> <div class="slide-description">{{event.description}}</div>
<a href="index.php?action=" class="button">S'inscrire</a>
</div> </div>
</div> </div>
{% endfor %} {% endfor %}
@ -71,9 +70,14 @@
</div> </div>
</div> </div>
</body> </body>
<footer> <footer> -->
{% include 'footer.html' %} {% include 'footer.html' %}
</footer> </footer>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</html> </html>
<script type="module" src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.esm.js"></script> <script type="module" src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.esm.js"></script>
<script nomodule src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.js"></script> <script nomodule src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.js"></script>

@ -15,7 +15,7 @@
<main class="container mt-4"> <main class="container mt-4">
<h1>Publier Une Offre</h1> <h1>Publier Une Offre</h1>
<form style="background-color: #00DBFF" class="p-4" enctype="multipart/form-data" action="index.php?action=createOffer" method="post"> <form style="background-color: #00DBFF" class="p-4" enctype="multipart/form-data" action="{{dir}}/user/{{id}}/createOffer" method="post">
{% if tabError is defined %} {% if tabError is defined %}
{% for error in tabError %} {% for error in tabError %}

@ -9,7 +9,7 @@
<body> <body>
<div class="container mt-5"> <div class="container mt-5">
<h1 class="text-center">Créer un Événement</h1> <h1 class="text-center">Créer un Événement</h1>
<form action="creerEvenement" method="post" enctype="multipart/form-data"> <form action="{{dir}}/admin/{{id}}/creerEvenement" method="post" enctype="multipart/form-data">
<div class="form-group"> <div class="form-group">
<label for="titre">Titre de l'Événement :</label> <label for="titre">Titre de l'Événement :</label>
@ -33,6 +33,7 @@
<div class="form-group"> <div class="form-group">
<label for="image">Image de l'Événement :</label> <label for="image">Image de l'Événement :</label>
<p><i>Les images doivent être de type png, jpg, jpeg, bmp, webp & inférieures à 10MB</i></p>
<input type="file" class="form-control-file" name="image" id="image" required> <input type="file" class="form-control-file" name="image" id="image" required>
</div> </div>

@ -1,125 +0,0 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
<meta charset="UTF-8">
<title>Publier une Offre</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<header>
{% include "menu.html" %}
</header>
<main class="container mt-4">
<h1>Publier Une Offre</h1>
<form style="background-color: #00DBFF" class="p-4" enctype="multipart/form-data" action="createOffer" method="post">
{% if tabError is defined %}
{% for error in tabError %}
<p style="color: red">{{ error }}</p>
{% endfor %}
{% endif %}
<p>Les champs contenant des astrérisques * sont obligatoires.</p>
<div class="form-group">
<label for="name">Intitulé de l'offre*</label>
<input type="text" class="form-control" id="name" name="name" placeholder="Intitulé" maxlength="128" required>
</div>
<div class="form-group">
<label for="entreprise">Nom de l'entreprise :*</label>
<input type="text" class="form-control" id="entreprise" name="entreprise" placeholder="Entreprise" maxlength="64" required>
</div>
<div class="form-group">
<label for="description">Amorce :*</label>
<textarea class="form-control" id="description" name="description" placeholder="Description rapide" maxlength="200" required></textarea>
</div>
<div class="form-check">
<input type="checkbox" class="form-check-input" id="fullRemote" name="fullRemote" >
<label class="form-check-label" for="fullRemote">Full Remote</label>
</div>
<div class="form-group">
<label for="ville">Ville</label>
<input type="text" class="form-control" id="ville" name="ville" placeholder="Ville" required maxlength="100">
</div>
<div class="form-group">
<label for="choixContrat">Choisissez un type de contrat :*</label>
<select class="form-control" id="choixContrat" name="typeContrat">
<option value="CDI" selected>CDI</option>
<option value="CDD">CDD</option>
<option value="Alternance">Alternance</option>
<option value="Stage">Stage</option>
</select>
</div>
<div class="form-group">
<label for="descriptPoste">Descriptif du Poste :*</label>
<textarea class="form-control" id="descriptPoste" name="descriptPoste" placeholder="Description du Poste" required maxlength="2028"></textarea>
</div>
<div class="form-group">
<label for="profilRecherche">Profil Recherché :*</label>
<textarea class="form-control" id="profilRecherche" name="profilRecherche" placeholder="Profil recherché" required maxlength="2028"></textarea>
</div>
<div class="form-group">
<label for="choixExp">Experience Recherchée :*</label>
<select class="form-control" id="choixExp" name="choixExp" required>
<option value="Indifférent" selected>Indifferent</option>
<option value="Junior">Junior</option>
<option value="Senior">Senior</option>
</select>
</div>
<div class="form-group">
<label for="nivEtudes">Niveau d'études :*</label>
<select class="form-control" id="nivEtudes" name="education" required>
<option value="Indifférent" selected>Indifferent</option>
<option value="Bac+2">Bac+2</option>
<option value="Bac+3">Bac+3</option>
<option value="Bac+5">Bac+5</option>
</select>
</div>
<div class="form-group">
<label for="mail">Email de contact :*</label>
<input type="text" class="form-control" id="mail" name="mail" placeholder="Adresse de contact" maxlength="30" required>
</div>
<div class="form-group">
<label for="num">Numero de contact :*</label>
<input type="text" class="form-control" id="num" name="num" placeholder="Numéro de contact" required maxlength="10">
</div>
<div class="form-group">
<label for="site">Site web de l'annonce ou entreprise :</label>
<input type="text" class="form-control" id="site" name="site" placeholder="Adresse web" maxlength="40" required>
</div>
<label for="image">Image*</label>
<input type="file" name="image" id="image" required>
<label for="logo">Logo d'entreprise*</label>
<input type="file" name="logo" id="logo" required>
<input type="submit" value="Publier L'annonce" name="submit" id="submit">
<p><i>Les images doivent être de type png, jpg, jpeg, bmp, webp & inférieures à 10MB</i></p>
</form>
</main>
<!-- scripts : -->
<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>

@ -22,7 +22,12 @@
</button> </button>
</form> </form>
<h1>Liste des Événements</h1> <h1>Liste des Événements</h1>
<a href="{{dir}}/creerEvenement" class="btn btn-primary">Publier événement</a> {% if role == 'Admin' %}
<a href="{{dir}}/admin/{{id}}/creerEvenement" class="btn btn-primary">Publier événement</a>
{% else %}
<div>
</div>
{% endif %}
</div> </div>
<ul class="list-group"> <ul class="list-group">
@ -38,11 +43,16 @@
<p><strong>Places disponibles:</strong> {{ evenement.nbPlaceMax }}</p> <p><strong>Places disponibles:</strong> {{ evenement.nbPlaceMax }}</p>
<a href="{{dir}}/avoirDetailEvenement/{{ evenement.id }}" class="btn btn-primary">Détails</a> <a href="{{dir}}/avoirDetailEvenement/{{ evenement.id }}" class="btn btn-primary">Détails</a>
</div> </div>
<form action="{{dir}}/supprimerEvenement/{{ evenement.id }}" method="get"> {% if role == 'Admin' %}
<button type="submit" class="btn btn-primary" id="deleteButton"> <form action="{{dir}}/admin/{{id}}/supprimerEvenement/{{ evenement.id }}" method="get">
<img src="{{dir}}/public/assets/close.png" alt="Supprimer" width="20px"> <button type="submit" class="btn btn-primary" id="deleteButton">
</button> <img src="{{dir}}/public/assets/close.png" alt="Supprimer" width="20px">
</form> </button>
</form>
{% else %}
<div>
</div>
{% endif %}
</li> </li>
{% endfor %} {% endfor %}
{% else %} {% else %}

@ -27,7 +27,8 @@
<!-- 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="{{dir}}/deconnexion" class="button">Déconnexion</a> <a href="index.php?action=displayExperience">Mon profil</a>
<a href="{{dir}}/user/deconnexion" class="button">Déconnexion</a>
{% else %} {% else %}
<div class="login-register"> <div class="login-register">
<a href="{{dir}}/connection" class="button">Connexion</a> <a href="{{dir}}/connection" class="button">Connexion</a>

@ -19,14 +19,18 @@
{% for profil in profils %} {% for profil in profils %}
<div class="profile d-flex"> <div class="profile d-flex">
<div class="profile-image-container"> <div class="profile-image-container">
<img src="{{ dir }}/public/assets/{{ profil.image ?: 'default.png' }}" alt="Image de profil"> <img src=" {{dir}}/public/uploads/{{ profil.getImage() ?: 'logo.png'}}" alt="Image de profil">
</div> </div>
<div class="profile-details"> <div class="profile-details">
<p>{{ profil.prenom }} {{ profil.nom }}</p> <p>{{ profil.prenom }} {{ profil.nom }}</p>
<p class="job-title">Développeur web chez CGI FRANCE</p> {% if profil.experience is defined %}
<a href="{{ 'voir_profil.php?id=' ~ profil.id }}" class="btn btn-primary">Voir le détail du profil</a> <p class="job-title">{{ profil.experience }}</p>
{% if user.role == 'admin' %} {% else %}
<a href="{{ 'bloquer_profil.php?id=' ~ profil.id }}" class="btn btn-danger">Bannir l'utilisateur</a> <p class="job-title">Cet utilisateur n'a pas renseigné son poste</p>
{% endif %}
<a href="#" class="btn btn-primary">Voir le détail du profil</a>
{% if role == 'Admin' %}
<button onclick="fetch('{{ dir }}/admin/{{ profil.id }}/supprimerCompte');window.location.reload()" class="btn btn-danger">Bannir l'utilisateur</button>
{% endif %} {% endif %}
</div> </div>
</div> </div>
@ -62,7 +66,7 @@
</ul> </ul>
</nav> </nav>
<script></script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script> <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>

Loading…
Cancel
Save