Compare commits

..

5 Commits

Author SHA1 Message Date
Baptiste D e4d480b28f test
1 year ago
Baptiste D bd7f228d1f fix conflicts je crois
1 year ago
Baptiste D ef93699a64 test
1 year ago
Baptiste D 6f82697826 modif offres
1 year ago
Baptiste D b4127bb330 modification image saver gestion cas image nom existant
1 year ago

BIN
.DS_Store vendored

Binary file not shown.

86
.gitignore vendored

@ -8,6 +8,9 @@ ehthumbs_vista.db
# Dump file # Dump file
*.stackdump *.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares # Recycle Bin used on file shares
$RECYCLE.BIN/ $RECYCLE.BIN/
@ -74,6 +77,12 @@ Temporary Items
##### GPG ##### GPG
secring.* secring.*
##### Dropbox
# Dropbox settings and caches
.dropbox
.dropbox.attr
.dropbox.cache
##### SynopsysVCS ##### SynopsysVCS
# Waveform formats # Waveform formats
*.vcd *.vcd
@ -156,11 +165,23 @@ Sessionx.vim
# Temporary # Temporary
.netrwhist .netrwhist
*~
# Auto-generated tag files # Auto-generated tag files
tags tags
# Persistent undo # Persistent undo
[._]*.un~ [._]*.un~
##### Emacs
# -*- mode: gitignore; -*-
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*
# Org-mode # Org-mode
.org-id-locations .org-id-locations
*_archive *_archive
@ -233,6 +254,10 @@ bh_unicode_properties.cache
# https://packagecontrol.io/packages/sublime-github # https://packagecontrol.io/packages/sublime-github
GitHub.sublime-settings GitHub.sublime-settings
##### Notepad++
# Notepad++ backups #
*.bak
##### TextMate ##### TextMate
*.tmproj *.tmproj
*.tmproject *.tmproject
@ -255,6 +280,7 @@ tmtags
**/nbproject/Package-*.bash **/nbproject/Package-*.bash
build/ build/
nbbuild/ nbbuild/
dist/
nbdist/ nbdist/
.nb-gradle/ .nb-gradle/
@ -263,27 +289,27 @@ nbdist/
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff # User-specific stuff
php/.idea/**/workspace.xml .idea/**/workspace.xml
php/.idea/**/tasks.xml .idea/**/tasks.xml
php/.idea/**/usage.statistics.xml .idea/**/usage.statistics.xml
php/.idea/**/dictionaries .idea/**/dictionaries
php/.idea/**/shelf .idea/**/shelf
# Generated files # Generated files
php/.idea/**/contentModel.xml .idea/**/contentModel.xml
# Sensitive or high-churn files # Sensitive or high-churn files
php/.idea/**/dataSources/ .idea/**/dataSources/
php/.idea/**/dataSources.ids .idea/**/dataSources.ids
php/.idea/**/dataSources.local.xml .idea/**/dataSources.local.xml
php/.idea/**/sqlDataSources.xml .idea/**/sqlDataSources.xml
php/.idea/**/dynamic.xml .idea/**/dynamic.xml
php/.idea/**/uiDesigner.xml .idea/**/uiDesigner.xml
php/.idea/**/dbnavigator.xml .idea/**/dbnavigator.xml
# Gradle # Gradle
php/.idea/**/gradle.xml .idea/**/gradle.xml
php/.idea/**/libraries .idea/**/libraries
# Gradle and Maven with auto-import # Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files, # When using Gradle or Maven with auto-import, you should exclude module files,
@ -302,7 +328,7 @@ php/.idea/**/libraries
cmake-build-*/ cmake-build-*/
# Mongo Explorer plugin # Mongo Explorer plugin
php/.idea/**/mongoSettings.xml .idea/**/mongoSettings.xml
# File-based project format # File-based project format
*.iws *.iws
@ -317,7 +343,7 @@ out/
atlassian-ide-plugin.xml atlassian-ide-plugin.xml
# Cursive Clojure plugin # Cursive Clojure plugin
php/.idea/replstate.xml .idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ) # Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml com_crashlytics_export_strings.xml
@ -326,15 +352,17 @@ crashlytics-build.properties
fabric.properties fabric.properties
# Editor-based Rest Client # Editor-based Rest Client
php/.idea/httpRequests .idea/httpRequests
# Android studio 3.1+ serialized cache file # Android studio 3.1+ serialized cache file
php/.idea/caches/build_file_checksums.ser .idea/caches/build_file_checksums.ser
##### Eclipse ##### Eclipse
.metadata .metadata
bin/ bin/
tmp/ tmp/
*.tmp
*.bak
*.swp *.swp
*~.nib *~.nib
local.properties local.properties
@ -348,6 +376,12 @@ local.properties
# Locally stored "Eclipse launch configurations" # Locally stored "Eclipse launch configurations"
*.launch *.launch
# PyDev specific (Python IDE for Eclipse)
*.pydevproject
# CDT-specific (C/C++ Development Tooling)
.cproject
# CDT- autotools # CDT- autotools
.autotools .autotools
@ -376,6 +410,11 @@ local.properties
.apt_generated/ .apt_generated/
.apt_generated_test/ .apt_generated_test/
# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet
# Uncomment this line if you wish to ignore the project description file. # Uncomment this line if you wish to ignore the project description file.
# Typically, this file would be tracked if it contains build/dependency configurations: # Typically, this file would be tracked if it contains build/dependency configurations:
#.project #.project
@ -413,13 +452,12 @@ gradle-app.setting
# gradle/wrapper/gradle-wrapper.properties # gradle/wrapper/gradle-wrapper.properties
##### Composer ##### Composer
php/composer.phar composer.phar
php/composer /vendor/
php/vendor/
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control # Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
php/composer.lock composer.lock
##### PHP CodeSniffer ##### PHP CodeSniffer
# gitignore for the PHP Codesniffer framework # gitignore for the PHP Codesniffer framework
@ -438,4 +476,4 @@ php/composer.lock
php/.idea/ php/.idea/
##### Images : ##### Images :
###php/public/uploads/ php/public/uploads/

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="SqlDialectMappings">
<file url="file://$PROJECT_DIR$/php/src/gateway/AlumniGateway.php" dialect="GenericSQL" />
</component>
</project>

@ -0,0 +1 @@
dqzdqd

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

@ -1,372 +0,0 @@
-- 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.

@ -1,11 +1,3 @@
#RewriteEngine On
#
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.*)$ index.php/$1 [L]
RewriteEngine on RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L] RewriteRule . index.php [L]

@ -1,7 +1,6 @@
{ {
"require": { "require": {
"twig/twig": "^3.0", "twig/twig": "^3.0",
"twig/extensions": "^1.5",
"ext-pdo": "*", "ext-pdo": "*",
"ext-fileinfo": "*" "ext-fileinfo": "*"
}, },

@ -2,11 +2,9 @@
/** PC IUT - PHP 8.1 */ /** PC IUT - PHP 8.1 */
/** Chargement config */ /** Chargement config */
require_once __DIR__ . '/src/config/config.php'; require_once __DIR__ . '/src/config/config.php';
require __DIR__ . '/vendor/autoload.php'; require __DIR__ . '/vendor/autoload.php';
/** Configuration twig */ /** Configuration twig */
$loader = new \Twig\Loader\FilesystemLoader(__DIR__ . '/templates'); $loader = new \Twig\Loader\FilesystemLoader(__DIR__ . '/templates');
$twig = new \Twig\Environment($loader, [ $twig = new \Twig\Environment($loader, [
@ -14,9 +12,4 @@ $twig = new \Twig\Environment($loader, [
'debug' => true 'debug' => true
]); ]);
$twig->addExtension(new \Twig\Extension\DebugExtension()); $twig->addExtension(new \Twig\Extension\DebugExtension());
$twig->addGlobal('dir', '/SAE_2A_FA-Reseau_ALICA/php');
$cont = new \App\controleur\FrontControleur(); $cont = new \App\controleur\FrontControleur();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 842 KiB

@ -12,14 +12,13 @@ a{
body{ body{
display: flex; display: flex;
flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
min-height: 100vh; min-height: 100vh;
background: #fff; background: #fff;
} }
.containerC{ .container{
position: relative; position: relative;
width: 500px; width: 500px;
min-height: 500px; min-height: 500px;
@ -31,13 +30,12 @@ body{
-10px -10px 20px #ccc; -10px -10px 20px #ccc;
border-radius: 30px; border-radius: 30px;
padding: 50px; padding: 50px;
margin: 50px;
} }
form{ form{
position: relative; position: relative;
width: 100%; width: 100%;
} }
.containerC h3{ .container h3{
color: #000; color: #000;
font-weight: 600; font-weight: 600;
font-size: 2em; font-size: 2em;

@ -12,14 +12,13 @@ a{
body{ body{
display: flex; display: flex;
flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
min-height: 100vh; min-height: 100vh;
background: #fff; background: #fff;
} }
.containerC{ .container{
position: relative; position: relative;
width: 500px; width: 500px;
min-height: 500px; min-height: 500px;
@ -31,13 +30,12 @@ body{
-10px -10px 20px #ccc; -10px -10px 20px #ccc;
border-radius: 30px; border-radius: 30px;
padding: 50px; padding: 50px;
margin: 50px;
} }
form{ form{
position: relative; position: relative;
width: 100%; width: 100%;
} }
.containerC h3{ .container h3{
color: #000; color: #000;
font-weight: 600; font-weight: 600;
font-size: 2em; font-size: 2em;

@ -12,8 +12,8 @@
} }
.custom-button { .custom-button {
background-color: #7fb4bd; background-color: #00DBFF;
border-color: #7fb4bd; border-color: #00DBFF;
color: #fff; color: #fff;
} }
@ -49,12 +49,3 @@
.row3 img { .row3 img {
align-self: flex-start; align-self: flex-start;
} }
a{
text-decoration: none;
}
.current{
border-bottom: 1px solid black;
}

@ -1,122 +0,0 @@
/* profil.css */
.profiles-container {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
gap: 20px;
padding: 0;
list-style: none;
}
.profile {
width: calc(50% - 20px); /* Ajustez la largeur si nécessaire pour correspondre au design */
border: 1px solid #ccc; /* Bordure comme dans l'image */
border-radius: 10px;
overflow: hidden;
background: #fff;
margin-bottom: 20px;
display: flex;
align-items: center; /* Alignement vertical */
}
.profile-image-container {
padding: 10px;
display: flex;
align-items: center;
justify-content: center;
background: #f0f0f0;
flex-shrink: 0; /* Empêche le conteneur de rétrécir */
}
.profile-image-container img {
width: 100px;
height: 100px;
border-radius: 50%;
}
.profile-details {
padding: 10px;
flex-grow: 1; /* Permet à ce div de prendre l'espace restant */
}
.profile-details p {
margin: 5px 0;
font-weight: bold; /* Texte en gras comme dans l'image */
}
.profile-details .job-title {
color: #007bff;
font-size: 0.85em;
}
.profile-details a {
display: block; /* Prend toute la largeur du conteneur */
background: #007bff;
color: #fff;
padding: 5px 15px;
text-decoration: none;
border-radius: 5px;
font-size: 14px;
margin-top: 10px; /* Espace au-dessus du lien */
text-align: center; /* Centre le texte dans le lien */
}
.profile-details a:hover {
background: #0056b3;
}
/* profil.css */
.pagination {
display: flex;
padding-left: 0;
list-style: none;
border-radius: 0.25rem;
}
.page-link {
position: relative;
display: block;
padding: 0.5rem 0.75rem;
margin-left: -1px;
line-height: 1.25;
color: #007bff;
background-color: #fff;
border: 1px solid #dee2e6;
}
.page-link:hover {
color: #0056b3;
text-decoration: none;
background-color: #e9ecef;
border-color: #dee2e6;
}
.page-item:first-child .page-link {
margin-left: 0;
border-top-left-radius: 0.25rem;
border-bottom-left-radius: 0.25rem;
}
.page-item:last-child .page-link {
border-top-right-radius: 0.25rem;
border-bottom-right-radius: 0.25rem;
}
.page-item.active .page-link {
z-index: 1;
color: #fff;
background-color: #007bff;
border-color: #007bff;
}
.page-item.disabled .page-link {
color: #6c757d;
pointer-events: none;
cursor: auto;
background-color: #fff;
border-color: #dee2e6;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 467 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

@ -1,7 +1,6 @@
<?php <?php
namespace App\config; namespace App\config;
use App\metier\Alumni;
use App\modele\ImageModele; use App\modele\ImageModele;
use App\modele\OffreModele; use App\modele\OffreModele;
@ -81,9 +80,9 @@ class Validation
return false; return false;
} }
public static function validerEvenement(int $idOrganisateur, string $titre, string $description, string $date, int $nbPlaceMax, string $img) : bool public static function validerEvenement(string $titre, string $description, string $date, int $nbPlaceMax, string $img) : bool
{ {
if(!empty($idOrganisateur) && !empty($titre) && !empty($description) && !empty($date) && !empty($nbPlaceMax) && !empty($img)) if(!empty($titre) && !empty($description) && !empty($date) && !empty($nbPlaceMax) && !empty($img))
{ {
if(self::validerIntPossitif($nbPlaceMax)) if(self::validerIntPossitif($nbPlaceMax))
{ {
@ -144,15 +143,4 @@ class Validation
} }
public function isAdmin() : ?Alumni
{
if(isset($_SESSION['login']) && isset($_SESSION['role']))
{
$login = self::nettoyerString($_SESSION['login']);
$role = self::nettoyerString($_SESSION['role']);
return $_SESSION["utilisateur"];
}
return null;
}
} }

@ -1,36 +1,41 @@
<?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 supprimerCompte(?array $params) public function __construct()
{ {
global $twig; global $twig;
$adminModel = new AdminModele(); if (!isset($_REQUEST["action"])) {
$dVueErreur = []; $action = NULL;
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 {
$dVueErreur[] = "ID du profil non spécifié."; $action = \App\config\Validation::nettoyerString($_REQUEST["action"]);
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()
@ -38,33 +43,14 @@ class AdminControleur extends ModerateurControleur
//TODO //TODO
} }
public function creerEvenement() protected function creerEvenement()
{ {
global $twig; //TODO
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', []);
}
} }
public function supprimerEvenement(?array $params) protected function supprimerEvenement()
{ {
$mdl = new AdminModele(); //TODO
$mdl->deleteEvenement($params["id2"]);
$this->listerEvenement();
} }
protected function supprimerOffre() protected function supprimerOffre()

@ -1,136 +1,55 @@
<?php <?php
namespace App\controleur; namespace App\controleur;
use App\router\AltoRouter;
use App\controleur\Error;
class FrontControleur class FrontControleur
{ {
public function __construct() public function __construct()
{ {
global $twig; global $twig;
session_start(); session_start();
$dVueErreur = [];
if(!isset($_SESSION['nom']) && !isset($_SESSION['prenom']) && !isset($_SESSION['role']) && !isset($_SESSION['id'])) $actions = array(
{ "Admin" => [
$_SESSION['nom'] = NULL; "supprimerCompte", "consulterSignalement","supprimerOffre"
$_SESSION['prenom'] = NULL; ],
$_SESSION['role'] = "guest"; "Moderateur" => [
$_SESSION['id'] = NULL; //TODO
} ],
else{ "Membre" => [
$twig->addGlobal('nom', $_SESSION['nom']); "deconnexion","proposerOffre","consulterProfil","modifierProfil","signaler",
$twig->addGlobal('prenom', $_SESSION['prenom']); ],
$twig->addGlobal('role', $_SESSION['role']); "Utilisateur" => [
$twig->addGlobal('id', $_SESSION['id']);
} "connexion", "inscription", "accueil", "consulterProfilLimite", "publierOffre", "listerEvenement", "creerEvenement", "supprimerEvenement", "avoirDetailEvenement", "rechercherEvenement"
]
);
$router = new AltoRouter();
$action = \App\config\Validation::nettoyerString($_GET["action"] ?? "");
$router->setBasePath('/SAE_2A_FA-Reseau_ALICA/php'); if(in_array($action,$actions['Admin'])) {
if (!isset($_SESSION["role"]) || $_SESSION["role"]!="admin") {
$router->map('GET|POST', '/', 'UtilisateurControleur'); $dVueErreur[] = 'Veuillez vous connecter';
echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]);
$router->map('GET|POST','/[a:action]?','UtilisateurControleur'); } else{
new AdminControleur();
$router->map('POST','/[a:action]?','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]/[i:id2]?', 'MembreControleur');
$router->map('GET|POST', '/admin/[i:id]/[a:action]?', 'AdminControleur');
$router->map('GET|POST', '/admin/[i:id]/[a:action]/[i:id2]?', 'AdminControleur');
$id = 0;
$match = $router->match();
$action = array();
$id = array();
try{
if (!$match) {
$dVueErreur[] = "Error 404 Page not found";
echo $twig->render("erreur.html", ['dVueErreur' => $dVueErreur]);
}
if ($match) {
$controller = $match['target'] ?? NULL;
$action = $match['params']['action'] ?? NULL;
$id = $match['params']['id'] ?? NULL;
$namespace = 'App\\controleur\\';
try {
if ($controller == "MembreControleur") {
if ($_SESSION["role"] != "Membre" && $_SESSION["role"] != "Admin") {
echo $twig->render("connection.html", ['msg' => 'Vous devez vous connecter pour effectuer cette action']);
} else {
$controller = "MembreControleur";
$controller = $namespace . $controller;
//echo "controller : ".$controller;
$controller = new $controller();
} }
} }
else if(in_array($action,$actions['Moderateur'])) {
if ($controller == "AdminControleur") { if (!isset($_SESSION["role"]) || ($_SESSION["role"]!="moderateur" && $_SESSION["role"]!="admin")) {
if ($_SESSION["role"] != "Admin") { $dVueErreur[] = 'Veuillez vous connecter';
$dVueErreur = ["Erreur : Vous n'avez pas les privileges pour cette action"];
global $twig;
echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]); echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]);
return; } else{
} else { new ModerateurControleur();
$controller = "AdminControleur";
$controller = $namespace . $controller;
$controller = new $controller();
} }
} }
else if(in_array($action,$actions['Membre'])) {
if ($controller == "UtilisateurControleur") { if (!isset($_SESSION["utilisateur"])) {
$controller = $namespace . $controller; $dVueErreur[] = 'Veuillez vous connecter';
$controller = new $controller();
}
if (is_callable(array($controller, $action))) {
call_user_func(array($controller, $action), $match['params']);
} else {
echo $twig->render('accueil.html');
}
} catch (Error $error) {
$dVueErreur = ['Erreur : Action inconnue'];
echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]); echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]);
} else{
new MembreControleur();
} }
}else{
new UtilisateurControleur();
} }
} }
catch(Error $e)
{
$dVueErreur = ['Erreur : Action inconnue'];
echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]);
}
}
} }

@ -1,123 +1,60 @@
<?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()
{}
public function deconnexion()
{ {
global $twig; global $twig;
session_unset(); if (!isset($_REQUEST["action"])) {
$action = NULL;
} else {
$action = \App\config\Validation::nettoyerString($_REQUEST["action"]);
}
switch ($action) {
case "deconnexion":
$this->deconnexion();
break;
case "proposerOffre":
$this->proposerOffre();
break;
case "consulterProfil":
$this->consulterProfil();
break;
case "modifierProfil":
$this->modifierProfil();
break;
case "signaler":
$this->signaler();
break;
default:
parent::__construct();
}
}
protected function deconnexion()
{
session_destroy(); session_destroy();
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", []);
}
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("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 proposerOffre()
public function deleteOffer(?array $params)
{
global $twig;
$id = $params['id2'];
$MemberModel = new MembreModele();
$offre = $MemberModel->getOfferFromId($id);
if($offre != NULL)
{
$MemberModel->deleteOffer($offre);
}
$this->consultOffers(NULL);
}
public function proposerOffre()
{ {
//TODO //TODO
} }
public function consulterProfil()
protected function consulterProfil()
{ {
//TODO //TODO
} }
public function modifierProfil()
protected function modifierProfil()
{ {
//TODO //TODO
} }
public function signaler()
protected function signaler()
{ {
//TODO //TODO
} }

@ -3,43 +3,80 @@
namespace App\controleur; namespace App\controleur;
use App\config\Validation; use App\config\Validation;
use App\gateway\ImageManager; use App\gateway\Connection;
use App\metier\Alumni; use App\gateway\ImageSaver;
use App\modele\OffreModele; use App\gateway\OffreGateway;
use App\modele\UtilisateurModele; use App\modele\UtilisateurModele;
use Exception;
use App\config;
class UtilisateurControleur class UtilisateurControleur
{ {
private \App\modele\UtilisateurModele $userModel;
public function __construct()
public function connection()
{ {
global $twig; global $twig;
$dVueErreur = []; $this->userModel = new \App\modele\UtilisateurModele();
$userModel = new UtilisateurModele();
if (isset($_POST['email'], $_POST['password'])) {
$email = Validation::nettoyerString($_POST['email']);
$motDePasse = Validation::nettoyerString($_POST['password']);
$utilisateur = $userModel->connection($email, $motDePasse); if (!isset($_REQUEST["action"])) {
//$action = NULL;
$action = "consultOffers";
} else {
$action = \App\config\Validation::nettoyerString($_REQUEST["action"]);
}
switch ($action) {
case NULL:
case "accueil":
$this->accueil();
break;
case "inscription_success":
$this->inscription_success();
break;
case "connection":
$this->connection();
break;
case "inscription":
$this->inscription();
break;
case "consultOffers":
$this->consultOffers();
break;
case "consulterProfilLimite":
$this->consulterProfilLimite();
break;
case "createOffer":
$this->createOffer();
break;
case "createOfferForm":
$this->createOfferForm();
break;
case "displayOffer":
$this->displayOffer();
break;
default:
$dVueErreur[] = "Action inconnue ou non autorisée";
echo $twig->render("erreur.html", ['dVueErreur' => $dVueErreur]);
if ($utilisateur instanceof Alumni) { }
$_SESSION['nom'] = $utilisateur->getNom(); }
$_SESSION['prenom'] = $utilisateur->getPrenom();
$_SESSION['role'] = $utilisateur->getRole();
$_SESSION['id'] = $utilisateur->getId();
echo $twig->render('accueil.html',[ protected function connection()
'nom' => $_SESSION['nom'], {
'prenom' => $_SESSION['prenom'], global $twig;
'role' => $_SESSION['role'], $dVueErreur = []; // Tableau pour stocker les erreurs, le cas échéant
'id' => $_SESSION['id' $userModel = new \App\modele\UtilisateurModele();
]]);
return; if (isset($_POST['email'], $_POST['password'])) {
$email = \App\config\Validation::nettoyerString($_POST['email']);
$motDePasse = \App\config\Validation::nettoyerString($_POST['password']);
$utilisateur = $userModel->connection($email, $motDePasse);
if ($utilisateur instanceof \App\metier\Alumni) {
$_SESSION['utilisateur'] = $utilisateur;
header('Location: index.php?action=accueil');
exit();
} else { } else {
$dVueErreur[] = "L'adresse email ou le mot de passe est incorrect."; $dVueErreur[] = "L'adresse email ou le mot de passe est incorrect.";
} }
@ -47,266 +84,263 @@ class UtilisateurControleur
echo $twig->render('connection.html', ['dVueErreur' => $dVueErreur]); echo $twig->render('connection.html', ['dVueErreur' => $dVueErreur]);
} }
public function inscription() protected function inscription()
{ {
global $twig; global $twig;
$dVueErreur = []; $dVueErreur = []; // Tableau pour stocker les erreurs, le cas échéant
$userModel = new UtilisateurModele(); $userModel = new \App\modele\UtilisateurModele();
if (isset($_POST['firstname'],$_POST['name'], $_POST['email'], $_POST['password'])) { if (isset($_POST['firstname'],$_POST['name'], $_POST['email'], $_POST['password'])) {
$nom = Validation::nettoyerString($_POST['name']); $nom = \App\config\Validation::nettoyerString($_POST['name']);
$prenom = Validation::nettoyerString($_POST['firstname']); $prenom = \App\config\Validation::nettoyerString($_POST['firstname']);
$email = Validation::nettoyerString($_POST['email']); $email = \App\config\Validation::nettoyerString($_POST['email']);
$motDePasse = Validation::nettoyerString($_POST['password']); $motDePasse = \App\config\Validation::nettoyerString($_POST['password']);
$hash = password_hash($motDePasse, PASSWORD_DEFAULT); $hash = password_hash($motDePasse, PASSWORD_DEFAULT);
try {
// verification que l'email est valide et unique : // verification que l'email est valide et unique :
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$dVueErreur[] = "L'adresse email n'est pas valide ou est déjà utilisée."; $dVueErreur[] = "L'adresse email n'est pas valide ou est déjà utilisée.";
} else { } else {
$utilisateur = $userModel->getUtilisateurByEmail($email); $utilisateur = $userModel->getUtilisateurByEmail($email);
if ($utilisateur instanceof Alumni) { if ($utilisateur instanceof \App\metier\Alumni) {
$dVueErreur[] = "L'adresse email est déjà utilisée."; $dVueErreur[] = "L'adresse email est déjà utilisée.";
} }
} }
$nouvelUtilisateur = $userModel->inscription($prenom, $nom, $email, $hash); $nouvelUtilisateur = $userModel->inscription($prenom,$nom,$email, $hash);
if ($nouvelUtilisateur instanceof Alumni) { if ($nouvelUtilisateur instanceof \App\metier\Alumni) {
echo $twig->render('inscription_success.html'); header('Location: index.php?action=inscription_success');
exit(); exit();
} } else {
}
catch (Exception $e) {
$dVueErreur[] = "L'inscription a échoué, veuillez réessayer."; $dVueErreur[] = "L'inscription a échoué, veuillez réessayer.";
} }
} }
echo $twig->render('inscription.html', ['dVueErreur' => $dVueErreur]); echo $twig->render('inscription.html', ['dVueErreur' => $dVueErreur]);
} }
public function accueil() protected function accueil()
{ {
global $twig; global $twig;
// Ajout d'un var_dump pour déboguer // Ajout d'un var_dump pour déboguer
if (isset($_SESSION['utilisateur']) && $_SESSION['utilisateur'] instanceof Alumni) { if (isset($_SESSION['utilisateur']) && $_SESSION['utilisateur'] instanceof \App\metier\Alumni) {
$userModel = new UtilisateurModele(); $prenom = $_SESSION['utilisateur']->getPrenom();
$evenements=$userModel->getEvenement(); $nom = $_SESSION['utilisateur']->getNom();
//aller sur la page d'accueil avec le nom et prenom de l'utilisateur
echo $twig->render('accueil.html', ['evenements' => $evenements]);
} else {
echo $twig->render('accueil.html');
} }
else{
$prenom = null;
$nom = null;
}
//aller sur la page d'accueil avec le nom et prenom de l'utilisateur
echo $twig->render('accueil.html', ['prenom' => $prenom, 'nom' => $nom]);
} }
public function consulterProfilLimite() protected function inscription_success()
{ {
//TODO global $twig;
echo 'not implemented yet'; echo $twig->render('inscription_success.html');
} }
protected function consulterProfilLimite()
/**
* @return void
* @description afficher la liste des offres
*/
public function resetFilters()
{ {
unset($_SESSION["niveauEtudes"]); //TODO
unset($_SESSION["typeContrat"]);
unset($_SESSION["experience"]);
$this->consultOffers(null);
} }
/** /**
* @param array|null $params paramètres / filtres de la rehcerhce
* @return void * @return void
* @description afficher la liste des offres * @brief Affiche la liste des offres d'emploi
*/ */
public function consultOffers(?array $params)
protected function consultOffers()
{ {
$userMdl = new UtilisateurModele();
global $twig; global $twig;
$niveauEtudes = NULL;
$typeContrat = NULL;
$exp = NULL;
$msg = NULL;
$niveauEtudes=null;
$typeContrat=null;
$exp = null;
// number of offers by pages
$nbOffers = 5 ; $nbOffers = 5 ;
if(isset($_POST["niveauEtudes"]) && Validation::validateTypeStudies($_POST["niveauEtudes"])) { /** validation of entry's : */
//$niveauEtudes = $_POST["niveauEtudes"]; if(isset($_GET["niveauEtudes"]) && Validation::validateTypeStudies($_GET["niveauEtudes"])) {
$_SESSION["niveauEtudes"] = $_POST["niveauEtudes"]; $niveauEtudes = $_GET["niveauEtudes"];
$niveauEtudes = $_SESSION["niveauEtudes"];
} }
else if(isset($_SESSION["niveauEtudes"]))
{$niveauEtudes = $_SESSION["niveauEtudes"];}
if(isset($_POST["typeContrat"]) && Validation::validateTypeContract($_POST["typeContrat"])) { if(isset($_GET["typeContrat"]) && Validation::validateTypeContract($_GET["typeContrat"])) {
//$typeContrat = $_POST["typeContrat"]; $typeContrat = $_GET["typeContrat"];
$_SESSION["typeContrat"] = $_POST["typeContrat"];
$typeContrat = $_SESSION["typeContrat"];
} }
else if(isset($_SESSION["typeContrat"]))
{$typeContrat = $_SESSION["typeContrat"];}
if(isset($_POST["experience"]) && Validation::validateExperience($_POST["experience"])) { if(isset($_GET["experience"]) && Validation::validateExperience($_GET["experience"])) {
//$exp = $_POST["experience"]; $exp = $_GET["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 = $this->userModel->getNbOffers();
} else { } else {
$params = array( $params = array(
'typeContrat' => $typeContrat, 'typeContrat' => $typeContrat,
'exp' => $exp, 'exp' => $exp,
'niveauEtudes' => $niveauEtudes 'niveauEtudes' => $niveauEtudes,
); );
//$offers = $userMdl->getOffersWithFilters($params); $offers = $this->userModel->getOffersWithFilters($params);
//var_dump($offers); $totalOffers = count($offers);
//$totalOffers = count($offers);
$totalOffers = count($userMdl->getOffersWithFilters($params));
} }
// get the current pages to display
$numberPages = ceil($totalOffers / 5); $numberPages = ceil($totalOffers / 5);
//var_dump($params); if($numberPages == 0 )
//echo "page : ".$params["id"];
/*if (isset($params["id"]) && intval($params["id"]) != null)*/
if(isset($_GET['id']) && intval($_GET['id']) != null)
{ {
$page = intval($_GET['id']);
//echo "page : ".$page; echo $twig->render("OffersList.html",['dVueErreur' => ['Aucune Offre Trouvée']]);
return;
}
// validate the page number
if (isset($_GET["page"]) && intval($_GET["page"]) != null) {
$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]);
return; return;
} }
} else { } else {
$page = 1; $page = 1;
} }
$start = intval(($page - 1) * 5);
$offers = []; $start = intval(($page - 1) * 5);
if ($niveauEtudes == null && $typeContrat == null && $exp == null) { if ($niveauEtudes == null && $typeContrat == null && $exp == null) {
$offers = $userMdl->getOfferLimit($start, $nbOffers); $offers = $this->userModel->getOfferLimit($start, $nbOffers);
} else { } else {
$params['start'] = $start; $params['start'] = $start;
$params['nbOffers'] = 5; $params['nbOffers'] = 5;
$offers = $userMdl->getOffersWithFilters($params); $offers = $this->userModel->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,
'offres' => $offers, 'offres' => $offers,
'numberPages' => $numberPages, 'numberPages' => $numberPages,
'currentPage' => $page, 'currentPage' => $page,
'typeContrat' => (($typeContrat != null) ? $typeContrat : ""), 'typeContrat' => (($typeContrat != null ? $typeContrat : "")),
'experience' => (($exp != null) ? $exp : ""), 'experience' => (($exp != null ? $exp : "")),
'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 : ""))
]); ]);
} }
/**
* @param array|null $params paramètres
* @return void
* @description afficher le détail d'une offre // display the form to create an offer
*/ protected function createOfferForm()
public function displayOffer(?array $params)
{ {
global $twig; global $twig;
echo $twig->render("CreerOffre.html", []);
}
if (isset($params['id']) && intval($params['id']) != null)
{ // create offer
$uttilsMdl = new UtilisateurModele(); protected function createOffer()
$offre = $uttilsMdl->getOfferFromId(intval($params["id"]));
if($offre != NULL)
{ {
echo $twig->render("OffreDetail.html",['offre' => $offre]); global $twig;
return; $taberror = [];
$requiredFields = ['name', 'entreprise', 'description','typeContrat', 'descriptPoste', 'profilRecherche', 'choixExp', 'education', 'mail', 'num'];
// validate required fields
$error = false;
foreach ($requiredFields as $field) {
if (empty($_POST[$field])) {
$error = true;
$taberror[] = "Le champ {$field} est requis !";
} }
} }
$dVueErreur[] = "Erreur, Offre introuvable"; if($error)
echo $twig->render("erreur.html", ['dVueErreur' => $dVueErreur]); {
echo $twig->render("CreerOffre.html", ['tabError' => $taberror ]);
return;
} }
public function listerEvenement()
{
$mdl = new UtilisateurModele();
$evenements = $mdl->getEvenement();
global $twig;
echo $twig->render('evenement.html', ['evenements' => $evenements]); // validate entrys
if(!Validation::verifierEmail($_POST["mail"]))
{
//echo $twig->render("CreerOffre.html", ['errMsg' => "Email non valide !" ]);
$taberror[] = "Email non valide !";
} }
public function avoirDetailEvenement(?array $params) if(!Validation::validateNumber($_POST["num"]))
{ {
$mdl = new UtilisateurModele(); $taberror[] = "Numero non valide !";
global $twig; //echo $twig->render("CreerOffre.html", ['errMsg' => "Numero non valide !" ]);
}
if(isset($params['id']))
if (!Validation::validateImage("image"))
{ {
$evenement = $mdl->getEvenementById($params['id']); 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 errors display the form with errors
if(count($taberror) > 0)
{
echo $twig->render("CreerOffre.html", ['tabError' => $taberror ]);
echo $twig->render('detailEvenement.html', ['evenement' => $evenement]);
} }
else echo $twig->render('erreur.html', ['dVueErreur' => ['erreur id evenement']]); else{
$saveImg1 = ImageSaver::SaveImage("image");
$saveImg2 = ImageSaver::SaveImage("logo");
if($saveImg1[0] && $saveImg2[0]) {
$offre = $this->userModel->publishOffer($saveImg1[1], $saveImg2[1]);
echo $twig->render("OffreDetailTest.html", ['offre' => $offre]);
} }
else
public function rechercherEvenement()
{ {
$mdl = new UtilisateurModele(); $taberror[] = "Erreur lors de l'upload des images";
$evenements = $mdl->getEvenement(); echo $twig->render("CreerOffre.html", ['tabError' => $taberror ]);
}
if (isset($_POST["recherche"]) and !empty($_POST["recherche"])) {
$recherche = Validation::nettoyerString($_POST["recherche"]);
$evenements = $mdl->getEvenementByTitre($recherche);
} }
global $twig;
echo $twig->render('evenement.html', ['evenements' => $evenements]);
} }
public function getProfilByPage(?array $params) // display offers
public function displayOffer()
{ {
global $twig; global $twig;
$dVueErreur = []; // Tableau pour stocker les erreurs, le cas échéant
$userModel = new UtilisateurModele(); if (isset($_GET["id"]) && intval($_GET["id"]) != null)
$nbParPage = 6; {
$nombreTotalPages = ceil(($userModel->getNbTotalPages())/$nbParPage); $offre = $this->userModel->getOfferFromId(intval($_GET["id"]));
if (isset($params['id'] ) && $params['id'] != null) { if($offre != NULL)
$page = Validation::validerIntPossitif($params['id']); {
try{ echo $twig->render("OffreDetailTest.html",['offre' => $offre]);
$profils = $userModel->getProfilByPage($page, $nbParPage); return;
if (isset($profils)) {
echo $twig->render('profil.html', [
'profils' => $profils,
'nombreTotalPages' => $nombreTotalPages,
'page' => $page]
);
}
}catch (Exception $e){
$dVueErreur[] = "Aucun profil n'a été trouvé.";
echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]);
} }
} else {
$dVueErreur[] = "La page n'existe pas.";
echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]);
} }
$dVueErreur[] = "Erreur, Offre introuvable";
echo $twig->render("erreur.html", ['dVueErreur' => $dVueErreur]);
} }
} }

@ -3,22 +3,19 @@ namespace App\gateway;
use PDO; use PDO;
use App\metier\Alumni; use App\metier\Alumni;
use App\metier\Role; use App\metier\Role;
use App\metier\Profil;
class AlumniGateway class AlumniGateway
{ {
private Connection $con; private \App\gateway\Connection $con;
/** /**
* @param $con * @param $con
*/ */
public function __construct(Connection $con) public function __construct(\App\gateway\Connection $con){
{
$this->con = $con; $this->con = $con;
} }
public function insert(string $email, string $motDePasse, string $role) public function insert(string $email, string $motDePasse, string $role){
{
$query = 'INSERT INTO Alumni (mail, mdp, role) VALUES (:mail, :mdp, :role)'; $query = 'INSERT INTO Alumni (mail, mdp, role) VALUES (:mail, :mdp, :role)';
return $this->con->executeQuery($query, array( return $this->con->executeQuery($query, array(
':mail' => array($email, PDO::PARAM_STR), ':mail' => array($email, PDO::PARAM_STR),
@ -28,16 +25,15 @@ class AlumniGateway
} }
public function updateMotDePasse(int $id, string $password) public function updateMotDePasse(int $id, string $password){
{ $query='UPDATE Alumni SET motDePasse=:new WHERE id=:i';
$query = 'UPDATE Alumni SET motDePasse=:new WHERE id=:i';
$this->con->executeQuery($query, array( $this->con->executeQuery($query, array(
':i' => array($id, PDO::PARAM_INT), ':i' => array($id, PDO::PARAM_INT),
':new' => array($password, PDO::PARAM_STR) ':new' => array($password, PDO::PARAM_STR)
)); ));
} }
public function ObtenirById(int $id): array public function ObtenirById(int $id) : array
{ {
$query = 'SELECT * FROM Alumni WHERE id=:i'; $query = 'SELECT * FROM Alumni WHERE id=:i';
$this->con->executeQuery($query, array( $this->con->executeQuery($query, array(
@ -46,24 +42,31 @@ class AlumniGateway
return $this->con->getResults(); return $this->con->getResults();
} }
public function findByEmail(string $email) public function findByEmail(string $email){
{ $query = 'SELECT Alumni.mail, Alumni.mdp, Alumni.role, Profil.nom, Profil.prenom
$query = 'SELECT Alumni.id, Alumni.mail, Alumni.mdp, Alumni.role, Profil.nom, Profil.prenom
FROM Alumni FROM Alumni
LEFT JOIN Profil ON Alumni.id = Profil.alumni LEFT JOIN Profil ON Alumni.id = Profil.alumni
WHERE Alumni.mail = :e'; WHERE Alumni.mail = :e';
$this->con->executeQuery($query, array( $this->con->executeQuery($query, array(
':e' => array($email, PDO::PARAM_STR), ':e' => array($email, PDO::PARAM_STR),
)); ));
return $this->con->getResults(); $res = $this->con->getResults();
if (count($res) == 0) {
return null;
}
return new \App\metier\Alumni($res[0]['mail'], $res[0]['mdp'], $res[0]['role'], $res[0]['nom'], $res[0]['prenom']);
} }
public function getAll() public function getAll(){
{ $query='SELECT * FROM Alumni';
$query = 'SELECT * FROM Alumni';
$this->con->executeQuery($query); $this->con->executeQuery($query);
return $this->con->getResults(); $res=$this->con->getResults();
$array=[];
foreach($res as $r){
$array[]=new Alumni($r['mail'],$r['id'],$r['mdp'],$r['role']);
}
return $array;
} }
public function getID(string $email) public function getID(string $email)
@ -75,27 +78,4 @@ class AlumniGateway
$res = $this->con->getResults(); $res = $this->con->getResults();
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,62 +0,0 @@
<?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;
}
}
}

@ -0,0 +1,44 @@
<?php
namespace App\gateway;
class ImageSaver
{
public static function getId() : int
{
return rand(10000,19999);
}
public static function SaveImage(string $filename) : array
{
try {
$return = [];
$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;
return $return;
} catch (\Exception $e) {
$return[] = false;
$return[] = "";
return $return;
}
}
}

@ -53,7 +53,8 @@ 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_INT), //':o' => array($offre->getOffreurId(), \PDO::PARAM_STR),
':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),
@ -127,22 +128,6 @@ class OffreGateway
return $this->con->getResults(); return $this->con->getResults();
} }
public function getNbTotalPages()
{
$query = 'SELECT COUNT(*) FROM Profil';
$this->con->executeQuery($query, array());
$res = $this->con->getResults();
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)
)
);
}
} }

@ -4,11 +4,11 @@ namespace App\gateway;
use PDO; use PDO;
class ProfilGateway class ProfilGateway
{ {
private Connection $con; private \App\gateway\Connection $con;
/** /**
* @param Connection $con * @param Connection $con
*/ */
public function __construct(Connection $con) public function __construct(\App\gateway\Connection $con)
{ {
$this->con = $con; $this->con = $con;
} }
@ -33,16 +33,4 @@ class ProfilGateway
)); ));
return $this->con->getResults(); return $this->con->getResults();
} }
public function userByPage(int $page, int $nbParPage)
{
$start = ($page - 1) * $nbParPage; // Calcul de l'index de départ pour LIMIT
$start = max(0, $start); // Si $start est négatif, on met 0 (pas de page -1)
$query = 'SELECT * FROM Profil LIMIT :start, :nbParPage';
$this->con->executeQuery($query, array(
':start' => array($start, PDO::PARAM_INT),
':nbParPage' => array($nbParPage, PDO::PARAM_INT),
));
return $this->con->getResults();
}
} }

@ -3,7 +3,7 @@
namespace App\metier; namespace App\metier;
class Alumni{ class Alumni{
private int $id;
/** /**
* @var string Email * @var string Email
*/ */
@ -28,13 +28,12 @@ class Alumni{
* @param Profil $profil * @param Profil $profil
*/ */
public function __construct(int $id,string $email, string $motDePasse, String $role, string $nom, string $prenom) public function __construct(string $email, string $motDePasse, String $role, string $nom, string $prenom)
{ {
$this->id = $id;
$this->email = $email; $this->email = $email;
$this->motDePasse = $motDePasse; $this->motDePasse = $motDePasse;
$this->role = $role; $this->role = $role;
$this->profil = new Profil($id,$nom, $prenom, $email, "","", "", "",""); $this->profil = new Profil($nom, $prenom, $email, "","", "", "");
} }
/** /**
@ -77,9 +76,4 @@ class Alumni{
{ {
return $this->profil->getNom(); return $this->profil->getNom();
} }
public function getId()
{
return $this->id;
}
} }

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

@ -10,21 +10,21 @@ class TypeContrat {
const Alternance = "Alternance"; const Alternance = "Alternance";
const Stage = "Stage"; const Stage = "Stage";
} }
//
//enum ProfilRecherche : string enum ProfilRecherche : string
//{ {
// case Junior = "Junior"; case Junior = "Junior";
// case Senior = "Senior"; case Senior = "Senior";
// case Indifferent = "Indifferent"; case Indifferent = "Indifferent";
//} }
//
//enum NiveauEtudes: string enum NiveauEtudes: string
//{ {
// case Bac2 = "Bac+2"; case Bac2 = "Bac+2";
// case Bac3 = "Bac+3"; case Bac3 = "Bac+3";
// case Bac5 = "Bac+5"; case Bac5 = "Bac+5";
// case Indifferent = "Indifferent"; case Indifferent = "Indifferent";
//} }
class Offre class Offre
{ {

@ -19,7 +19,6 @@ class Profil
*/ */
private string $nom; private string $nom;
/** /**
* @var string Prenom * @var string Prenom
*/ */
@ -29,8 +28,6 @@ class Profil
/** /**
* @var string Url linkedin * @var string Url linkedin
*/ */
//image can be null
private ?string $image;
private string $linkedinUrl; private string $linkedinUrl;
/** /**
@ -51,12 +48,11 @@ class Profil
* @param string $githubUrl * @param string $githubUrl
* @param string $portfolioUrl * @param string $portfolioUrl
*/ */
public function __construct(int $alumni,string $nom, string $prenom, string $email, ?string $image,string $cv, string $linkedinUrl, string $githubUrl, string $portfolioUrl) public function __construct(string $nom, string $prenom, string $email, 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->email = $email; $this->email = $email;
$this->cv = $cv; $this->cv = $cv;
$this->linkedinUrl = $linkedinUrl; $this->linkedinUrl = $linkedinUrl;
@ -65,14 +61,6 @@ class Profil
} }
public function getId(): int
{
return $this->id;
}
public function getImage(): ?string
{
return $this->image ?? 'logo.png';
}
public function getCv(): string public function getCv(): string
{ {
return $this->cv; return $this->cv;

@ -2,9 +2,7 @@
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
{ {
@ -12,21 +10,9 @@ 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(int $accountId) public function deleteAccount(\App\metier\Alumni $account)
{ {
global $twig; // TO DO
$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]);
}*/
} }
/** /**
@ -43,33 +29,30 @@ 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 ajouterEvenement(int $idOrganisateur, string $titre, string $description, string $date, int $nbPlaceMax, string $img) public function createEvent() : \Evenement
{ {
$evenement = new Evenement( $event = new \Evenement("","",null);
$this->eventGw->getNewId(), // TO DO
$idOrganisateur,
$titre,
$description,
$date,
$nbPlaceMax,
$img
);
$this->eventGw->insertEvenement($evenement); return $event;
} }
/** /**
* @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 deleteEvenement(int $id) public function deleteEvent(\Evenement $event)
{ {
$this->eventGw->deleteEvenement($id); // TO DO
} }
/** /**

@ -2,13 +2,20 @@
namespace App\modele; namespace App\modele;
use App\gateway\ImageManager; use App\gateway\Connection;
use App\gateway\OffreGateway;
use App\metier\Alumni; use App\metier\Alumni;
use App\metier\Offre; use App\metier\Offre;
class MembreModele extends UtilisateurModele class MembreModele extends UtilisateurModele
{ {
private OffreGateway $offreGw;
public function __construct()
{
$this->offreGw = new OffreGateway(new Connection("mysql:host=localhost;dbname=dbAlica", "Dev", "Dev"));
}
/** /**
* @description modifier photo de profil * @description modifier photo de profil
@ -19,6 +26,8 @@ class MembreModele extends UtilisateurModele
return false; return false;
} }
/** /**
* @description ajouter formation * @description ajouter formation
*/ */
@ -66,13 +75,7 @@ class MembreModele extends UtilisateurModele
// TO DO // TO DO
return false; return false;
} }
public function publishOffer(string $img,string $logo)
/**
* @param string $img url de l'image
* @param string $logo url du logo
* @description publier une offre
*/
public function publishOffer(string $img, string $logo)
{ {
$desc = $_POST["description"]; $desc = $_POST["description"];
$descposte = $_POST["descriptPoste"]; $descposte = $_POST["descriptPoste"];
@ -96,7 +99,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(intval($_SESSION['id']),"test.mail@icloud.fr","",$_SESSION['role'],$_SESSION['nom'],$_SESSION['prenom']), new Alumni("test.mail@icloud.fr","password","admin","prenom","nom"),
$nom, $nom,
$desc, $desc,
$img, $img,
@ -119,18 +122,7 @@ class MembreModele extends UtilisateurModele
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());
}
} }

@ -0,0 +1,145 @@
<?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(DB_HOST,DB_USER,DB_PASS));
}
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(DB_HOST,DB_USER,DB_PASS));
$offers=[];
foreach ($res as $row)
{
$resal = $alGw->ObtenirById($row['offreur']);
$profilGw = new ProfilGateway(new Connection(DB_HOST,DB_USER,DB_PASS));
$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,50 +1,50 @@
<?php <?php
namespace App\modele; namespace App\modele;
use App\gateway\AlumniGateway;
use App\gateway\Connection; use App\gateway\Connection;
use App\gateway\EvenementGateway;
use App\gateway\OffreGateway; use App\gateway\OffreGateway;
use App\metier\Evenement;
use App\metier\Alumni;
use App\gateway\AlumniGateway;
use App\gateway\ProfilGateway; use App\gateway\ProfilGateway;
use App\metier\Profil; use App\metier\Alumni;
use App\metier\Offre; use App\metier\Offre;
class UtilisateurModele class UtilisateurModele
{ {
private $con; /**
protected $offreGw; * @description Charger le flux d'activiter
protected $eventGw; * @return array flux
*/
public function LoadFeed() : array
{
// TO DO
return [];
}
private OffreGateway $offreGw;
public function __construct() public function __construct()
{ {
$this->con = new Connection(DB_HOST,DB_USER,DB_PASS); $this->offreGw = new OffreGateway(new Connection("mysql:host=localhost;dbname=dbAlica", "Dev", "Dev"));
$this->offreGw = new OffreGateway($this->con);
$this->eventGw = new EvenementGateway($this->con);
} }
/** /**
* @description se connecter * @description se connecter
* @param string email * @param string email
* @param string hash * @param string hash
* @return Alumni * @return \App\metier\Alumni
*/ */
public function connection(string $email, string $mdp): ?Alumni public function connection(string $email, string $mdp) : ? \App\metier\Alumni
{ {
$con = new Connection(DB_HOST, DB_USER, DB_PASS); $con = new \App\gateway\Connection(DB_HOST,DB_USER,DB_PASS);
$gate = new AlumniGateway($con); $gate = new \App\gateway\AlumniGateway($con);
// Récupérez l'utilisateur avec l'email donné en utilisant AlumniGateway
// Récupation de l'utilisateur avec l'email
$utilisateur = $gate->findByEmail($email); $utilisateur = $gate->findByEmail($email);
if (isset($utilisateur[0])) { if ($utilisateur instanceof \App\metier\Alumni) {
// L'utilisateur existe, vérification du mot de passe // L'utilisateur existe, vérifiez le mot de passe
if (password_verify($mdp, $utilisateur[0]['mdp'])) { if (password_verify($mdp, $utilisateur->getPassword())) {
// Le mot de passe est correct, retournez l'utilisateur // Le mot de passe est correct, retournez l'utilisateur
return new Alumni($utilisateur[0]['id'],$utilisateur[0]['mail'], $utilisateur[0]['mdp'], $utilisateur[0]['role'],$utilisateur[0]['nom'],$utilisateur[0]['prenom']); session_start();
return $utilisateur;
} else { } else {
// Le mot de passe est incorrect, renvoyez null // Le mot de passe est incorrect, renvoyez null
return null; return null;
@ -63,18 +63,26 @@ class UtilisateurModele
* @return \Alumni chargé * @return \Alumni chargé
*/ */
public function inscription(string $prenom, string $nom, string $email, string $hashpassword): ?Alumni public function inscription(string $prenom, string $nom,string $email, string $hashpassword):? \App\metier\Alumni
{ {
$role = "Membre"; $role = "Membre";
$con = new Connection(DB_HOST, DB_USER, DB_PASS); $con = new \App\gateway\Connection(DB_HOST,DB_USER,DB_PASS);
$gate = new AlumniGateway($con); $gate = new \App\gateway\AlumniGateway($con);
$profilGate = new ProfilGateway($con); $profilGate = new \App\gateway\ProfilGateway($con);
// Insérez le nouvel utilisateur dans la base de données en utilisant AlumniGateway // Insérez le nouvel utilisateur dans la base de données en utilisant AlumniGateway
if ($gate->insert($email, $hashpassword, $role)) { if ($gate->insert($email, $hashpassword, $role)) {
$id = $gate->getID($email); // <<<<<<< HEAD
if ($profilGate->insert($id, $nom, $prenom, $email)) { // // L'insertion a réussi, retournez le nouvel utilisateur
// $nouvelUtilisateur = new \App\metier\Alumni($email, $hashpassword, $role);
// return $nouvelUtilisateur;
// } else {
// // L'insertion a échoué, renvoyez un utilisateur vide pour indiquer l'échec
// return new \App\metier\Alumni(null, null, null);
// =======
$alumni = $gate->getID($email);
if($profilGate->insert($alumni,$nom, $prenom,$email)){
// L'insertion a réussi, retournez le nouvel utilisateur // L'insertion a réussi, retournez le nouvel utilisateur
$nouvelUtilisateur = new Alumni($id, $email, $hashpassword, $role, $nom, $prenom); $nouvelUtilisateur = new \App\metier\Alumni($email, $hashpassword, $role,$nom,$prenom);
return $nouvelUtilisateur; return $nouvelUtilisateur;
} }
return null; return null;
@ -86,117 +94,26 @@ class UtilisateurModele
public function getUtilisateurByEmail(string $email) public function getUtilisateurByEmail(string $email)
{ {
$con = new Connection(DB_HOST, DB_USER, DB_PASS); $con = new \App\gateway\Connection(DB_HOST,DB_USER,DB_PASS);
$gate = new AlumniGateway($con); $gate = new \App\gateway\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 (isset($utilisateur[0])) { if ($utilisateur instanceof \App\metier\Alumni) {
// L'utilisateur existe, retournez-le // L'utilisateur existe, retournez-le
return new Alumni($utilisateur[0]['id'],$utilisateur[0]['mail'], $utilisateur[0]['mdp'], $utilisateur[0]['role'],$utilisateur[0]['nom'],$utilisateur[0]['prenom']); return $utilisateur;
} else { } else {
// L'utilisateur n'existe pas, renvoyez null // L'utilisateur n'existe pas, renvoyez null
return null; return null;
} }
} }
public function getEvenement() : array public function getOffers() : array
{
$gate = new EvenementGateway($this->con);
$data = $gate->getAllEvenement();
$evenement = array();
foreach ($data as $row) {
$evenement[] = new Evenement(
$row['id'],
$row['organisateur'],
$row['titre'],
$row['description'],
$row['date'],
$row['nbPlaceMax'],
$row['image']
);
}
return $evenement;
}
public function getEvenementById(int $id) : Evenement
{
$gate = new EvenementGateway($this->con);
$data = $gate->findById($id);
$evenement = new Evenement(
$data[0]['id'],
$data[0]['organisateur'],
$data[0]['titre'],
$data[0]['description'],
$data[0]['date'],
$data[0]['nbPlaceMax'],
$data[0]['image']
);
return $evenement;
}
public function getEvenementByTitre(string $titre) : array
{
$gate = new EvenementGateway($this->con);
$data = $gate->findByTitle($titre);
$evenement = array();
foreach($data as $row)
{
$evenement[] = new Evenement(
$row['id'],
$row['organisateur'],
$row['titre'],
$row['description'],
$row['date'],
$row['nbPlaceMax'],
$row['image']
);
}
return $evenement;
}
public function getProfilByPage(string $page, int $nbParPage)
{ {
$page = max(1, intval($page)); $res = $this->offreGw->getOffers();
$con = new Connection(DB_HOST, DB_USER, DB_PASS); $offers = $this->CreateOffersFromGw($res);
$gate = new ProfilGateway($con); return $offers;
$data = $gate->userByPage($page, $nbParPage);
if(isset($data)){
//Création d'une liste d'objets utilisateurs
$profils = array();
foreach ($data as $row) {
$profils[] = new Profil(
$row['alumni'],
$row['nom'],
$row['prenom'],
$row['email'],
$row['image'] ?? null,
$row['cv'] ?? '',
$row['linkedinURL'] ?? '',
$row['githubURL'] ?? '',
$row['portfolioURL'] ?? ''
);
}
return $profils;
}
return null;
} }
/**
* @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);
@ -205,27 +122,21 @@ class UtilisateurModele
return null; return null;
} }
/**
* @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("mysql:host=localhost;dbname=dbAlica", "test", "test"));
$offers=[]; $offers=[];
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));
$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"]);
$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']); $date = \DateTime::createFromFormat('Y-m-d', $row['date']);
@ -254,46 +165,71 @@ 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->CreateOffersFromGw($this->offreGw->getOffersWithFilters($params)); 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 array tableau de toutes les offres
*/
public function getOffers() : array
{
$res = $this->offreGw->getOffers();
$offers = $this->CreateOffersFromGw($res);
return $offers;
}
public function getNbTotalPages() return $offre;
{
return $this->offreGw->getNbTotalPages();
} }
} }

@ -1,304 +0,0 @@
<?php
namespace App\router;
/*
MIT License
Copyright (c) 2012 Danny van Kooten <hi@dannyvankooten.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
class AltoRouter
{
/**
* @var array Array of all routes (incl. named routes).
*/
protected $routes = [];
/**
* @var array Array of all named routes.
*/
protected $namedRoutes = [];
/**
* @var string Can be used to ignore leading part of the Request URL (if main file lives in subdirectory of host)
*/
protected $basePath = '';
/**
* @var array Array of default match types (regex helpers)
*/
protected $matchTypes = [
'i' => '[0-9]++',
'a' => '[0-9A-Za-z]++',
'h' => '[0-9A-Fa-f]++',
'*' => '.+?',
'**' => '.++',
'' => '[^/\.]++'
];
/**
* Create router in one call from config.
*
* @param array $routes
* @param string $basePath
* @param array $matchTypes
* @throws Exception
*/
public function __construct(array $routes = [], $basePath = '', array $matchTypes = [])
{
$this->addRoutes($routes);
$this->setBasePath($basePath);
$this->addMatchTypes($matchTypes);
}
/**
* Retrieves all routes.
* Useful if you want to process or display routes.
* @return array All routes.
*/
public function getRoutes()
{
return $this->routes;
}
/**
* Add multiple routes at once from array in the following format:
*
* $routes = [
* [$method, $route, $target, $name]
* ];
*
* @param array $routes
* @return void
* @author Koen Punt
* @throws Exception
*/
public function addRoutes($routes)
{
if (!is_array($routes) && !$routes instanceof Traversable) {
throw new RuntimeException('Routes should be an array or an instance of Traversable');
}
foreach ($routes as $route) {
call_user_func_array([$this, 'map'], $route);
}
}
/**
* Set the base path.
* Useful if you are running your application from a subdirectory.
* @param string $basePath
*/
public function setBasePath($basePath)
{
$this->basePath = $basePath;
}
/**
* Add named match types. It uses array_merge so keys can be overwritten.
*
* @param array $matchTypes The key is the name and the value is the regex.
*/
public function addMatchTypes(array $matchTypes)
{
$this->matchTypes = array_merge($this->matchTypes, $matchTypes);
}
/**
* Map a route to a target
*
* @param string $method One of 5 HTTP Methods, or a pipe-separated list of multiple HTTP Methods (GET|POST|PATCH|PUT|DELETE)
* @param string $route The route regex, custom regex must start with an @. You can use multiple pre-set regex filters, like [i:id]
* @param mixed $target The target where this route should point to. Can be anything.
* @param string $name Optional name of this route. Supply if you want to reverse route this url in your application.
* @throws Exception
*/
public function map($method, $route, $target, $name = null)
{
$this->routes[] = [$method, $route, $target, $name];
if ($name) {
if (isset($this->namedRoutes[$name])) {
throw new RuntimeException("Can not redeclare route '{$name}'");
}
$this->namedRoutes[$name] = $route;
}
return;
}
/**
* Reversed routing
*
* Generate the URL for a named route. Replace regexes with supplied parameters
*
* @param string $routeName The name of the route.
* @param array @params Associative array of parameters to replace placeholders with.
* @return string The URL of the route with named parameters in place.
* @throws Exception
*/
public function generate($routeName, array $params = [])
{
// Check if named route exists
if (!isset($this->namedRoutes[$routeName])) {
throw new RuntimeException("Route '{$routeName}' does not exist.");
}
// Replace named parameters
$route = $this->namedRoutes[$routeName];
// prepend base path to route url again
$url = $this->basePath . $route;
if (preg_match_all('`(/|\.|)\[([^:\]]*+)(?::([^:\]]*+))?\](\?|)`', $route, $matches, PREG_SET_ORDER)) {
foreach ($matches as $index => $match) {
list($block, $pre, $type, $param, $optional) = $match;
if ($pre) {
$block = substr($block, 1);
}
if (isset($params[$param])) {
// Part is found, replace for param value
$url = str_replace($block, $params[$param], $url);
} elseif ($optional && $index !== 0) {
// Only strip preceding slash if it's not at the base
$url = str_replace($pre . $block, '', $url);
} else {
// Strip match block
$url = str_replace($block, '', $url);
}
}
}
return $url;
}
/**
* Match a given Request Url against stored routes
* @param string $requestUrl
* @param string $requestMethod
* @return array|boolean Array with route information on success, false on failure (no match).
*/
public function match($requestUrl = null, $requestMethod = null)
{
$params = [];
// set Request Url if it isn't passed as parameter
if ($requestUrl === null) {
$requestUrl = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/';
}
// strip base path from request url
$requestUrl = substr($requestUrl, strlen($this->basePath));
// Strip query string (?a=b) from Request Url
if (($strpos = strpos($requestUrl, '?')) !== false) {
$requestUrl = substr($requestUrl, 0, $strpos);
}
$lastRequestUrlChar = $requestUrl ? $requestUrl[strlen($requestUrl)-1] : '';
// set Request Method if it isn't passed as a parameter
if ($requestMethod === null) {
$requestMethod = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';
}
foreach ($this->routes as $handler) {
list($methods, $route, $target, $name) = $handler;
$method_match = (stripos($methods, $requestMethod) !== false);
// Method did not match, continue to next route.
if (!$method_match) {
continue;
}
if ($route === '*') {
// * wildcard (matches all)
$match = true;
} elseif (isset($route[0]) && $route[0] === '@') {
// @ regex delimiter
$pattern = '`' . substr($route, 1) . '`u';
$match = preg_match($pattern, $requestUrl, $params) === 1;
} elseif (($position = strpos($route, '[')) === false) {
// No params in url, do string comparison
$match = strcmp($requestUrl, $route) === 0;
} else {
// Compare longest non-param string with url before moving on to regex
// Check if last character before param is a slash, because it could be optional if param is optional too (see https://github.com/dannyvankooten/AltoRouter/issues/241)
if (strncmp($requestUrl, $route, $position) !== 0 && ($lastRequestUrlChar === '/' || $route[$position-1] !== '/')) {
continue;
}
$regex = $this->compileRoute($route);
$match = preg_match($regex, $requestUrl, $params) === 1;
}
if ($match) {
if ($params) {
foreach ($params as $key => $value) {
if (is_numeric($key)) {
unset($params[$key]);
}
}
}
return [
'target' => $target,
'params' => $params,
'name' => $name
];
}
}
return false;
}
/**
* Compile the regex for a given route (EXPENSIVE)
* @param $route
* @return string
*/
protected function compileRoute($route)
{
if (preg_match_all('`(/|\.|)\[([^:\]]*+)(?::([^:\]]*+))?\](\?|)`', $route, $matches, PREG_SET_ORDER)) {
$matchTypes = $this->matchTypes;
foreach ($matches as $match) {
list($block, $pre, $type, $param, $optional) = $match;
if (isset($matchTypes[$type])) {
$type = $matchTypes[$type];
}
if ($pre === '.') {
$pre = '\.';
}
$optional = $optional !== '' ? '?' : null;
//Older versions of PCRE require the 'P' in (?P<named>)
$pattern = '(?:'
. ($pre !== '' ? $pre : null)
. '('
. ($param !== '' ? "?P<$param>" : null)
. $type
. ')'
. $optional
. ')'
. $optional;
$route = str_replace($block, $pattern, $route);
}
}
return "`^$route$`u";
}
}

@ -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="{{dir}}/user/{{id}}/createOffer" method="post"> <form style="background-color: #00DBFF" class="p-4" enctype="multipart/form-data" action="index.php?action=createOffer" method="post">
{% if tabError is defined %} {% if tabError is defined %}
{% for error in tabError %} {% for error in tabError %}

@ -5,7 +5,7 @@
<title>Alica - Offres</title> <title>Alica - Offres</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link rel="stylesheet" href="{{dir}}/public/css/offres.css"> <link rel="stylesheet" href="public/css/offres.css">
</head> </head>
<body> <body>
<header> <header>
@ -14,18 +14,13 @@
<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' %} <a href="?action=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 %}
</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="post" class="form-inline flex-wrap mb-4"> <form action="?consultOffer" method="get" class="form-inline flex-wrap mb-4">
<h2 class="mr-3">Filtrer les offres</h2> <h2 class="mr-3">Filtrer les offres</h2>
<div class="form-group mr-3 flex-column justify-content-left"> <div class="form-group mr-3 flex-column justify-content-left">
@ -48,6 +43,8 @@
</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">
@ -82,7 +79,7 @@
</div> </div>
<div> <div>
<a href="{{dir}}/resetFilters" class="btn btn-info">Réinitialiser les filtres</a> <a href="?action=consultOffers" class="btn btn-info">Réinitialiser les filtres</a>
</div> </div>
</div> </div>
@ -90,64 +87,63 @@
<h1 id="titrePrincipal">Offres d'emploi</h1> <h1 id="titrePrincipal">Offres d'emploi</h1>
{% if msg %} {% if dVueErreur is defined %}
<p>{{ msg }}</p> {% for value in dVueErreur %}
<p>{{value}}</p>
{% endfor %}
{% endif %} {% endif %}
<div class="col-md-8 offset-md-2">
<div class="col-md-8 offset-md-2">
{% if offres %}
{% for offre in offres %} {% for offre in offres %}
<article class="list-group-item"> <article class="mb-4">
<div class="row1"> <div class="row1">
<img src="{{dir}}/public/uploads/{{offre.getLogo()}}" class="img-fluid rounded" alt="logo"> <!-- Ajoutez la classe "rounded" pour arrondir les coins --> <img src="public/uploads/{{offre.getLogo()}}" class="img-fluid rounded" alt="logo"> <!-- Ajoutez la classe "rounded" pour arrondir les coins -->
<h4>{{ offre.getNom() }}</h4> <h4>{{ offre.getNom() }}</h4>
</div> </div>
<div class="row2"> <div class="row2">
<p class="authorDate"><strong>{{offre.getOffreur().Prenom()}}, {{offre.getOffreur().getNom() }} | {{ offre.getDateStringFr()}}</strong></p> <p class="authorDate"><strong>Julien Martin | {{ offre.getDateStringFr()}}</strong></p>
<p>{{ offre.getDescription() }}</p> <p>{{ offre.getDescription() }}</p>
</div> </div>
<div class="row3"> <div class="row3">
<img src="{{dir}}/public/assets/location.png" alt="location"> <img src="public/assets/location.png" alt="location">
<p>{{offre.getVille()}}</p> <p>{{offre.getVille()}}</p>
</div> </div>
<div class="d-flex justify-content-around">
<button type="button" class="btn btn-outline-primary btn-sm mb-2 custom-button" <button type="button" class="btn btn-outline-primary btn-sm mb-2 custom-button"
onclick="window.location.href = '{{dir}}/displayOffer/{{offre.getId()}}'">En savoir plus</button> onclick="window.location.href = '?action=displayOffer&id={{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> </article>
{% endfor %} {% endfor %}
{% else %}
<li class="list-group-item">Aucune offre trouvée.</li> <nav style="text-align: center;">
{% endif %} <nav style="text-align: center;">
<nav class="pagination justify-content-center">
{% if numberPages is defined %} {% if numberPages is defined %}
{% if numberPages > 1 %}
{% if currentPage is defined %} {% if currentPage is defined %}
{% for i in 1..numberPages %} {% for i in 1..numberPages %}
{% if i == currentPage %} {% if i == currentPage %}
<a href="{{ dir }}/consultOffers?id={{ i }}" class="page-item page-link current">{{ i }}</a> <!--
index.php?action=consultOffers&page={{ i }}&typeContrat={{ typeContrat }}&experience={{ experience }}&niveauEtudes={{ niveauEtudes }}
-->
<a href="?action=consultOffers&page={{ i }}&{{valContrat}}{{valExp}}{{ValEtudes}}" class="active bg-danger">{{ i }}</a>
{% else %} {% else %}
<a href="{{ dir }}/consultOffers?id={{ i }}" class="page-item page-link">{{ i }}</a> <a href="?action=consultOffers&page={{ i }}&{{valContrat}}{{valExp}}{{ValEtudes}}">{{ i }}</a>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endif %}
</nav> </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>

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Offre {{ offre.getNom() }}</title>
</head>
<body>
</body>
</html>

@ -9,39 +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="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>
{% if role == 'Admin' or id == offre.getOffreur().getId() %} <!--<li class="list-group-item"><strong>ID:</strong> {{ offre.getId() }}</li> -->
<button class="btn btn-outline-danger mb-2" onclick="window.location.href='{{dir}}/user/{{id}}/deleteOffer/{{offre.getId()}}'">Supprimer</button> <li class="list-group-item"><strong>Offreur:</strong> {{ offre.getOffreur().getNom() }}</li>
{% 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"><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><a href="{{offre.getSiteUrl()}}" target="_blank">{{ offre.getSiteUrl() }}</a></li> <li class="list-group-item"><strong>Site de L'annonce :</strong> {{ offre.getSiteUrl() }}</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() %}
Oui
{% else %} {% else %}
Non Non
{% endif %} {% endif %}

@ -1,108 +1,40 @@
<!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" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="/css/accueil.css">
<link rel="stylesheet" type="text/css" href="{{dir}}/public/css/accueil.css">
<title>Alica - Accueil</title> <title>Alica - Accueil</title>
</head> </head>
<body>
<header>
{% include 'menu.html' %}
</header>
<div class="container mt-5"> <body>
<h1 class="text-center">Accueil</h1> <header>
<p class="text-center"> {% include 'menu.html' %}
{% if prenom and nom %} </header>
Bienvenue, {{ prenom }} {{ nom }} {{id}} {{role}}! <h1>Accueil</h1>
<!-- Bienvenu suivie du mail des informations sessions de l'utilisateur -->
<p>{% if prenom and nom %}
Bienvenue, {{ prenom }} {{ nom }}!
{% else %} {% else %}
Bienvenue, invité! Bienvenue, invité!
{% endif %} {% endif %}</p>
</p> <p>Vous êtes sur la page d'accueil</p>
{% if dVueErreur is not empty %} {% if dVueErreur is not empty %}
<div class="alert alert-danger"> <div class="CadreInput">
<div class="box">
<div class="error">
<ul> <ul>
{% for erreur in dVueErreur %} {% for erreur in dVueErreur %}
<li>{{ erreur }}</li> <li>{{ erreur }}</li>
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
{% endif %}
<div class="row">
<div class="col-md-12">
<div class="banner">
<img class="img-fluid" src="{{dir}}/public/assets/bandeau.png">
<div class="banner-content">
<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>
{% endif %}
<!--
<div class="slideshow-container" id="evenements">
{% for event in eventsList %}
<div class="slide">
<div class="slide-img">
<img src="{{ event.image }}">
</div>
<div class="slide-info">
<div class="slide-date">{{event.date}}</div>
<div class="slide-title">{{event.titre}}</div>
<div class="slide-description">{{event.description}}</div>
</div>
</div>
{% endfor %}
<button class="prevButton" onclick="plusDivs(-1)">&#10094;</button>
<button class="nextButton" onclick="plusDivs(1)">&#10095;</button>
</div>
<div class="search">
<input class="search-bar" type="text" placeholder=" Rechercher des alumni...">
<a class="search-button" href="index.php?action=consulterProfilLimite">
<ion-icon name="search-outline"></ion-icon>
</a>
</div>
</div>
</body> </body>
<footer> -->
{% include 'footer.html' %}
</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 nomodule src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.js"></script>
<script>
let bar = document.querySelector('.bars'), navItem = document.querySelector('.nav-items');
bar.addEventListener('click', () => {
navItem.classList.toggle('active');
});
var slideIndex = 1;
showDivs(slideIndex);
function plusDivs(n) {
showDivs(slideIndex += n);
}
function showDivs(n) {
var i;
var x = document.getElementsByClassName("slide");
if (n > x.length) {slideIndex = 1}
if (n < 1) {slideIndex = x.length}
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
x[slideIndex-1].style.display = "flex";
}
</script>

@ -4,16 +4,11 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Alica - Connexion</title> <title>Alica - Connexion</title>
<link rel="stylesheet" type="text/css" href="{{dir}}/public/css/connexion.css"> <link rel="stylesheet" type="text/css" href="public/css/connexion.css">
</head> </head>
<body> <body>
{% if msg %}
<p>{{msg}}</p>
{% endif %}
<div class="container"> <div class="container">
<form action="{{dir}}/connection" method="POST"> <form action="" method="POST">
<h3>Connexion</h3> <h3>Connexion</h3>
<div class="CadreInput"> <div class="CadreInput">
<span>Identifiant</span> <span>Identifiant</span>
@ -42,7 +37,9 @@
</form> </form>
<div class="CadreInput"> <div class="CadreInput">
<div class="box"> <div class="box">
<a href="{{dir}}/inscription" class="other">S'inscrire</a> <form action="/?action=inscription" method="POST">
<input type="submit" class="other" value="S'inscrire">
</form>
</div> </div>
</div> </div>
{% if dVueErreur is not empty %} {% if dVueErreur is not empty %}

@ -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="{{dir}}/admin/{{id}}/creerEvenement" method="post" enctype="multipart/form-data"> <form action="index.php?action=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,7 +33,6 @@
<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>

@ -0,0 +1,125 @@
<!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="index.php?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,9 +22,9 @@
<p><strong>Organisateur:</strong> {{ evenement.organisateurId }}</p> <p><strong>Organisateur:</strong> {{ evenement.organisateurId }}</p>
<p><strong>Date:</strong> {{ evenement.date }}</p> <p><strong>Date:</strong> {{ evenement.date }}</p>
<p><strong>Description:</strong> {{ evenement.description }}</p> <p><strong>Description:</strong> {{ evenement.description }}</p>
<img src="{{dir}}/public/uploads/{{ evenement.getImage() }}" width="250px" class="img-fluid" alt="Event Image"> <img src="uploads/{{ evenement.getImage() }}" width="250px" class="img-fluid" alt="Event Image">
<p><strong>Places disponibles:</strong> {{ evenement.nbPlaceMax }}</p> <p><strong>Places disponibles:</strong> {{ evenement.nbPlaceMax }}</p>
<a href="{{dir}}/listerEvenement" class="btn btn-primary">Retour</a> <a href="../public/index.php?action=listerEvenement" class="btn btn-primary">Retour</a>
</div> </div>
{% else %} {% else %}
<p>L'événement n'existe pas ou n'est pas disponible.</p> <p>L'événement n'existe pas ou n'est pas disponible.</p>

@ -3,24 +3,24 @@
<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="{{dir}}/public/css/erreur.css"> <link rel="stylesheet" type="text/css" href="public/css/erreur.css">
<title>Alica - Erreur</title> <title>Alica - Erreur</title>
</head> </head>
<style>
body{
text-align: center;
}
</style>
<body>
<header>
{% include "menu.html" %} {% include "menu.html" %}
</header> <body>
<h1>Erreur</h1> <h1>Erreur</h1>
{% if dVueErreur is defined %} {% if dVueErreur is defined %}
{% for value in dVueErreur %} {% for value in dVueErreur %}
<p>{{value}}</p> <p>{{value}}</p>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
<form action="{{dir}}/accueil" method="POST"> <a href=".">Retourner à l'accueil<a/>
<input type="submit" value="Retourner à l'accueil">
</form>
</body> </body>
</html> </html>

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Liste des Événements</title> <title>Liste des Événements</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href="{{dir}}/public/css/evenement.css"> <link rel="stylesheet" href="css/evenement.css">
</head> </head>
<body> <body>
@ -15,19 +15,14 @@
<div class="container mt-4"> <div class="container mt-4">
<div class="div_titres"> <div class="div_titres">
<form action="{{dir}}/rechercherEvenement" method="post"> <form action="../public/index.php?action=rechercherEvenement" method="post">
<input type="text" name="recherche" id="recherche" placeholder="Rechercher un événement"> <input type="text" name="recherche" id="recherche" placeholder="Rechercher un événement">
<button type="submit"> <button type="submit">
<img src="{{dir}}/public/assets/search.svg" alt="rechercher" width="30px"> <img src="assets/search.svg" alt="rechercher" width="30px">
</button> </button>
</form> </form>
<h1>Liste des Événements</h1> <h1>Liste des Événements</h1>
{% if role == 'Admin' %} <a href="../public/index.php?action=creerEvenement" class="btn btn-primary">Publier événement</a>
<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">
@ -39,20 +34,15 @@
<p><strong>Organisateur:</strong> {{ evenement.getNomOrganisateur() }}</p> <p><strong>Organisateur:</strong> {{ evenement.getNomOrganisateur() }}</p>
<p><strong>Date:</strong> {{ evenement.date }}</p> <p><strong>Date:</strong> {{ evenement.date }}</p>
<p><strong>Description:</strong> {{ evenement.description }}</p> <p><strong>Description:</strong> {{ evenement.description }}</p>
<img src="{{dir}}/public/uploads/{{ evenement.getImage() }}" width="250px" class="img-fluid" alt="{{ evenement.titre }}"> <img src="uploads/{{ evenement.getImage() }}" width="250px" class="img-fluid" alt="{{ evenement.titre }}">
<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="../public/index.php?action=avoirDetailEvenement&id={{ evenement.id }}" class="btn btn-primary">Détails</a>
</div> </div>
{% if role == 'Admin' %} <form action="../public/index.php?action=supprimerEvenement&id={{ evenement.id }}" method="post">
<form action="{{dir}}/admin/{{id}}/supprimerEvenement/{{ evenement.id }}" method="get">
<button type="submit" class="btn btn-primary" id="deleteButton"> <button type="submit" class="btn btn-primary" id="deleteButton">
<img src="{{dir}}/public/assets/close.png" alt="Supprimer" width="20px"> <img src="assets/close.png" alt="Supprimer" width="20px">
</button> </button>
</form> </form>
{% else %}
<div>
</div>
{% endif %}
</li> </li>
{% endfor %} {% endfor %}
{% else %} {% else %}

@ -4,11 +4,11 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Alica - Inscription</title> <title>Alica - Inscription</title>
<link rel="stylesheet" type="text/css" href="{{dir}}/public/css/inscription.css"> <link rel="stylesheet" type="text/css" href="public/css/inscription.css">
</head> </head>
<body> <body>
<div class="container"> <div class="container">
<form action="{{dir}}/inscription" method="POST"> <form action="" method="POST">
<h3>S'inscrire</h3> <h3>S'inscrire</h3>
<div class="CadreInput"> <div class="CadreInput">
<span>Prénom :</span> <span>Prénom :</span>
@ -18,6 +18,7 @@
</div> </div>
<label> <label>
<input type="text" name="firstname" required> <input type="text" name="firstname" required>
</label>
</div> </div>
</div> </div>
<div class="CadreInput"> <div class="CadreInput">
@ -26,7 +27,9 @@
<div class="icon"> <div class="icon">
<ion-icon name="person"></ion-icon> <ion-icon name="person"></ion-icon>
</div> </div>
<label>
<input type="text" name="name" required> <input type="text" name="name" required>
</label>
</div> </div>
</div> </div>
<div class="CadreInput"> <div class="CadreInput">
@ -35,6 +38,7 @@
<div class="icon"> <div class="icon">
<ion-icon name="mail-outline"></ion-icon> <ion-icon name="mail-outline"></ion-icon>
</div> </div>
<label>
<input type="email" name="email" required> <input type="email" name="email" required>
</label> </label>
</div> </div>
@ -58,7 +62,9 @@
</form> </form>
<div class="CadreInput"> <div class="CadreInput">
<div class="box"> <div class="box">
<a href="{{dir}}/connection" class="other">Se Connecter</a> <form action="/?action=connection" method="POST">
<input class="other" type="submit" value="Se connecter">
</form>
</div> </div>
</div> </div>
{% if dVueErreur is not empty %} {% if dVueErreur is not empty %}

@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Success</title> <title>Success</title>
<link rel="stylesheet" type="text/css" href="{{dir}}/public/css/inscription_success.css"> <link rel="stylesheet" type="text/css" href="../public/css/inscription_success.css">
</head> </head>
<body> <body>
<h1>Inscription effectuée avec succès, vous pouvez désormais vous connecter</h1> <h1>Inscription effectuée avec succès, vous pouvez désormais vous connecter</h1>
@ -15,7 +15,7 @@
</div> </div>
<script> <script>
setTimeout(function () { setTimeout(function () {
window.location.href = "{{dir}}/connection"; window.location.href = "../index.php";
}, 5000); }, 5000);
</script> </script>

@ -1,13 +1,13 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="fr">
<head> <head>
<link rel="stylesheet" type="text/css" href="{{dir}}/public/css/menu.css"> <link rel="stylesheet" type="text/css" href="public/css/menu.css">
</head> </head>
<nav class="navbar-container"> <nav class="navbar-container">
<div class="logo-container"> <div class="logo-container">
<a href="{{dir}}/accueil"> <a href=".">
<img src="{{dir}}/public/assets/logo.png" alt="Logo" height="70px"> <img src="public/assets/logo.png" alt="Logo" height="70px">
</a> </a>
</div> </div>
<div class="bars"> <div class="bars">
@ -17,22 +17,20 @@
</div> </div>
<ul class="nav-items"> <ul class="nav-items">
<li class="nav-link"><a href="#">A propos</a></li> <li class="nav-link"><a href="#">A propos</a></li>
<li class="nav-link"><a href="{{dir}}/listerEvenement">Evenements</a></li> <li class="nav-link"><a href="#">Evenements</a></li>
<li class="nav-link"><a href="{{dir}}/consultOffers">Offres</a></li> <li class="nav-link"><a href="?action=consultOffers">Offres</a></li>
<li class="nav-link"><a href="#">Nous contacter</a></li> <li class="nav-link"><a href="#">Nous contacter</a></li>
<li class="nav-link"><a href="{{dir}}/getProfilByPage/1">Les Alumnis</a></li>
</ul> </ul>
<ul class="nav-items"> <ul class="nav-items">
<!-- Afficher boutons de connexion et d'inscription --> <!-- Afficher boutons de connexion et d'inscription -->
{% if nom and prenom %} {% if nom and prenom %}
<!-- Afficher bouton de déconnexion --> <!-- Afficher bouton de déconnexion -->
<a href="index.php?action=displayExperience">Mon profil</a> <a href="../?action=deconnexion" class="button">Déconnexion</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="/?action=connection" class="button">Connexion</a>
<a href="{{dir}}/inscription" class="button button2">Inscription</a> <a href="/?action=inscription" class="button button2">Inscription</a>
</div> </div>
{% endif %} {% endif %}

@ -0,0 +1,52 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Offre Detail</title>
<link rel="stylesheet" href="css/offreDetail.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
</head>
<body>
<header>
{% include "menu.html" %}
</header>
<div id="titleDiv" class="jumbotron text-center">
<img src="public/assets/michelin.png" alt="Logo" height="70px">
<h1>Developpeur Fullstack</h1>
<img src="public/assets/location.png">
<p>Paris</p>
<div id="key" class="row justify-content-center">
<div class="col-md-2">
<p>CDI</p>
</div>
<div class="col-md-3">
<p>Experience: Non spécifié</p>
</div>
<div class="col-md-3">
<p>Etudes: Bac+2</p>
</div>
</div>
</div>
<p>Offre Proposée par marvin marbout</p>
<p>Publiée le 15/17/2023</p>
<h3>Description de l'offre</h3>
<div id="description" class="container">
<p>
Accompagné(e) par nos experts au sein d'une équipe pluridisciplinaire, tu conçois et développes des solutions innovantes répondant aux besoins de nos clients.
A ce titre, tu utilises les langages, frameworks et outils actuels.
Les méthodes agiles ainsi que les pratiques DevOps, l'intégration et le déploiement continu sont ton quotidien.
Tu interviens dans un environnement technique très riche. Rejoindre CGI dans le cadre de ton stage de fin détudes,
cest intervenir sur des projets denvergure et variés en lien avec ta formation tout en bénéficiant dun accompagnement de proximité pour construire ta carrière.
Cest aussi sinvestir auprès dune entreprise responsable qui propose de nombreux avantages (prise en charge jusquà 100% des transports en commun) et partager des moments de convivialité pour ensuite nous rejoindre en CDI !
</p>
</div>
<!-- Include Bootstrap JS and jQuery -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.2/dist/js/bootstrap.min.js"></script>
</body>
</html>

@ -44,7 +44,7 @@
<div class="col-12 col-md-9"> <div class="col-12 col-md-9">
<h3>{{ offre.getNom() }}</h3> <h3>{{ offre.getNom() }}</h3>
<p>Julien Martin</p><!-- A changer --> <p>Julien Martin</p>
</div> </div>
</div> </div>
<div class="row"> <div class="row">

@ -1,74 +0,0 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Profils des Alumnis</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="{{ dir }}/public/css/profil.css">
</head>
<body>
<header>
{% include "menu.html" %}
</header>
<h1 class="text-center my-4">Les Alumnis :</h1>
<div class="container">
<div class="row justify-content-center">
<div class="col-12 col-md-8">
<div class="profiles-container">
{% for profil in profils %}
<div class="profile d-flex">
<div class="profile-image-container">
<img src=" {{dir}}/public/uploads/{{ profil.getImage() ?: 'logo.png'}}" alt="Image de profil">
</div>
<div class="profile-details">
<p>{{ profil.prenom }} {{ profil.nom }}</p>
{% if profil.experience is defined %}
<p class="job-title">{{ profil.experience }}</p>
{% else %}
<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 %}
</div>
</div>
{% else %}
<p>Aucun profil trouvé.</p>
{% endfor %}
</div>
</div>
</div>
</div>
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-center">
<li class="page-item {% if page <= 1 %}disabled{% endif %}">
<a class="page-link" href="{{ dir }}/getProfilByPage/{{ page - 1 }}" tabindex="-1">Précédente</a>
</li>
{% for i in 1..nombreTotalPages %}
<li class="page-item {% if page == i %}active{% endif %}">
<a class="page-link" href="{{ dir }}/getProfilByPage/{{ i }}">{{ i }}</a>
</li>
{% endfor %}
{% if page < nombreTotalPages %}
<li class="page-item">
<a class="page-link" href="{{ dir }}/getProfilByPage/{{ page + 1 }}">Suivante</a>
</li>
{% else %}
<li class="page-item disabled">
<a class="page-link" href="#">Suivante</a>
</li>
{% endif %}
</ul>
</nav>
<script></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://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</body>
</html>
Loading…
Cancel
Save