diff --git a/.env b/.env deleted file mode 100644 index 312e8f9..0000000 --- a/.env +++ /dev/null @@ -1,10 +0,0 @@ -# config BDD - -DB_CONNECTION=mysql -DB_HOSTNAME=boulayoune.com -DB_DATABASE=projet_folliow -DB_USERNAME= -DB_PASSWORD= - -IMG_PROJECT_PATH = uploads/projects/ -IMG_USER_PATH = uploads/profiles/ \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index e745855..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Deploy production (servyass) - -on: - push: - branches: - - main - -jobs: - deploy: - runs-on: ubuntu-latest - - steps: - - name: Deploy via SSH - uses: appleboy/ssh-action@master - with: - host: boulayoune.com - username: yass - key: | - ${{ secrets.SSH_KEY }} - port: 22 - debug: true - script: | - echo "➡️ Connexion réussie !" - cd /var/www/projet_php - - echo "➡️ Mise à jour du code..." - git fetch origin main - git reset --hard origin/main - - echo "➡️ Correction des permissions et nettoyage..." - sudo chown -R yass:www-data /var/www/projet_php - sudo chmod -R 775 /var/www/projet_php/templates_c - sudo rm -rf /var/www/projet_php/templates_c/* - sudo chmod -R 775 /var/www/projet_php/uploads/projects - sudo chmod -R 775 /var/www/projet_php/uploads/profiles - - echo "✅ Déploiement terminé ! (Shin-en no Egotisu)" diff --git a/README.md b/README.md deleted file mode 100644 index ff24f70..0000000 --- a/README.md +++ /dev/null @@ -1,98 +0,0 @@ -# Folliow – Projet PHP - -A platform for sharing portfolios and projects, designed as a mix between Behance and LinkedIn. Folliow focuses on highlighting real projects while making it easy to connect with other users. - -This project was developed as part of the **DWWM (Développeur Web et Web Mobile)** training. - ---- - -## Features - -- User authentication and profile management -- Portfolio and project creation -- Project showcase with descriptions and technologies -- User connections / follow system -- Project feed and discovery -- Profile and project search - ---- - -## Tech Stack - -**Client:** HTML, CSS, JavaScript -**Server:** PHP (MVC architecture) -**Database:** MySQL -**Web Server:** Apache - ---- - -## Project Structure - -```text -folliow/ -├── app/ -│ ├── controllers/ -│ ├── models/ -│ └── views/ -├── public/ -│ ├── assets/ -│ └── index.php -├── config/ -│ └── database.php -├── sql/ -│ └── folliow.sql -└── README.md -``` - ---- - -## Installation - -Clone the project - -```bash -git clone https://github.com/Yasder5/projet_php.git -``` - -Go to the project directory - -```bash -cd projet_php -``` - -Import the database - -- Use the SQL file located in the `sql/` directory - -Configure database access - -- Update credentials in `config/database.php` - -Run the project - -- Use a local server (XAMPP, WAMP, or Apache on Linux) - ---- - -## Learning Objectives - -- Build a complete PHP web application -- Apply MVC architecture -- Manage a relational database -- Design a user-oriented portfolio platform - ---- - -## Future Improvements - -- Private messaging -- Likes and comments on projects -- Tags and categories -- Improved responsive design -- Advanced authentication and roles - ---- - -## License - -This project is for educational purposes. diff --git a/assests/css/style.css b/assests/css/style.css index 142ea7f..6a8f455 100644 --- a/assests/css/style.css +++ b/assests/css/style.css @@ -102,7 +102,7 @@ body { .footer{ color: white; - background-color: #6A6ED4; + background-color: #0000ff; } .footer ul{ @@ -113,7 +113,3 @@ body { text-decoration: none; color: white; } - -.txt_title { - color: rgb(51, 152, 217); -} diff --git a/assests/img/Group-49.ico b/assests/img/Group-49.ico deleted file mode 100644 index 55624b2..0000000 Binary files a/assests/img/Group-49.ico and /dev/null differ diff --git a/composer.json b/composer.json index a478818..c44dd27 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "groupe3/projetphp", + "name": "yasse/projetphp", "description": "le projet php de ces mort", "require": { "smarty/smarty": "^5.7", @@ -8,15 +8,13 @@ }, "autoload": { "psr-4": { - "Controllers\\": "controllers/", - "Entities\\": "entities/", - "Models\\": "models/" + "Guill\\Guillaume\\": "src/" } }, "authors": [ { - "name": "Le Meilleur groupe", - "email": "pasdemail@meilleurgroupe.ccicampus" + "name": "GuillaumeH-Cci", + "email": "guillaume.hess@ccicampus.fr" } ] } diff --git a/controllers/PageCtrl.php b/controllers/PageCtrl.php deleted file mode 100644 index 248435d..0000000 --- a/controllers/PageCtrl.php +++ /dev/null @@ -1,39 +0,0 @@ -_display("help"); - - } - - /** - * Page mentions légales - */ - public function mentions(){ - // Afficher - $this->_display("mentions"); - } - - /** - * Page à propos - */ - public function about(){ - // Afficher - $this->_display("about"); - } - - } \ No newline at end of file diff --git a/controllers/AdminCtrl.php b/controllers/admin_controller.php similarity index 83% rename from controllers/AdminCtrl.php rename to controllers/admin_controller.php index 88896dc..b98252b 100644 --- a/controllers/AdminCtrl.php +++ b/controllers/admin_controller.php @@ -1,13 +1,16 @@ findAllCategory(); $arrCategoryToDisplay = array(); @@ -55,6 +58,7 @@ $arrCategoryToDisplay[] = $objCategory; } + //gestion de l'user $objUserModel = new UserModel; if (!empty($_POST['action'])) { @@ -78,6 +82,7 @@ } } + //affichage select des users $arrUser = $objUserModel->findAllUsers(); $arrUserToDisplay = array(); @@ -87,6 +92,7 @@ $arrUserToDisplay[] = $objUser; } + //affichage select des authorisations $objAuthorisationModel = new AuthorisationModel; $arrAuthorisation = $objAuthorisationModel->findAllAuthorisation(); $arrAuthorisationToDisplay = array(); @@ -97,6 +103,7 @@ $arrAuthorisationToDisplay[] = $objAuthorisation; } + //gérer l'affichage $this->_arrData['arrCategoryToDisplay'] = $arrCategoryToDisplay; $this->_arrData['arrUserToDisplay'] = $arrUserToDisplay; $this->_arrData['arrAuthorisationToDisplay'] = $arrAuthorisationToDisplay; diff --git a/controllers/ErrorCtrl.php b/controllers/error_controller.php similarity index 77% rename from controllers/ErrorCtrl.php rename to controllers/error_controller.php index 2e69e9e..4ebead6 100644 --- a/controllers/ErrorCtrl.php +++ b/controllers/error_controller.php @@ -1,9 +1,9 @@ registerPlugin('modifier', 'vardump', 'var_dump'); - $objSmarty->registerPlugin('modifier', 'file_exists', 'file_exists'); + // Désactiver la mise en cache $objSmarty->caching = false; - + + // Forcer la recompilation des templates $objSmarty->force_compile = true; - + + // Vérifier si les templates ont été modifiés $objSmarty->compile_check = true; + // Récupérer les variables foreach($this->_arrData as $key=>$value){ + //$$key = $value; $objSmarty->assign($key, $value); } - + // Message de succès $objSmarty->assign("success_message", $_SESSION['success']??''); unset($_SESSION['success']); @@ -46,6 +43,14 @@ }else{ return $objSmarty->fetch("views/".$strView.".tpl"); } + + + + // inclusion du header + /*include("views/_partial/header.php"); + include("views/".$strView.".php"); + include("views/_partial/footer.php");*/ } + } \ No newline at end of file diff --git a/controllers/page_controller.php b/controllers/page_controller.php new file mode 100644 index 0000000..c7ff933 --- /dev/null +++ b/controllers/page_controller.php @@ -0,0 +1,17 @@ +_display("help"); + + } + } \ No newline at end of file diff --git a/controllers/ProjectCtrl.php b/controllers/project_controller.php similarity index 72% rename from controllers/ProjectCtrl.php rename to controllers/project_controller.php index 6cb408c..ae44662 100644 --- a/controllers/ProjectCtrl.php +++ b/controllers/project_controller.php @@ -1,34 +1,27 @@ getTokenUser($hash_a_verifier); if ($row) { + // 3. Jeton trouvé ! On récupère les infos de l'utilisateur $user = $objUserModel->findUserById($row['token_user_id']); if ($user) { + // 4. On recrée la session comme lors d'un login normal $_SESSION['user'] = $user; } } @@ -79,6 +75,7 @@ */ public function search(){ + //Récupérer les informations du formulaire $strKeywords = $_POST['keywords']??''; $intAuthor = $_POST['author']??0; $intPeriod = $_POST['period']??0; @@ -87,6 +84,7 @@ $strEndDate = $_POST['enddate']??''; $intCategory = $_POST['category']??0; + // Récupération des projets $objProjectModel = new ProjectModel; $arrProject = $objProjectModel->findAll(intAuthor:$intAuthor, intPeriod:$intPeriod, strDate:$strDate, strKeywords:$strKeywords, strStartDate:$strStartDate, strEndDate:$strEndDate, intCategory:$intCategory); @@ -98,32 +96,28 @@ $arrProjectToDisplay[] = $objProject; } + // Récupération des utilisateurs $objUserModel = new UserModel; $arrUser = $objUserModel->findAllUsers(); + // Récupération des catégories $objCategoryModel = new CategoryModel; $arrCategory = $objCategoryModel->findAllCategory(); $this->_arrData['arrProjectToDisplay'] = $arrProjectToDisplay; $this->_arrData['arrCategory'] = $arrCategory; - $this->_arrData['arrProject'] = $arrProject; - $this->_arrData['arrUser'] = $arrUser; - $this->_arrData['strKeywords'] = $strKeywords; - $this->_arrData['intAuthor'] = $intAuthor; - $this->_arrData['intPeriod'] = $intPeriod; - $this->_arrData['strDate'] = $strDate; - $this->_arrData['strStartDate'] = $strStartDate; - $this->_arrData['strEndDate'] = $strEndDate; - $this->_arrData['intCategory'] = $intCategory; + $this->_arrData['arrProject'] = $arrProject; + $this->_arrData['arrUser'] = $arrUser; $this->_display("search"); } /** * Fonction d'affichage de la page projet + * @author Christel adapter par Guillaume */ - public function addedit_project() { - if (!isset($_SESSION['user'])){ + public function addedit_project(){ + if (!isset($_SESSION['user'])){ // Pas d'utilisateur connecté header("Location:index.php?ctrl=error&action=error_403"); exit; } @@ -132,20 +126,18 @@ $objProjectModel = new ProjectModel; $objCategoryModel = new CategoryModel; + // Dans la cas de modif if (isset($_GET['id'])){ $arrProject = $objProjectModel->findOne($_GET['id']); - if($_SESSION['user']['user_id'] != $arrProject['project_user_id']){ - header("Location:index.php?ctrl=error&action=error_403"); - exit; - } - $objProject->hydrate($arrProject); + $objProject->hydrate($arrProject); // BDD $this->_arrData['arrImages'] = $objProjectModel->getImagesByProjectId($objProject->getId()); } + // Tester le formulaire $arrError = []; if (count($_POST) > 0) { - $objProject->hydrate($_POST); + $objProject->hydrate($_POST); // Formulaire if ($objProject->getTitle() == ""){ $arrError['title'] = "Le titre est obligatoire"; } @@ -158,6 +150,7 @@ $arrError['content'] = "Le contenu est obligatoire"; } + // Vérification de l'image (Thumbnail) $arrTypeAllowed = array('image/jpeg', 'image/png', 'image/webp'); if ($_FILES['thumbnail']['error'] != 4){ if (!in_array($_FILES['thumbnail']['type'], $arrTypeAllowed)){ @@ -192,14 +185,18 @@ } } + // SI pas d'erreur : on traite l'image principale if (count($arrError) == 0){ $boolImageOk = true; + + // On peux changer ces dimensions si on veux que la miniature soit plus grande/petite if (isset($strImageName)){ $strDest = $_ENV['IMG_PROJECT_PATH'].$strImageName; $strSource = $_FILES['thumbnail']['tmp_name']; list($intWidth, $intHeight) = getimagesize($strSource); + // Redimensionnement de la Thumbnail $intDestWidth = 200; $intDestHeight = 250; $fltDestRatio = $intDestWidth / $intDestHeight; $fltSourceRatio = $intWidth / $intHeight; @@ -232,10 +229,12 @@ imagecopyresampled($objDest, $objSource, 0, 0, $intCropX, $intCropY, $intDestWidth, $intDestHeight, $intCropWidth, $intCropHeight); $boolImageOk = imagewebp($objDest, $strDest); + //Suppression des doublons pour la mémoire vive imagedestroy($objDest); imagedestroy($objSource); } + // SI image ok, on balance tout dans la bdd if ($boolImageOk){ if (!isset($_GET['id'])){ $objProject->setUser_id($_SESSION['user']['user_id']); @@ -244,21 +243,28 @@ $boolOk = $objProjectModel->updateProject($objProject); } + // Gestion des 20 Images après l'envoie de la Thumbnail en BDD if ($boolOk){ + //Si pas d'erreur if (isset($_FILES['imageProject']) && $_FILES['imageProject']['error'][0] != 4) { $files = $_FILES['imageProject']; $maxPhotos = 20; + // 1. On compte combien d'images le projet possède déjà en BDD $currentImages = $objProjectModel->getImagesByProjectId($objProject->getId()); $totalExisting = count($currentImages); + + // 2. On calcule combien de photos on peut encore ajouter $remainingSlots = $maxPhotos - $totalExisting; + // Si on a déjà atteint ou dépassé la limite, on ne traite même pas les fichiers if ($remainingSlots <= 0) { $_SESSION['error'] = "Limite de $maxPhotos photos atteinte. Supprimez-en pour en ajouter de nouvelles."; } else { $uploadedCount = 0; foreach ($files['name'] as $key => $name) { + // 3. On utilise le quota restant comme condition d'arrêt if ($uploadedCount >= $remainingSlots) break; if ($files['error'][$key] === 0 && in_array($files['type'][$key], $arrTypeAllowed)) { @@ -267,8 +273,10 @@ $strDestGallery = $_ENV['IMG_PROJECT_PATH'].$galleryName; $strSourceGallery = $files['tmp_name'][$key]; + // Reprise de la logique de redimensionnement list($intW, $intH) = getimagesize($strSourceGallery); + // On peux changer ces dimensions si on veux que la galerie soit plus grande/petite $intDestW = 150; $intDestH = 150; $fltDestR = $intDestW / $intDestH; $fltSourceR = $intW / $intH; @@ -286,7 +294,8 @@ } $objDestGallery = imagecreatetruecolor($intDestW, $intDestH); - + + // Création de la source selon le type de chaque image de la boucle switch ($files['type'][$key]) { case 'image/jpeg' : $objSourceGallery = imagecreatefromjpeg($strSourceGallery); @@ -303,6 +312,7 @@ imagecopyresampled($objDestGallery, $objSourceGallery, 0, 0, $intCropX, $intCropY, $intDestW, $intDestH, $intCropW, $intCropH); if (imagewebp($objDestGallery, $strDestGallery)) { + // Insertion en BDD $objProjectModel->addImageInProject($galleryName, $objProject->getId()); $uploadedCount++; } @@ -319,6 +329,7 @@ } } + // Suppression de l'ancienne miniature if(isset($strOldImg) && !empty($strOldImg) && isset($strImageName)){ $strOldFile = $_ENV['IMG_PROJECT_PATH'].$strOldImg; if (file_exists($strOldFile)) unlink($strOldFile); @@ -336,23 +347,26 @@ } } + // Données pour la vue $this->_arrData['arrCategory'] = $objCategoryModel->findAllCategory(); $this->_arrData['objProject'] = $objProject; $this->_arrData['arrError'] = $arrError; + // Si on est en modifications de projet, on récupère les images pour les afficher dans le formulaire if ($objProject->getId()) { + // On récupère les images via le modèle et on les stocke dans le tableau de données $this->_arrData['arrImages'] = $objProjectModel->getImagesByProjectId($objProject->getId()); } else { + // Sinon on initialise un tableau vide pour éviter que Smarty ne râle $this->_arrData['arrImages'] = []; } $this->_display('addedit_project'); } - - /** - * Fonction d'affichage d'un projet - */ + /** + * Fonction d'affichage de projet + */ public function display() { $intId = $_GET['id'] ?? null; @@ -360,13 +374,13 @@ $objProjectModel = new ProjectModel(); $arrProject = $objProjectModel->findOne((int)$intId); + // CORRECTION ICI : on utilise $intId (pas $id) $arrImages = $objProjectModel->getImagesByProjectId((int)$intId); if ($arrProject) { $objProject = new Project(); $objProject->hydrate($arrProject); - $this->_arrData["arrProject"] = $arrProject; $this->_arrData["objProject"] = $objProject; $this->_arrData["arrImages"] = $arrImages; @@ -382,12 +396,12 @@ } } - /** - * Fonction d'envoi d'email - */ - public function sendEmail(){ - if (count($_POST) > 0) { - + /** + * Fonction de partage de projet + */ + public function shareProject(){ + if (count($_POST) > 0) + { $projectId = (int)($_POST['project_id'] ?? 0); $toEmail = trim($_POST['to_email'] ?? ''); @@ -415,6 +429,8 @@ $objMail->Username = 'a2a67e001@smtp-brevo.com'; $objMail->Password = 'xsmtpsib-f2af87e12d3db6f1b99802a92c1acda32d45fc32a8446eeed7e49ec91c4ec7ef-AX8Y7YkRWYSmKHwS'; + // Désactive la vérification du certificat SSL + // Cela permet d'éviter les erreurs liées au certificat, mais réduit la sécurité de la connexion. $objMail->SMTPOptions = [ 'ssl' => [ 'verify_peer' => false, @@ -451,72 +467,76 @@ /** * Fonction de modération de projet = accepté + * @author Guillaume */ public function accept(){ + //Récupéré l'id dans l'url $intId = $_GET['id']; + //Je créer un nouveau model pour exec la commande SQL $objProjectModel = new ProjectModel; $objProjectModel->accept($intId); + //Redirection vers la page header("Location: index.php"); exit; } /** * Fonction de modération de projet = refusé + * @author Guillaume */ public function refuse(){ + //Récupéré l'id dans l'url $intId = $_GET['id']; + //Je créer un nouveau model pour exec la commande SQL $objProjectModel = new ProjectModel; $objProjectModel->refuse($intId); + //Redirection vers la page header("Location: index.php"); exit; } /** * Fonction de suppression de projet + * @author Guillaume */ public function delete(){ - if (!isset($_SESSION['user']) || $_SESSION['user']['user_status'] != 2) { - header("Location: index.php"); - exit; - } - - $intId = $_GET['id'] ?? null; + //Récupéré l'id dans l'url + $intId = $_GET['id']; - if ($intId) { - $objProjectModel = new ProjectModel(); - if ($objProjectModel->delete_soft_project((int) $intId)) { - $_SESSION['success'] = "Le projet a été archivé avec succès."; - } else { - $_SESSION['error'] = "Une erreur est survenue lors de l'archivage."; - } - } + //Je créer un nouveau model pour exec la commande SQL + $objProjectModel = new ProjectModel; + $objProjectModel->delete($intId); + //Redirection vers la page header("Location: index.php"); exit; } /** * Fonction de changement de statut (Approuvé, Refusé, En attente) + * @author Guillaume */ public function change_image_status() { if (isset($_GET['id_img']) && isset($_GET['status'])) { $idImg = (int)$_GET['id_img']; - $status = $_GET['status']; + $status = $_GET['status']; // "en_attente" passage à "approuvé" $objProjectModel = new ProjectModel(); + // On passe le statut texte directement à ta méthode de modèle if ($objProjectModel->updateImageStatus($idImg, $status)) { $_SESSION['success'] = "Le statut de l'image est désormais : " . ucfirst($status); } } + // La redirection : Si on sait d'où on vient, on y retourne, sinon index $urlRedirect = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "index.php"; header("Location: " . $urlRedirect); exit; @@ -525,12 +545,14 @@ /** * Fonction de validation de l'image de projet + * @author Guillaume */ public function delete_image() { - + // Vérifier l'id de l'image $idImg = $_GET['id_img']; $objProjectModel = new ProjectModel(); + // Récupérer le nom du fichier pour le supprimer physiquement $image = $objProjectModel->findImage($idImg); if ($image) { $filePath = $_ENV['IMG_PROJECT_PATH'] . $image['image_name']; @@ -540,10 +562,70 @@ $_SESSION['success'] = "Image supprimée !"; } + // La redirection : Si on sait d'où on vient, on y retourne, sinon index $url = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : "index.php"; header("Location: " . $url); exit; } + + /** + * Fonction d'ajout des 20 images max du projet + * @author Guillaume + * @param string $fileName = le nom de l'image, int $projectId = L'Id du projet que l'on veut afficher, string $alt = qui affichera pars défaut "Image de projet" + * @return bool Est-ce que la requête s'est bien passée + */ + public function addImageInProject(string $fileName, int $projectId, string $alt = "Image de projet"): bool { + $strRq = "INSERT INTO image ( + image_name, + image_alt, + image_status, + image_project + ) + VALUES (:name, :alt, :status, :project)"; + + $rqPrep = $this->_db->prepare($strRq); + + $rqPrep->bindValue(":name", $fileName, PDO::PARAM_STR); + $rqPrep->bindValue(":alt", $alt, PDO::PARAM_STR); + $rqPrep->bindValue(":status", "en_attente", PDO::PARAM_STR); // Valeur string en brute + $rqPrep->bindValue(":project", $projectId, PDO::PARAM_INT); + + return $rqPrep->execute(); + } + + /** + * Fonction d'affichage des 20 images max du projet + * @author Guillaume + * @param array $ProjectId L'Id du projet que l'on veut afficher + * @return bool Est-ce que la requête s'est bien passée + */ + public function getImagesByProjectId(int $projectId): array { + $strRq = "SELECT image_id, image_name, image_alt, image_status + FROM image + WHERE image_project = :id"; + + $rqPrep = $this->_db->prepare($strRq); + $rqPrep->bindValue(":id", $projectId, PDO::PARAM_INT); + $rqPrep->execute(); + + return $rqPrep->fetchAll(PDO::FETCH_ASSOC); + } + + /** + * Page mentions légales + */ + public function mentions(){ + // Afficher + $this->_display("mentions"); + } + + /** + * Page à propos + */ + public function about(){ + // Afficher + $this->_display("about"); + } } diff --git a/controllers/UserCtrl.php b/controllers/user_controller.php similarity index 85% rename from controllers/UserCtrl.php rename to controllers/user_controller.php index c1f288a..eafccef 100644 --- a/controllers/UserCtrl.php +++ b/controllers/user_controller.php @@ -1,29 +1,22 @@ 0) { + // Vérifier le formulaire if ($strMail == ""){ $arrError['mail'] = "Le mail est obligatoire"; } @@ -31,12 +24,16 @@ class UserCtrl extends MotherCtrl { $arrError['pwd'] = "Le mot de passe est obligatoire"; } + // Si le formulaire est rempli correctement if (count($arrError) == 0){ + // Vérifier l'utilisateur en BDD $objUserModel = new UserModel; $arrResult = $objUserModel->verifUser($strMail, $strPwd); - if ($arrResult === false){ + //var_dump($arrResult); + if ($arrResult === false){ // Si la base de données ne renvoie rien $arrError[] = "Mail ou mot de passe invalide"; }else{ + // Ajoute l'utilisateur en session $_SESSION['user'] = $arrResult; $_SESSION['success'] = "Bienvenue, vous êtes bien connecté"; if (isset($_POST['remember_me'])) { @@ -58,9 +55,7 @@ class UserCtrl extends MotherCtrl { } - /** - * Fonction pour ce déconnecter - */ + public function logout(){ if (isset($_COOKIE['remember_me'])) { @@ -79,30 +74,42 @@ class UserCtrl extends MotherCtrl { exit; } - /** + /** * Fonction d'inscription d'un utilisateur * Effectue les validations du formulaire, - * vérifie l'unicité du mail et du pseudo, puis insère l'utilisateur en base de données + * vérifie l'unicité du mail et du pseudo, + * puis insère l'utilisateur en base de données * @return void */ public function signup(){ + // Entité pour réafficher les valeurs dans le formulaire $objUser = new User(); + + // Récupération des champs $strPwdConfirm = $_POST['pwd_confirm'] ?? ""; + // Tableau d'erreurs $arrError = []; + // Traitement du formulaire uniquement si POST if (!empty($_POST)) { + + // Hydratation $objUser->setName($_POST['user_name'] ?? ""); $objUser->setFirstname($_POST['user_firstname'] ?? ""); $objUser->setMail($_POST['user_mail'] ?? ""); $objUser->setPseudo($_POST['user_pseudo'] ?? ""); $objUser->setPwd($_POST['user_password'] ?? ""); + + // Champs optionnels : on les stocke aussi même si ils sont vides $objUser->setPhone($_POST['user_phone'] ?? ""); $objUser->setWork($_POST['user_work'] ?? ""); $objUser->setLocation($_POST['user_location'] ?? ""); $objUser->setDescription($_POST['user_description'] ?? ""); + + // --- VALIDATIONS (obligatoires) --- if (trim($objUser->getName()) === "") { $arrError['user_name'] = "Le nom est obligatoire"; } @@ -130,14 +137,21 @@ class UserCtrl extends MotherCtrl { $arrError['pwd_confirm'] = "La confirmation du mot de passe ne correspond pas"; } + // Si pas d'erreurs => insertion if (count($arrError) === 0) { $objUserModel = new UserModel(); + + // Vérif mail if ($objUserModel->mailExists($objUser->getMail())) { $arrError['user_mail'] = "Impossible de créer le compte avec ces informations"; } + + // Vérif pseudo if ($objUserModel->pseudoExists($objUser->getPseudo())) { $arrError['user_pseudo'] = "Ce pseudo existe déjà"; } + + // Si aucune erreur => insert if (count($arrError) === 0) { $boolInsert = $objUserModel->insert($objUser); @@ -152,17 +166,37 @@ class UserCtrl extends MotherCtrl { } } + // Affichage de la vue inscription $this->_arrData['objUser'] = $objUser; $this->_arrData['arrError'] = $arrError; $this->_display("signup"); } + + + /** * le controlleur affichage de la page user */ public function user(){ + /**$intId = isset($_GET['id']) ? (int)$_GET['id'] : 0; + + if ($intId <= 0) { + header("Location: index.php"); + exit; + } + + //affichage info utilisateur + $objUserModel = new UserModel; + $arrUserData = $objUserModel->findUserById($intId); + + if ($arrUserData === false) { + header("Location: index.php"); + exit; + }*/ + $strPseudo = $_GET['pseudo']??''; $objUserModel = new UserModel; @@ -175,6 +209,8 @@ class UserCtrl extends MotherCtrl { $objUser = new User; $objUser->hydrate($arrUserData); + + //affichage projet de l'utilisateur $objProjectModel = new ProjectModel; $arrProjects = $objProjectModel->findAll(0,'',$objUser->getId()); @@ -190,14 +226,12 @@ class UserCtrl extends MotherCtrl { $this->_display("user"); } - /** - * le controlleur de la modification d'un user - */ public function edit(){ if(!isset($_SESSION['user'])){ header("Location: index.php"); exit; } + $objUserModel = new UserModel; $arrError = []; $objUser = new User; @@ -214,6 +248,7 @@ class UserCtrl extends MotherCtrl { $objUser->hydrate($_POST); $objUser->setId($_SESSION['user']['user_id']); + // Vérification de l'image $arrTypeAllowed = array('image/jpeg', 'image/png', 'image/webp'); $boolImageOk = true; @@ -244,6 +279,7 @@ class UserCtrl extends MotherCtrl { } } + // Traitement de l'image si pas d'erreur if (count($arrError) == 0 && isset($strImageName)) { $strDest = $_ENV['IMG_USER_PATH'] . $strImageName; $strSource = $_FILES['image']['tmp_name']; diff --git a/database/.gitkeep b/database/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/database/database.sql b/database/database.sql deleted file mode 100644 index 649db7d..0000000 --- a/database/database.sql +++ /dev/null @@ -1,253 +0,0 @@ -CREATE DATABASE IF NOT EXISTS `projet_folliow` - DEFAULT CHARACTER SET utf8mb4 - COLLATE utf8mb4_unicode_ci; - -USE `projet_folliow`; - -/*M!999999\- enable the sandbox mode */ --- MariaDB dump 10.19 Distrib 10.11.14-MariaDB, for debian-linux-gnu (x86_64) --- --- Host: localhost Database: projet_folliow --- ------------------------------------------------------ --- Server version 10.11.14-MariaDB-0+deb12u2 - -/*!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 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - --- --- Table structure for table `authorisation` --- - -DROP TABLE IF EXISTS `authorisation`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8mb4 */; -CREATE TABLE `authorisation` ( - `authorisation_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifiant unique des autorisations', - `authorisation_name` varchar(30) NOT NULL COMMENT 'Administrateur, modérateur, utilisateur', - PRIMARY KEY (`authorisation_id`), - UNIQUE KEY `uk_authorisation_name` (`authorisation_name`) -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `authorisation` --- - -LOCK TABLES `authorisation` WRITE; -/*!40000 ALTER TABLE `authorisation` DISABLE KEYS */; -INSERT INTO `authorisation` VALUES -(1,'Administrateur'), -(2,'Modérateur'), -(3,'Utilisateur'); -/*!40000 ALTER TABLE `authorisation` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `category` --- - -DROP TABLE IF EXISTS `category`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8mb4 */; -CREATE TABLE `category` ( - `category_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifiant unique des catégorie du projet', - `category_name` varchar(150) NOT NULL COMMENT 'Nom de chaque catégorie', - `category_parent` int(10) unsigned DEFAULT NULL COMMENT 'ID de la catégorie parente (NULL = catégorie principale)', - PRIMARY KEY (`category_id`), - UNIQUE KEY `uk_category_name_parent` (`category_name`,`category_parent`), - KEY `fk_category_parent` (`category_parent`), - CONSTRAINT `fk_category_parent` FOREIGN KEY (`category_parent`) REFERENCES `category` (`category_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB AUTO_INCREMENT=54 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `category` --- - -LOCK TABLES `category` WRITE; -/*!40000 ALTER TABLE `category` DISABLE KEYS */; -INSERT INTO `category` VALUES -(32,'3D',4), -(34,'Aquarelle',4), -(5,'Architecture',NULL), -(36,'Architecture d\'Intérieur',5), -(35,'Architecture Moderne',5), -(24,'Backend',2), -(33,'Bande Dessinée',4), -(1,'Design',NULL), -(2,'Développement Web',NULL), -(31,'Digital Art',4), -(30,'Événementiel',3), -(23,'Frontend',2), -(25,'Full-Stack',2), -(4,'Illustration',NULL), -(20,'Logo & Identité Visuelle',1), -(39,'Marketing',NULL), -(46,'Marketing',NULL), -(26,'Mobile',2), -(21,'Motion Design',1), -(38,'Patrimoine',5), -(28,'Paysage',3), -(3,'Photographie',NULL), -(27,'Portrait',3), -(22,'Print Design',1), -(40,'Rédaction',NULL), -(47,'Rédaction',NULL), -(29,'Sport',3), -(19,'UI/UX Design',1), -(37,'Urbanisme',5), -(41,'Vidéo',NULL), -(48,'Vidéo',NULL); -/*!40000 ALTER TABLE `category` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `image` --- - -DROP TABLE IF EXISTS `image`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8mb4 */; -CREATE TABLE `image` ( - `image_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'identifiant unique des images', - `image_name` varchar(150) NOT NULL COMMENT 'Chemin de l''image enregistrée', - `image_alt` varchar(255) DEFAULT NULL COMMENT 'Alt de l''image', - `image_status` varchar(50) NOT NULL DEFAULT 'en_attente' COMMENT 'Statut de modération de l''image', - `image_project` int(10) unsigned DEFAULT NULL COMMENT 'Identifiant du projet où se trouve l''image', - PRIMARY KEY (`image_id`), - KEY `fk_image_project` (`image_project`), - CONSTRAINT `fk_image_project` FOREIGN KEY (`image_project`) REFERENCES `project` (`project_id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `chk_image_status` CHECK (`image_status` in ('en_attente','approuvé','rejeté')) -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `image` --- - -LOCK TABLES `image` WRITE; -/*!40000 ALTER TABLE `image` DISABLE KEYS */; -INSERT INTO `image` VALUES -(1,'/uploads/projects/ecommerce-01.jpg','Page d\'accueil du site e-commerce refondu','approuvé',1), -(2,'/uploads/projects/ecommerce-02.jpg','Interface mobile du processus de commande','approuvé',1), -(3,'/uploads/projects/taskmanager-01.jpg','Vue kanban de l\'application','approuvé',2), -(4,'/uploads/projects/urban-01.jpg','Architecture moderne à La Défense','en_attente',3); -/*!40000 ALTER TABLE `image` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `project` --- - -DROP TABLE IF EXISTS `project`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8mb4 */; -CREATE TABLE `project` ( - `project_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifiant unique du projet', - `project_title` varchar(150) NOT NULL COMMENT 'Titre du projet', - `project_description` text DEFAULT NULL COMMENT 'Description du projet', - `project_thumbnail` varchar(150) DEFAULT NULL COMMENT 'Image miniature du projet', - `project_content` text DEFAULT NULL COMMENT 'Contenu du projet', - `project_creation_date` date NOT NULL COMMENT 'Date de création du projet', - `project_status` varchar(30) NOT NULL DEFAULT 'brouillon' COMMENT 'Statut du projet : brouillon, publié, en_attente', - `project_user` int(10) unsigned DEFAULT NULL COMMENT 'Identifiant de l''user', - `project_category` int(10) unsigned DEFAULT NULL COMMENT 'Identifiant de la catégorie', - - PRIMARY KEY (`project_id`), - KEY `fk_project_user` (`project_user`), - KEY `fk_project_category` (`project_category`), - KEY `idx_project_status` (`project_status`), - KEY `idx_project_creation_date` (`project_creation_date`), - - CONSTRAINT `fk_project_category` - FOREIGN KEY (`project_category`) - REFERENCES `category` (`category_id`) - ON DELETE SET NULL - ON UPDATE CASCADE, - - CONSTRAINT `fk_project_user` - FOREIGN KEY (`project_user`) - REFERENCES `users` (`user_id`) - ON DELETE CASCADE - ON UPDATE CASCADE -) ENGINE=InnoDB -DEFAULT CHARSET=utf8mb4 -COLLATE=utf8mb4_unicode_ci; - -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `project` --- - -LOCK TABLES `project` WRITE; -/*!40000 ALTER TABLE `project` DISABLE KEYS */; -INSERT INTO `project` VALUES -(1,'Refonte du site e-commerce','Refonte complète de l\'interface utilisateur d\'une boutique en ligne avec focus sur l\'expérience mobile','/uploads/projects/ecommerce-thumb.jpg','Ce projet visait à moderniser entièrement l\'interface d\'un site e-commerce existant. Les principales améliorations incluent une navigation simplifiée, un processus de commande optimisé et une interface responsive.','2025-12-01','publié',1,1), -(2,'Application de gestion de tâches','Développement d\'une application web pour la gestion collaborative de projets','/uploads/projects/taskmanager-thumb.jpg','Application web développée en React et Node.js permettant aux équipes de gérer leurs projets de manière collaborative. Fonctionnalités : kanban, calendrier, notifications en temps réel.','2025-12-15','publié',2,2), -(3,'Série photo urbaine','Collection de photographies capturant l\'architecture moderne de Paris','/uploads/projects/urban-thumb.jpg','Série de 30 photographies prises dans différents quartiers de Paris, mettant en valeur le contraste entre architecture classique et moderne. Travail sur la lumière naturelle et les perspectives.','2026-01-05','en_attente',3,3); -/*!40000 ALTER TABLE `project` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `users` --- - -DROP TABLE IF EXISTS `users`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8mb4 */; -CREATE TABLE `users` ( - `user_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifiant unique de l''utilisateur', - `user_name` varchar(100) NOT NULL COMMENT 'Nom de l''utilisateur', - `user_firstname` varchar(100) NOT NULL COMMENT 'Prénom de l''utilisateur', - `user_pseudo` varchar(30) NOT NULL COMMENT 'Pseudo de l''utilisateur', - `user_image` varchar(150) DEFAULT NULL COMMENT 'Photo de profil de l''utilisateur', - `user_mail` varchar(100) NOT NULL COMMENT 'Mail de l''utilisateur', - `user_password` varchar(255) NOT NULL COMMENT 'Mot de passe de l''utilisateur', - `user_phone` varchar(20) DEFAULT NULL COMMENT 'Téléphone de l''utilisateur', - `user_work` varchar(50) DEFAULT NULL COMMENT 'Profession de l''utilisateur', - `user_birth` date DEFAULT NULL COMMENT 'Date de naissance de l''utilisateur', - `user_location` varchar(150) DEFAULT NULL COMMENT 'Localisation de l''utilisateur', - `user_description` varchar(255) DEFAULT NULL COMMENT 'Phrase d''accroche de l''utilisateur', - `user_account_creation` datetime NOT NULL DEFAULT current_timestamp() COMMENT 'Date et heure de création du compte', - `user_status` int(10) unsigned DEFAULT NULL COMMENT 'identifiant de niveau d''autorisation', - PRIMARY KEY (`user_id`), - UNIQUE KEY `uk_user_mail` (`user_mail`), - UNIQUE KEY `uk_user_pseudo` (`user_pseudo`), - KEY `fk_users_authorisation` (`user_status`), - KEY `idx_user_mail` (`user_mail`), - CONSTRAINT `fk_users_authorisation` FOREIGN KEY (`user_status`) REFERENCES `authorisation` (`authorisation_id`) ON DELETE SET NULL ON UPDATE CASCADE -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `users` --- - -LOCK TABLES `users` WRITE; -/*!40000 ALTER TABLE `users` DISABLE KEYS */; -INSERT INTO `users` VALUES -(1,'Dupont','Marie','marie_design','/uploads/users/marie.jpg','marie.dupont@example.com','$2y$10$T5kWRD3NBqXKWtQqrBG3We1Qpq2Odum0/xYAoT2SaCclG7h2Y0Gvq','0612345678','Designer UI/UX','1995-03-15','Paris, France','Passionnée de design et d\'expérience utilisateur','2024-01-15 10:30:00',1), -(2,'Martin','Thomas','thomas_dev','/uploads/users/thomas.jpg','thomas.martin@example.com','$2y$10$T5kWRD3NBqXKWtQqrBG3We1Qpq2Odum0/xYAoT2SaCclG7h2Y0Gvq','0623456789','Développeur Full-Stack','1992-07-22','Lyon, France','Créateur d\'applications web modernes','2024-02-20 14:45:00',2), -(3,'Dubois','Sophie','sophie_photo','/uploads/users/sophie.jpg','sophie.dubois@example.com','$2y$10$T5kWRD3NBqXKWtQqrBG3We1Qpq2Odum0/xYAoT2SaCclG7h2Y0Gvq','0634567890','Photographe','1998-11-08','Marseille, France','Capturer l\'instant présent est ma passion','2024-03-10 09:15:00',3); -/*!40000 ALTER TABLE `users` ENABLE KEYS */; -UNLOCK TABLES; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!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 */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - --- Dump completed on 2026-01-09 17:33:08 diff --git a/entities/Authorisation.php b/entities/Authorisation.php deleted file mode 100644 index cac51b4..0000000 --- a/entities/Authorisation.php +++ /dev/null @@ -1,53 +0,0 @@ -_prefix = 'authorisation_'; - } - - /** - * Récuperation de l'id du statut d'un utilisateur - * @return int l'id du statut - */ - public function getId():int{ - return $this->_id; - } - - /** - * Mise à jour de l'id du statut d'un utilisateur - * @param int le nouvelle id du statut - */ - public function setId(int $id){ - $this->_id = $id; - } - - /** - * Récuperation de l'intitulé du statut d'un utilisateur - * @return string l'intitulé du statut - */ - public function getName():string{ - return $this->_name; - } - - /** - * Mise à jour de l'intitulé du statut d'un utilisateur - * @return string le nouvel intitulé du statut - */ - public function setName(string $name){ - $this->_name = $name; - } - - } \ No newline at end of file diff --git a/entities/User.php b/entities/User.php deleted file mode 100644 index 1eee5be..0000000 --- a/entities/User.php +++ /dev/null @@ -1,263 +0,0 @@ -_prefix = 'user_'; - } - - /** - * Récuperation de l'id d'un utilisateur - * @return int l'id de l'utilisateur - */ - public function getId():int{ - return $this->_id; - } - - /** - * Mise à jour de l'id d'un utilisateur - * @param int le nouvelle id de l'utilisateur - */ - public function setId(int $id){ - $this->_id = $id; - } - - /** - * Récuperation du nom d'un utilisateur - * @return string le nom de l'utilisateur - */ - public function getName():string{ - return $this->nettoyer($this->_name); - } - - /** - * Mise à jour du nom d'un utilisateur - * @return string le nouveau nom de l'utilisateur - */ - public function setName(string $name){ - $this->_name = $name; - } - - /** - * Récuperation du prénom d'un utilisateur - * @return string le prénom de l'utilisateur - */ - public function getFirstname():string{ - return $this->nettoyer($this->_firstname); - } - - /** - * Mise à jour du prénom d'un utilisateur - * @return string le nouveau prénom de l'utilisateur - */ - public function setFirstname(string $firstname){ - $this->_firstname = $firstname; - } - - /** - * Récuperation du pseudo unique d'un utilisateur - * @return string le pseudo de l'utilisateur - */ - public function getPseudo():string{ - return $this->nettoyer($this->_pseudo); - } - - /** - * Mise à jour du pseudo unique d'un utilisateur - * @return string le nouveau pseudo de l'utilisateur - */ - public function setPseudo(string $pseudo){ - $this->_pseudo = $pseudo; - } - - /** - * Récuperation du nom de l'image d'un utilisateur - * @return string du nom de l'image de l'utilisateur - */ - public function getImage():?string{ - return $this->_image; - } - - /** - * Mise à jour du nom de l'image d'un utilisateur - * @return string le nouveau nom de l'image de l'utilisateur - */ - public function setImage(?string $image){ - $this->_image = $image; - } - - /** - * Récuperation de l'email d'un utilisateur - * @return string l'email de l'utilisateur - */ - public function getMail():string{ - return $this->_mail; - } - - /** - * Mise à jour de l'email d'un utilisateur - * @return string le nouvel email de l'utilisateur - */ - public function setMail(string $mail){ - $this->_mail = strtolower($mail); - } - - /** - * Récuperation du mot de passe d'un utilisateur - * @return string le mot de passe de l'utilisateur - */ - public function getPwd():string{ - return $this->_pwd; - } - - /** - * Récuperation du mot de passe haché d'un utilisateur - * @return string le mot de passe haché de l'utilisateur - */ - public function getPwdHash():string{ - return password_hash($this->_pwd, PASSWORD_DEFAULT); - } - - /** - * Mise à jour du mot de passe d'un utilisateur - * @return string le nouveau mot de passe de l'utilisateur - */ - public function setPwd(string $pwd){ - $this->_pwd = $pwd; - } - - /** - * Récuperation du numéro de téléphone d'un utilisateur - * @return string le numéro de téléphone de l'utilisateur - */ - public function getPhone():string{ - return $this->nettoyer($this->_phone); - } - - /** - * Mise à jour du numéro de téléphone d'un utilisateur - * @return string le nouveau numéro de téléphone de l'utilisateur - */ - public function setPhone(string $phone){ - $this->_phone = $phone; - } - - /** - * Récuperation de la profession d'un utilisateur - * @return string la profession de l'utilisateur - */ - public function getWork():string{ - return $this->nettoyer($this->_work); - } - - /** - * Mise à jour de la profession d'un utilisateur - * @return string la nouvelle profession de l'utilisateur - */ - public function setWork(string $work){ - $this->_work = $work; - } - - /** - * Récuperation de la date de naissance d'un utilisateur - * @return string la date de naissance de l'utilisateur - */ - public function getBirth():?string{ - return $this->_birth; - } - - /** - * Mise à jour de la date de naissance d'un utilisateur - * @return string la nouvelle date de naissance de l'utilisateur - */ - public function setBirth(?string $birth){ - $this->_birth = $birth; - } - - /** - * Récuperation de la localisation d'un utilisateur - * @return string la localisation de l'utilisateur - */ - public function getLocation():string{ - return $this->nettoyer($this->_location); - } - - /** - * Mise à jour de la localisation d'un utilisateur - * @return string la nouvelle localisation de l'utilisateur - */ - public function setLocation(string $location){ - $this->_location = $location; - } - - /** - * Récuperation de la description d'un utilisateur - * @return string la description de l'utilisateur - */ - public function getDescription():string{ - return $this->nettoyer($this->_description); - } - - /** - * Mise à jour de la description d'un utilisateur - * @return string la nouvelle description de l'utilisateur - */ - public function setDescription(string $description){ - $this->_description = $description; - } - - /** - * Récuperation de la date de création d'un utilisateur - * @return string la date de création de l'utilisateur - */ - public function getAccountCreation():string{ - return $this->_account_creation; - } - - /** - * Mise à jour de la date de création d'un utilisateur - * @return string la nouvelle date de création de l'utilisateur - */ - public function setAccountCreation(string $account_creation){ - $this->_account_creation = $account_creation; - } - - /** - * Récuperation de l'id du statut d'un utilisateur - * @return int l'id du statut de l'utilisateur - */ - public function getStatus():int{ - return $this->_status; - } - - /** - * Mise à jour de l'id du statut d'un utilisateur - * @return int le nouvel id du statut de l'utilisateur - */ - public function setStatus(int $status){ - $this->_status = $status; - } - } diff --git a/entities/authorisation_entity.php b/entities/authorisation_entity.php new file mode 100644 index 0000000..d072d01 --- /dev/null +++ b/entities/authorisation_entity.php @@ -0,0 +1,28 @@ +_prefix = 'authorisation_'; + } + + public function getId():int{ + return $this->_id; + } + public function setId(int $id){ + $this->_id = $id; + } + + public function getName():string{ + return $this->_name; + } + + public function setName(string $name){ + $this->_name = $name; + } + + } \ No newline at end of file diff --git a/entities/Category.php b/entities/category_entity.php similarity index 90% rename from entities/Category.php rename to entities/category_entity.php index 9b9b749..c614541 100644 --- a/entities/Category.php +++ b/entities/category_entity.php @@ -1,20 +1,20 @@ _prefix = 'category_'; diff --git a/entities/Image.php b/entities/image_entity.php similarity index 94% rename from entities/Image.php rename to entities/image_entity.php index 11dfad5..29588a1 100644 --- a/entities/Image.php +++ b/entities/image_entity.php @@ -1,13 +1,13 @@ _prefix = 'image_'; } diff --git a/entities/Mother.php b/entities/mother_entity.php similarity index 93% rename from entities/Mother.php rename to entities/mother_entity.php index c05ced3..992fb89 100644 --- a/entities/Mother.php +++ b/entities/mother_entity.php @@ -1,13 +1,11 @@ _prefix = 'project_'; @@ -35,7 +30,7 @@ class Project extends Mother{ // Méthode Getter et Setter /** - * Récuperation de l'id du projet + * Récuperation de l'id du Projet * @return int l'id du projet */ public function getId():?int{ @@ -56,7 +51,7 @@ class Project extends Mother{ * @return string tite du projet */ public function getTitle(){ - return $this->nettoyer($this->_title); + return $this->_title; } /** @@ -72,7 +67,7 @@ class Project extends Mother{ * @return string description du projet */ public function getDescription(){ - return $this->nettoyer($this->_description) ; + return $this->_description; } /** @@ -101,16 +96,16 @@ class Project extends Mother{ } /** - * Récuperation du contenu - * @return string contenu du projet + * Récuperation du contenue + * @return string contenue du projet */ public function getContent(){ - return $this->nettoyer($this->_content); + return $this->_content; } /** - * Mise à jour du contenu - * @param string le nouveau contenu + * Mise à jour du contenue + * @param string le nouveau contenue */ public function setContent($content){ $this->_content = $content; @@ -221,20 +216,6 @@ class Project extends Mother{ public function setUser_image($user_image){ $this->_user_image = $user_image; } - - /** - * Récupération de la date du projet supprimer - * @return string date du projet - */ - public function getProject_deleted_at(){ - return $this->_project_deleted_at; - } - /** - * Mise à jour de la date de suppression de projet - * @param string date du projet - */ - public function setProject_deleted_at($project_deleted_at){ - $this->_project_deleted_at = $project_deleted_at; - } + } \ No newline at end of file diff --git a/entities/user_entity.php b/entities/user_entity.php new file mode 100644 index 0000000..a034835 --- /dev/null +++ b/entities/user_entity.php @@ -0,0 +1,124 @@ +_prefix = 'user_'; + } + + public function getId():int{ + return $this->_id; + } + public function setId(int $id){ + $this->_id = $id; + } + + public function getName():string{ + return $this->_name; + } + public function setName(string $name){ + $this->_name = $name; + } + + public function getFirstname():string{ + return $this->_firstname; + } + public function setFirstname(string $firstname){ + $this->_firstname = $firstname; + } + + public function getPseudo():string{ + return $this->_pseudo; + } + public function setPseudo(string $pseudo){ + $this->_pseudo = $pseudo; + } + + public function getImage():?string{ + return $this->_image; + } + public function setImage(?string $image){ + $this->_image = $image; + } + + public function getMail():string{ + return $this->_mail; + } + public function setMail(string $mail){ + $this->_mail = strtolower($mail); + } + + public function getPwd():string{ + return $this->_pwd; + } + public function getPwdHash():string{ + return password_hash($this->_pwd, PASSWORD_DEFAULT); + } + public function setPwd(string $pwd){ + $this->_pwd = $pwd; + } + + public function getPhone():string{ + return $this->_phone; + } + public function setPhone(string $phone){ + $this->_phone = $phone; + } + + public function getWork():string{ + return $this->_work; + } + public function setWork(string $work){ + $this->_work = $work; + } + + public function getBirth():?string{ + return $this->_birth; + } + public function setBirth(?string $birth){ + $this->_birth = $birth; + } + + public function getLocation():string{ + return $this->_location; + } + public function setLocation(string $location){ + $this->_location = $location; + } + + public function getDescription():string{ + return $this->_description; + } + public function setDescription(string $description){ + $this->_description = $description; + } + + public function getAccountCreation():string{ + return $this->_account_creation; + } + public function setAccountCreation(string $account_creation){ + $this->_account_creation = $account_creation; + } + + public function getStatus():int{ + return $this->_status; + } + public function setStatus(int $status){ + $this->_status = $status; + } + } diff --git a/index.php b/index.php index 0b6c7b0..4013681 100644 --- a/index.php +++ b/index.php @@ -1,31 +1,36 @@ safeLoad(); - $strCtrl = $_GET['ctrl'] ?? 'project'; - $strMethod = $_GET['action'] ?? 'home'; + $strCtrl = $_GET['ctrl']??'project'; + $strMethod = $_GET['action']??'home'; - $strClassName = "Controllers\\" . ucfirst($strCtrl) . "Ctrl"; + $boolError = false; + $strFileName = "./controllers/".$strCtrl."_controller.php"; - $boolError = false; - - if (class_exists($strClassName)) { - $objController = new $strClassName(); - - if (method_exists($objController, $strMethod)) { - $objController->$strMethod(); - } else { + if(file_exists($strFileName)){ + require($strFileName); + $strClassName = ucfirst($strCtrl)."Ctrl"; + if(class_exists($strClassName)){ + $objController = new $strClassName(); + if(method_exists($objController,$strMethod)){ + $objController->$strMethod (); + }else{ + $boolError = true; + } + }else{ $boolError = true; } - } else { + }else{ $boolError = true; } - if ($boolError) { - header("Location: index.php?ctrl=error&action=error_404"); - exit; - } \ No newline at end of file + if($boolError){ + header("Location:index.php?ctrl=error&action=error_404"); + } + diff --git a/models/MotherModel.php b/models/MotherModel.php deleted file mode 100644 index df9f2f7..0000000 --- a/models/MotherModel.php +++ /dev/null @@ -1,24 +0,0 @@ -_db = new PDO( - "mysql:host=localhost;dbname=projet_folliow", - "projet_user", - "F0lliowRules!", - array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC) - ); - $this->_db->exec("SET CHARACTER SET utf8"); - $this->_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - } catch(PDOException$e) { - echo "Échec : " . $e->getMessage(); - } - } - } \ No newline at end of file diff --git a/models/AuthorisationModel.php b/models/authorisation_model.php similarity index 85% rename from models/AuthorisationModel.php rename to models/authorisation_model.php index f98030b..010660b 100644 --- a/models/AuthorisationModel.php +++ b/models/authorisation_model.php @@ -1,7 +1,5 @@ _db = new PDO( + "mysql:host=boulayoune.com;dbname=projet_folliow", // Serveur et BDD "mysql:host=localhost;dbname=projet_folliow", + "projet_user", //Nom d'utilisateur de la base de données root + "F0lliowRules!",// Mot de passe de la base de données + array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC) // Mode de renvoi + ); + // Pour résoudre les problèmes d’encodage + $this->_db->exec("SET CHARACTER SET utf8"); + // Configuration des exceptions + $this->_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + } catch(PDOException$e) { + echo "Échec : " . $e->getMessage(); + } + } + } + + /** + *Pour passer sur le serveur de YASS: + *"mysql:host=boulayoune.com;dbname=projet_folliow", // Serveur et BDD + "projet_user", //Nom d'utilisateur de la base de données + "F0lliowRules!",// Mot de passe de la base de données + Site pour BDD: https://phpmyadmin.boulayoune.com/index.php?route=/sql&pos=0&db=projet_folliow&table=project + + *Pour passer en local: + *"mysql:host=localhost;dbname=projet_folliow", // Serveur et BDD + *"root", //Nom d'utilisateur de la base de données + *"",// Mot de passe de la base de données + */ \ No newline at end of file diff --git a/models/ProjectModel.php b/models/project_model.php similarity index 73% rename from models/ProjectModel.php rename to models/project_model.php index a248884..04bd1a6 100644 --- a/models/ProjectModel.php +++ b/models/project_model.php @@ -1,16 +1,13 @@ _db->quote("%" . $strKeywords . "%"); - - $strRq .= $strAnd. " (project_title LIKE ".$strSafeKeywords." - OR project_content LIKE ".$strSafeKeywords.") "; - + $strRq .= " AND (project_title LIKE :keywords OR project_content LIKE :keywords)"; } if ($intAuthor > 0){ - $strRq .= $strAnd." user_id = ".$intAuthor; + $strRq .= " AND project_user_id = :author"; + } - } if ($intCategory > 0){ - $strRq .= $strAnd." project_category = ".$intCategory; + $strRq .= " AND project_category = :category"; } + if ($boolOlderThan6Months === true) { - $strRq .= $strAnd . " project_creation_date <= DATE_SUB(NOW(), INTERVAL 6 MONTH) "; + $strRq .= " AND project_creation_date <= DATE_SUB(NOW(), INTERVAL 6 MONTH)"; } + if ($intPeriod == 0){ if ($strDate != ''){ - $strRq .= $strAnd." project_creation_date = '".$strDate."'"; + $strRq .= " AND project_creation_date = :date_exacte"; } - }else{ + } else { if ($strStartDate != '' && $strEndDate != ''){ - $strRq .= $strAnd." project_creation_date BETWEEN '".$strStartDate."' AND '".$strEndDate."'"; - }else{ + $strRq .= " AND project_creation_date BETWEEN :date_debut AND :date_fin"; + } else { if ($strStartDate != ''){ - $strRq .= $strAnd." project_creation_date >= '".$strStartDate."'"; - }else if ($strEndDate != ''){ - $strRq .= $strAnd." project_creation_date <= '".$strEndDate."'"; + $strRq .= " AND project_creation_date >= :date_debut"; + } else if ($strEndDate != ''){ + $strRq .= " AND project_creation_date <= :date_fin"; } } } - + $strRq .= " ORDER BY project_creation_date DESC"; if ($intLimit > 0){ - $strRq .= " LIMIT ".$intLimit; + $strRq .= " LIMIT :limit"; } - return $this->_db->query($strRq)->fetchAll(); + $rqPrep = $this->_db->prepare($strRq); + + if ($strKeywords != '') { + $rqPrep->bindValue(':keywords', '%' . $strKeywords . '%', PDO::PARAM_STR); + } + if ($intAuthor > 0){ + $rqPrep->bindValue(':author', $intAuthor, PDO::PARAM_INT); + } + if ($intCategory > 0){ + $rqPrep->bindValue(':category', $intCategory, PDO::PARAM_INT); + } + if ($intPeriod == 0){ + if ($strDate != ''){ + $rqPrep->bindValue(':date_exacte', $strDate, PDO::PARAM_STR); + } + } else { + if ($strStartDate != '' && $strEndDate != ''){ + $rqPrep->bindValue(':date_debut', $strStartDate, PDO::PARAM_STR); + $rqPrep->bindValue(':date_fin', $strEndDate, PDO::PARAM_STR); + } else { + if ($strStartDate != ''){ + $rqPrep->bindValue(':date_debut', $strStartDate, PDO::PARAM_STR); + } else if ($strEndDate != ''){ + $rqPrep->bindValue(':date_fin', $strEndDate, PDO::PARAM_STR); + } + } + } + if ($intLimit > 0){ + $rqPrep->bindValue(':limit', $intLimit, PDO::PARAM_INT); + } + + $rqPrep->execute(); + return $rqPrep->fetchAll(); } @@ -98,9 +121,12 @@ $rqPrep->bindValue(":project_user_id", $objProject->getUser_id(), PDO::PARAM_STR); $rqPrep->bindValue(":project_category", $objProject->getCategory(), PDO::PARAM_STR); + // On met une variable boolOk pour récupérer l'id du projet $boolOk = $rqPrep->execute(); + // Si boolOk est remplis if ($boolOk) { + // On récupère l'ID auto-incrémenté et on l'injecte dans l'objet $objProject->setId($this->_db->lastInsertId()); } @@ -120,8 +146,7 @@ FROM project INNER JOIN users ON users.user_id = project.project_user_id LEFT JOIN category ON category.category_id = project.project_category - WHERE project.project_id = :id - AND project.project_deleted_at IS NULL"; + WHERE project.project_id = :id"; $rqPrep = $this->_db->prepare($strRq); $rqPrep->bindValue(":id", $intId, PDO::PARAM_INT); @@ -132,14 +157,14 @@ /** * Fonction de changement de status (accepter) d'un projet en BDD + * @author Guillaume * @param int $id l'id du projet * @return bool Est-ce que la requête s'est bien passée */ public function accept(int $id){ $strRq = "UPDATE project - SET project_status = 'publié', - project_edit_date = NOW() + SET project_status= 'publié' WHERE project_id =".$id; return $this->_db->query($strRq); @@ -147,14 +172,14 @@ /** * Fonction de changement de status (refusé) d'un projet en BDD + * @author Guillaume * @param int $id l'id du projet * @return bool Est-ce que la requête s'est bien passée */ public function refuse(int $id){ $strRq = "UPDATE project - SET project_status = 'refusé', - project_edit_date = NOW() + SET project_status= 'refusé' WHERE project_id =".$id; return $this->_db->query($strRq); @@ -162,23 +187,21 @@ /** * Fonction de suppression d'un projet en BDD + * @author Guillaume * @param int $id l'id du projet * @return bool Est-ce que la requête s'est bien passée */ - public function delete_soft_project(int $intId): bool { - $strRq = "UPDATE project - SET project_deleted_at = NOW(), - project_edit_date = NOW() - WHERE project_id = :id"; - - $rqPrep = $this->_db->prepare($strRq); - $rqPrep->bindValue(":id", $intId, PDO::PARAM_INT); + public function delete(int $id){ - return $rqPrep->execute(); + $strRq = "DELETE FROM project + WHERE project_id =".$id; + + return $this->_db->query($strRq); } /** * Fonction de mise à jour d'un projet en BDD + * @author Guillaume * @param object $objProject L'objet utilisateur * @return bool Est-ce que la requête s'est bien passée */ @@ -188,9 +211,7 @@ SET project_title = :title, project_description = :description, project_content = :content, - project_thumbnail = :thumbnail, - project_status = 'en_attente', - project_edit_date = NOW() + project_thumbnail = :thumbnail WHERE project_id = :id"; $rqPrep = $this->_db->prepare($strRq); @@ -206,6 +227,7 @@ /** * Fonction de récupération d'image d'un projet en BDD + * @author Guillaume * @param int $objProject L'Id du projet choisit * @return array Un tableau avec les informations de la bdd */ @@ -223,6 +245,7 @@ /** * Fonction de récupération d'image d'un projet en BDD + * @author Guillaume * @param int $id L'Id de l'image choisit * @return array Un tableau avec les informations de la bdd */ @@ -235,13 +258,12 @@ /** * Fonction de modifications de status de l'image d'un projet en BDD + * @author Guillaume * @param int $id L'Id de l'image choisit, string $status le status choisit * @return array Un tableau avec les informations de la bdd */ public function updateImageStatus(int $id, string $status): bool { - $strRq = "UPDATE image - SET image_status = :status - WHERE image_id = :id"; + $strRq = "UPDATE image SET image_status = :status WHERE image_id = :id"; $rqPrep = $this->_db->prepare($strRq); $rqPrep->bindValue(':status', $status, PDO::PARAM_STR); $rqPrep->bindValue(':id', $id, PDO::PARAM_INT); @@ -250,12 +272,12 @@ /** * Fonction de récupération d'image d'un projet en BDD + * @author Guillaume * @param int $id L'Id de l'image choisit * @return array Un tableau avec les informations de la bdd */ public function findImage(int $id): array|bool { - $strRq = "SELECT * FROM image - WHERE image_id = :id"; + $strRq = "SELECT * FROM image WHERE image_id = :id"; $rqPrep = $this->_db->prepare($strRq); $rqPrep->bindValue(':id', $id, PDO::PARAM_INT); $rqPrep->execute(); @@ -265,6 +287,7 @@ /** * Ajoute une image liée à un projet dans la table 'image' + * @author Guillaume * @param string $fileName Nom du fichier image * @param int $projectId ID du projet parent * @param string $alt Texte alternatif @@ -283,10 +306,10 @@ $rqPrep->bindValue(":name", $fileName, PDO::PARAM_STR); $rqPrep->bindValue(":alt", $alt, PDO::PARAM_STR); + // On met le statut par défaut en "en_attente" pour la modération $rqPrep->bindValue(":status", "en_attente", PDO::PARAM_STR); $rqPrep->bindValue(":project", $projectId, PDO::PARAM_INT); return $rqPrep->execute(); } - -} \ No newline at end of file + } \ No newline at end of file diff --git a/models/UserModel.php b/models/user_model.php similarity index 84% rename from models/UserModel.php rename to models/user_model.php index 3563238..9c6c7ce 100644 --- a/models/UserModel.php +++ b/models/user_model.php @@ -1,16 +1,13 @@ execute(); } - /** - * Méthode pour sauvegarder l'utilisateur lorsqu'il veut être souvenue - * @param int $userId l'id de l'utilisateur a se rappeler - * @param string $token Token hashé unique lié à l'utilisateur à se rappeler - * @return bool Est-ce que la requête s'est bien passée - */ public function remember(int $userId, string $token):bool{ $strRq = "INSERT INTO tokens (token_user_id, token_hash, token_created_at, token_expire_at) VALUES (:id, :token, NOW(), :exp)"; $rqPrep = $this->_db->prepare($strRq); $rqPrep->bindValue(":id", $userId, PDO::PARAM_INT); $rqPrep->bindValue(":token", $token, PDO::PARAM_STR); $rqPrep->bindValue(":exp", + //pour faire que le cookies soit valable 15 jours date('Y-m-d H:i:s', time() + (15*24*60*60)) , PDO::PARAM_STR); return $rqPrep->execute(); + } - - /** - * Méthode pour récupperer l'utilisateur par rapport au cookie enregistrer - * @param string $hash Token hashé unique lié à l'utilisateur - * @return bool Est-ce que la requête s'est bien passée - */ - public function getTokenUser(string $hash){ $strRq = $this->_db->prepare("SELECT token_user_id FROM tokens WHERE token_hash = :hash AND token_expire_at > NOW()"); $strRq->execute(['hash' => $hash]); return $strRq->fetch(); } - - /** - * Méthode pour supprimer le token lors de la déconnexion - * @param string $hash Token hashé unique lié à l'utilisateur - * @return bool Est-ce que la requête s'est bien passée - */ public function deleteToken(string $hash){ $strRq = $this->_db->prepare("DELETE FROM tokens WHERE token_hash = :hash"); return $strRq->execute(['hash' => $hash]); } - - /** - * Méthode pour mettre a jour l'utilisateur - * @param object $objUser L'objet user a mettre à jour - * @return bool Est-ce que la requête s'est bien passée - */ public function update(object $objUser):bool{ $strRq = "UPDATE users SET user_name = :name, @@ -215,11 +189,6 @@ return $prep->fetch(); } - /** - * Récupère les informations d'un utilisateur par son ID - * @param string $strPseudo Pseudo de l'utilisateur - * @return array Tableau associatif (ou false si pas trouvé) - */ public function findUserByPseudo(string $strPseudo): array|bool { $strRq = "SELECT user_id,user_image, user_status ,user_name, user_firstname, user_pseudo, user_mail, user_phone, user_work, user_location, user_description, authorisation_name @@ -233,11 +202,6 @@ return $prep->fetch(); } - /** - * Verifie sur le pseudo entré n'est pas déjà utilisé - * @param string $pseudo Pseudo a verifié - * @return array Tableau associatif (ou false si pas trouvé) - */ public function pseudoExists(string $pseudo): bool{ $rq = $this->_db->prepare("SELECT 1 FROM users WHERE user_pseudo = :pseudo LIMIT 1"); diff --git a/sfq.txt b/sfq.txt deleted file mode 100644 index e69de29..0000000 diff --git a/uploads/profiles/699f20ffe7dcc.webp b/uploads/profiles/699f20ffe7dcc.webp deleted file mode 100644 index cfad533..0000000 Binary files a/uploads/profiles/699f20ffe7dcc.webp and /dev/null differ diff --git a/uploads/profiles/69a421bf7770c.webp b/uploads/profiles/69a421bf7770c.webp deleted file mode 100644 index db8dfc7..0000000 Binary files a/uploads/profiles/69a421bf7770c.webp and /dev/null differ diff --git a/uploads/projects/1.jpg b/uploads/projects/1.jpg deleted file mode 100644 index 49225e0..0000000 Binary files a/uploads/projects/1.jpg and /dev/null differ diff --git a/uploads/projects/2.jpg b/uploads/projects/2.jpg deleted file mode 100644 index 79d260f..0000000 Binary files a/uploads/projects/2.jpg and /dev/null differ diff --git a/uploads/projects/3.jpg b/uploads/projects/3.jpg deleted file mode 100644 index 01de3c8..0000000 Binary files a/uploads/projects/3.jpg and /dev/null differ diff --git a/uploads/projects/4.jpg b/uploads/projects/4.jpg deleted file mode 100644 index 22daa29..0000000 Binary files a/uploads/projects/4.jpg and /dev/null differ diff --git a/uploads/projects/699f31601272b_gallery.webp b/uploads/projects/699db11d1741e_gallery.webp similarity index 100% rename from uploads/projects/699f31601272b_gallery.webp rename to uploads/projects/699db11d1741e_gallery.webp diff --git a/uploads/projects/699f20b493c07.webp b/uploads/projects/699f20b493c07.webp deleted file mode 100644 index d07b20e..0000000 Binary files a/uploads/projects/699f20b493c07.webp and /dev/null differ diff --git a/uploads/projects/699f20b4a826c_gallery.webp b/uploads/projects/699f20b4a826c_gallery.webp deleted file mode 100644 index 76941cd..0000000 Binary files a/uploads/projects/699f20b4a826c_gallery.webp and /dev/null differ diff --git a/uploads/projects/699f315fe7382.webp b/uploads/projects/699f315fe7382.webp deleted file mode 100644 index 8b57651..0000000 Binary files a/uploads/projects/699f315fe7382.webp and /dev/null differ diff --git a/uploads/projects/699f316006dea_gallery.webp b/uploads/projects/699f316006dea_gallery.webp deleted file mode 100644 index ab526bb..0000000 Binary files a/uploads/projects/699f316006dea_gallery.webp and /dev/null differ diff --git a/uploads/projects/699f31601d2e5_gallery.webp b/uploads/projects/699f31601d2e5_gallery.webp deleted file mode 100644 index bd69290..0000000 Binary files a/uploads/projects/699f31601d2e5_gallery.webp and /dev/null differ diff --git a/uploads/projects/699f31602732d_gallery.webp b/uploads/projects/699f31602732d_gallery.webp deleted file mode 100644 index 76941cd..0000000 Binary files a/uploads/projects/699f31602732d_gallery.webp and /dev/null differ diff --git a/uploads/projects/699f31919901d.webp b/uploads/projects/699f31919901d.webp deleted file mode 100644 index 8b57651..0000000 Binary files a/uploads/projects/699f31919901d.webp and /dev/null differ diff --git a/uploads/projects/699f32e7df968.webp b/uploads/projects/699f32e7df968.webp deleted file mode 100644 index 8b57651..0000000 Binary files a/uploads/projects/699f32e7df968.webp and /dev/null differ diff --git a/uploads/projects/69a049e86a0f4.webp b/uploads/projects/69a049e86a0f4.webp deleted file mode 100644 index c504287..0000000 Binary files a/uploads/projects/69a049e86a0f4.webp and /dev/null differ diff --git a/uploads/projects/69a049e8834a4_gallery.webp b/uploads/projects/69a049e8834a4_gallery.webp deleted file mode 100644 index 5cf64d5..0000000 Binary files a/uploads/projects/69a049e8834a4_gallery.webp and /dev/null differ diff --git a/uploads/projects/69a07901009c5.webp b/uploads/projects/69a07901009c5.webp deleted file mode 100644 index 8b57651..0000000 Binary files a/uploads/projects/69a07901009c5.webp and /dev/null differ diff --git a/uploads/projects/69a07901159e9_gallery.webp b/uploads/projects/69a07901159e9_gallery.webp deleted file mode 100644 index ab526bb..0000000 Binary files a/uploads/projects/69a07901159e9_gallery.webp and /dev/null differ diff --git a/uploads/projects/69a07901209a9_gallery.webp b/uploads/projects/69a07901209a9_gallery.webp deleted file mode 100644 index 88d37ae..0000000 Binary files a/uploads/projects/69a07901209a9_gallery.webp and /dev/null differ diff --git a/uploads/projects/69a079012b538_gallery.webp b/uploads/projects/69a079012b538_gallery.webp deleted file mode 100644 index bd69290..0000000 Binary files a/uploads/projects/69a079012b538_gallery.webp and /dev/null differ diff --git a/uploads/projects/69a079013593e_gallery.webp b/uploads/projects/69a079013593e_gallery.webp deleted file mode 100644 index 76941cd..0000000 Binary files a/uploads/projects/69a079013593e_gallery.webp and /dev/null differ diff --git a/uploads/projects/69a07936f13ca_gallery.webp b/uploads/projects/69a07936f13ca_gallery.webp deleted file mode 100644 index ab526bb..0000000 Binary files a/uploads/projects/69a07936f13ca_gallery.webp and /dev/null differ diff --git a/uploads/projects/69a07937088e1_gallery.webp b/uploads/projects/69a07937088e1_gallery.webp deleted file mode 100644 index 88d37ae..0000000 Binary files a/uploads/projects/69a07937088e1_gallery.webp and /dev/null differ diff --git a/uploads/projects/69a079371c10b_gallery.webp b/uploads/projects/69a079371c10b_gallery.webp deleted file mode 100644 index bd69290..0000000 Binary files a/uploads/projects/69a079371c10b_gallery.webp and /dev/null differ diff --git a/uploads/projects/69a07937268f6_gallery.webp b/uploads/projects/69a07937268f6_gallery.webp deleted file mode 100644 index 76941cd..0000000 Binary files a/uploads/projects/69a07937268f6_gallery.webp and /dev/null differ diff --git a/uploads/projects/69a41ebf52f1a.webp b/uploads/projects/69a41ebf52f1a.webp deleted file mode 100644 index e2863da..0000000 Binary files a/uploads/projects/69a41ebf52f1a.webp and /dev/null differ diff --git a/uploads/projects/69a41f1c43371.webp b/uploads/projects/69a41f1c43371.webp deleted file mode 100644 index 951c5d5..0000000 Binary files a/uploads/projects/69a41f1c43371.webp and /dev/null differ diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index ebfd8a1..5451b88 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -12,9 +12,7 @@ return array( 'Smarty\\' => array($vendorDir . '/smarty/smarty/src'), 'PhpOption\\' => array($vendorDir . '/phpoption/phpoption/src/PhpOption'), 'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'), - 'Models\\' => array($baseDir . '/models'), + 'Guill\\Guillaume\\' => array($baseDir . '/src'), 'GrahamCampbell\\ResultType\\' => array($vendorDir . '/graham-campbell/result-type/src'), - 'Entities\\' => array($baseDir . '/entities'), 'Dotenv\\' => array($vendorDir . '/vlucas/phpdotenv/src'), - 'Controllers\\' => array($baseDir . '/controllers'), ); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 64f2380..a7c1951 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -26,26 +26,15 @@ class ComposerStaticInit68f8d029d347b4c0c8cdbe33eeb96101 'PhpOption\\' => 10, 'PHPMailer\\PHPMailer\\' => 20, ), - 'M' => - array ( - 'Models\\' => 7, - ), 'G' => array ( + 'Guill\\Guillaume\\' => 16, 'GrahamCampbell\\ResultType\\' => 26, ), - 'E' => - array ( - 'Entities\\' => 9, - ), 'D' => array ( 'Dotenv\\' => 7, ), - 'C' => - array ( - 'Controllers\\' => 12, - ), ); public static $prefixDirsPsr4 = array ( @@ -73,26 +62,18 @@ class ComposerStaticInit68f8d029d347b4c0c8cdbe33eeb96101 array ( 0 => __DIR__ . '/..' . '/phpmailer/phpmailer/src', ), - 'Models\\' => + 'Guill\\Guillaume\\' => array ( - 0 => __DIR__ . '/../..' . '/models', + 0 => __DIR__ . '/../..' . '/src', ), 'GrahamCampbell\\ResultType\\' => array ( 0 => __DIR__ . '/..' . '/graham-campbell/result-type/src', ), - 'Entities\\' => - array ( - 0 => __DIR__ . '/../..' . '/entities', - ), 'Dotenv\\' => array ( 0 => __DIR__ . '/..' . '/vlucas/phpdotenv/src', ), - 'Controllers\\' => - array ( - 0 => __DIR__ . '/../..' . '/controllers', - ), ); public static $classMap = array ( diff --git a/views/_partial/footer.tpl b/views/_partial/footer.tpl index e90b260..ba77334 100644 --- a/views/_partial/footer.tpl +++ b/views/_partial/footer.tpl @@ -1,23 +1,34 @@ -