diff --git a/bdd.sql b/bdd.sql new file mode 100644 index 0000000..3f2e7d2 --- /dev/null +++ b/bdd.sql @@ -0,0 +1,257 @@ +-- phpMyAdmin SQL Dump +-- version 5.2.0 +-- https://www.phpmyadmin.net/ +-- +-- Host: 127.0.0.1:3306 +-- Generation Time: Nov 22, 2023 at 05:07 PM +-- Server version: 8.0.31 +-- PHP Version: 8.1.13 + +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 */; + +-- +-- Database: `dbalica` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `alumni` +-- + +DROP TABLE IF EXISTS `alumni`; +CREATE TABLE IF NOT EXISTS `alumni` ( + `id` int NOT NULL AUTO_INCREMENT, + `mail` varchar(128) NOT NULL, + `mdp` varchar(256) NOT NULL, + `role` varchar(16) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `mail` (`mail`) +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb3; + +-- +-- Dumping data for table `alumni` +-- + +INSERT INTO `alumni` (`id`, `mail`, `mdp`, `role`) VALUES +(1, 'test', 'test', 'admin'), +(2, 't@t', '$2y$10$UUG8075sdZ7B1MLKtz.66.jY763TCdqpbMKKSX/K5DMBhXYsaLDXy', 'Membre'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `article` +-- + +DROP TABLE IF EXISTS `article`; +CREATE TABLE IF NOT EXISTS `article` ( + `id` int NOT NULL AUTO_INCREMENT, + `auteur` int NOT NULL, + `Titre` varchar(64) NOT NULL, + `sousTitre` varchar(64) NOT NULL, + `description` varchar(1024) NOT NULL, + `image` int NOT NULL, + PRIMARY KEY (`id`), + KEY `image` (`image`), + KEY `auteur` (`auteur`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `evenement` +-- + +DROP TABLE IF EXISTS `evenement`; +CREATE TABLE IF NOT EXISTS `evenement` ( + `id` int NOT NULL AUTO_INCREMENT, + `organisateur` int NOT NULL, + `titre` varchar(64) NOT NULL, + `description` varchar(512) NOT NULL, + `image` varchar(256) NOT NULL, + `date` date NOT NULL, + `nbPlaceMax` int NOT NULL, + PRIMARY KEY (`id`), + KEY `organisateur` (`organisateur`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3; + +-- +-- Dumping data for table `evenement` +-- + +INSERT INTO `evenement` (`id`, `organisateur`, `titre`, `description`, `image`, `date`, `nbPlaceMax`) VALUES +(1, 2, 'Atelier photographie', 'Ateliers Photo : tout ce que vous devez savoir pour devenir expert ! Il existe différents types d\'ateliers pour découvrir la magie de la photographie.', 'https://cdn.futura-sciences.com/buildsv6/images/wide1920/5/4/a/54a14c90eb_125482_bien-debuter-photographie.jpg', '2023-11-09', 10), +(2, 2, 'Laser game', 'Jeu de tir laser où les participants s\'affrontent pour marquer un maximum de points.', 'https://lvdneng.rosselcdn.net/sites/default/files/dpistyles_v2/ena_16_9_extra_big/2020/06/24/node_769129/47482757/public/2020/06/24/B9723823714Z.1_20200624175143_000%2BG15G7JJ5O.3-0.jpg', '2023-11-22', 15); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `experience` +-- + +DROP TABLE IF EXISTS `experience`; +CREATE TABLE IF NOT EXISTS `experience` ( + `id` int NOT NULL AUTO_INCREMENT, + `profil` int 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, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `formation` +-- + +DROP TABLE IF EXISTS `formation`; +CREATE TABLE IF NOT EXISTS `formation` ( + `id` int NOT NULL AUTO_INCREMENT, + `profil` int 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, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `image` +-- + +DROP TABLE IF EXISTS `image`; +CREATE TABLE IF NOT EXISTS `image` ( + `id` int NOT NULL AUTO_INCREMENT, + `nom` varchar(50) NOT NULL, + `taille` varchar(25) NOT NULL, + `type` varchar(25) NOT NULL, + `blob` longblob NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `offre` +-- + +DROP TABLE IF EXISTS `offre`; +CREATE TABLE IF NOT EXISTS `offre` ( + `id` int NOT NULL AUTO_INCREMENT, + `offreur` int 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, + PRIMARY KEY (`id`), + KEY `offreur` (`offreur`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb3; + +-- +-- Dumping data for table `offre` +-- + +INSERT INTO `offre` (`id`, `offreur`, `titre`, `description`, `image`, `logo`, `typeContrat`, `ville`, `entreprise`, `descriptifPoste`, `profil`, `experience`, `niveauEtudes`, `mailContact`, `numero`, `websiteURL`, `remote`, `date`) VALUES +(1, 2, 'Dev web', 'recherche alternant développeur php pour une année', 'https://pbs.twimg.com/profile_images/1542807492027113473/kuqya8nY_400x400.jpg', 'https://pbs.twimg.com/profile_images/1542807492027113473/kuqya8nY_400x400.jpg', 'Alternance', 'Clermont-Ferrand', 'CGI', 'développement de fonctionnalités diverses sur un framework mvc en php', 'Etudiant en Bac+2', 'Aucunes expériencse requises', 'Bac+2', 'cgi@mail.fr', '000000000000', 'cgi.com', 1, '2023-11-09'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `participer` +-- + +DROP TABLE IF EXISTS `participer`; +CREATE TABLE IF NOT EXISTS `participer` ( + `alumni` int NOT NULL, + `evenement` int NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `profil` +-- + +DROP TABLE IF EXISTS `profil`; +CREATE TABLE IF NOT EXISTS `profil` ( + `id` int NOT NULL AUTO_INCREMENT, + `alumni` int 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, + PRIMARY KEY (`id`), + KEY `alumni` (`alumni`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3; + +-- +-- Dumping data for table `profil` +-- + +INSERT INTO `profil` (`id`, `alumni`, `email`, `cv`, `nom`, `prenom`, `linkedinURL`, `githubURL`, `portfolioURL`, `image`) VALUES +(1, 1, 'jeandujardin@mail.fr', 'cv', 'Dujardin ', 'Jean', 'linkedinurl', 'github.com', 'portfolio.url', 'https://i.pinimg.com/originals/05/07/0d/05070dd4bc9c21c00b92c4083b962812.jpg'), +(2, 2, 't@t', 'cv', 'dujardin', 'thea', 'linkedin.com', 'github.com', 'portoflio.url', 'https://as2.ftcdn.net/v2/jpg/03/04/13/09/1000_F_304130911_sWj5OqYpwCfMxnlAG01DTLvQkEIBzhji.jpg'); + +-- +-- Constraints for dumped tables +-- + +-- +-- Constraints for 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`); + +-- +-- Constraints for table `evenement` +-- +ALTER TABLE `evenement` + ADD CONSTRAINT `evenement_ibfk_1` FOREIGN KEY (`organisateur`) REFERENCES `alumni` (`id`); + +-- +-- Constraints for table `offre` +-- +ALTER TABLE `offre` + ADD CONSTRAINT `offre_ibfk_1` FOREIGN KEY (`offreur`) REFERENCES `alumni` (`id`); + +-- +-- Constraints for 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 */; diff --git a/dbAlica-3.sql b/dbAlica-3.sql deleted file mode 100644 index 5bad779..0000000 --- a/dbAlica-3.sql +++ /dev/null @@ -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 d’Aubiè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 */; diff --git a/php/public/css/accueil.css b/php/public/css/accueil.css index b8516c3..47659cf 100755 --- a/php/public/css/accueil.css +++ b/php/public/css/accueil.css @@ -1,30 +1,148 @@ @import url(https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=Share+Tech+Mono&display=swap); *{ - margin: 0; - padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; + margin: 0; } -body{ - display: inline; - justify-content: center; - align-items: center; - min-height: 100vh; - background: #fff; + +.main { + color: #212121; + font-size: 1rem; +} + +.title-banner{ + text-align: center; } -input{ +.banner-img{ + width: 100%; + height: 250px; + object-fit: cover; +} + +.banner { position: relative; - outline: none; - padding: 10px 20px; - border-radius: 10px; - letter-spacing: 1px; - font-size: 0.85em; - background-color: #00DBFF; +} + +.title-banner { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + background-color: rgba(0, 0, 0, 0.5); color: #fff; - cursor: pointer; + padding: 10px; + border-radius: 5px; +} + +.title-banner .title{ + font-size: 35px; + color: #00DBFF; + font-weight: bold; +} + +.title-banner .subtitle{ + font-size: 20px; + color: #fff; +} + +.title-banner .description{ + font-size: 15px; + color: #fff; +} + +.slideshow-container { + position: relative; + max-width: 70%; + margin: 0 auto; + padding: 30px; +} + +.slide { + width: 100%; + height: 350px; + border-radius: 20px; + border: #212121 1px solid; +} + +.slide-content { + display: flex; + width: 100%; +} + +.slide-img, +.slide-info { + width: 50%; + overflow: hidden; +} + +.slide-info{ + padding: 15px; +} + +.slide-title{ + font-size: 20px; + font-weight: bold; +} + +.slide-info .button{ + color: #00DBFF; + font-size: 14px; + padding: 5px; text-transform: uppercase; - font-weight: 600; + border-radius: 15px; + border: #00DBFF 2px solid; + display: inline-block; margin-top: 10px; +} + +.slide-img img{ + height: 350px; + border-radius: 20px; +} + +.prevButton, .nextButton { + position: absolute; + top: 50%; + transform: translateY(-50%); + font-size: 24px; + background-color: black; + color: white; + padding: 8px 16px; border: none; + cursor: pointer; +} + +.prevButton { + left: 0; +} + +.nextButton { + right: 0; +} +.search{ + background-color: #212121; + padding: 50px 30px; + display: flex; + justify-content: center; + align-items: center; +} + +.search .search-bar{ + border-radius: 10px; + height: 40px; + width: calc(100% - 50px); + margin-right: 10px; +} + +.search .search-button{ + display: flex; + justify-content: center; + align-items: center; + width: 40px; + height: 40px; + border-radius: 10px; + background: #fff; + color: #212121; + vertical-align: middle; } \ No newline at end of file diff --git a/php/src/config/config.php b/php/src/config/config.php index 5baebeb..8ccbcec 100755 --- a/php/src/config/config.php +++ b/php/src/config/config.php @@ -10,8 +10,8 @@ static $OffersByPage = 5; // Variables connexion à la base : à modifier en fonction de la base de chacun define('DB_HOST', 'mysql:host=localhost;dbname=dbAlica'); -define('DB_USER', 'Dev'); -define('DB_PASS', 'Dev'); +define('DB_USER', 'test'); +define('DB_PASS', 'test'); //BD // $dsn = 'mysql:host=localhost;dbname=dbAlica'; // $username = 'test'; diff --git a/php/src/controleur/FrontControleur.php b/php/src/controleur/FrontControleur.php index 8c7690f..1024a19 100755 --- a/php/src/controleur/FrontControleur.php +++ b/php/src/controleur/FrontControleur.php @@ -3,6 +3,7 @@ namespace App\controleur; +use App\modele\UtilisateurModele; use App\router\AltoRouter; use App\controleur\Error; @@ -111,9 +112,10 @@ class FrontControleur call_user_func(array($controller, $action), $match['params']); } else { + $userModel = new UtilisateurModele(); + $evenements=$userModel->getEvenement(); - - echo $twig->render('accueil.html'); + echo $twig->render('accueil.html', ['eventsList' => $evenements]); } } catch (Error $error) { diff --git a/php/src/controleur/UtilisateurControleur.php b/php/src/controleur/UtilisateurControleur.php index fc73744..d2e4015 100755 --- a/php/src/controleur/UtilisateurControleur.php +++ b/php/src/controleur/UtilisateurControleur.php @@ -31,13 +31,16 @@ class UtilisateurControleur $_SESSION['prenom'] = $utilisateur->getPrenom(); $_SESSION['role'] = $utilisateur->getRole(); $_SESSION['id'] = $utilisateur->getId(); + $userModel = new UtilisateurModele(); + $evenements=$userModel->getEvenement(); echo $twig->render('accueil.html',[ 'nom' => $_SESSION['nom'], 'prenom' => $_SESSION['prenom'], 'role' => $_SESSION['role'], - 'id' => $_SESSION['id' - ]]); + 'id' => $_SESSION['id'], + 'eventsList' => $evenements + ]); return; } else { @@ -87,14 +90,14 @@ class UtilisateurControleur public function accueil() { global $twig; - // Ajout d'un var_dump pour déboguer - if (isset($_SESSION['utilisateur']) && $_SESSION['utilisateur'] instanceof Alumni) { $userModel = new UtilisateurModele(); $evenements=$userModel->getEvenement(); - //aller sur la page d'accueil avec le nom et prenom de l'utilisateur - echo $twig->render('accueil.html', ['evenements' => $evenements]); + // Ajout d'un var_dump pour déboguer + if (isset($_SESSION['utilisateur']) && $_SESSION['utilisateur'] instanceof Alumni) { + //aller sur la page d'accueil avec le nom et prenom de l'utilisateur + echo $twig->render('accueil.html', ['eventsList' => $evenements]); } else { - echo $twig->render('accueil.html'); + echo $twig->render('accueil.html', ['eventsList' => $evenements]); } } diff --git a/php/templates/CreerOffre.html b/php/templates/CreerOffre.html new file mode 100644 index 0000000..3f49216 --- /dev/null +++ b/php/templates/CreerOffre.html @@ -0,0 +1,125 @@ + + +
+ +{% if prenom and nom %} - Bienvenue, {{ prenom }} {{ nom }} {{id}} {{role}}! + Bienvenue, {{ prenom }} {{ nom }}! {% else %} Bienvenue, invité! {% endif %} @@ -32,20 +32,15 @@
Organisateur: {{ evenement.organisateurId }}
Date: {{ evenement.date }}
Description: {{ evenement.description }}
- +Places disponibles: {{ evenement.nbPlaceMax }}
RetourOrganisateur: {{ evenement.getNomOrganisateur() }}
Date: {{ evenement.date }}
Description: {{ evenement.description }}
- +Places disponibles: {{ evenement.nbPlaceMax }}
DétailsJulien Martin
+{{ offre.offreur }}
{{ offre.getDescription() }}
+{{ offre.description }}
{{ offre.getVille() }}
+{{ offre.ville }}
{{ profil.prenom }} {{ profil.nom }}