diff --git a/.env b/.env new file mode 100644 index 0000000..312e8f9 --- /dev/null +++ b/.env @@ -0,0 +1,10 @@ +# 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 new file mode 100644 index 0000000..e745855 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,37 @@ +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 new file mode 100644 index 0000000..ff24f70 --- /dev/null +++ b/README.md @@ -0,0 +1,98 @@ +# 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 6a8f455..142ea7f 100644 --- a/assests/css/style.css +++ b/assests/css/style.css @@ -102,7 +102,7 @@ body { .footer{ color: white; - background-color: #0000ff; + background-color: #6A6ED4; } .footer ul{ @@ -113,3 +113,7 @@ 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 new file mode 100644 index 0000000..55624b2 Binary files /dev/null and b/assests/img/Group-49.ico differ diff --git a/composer.json b/composer.json index c44dd27..a478818 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "yasse/projetphp", + "name": "groupe3/projetphp", "description": "le projet php de ces mort", "require": { "smarty/smarty": "^5.7", @@ -8,13 +8,15 @@ }, "autoload": { "psr-4": { - "Guill\\Guillaume\\": "src/" + "Controllers\\": "controllers/", + "Entities\\": "entities/", + "Models\\": "models/" } }, "authors": [ { - "name": "GuillaumeH-Cci", - "email": "guillaume.hess@ccicampus.fr" + "name": "Le Meilleur groupe", + "email": "pasdemail@meilleurgroupe.ccicampus" } ] } diff --git a/controllers/admin_controller.php b/controllers/AdminCtrl.php similarity index 83% rename from controllers/admin_controller.php rename to controllers/AdminCtrl.php index b98252b..88896dc 100644 --- a/controllers/admin_controller.php +++ b/controllers/AdminCtrl.php @@ -1,16 +1,13 @@ findAllCategory(); $arrCategoryToDisplay = array(); @@ -58,7 +55,6 @@ $arrCategoryToDisplay[] = $objCategory; } - //gestion de l'user $objUserModel = new UserModel; if (!empty($_POST['action'])) { @@ -82,7 +78,6 @@ } } - //affichage select des users $arrUser = $objUserModel->findAllUsers(); $arrUserToDisplay = array(); @@ -92,7 +87,6 @@ $arrUserToDisplay[] = $objUser; } - //affichage select des authorisations $objAuthorisationModel = new AuthorisationModel; $arrAuthorisation = $objAuthorisationModel->findAllAuthorisation(); $arrAuthorisationToDisplay = array(); @@ -103,7 +97,6 @@ $arrAuthorisationToDisplay[] = $objAuthorisation; } - //gérer l'affichage $this->_arrData['arrCategoryToDisplay'] = $arrCategoryToDisplay; $this->_arrData['arrUserToDisplay'] = $arrUserToDisplay; $this->_arrData['arrAuthorisationToDisplay'] = $arrAuthorisationToDisplay; diff --git a/controllers/error_controller.php b/controllers/ErrorCtrl.php similarity index 77% rename from controllers/error_controller.php rename to controllers/ErrorCtrl.php index 4ebead6..2e69e9e 100644 --- a/controllers/error_controller.php +++ b/controllers/ErrorCtrl.php @@ -1,9 +1,9 @@ registerPlugin('modifier', 'vardump', 'var_dump'); - // Désactiver la mise en cache + $objSmarty->registerPlugin('modifier', 'file_exists', 'file_exists'); $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']); @@ -43,14 +46,6 @@ }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/PageCtrl.php b/controllers/PageCtrl.php new file mode 100644 index 0000000..248435d --- /dev/null +++ b/controllers/PageCtrl.php @@ -0,0 +1,39 @@ +_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/project_controller.php b/controllers/ProjectCtrl.php similarity index 72% rename from controllers/project_controller.php rename to controllers/ProjectCtrl.php index ae44662..6cb408c 100644 --- a/controllers/project_controller.php +++ b/controllers/ProjectCtrl.php @@ -1,27 +1,34 @@ 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; } } @@ -75,7 +79,6 @@ */ public function search(){ - //Récupérer les informations du formulaire $strKeywords = $_POST['keywords']??''; $intAuthor = $_POST['author']??0; $intPeriod = $_POST['period']??0; @@ -84,7 +87,6 @@ $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); @@ -96,28 +98,32 @@ $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['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->_display("search"); } /** * Fonction d'affichage de la page projet - * @author Christel adapter par Guillaume */ - public function addedit_project(){ - if (!isset($_SESSION['user'])){ // Pas d'utilisateur connecté + public function addedit_project() { + if (!isset($_SESSION['user'])){ header("Location:index.php?ctrl=error&action=error_403"); exit; } @@ -126,18 +132,20 @@ $objProjectModel = new ProjectModel; $objCategoryModel = new CategoryModel; - // Dans la cas de modif if (isset($_GET['id'])){ $arrProject = $objProjectModel->findOne($_GET['id']); - $objProject->hydrate($arrProject); // BDD + if($_SESSION['user']['user_id'] != $arrProject['project_user_id']){ + header("Location:index.php?ctrl=error&action=error_403"); + exit; + } + $objProject->hydrate($arrProject); $this->_arrData['arrImages'] = $objProjectModel->getImagesByProjectId($objProject->getId()); } - // Tester le formulaire $arrError = []; if (count($_POST) > 0) { - $objProject->hydrate($_POST); // Formulaire + $objProject->hydrate($_POST); if ($objProject->getTitle() == ""){ $arrError['title'] = "Le titre est obligatoire"; } @@ -150,7 +158,6 @@ $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)){ @@ -185,18 +192,14 @@ } } - // 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; @@ -229,12 +232,10 @@ 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']); @@ -243,28 +244,21 @@ $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)) { @@ -273,10 +267,8 @@ $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; @@ -294,8 +286,7 @@ } $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); @@ -312,7 +303,6 @@ imagecopyresampled($objDestGallery, $objSourceGallery, 0, 0, $intCropX, $intCropY, $intDestW, $intDestH, $intCropW, $intCropH); if (imagewebp($objDestGallery, $strDestGallery)) { - // Insertion en BDD $objProjectModel->addImageInProject($galleryName, $objProject->getId()); $uploadedCount++; } @@ -329,7 +319,6 @@ } } - // Suppression de l'ancienne miniature if(isset($strOldImg) && !empty($strOldImg) && isset($strImageName)){ $strOldFile = $_ENV['IMG_PROJECT_PATH'].$strOldImg; if (file_exists($strOldFile)) unlink($strOldFile); @@ -347,26 +336,23 @@ } } - // 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 de projet - */ + /** + * Fonction d'affichage d'un projet + */ public function display() { $intId = $_GET['id'] ?? null; @@ -374,13 +360,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; @@ -396,12 +382,12 @@ } } - /** - * Fonction de partage de projet - */ - public function shareProject(){ - if (count($_POST) > 0) - { + /** + * Fonction d'envoi d'email + */ + public function sendEmail(){ + if (count($_POST) > 0) { + $projectId = (int)($_POST['project_id'] ?? 0); $toEmail = trim($_POST['to_email'] ?? ''); @@ -429,8 +415,6 @@ $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, @@ -467,76 +451,72 @@ /** * 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(){ - //Récupéré l'id dans l'url - $intId = $_GET['id']; + if (!isset($_SESSION['user']) || $_SESSION['user']['user_status'] != 2) { + header("Location: index.php"); + exit; + } + + $intId = $_GET['id'] ?? null; - //Je créer un nouveau model pour exec la commande SQL - $objProjectModel = new ProjectModel; - $objProjectModel->delete($intId); + 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."; + } + } - //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']; // "en_attente" passage à "approuvé" + $status = $_GET['status']; $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; @@ -545,14 +525,12 @@ /** * 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']; @@ -562,70 +540,10 @@ $_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/user_controller.php b/controllers/UserCtrl.php similarity index 85% rename from controllers/user_controller.php rename to controllers/UserCtrl.php index eafccef..c1f288a 100644 --- a/controllers/user_controller.php +++ b/controllers/UserCtrl.php @@ -1,22 +1,29 @@ 0) { - // Vérifier le formulaire if ($strMail == ""){ $arrError['mail'] = "Le mail est obligatoire"; } @@ -24,16 +31,12 @@ 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); - //var_dump($arrResult); - if ($arrResult === false){ // Si la base de données ne renvoie rien + if ($arrResult === false){ $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'])) { @@ -55,7 +58,9 @@ class UserCtrl extends MotherCtrl { } - + /** + * Fonction pour ce déconnecter + */ public function logout(){ if (isset($_COOKIE['remember_me'])) { @@ -74,42 +79,30 @@ 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"; } @@ -137,21 +130,14 @@ 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); @@ -166,37 +152,17 @@ 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; @@ -209,8 +175,6 @@ class UserCtrl extends MotherCtrl { $objUser = new User; $objUser->hydrate($arrUserData); - - //affichage projet de l'utilisateur $objProjectModel = new ProjectModel; $arrProjects = $objProjectModel->findAll(0,'',$objUser->getId()); @@ -226,12 +190,14 @@ 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; @@ -248,7 +214,6 @@ 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; @@ -279,7 +244,6 @@ 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/controllers/page_controller.php b/controllers/page_controller.php deleted file mode 100644 index c7ff933..0000000 --- a/controllers/page_controller.php +++ /dev/null @@ -1,17 +0,0 @@ -_display("help"); - - } - } \ No newline at end of file diff --git a/database/.gitkeep b/database/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/database/database.sql b/database/database.sql new file mode 100644 index 0000000..649db7d --- /dev/null +++ b/database/database.sql @@ -0,0 +1,253 @@ +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 new file mode 100644 index 0000000..cac51b4 --- /dev/null +++ b/entities/Authorisation.php @@ -0,0 +1,53 @@ +_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/category_entity.php b/entities/Category.php similarity index 90% rename from entities/category_entity.php rename to entities/Category.php index c614541..9b9b749 100644 --- a/entities/category_entity.php +++ b/entities/Category.php @@ -1,20 +1,20 @@ _prefix = 'category_'; diff --git a/entities/image_entity.php b/entities/Image.php similarity index 94% rename from entities/image_entity.php rename to entities/Image.php index 29588a1..11dfad5 100644 --- a/entities/image_entity.php +++ b/entities/Image.php @@ -1,13 +1,13 @@ _prefix = 'image_'; } diff --git a/entities/mother_entity.php b/entities/Mother.php similarity index 93% rename from entities/mother_entity.php rename to entities/Mother.php index 992fb89..c05ced3 100644 --- a/entities/mother_entity.php +++ b/entities/Mother.php @@ -1,11 +1,13 @@ _prefix = 'project_'; @@ -30,7 +35,7 @@ class Project extends Entity{ // 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{ @@ -51,7 +56,7 @@ class Project extends Entity{ * @return string tite du projet */ public function getTitle(){ - return $this->_title; + return $this->nettoyer($this->_title); } /** @@ -67,7 +72,7 @@ class Project extends Entity{ * @return string description du projet */ public function getDescription(){ - return $this->_description; + return $this->nettoyer($this->_description) ; } /** @@ -96,16 +101,16 @@ class Project extends Entity{ } /** - * Récuperation du contenue - * @return string contenue du projet + * Récuperation du contenu + * @return string contenu du projet */ public function getContent(){ - return $this->_content; + return $this->nettoyer($this->_content); } /** - * Mise à jour du contenue - * @param string le nouveau contenue + * Mise à jour du contenu + * @param string le nouveau contenu */ public function setContent($content){ $this->_content = $content; @@ -216,6 +221,20 @@ class Project extends Entity{ 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.php b/entities/User.php new file mode 100644 index 0000000..1eee5be --- /dev/null +++ b/entities/User.php @@ -0,0 +1,263 @@ +_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 deleted file mode 100644 index d072d01..0000000 --- a/entities/authorisation_entity.php +++ /dev/null @@ -1,28 +0,0 @@ -_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/user_entity.php b/entities/user_entity.php deleted file mode 100644 index a034835..0000000 --- a/entities/user_entity.php +++ /dev/null @@ -1,124 +0,0 @@ -_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 4013681..0b6c7b0 100644 --- a/index.php +++ b/index.php @@ -1,36 +1,31 @@ safeLoad(); - $strCtrl = $_GET['ctrl']??'project'; - $strMethod = $_GET['action']??'home'; + $strCtrl = $_GET['ctrl'] ?? 'project'; + $strMethod = $_GET['action'] ?? 'home'; - $boolError = false; - $strFileName = "./controllers/".$strCtrl."_controller.php"; + $strClassName = "Controllers\\" . ucfirst($strCtrl) . "Ctrl"; - 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 = false; + + if (class_exists($strClassName)) { + $objController = new $strClassName(); + + if (method_exists($objController, $strMethod)) { + $objController->$strMethod(); + } else { $boolError = true; } - }else{ + } else { $boolError = true; } - if($boolError){ - header("Location:index.php?ctrl=error&action=error_404"); - } - + if ($boolError) { + header("Location: index.php?ctrl=error&action=error_404"); + exit; + } \ No newline at end of file diff --git a/models/authorisation_model.php b/models/AuthorisationModel.php similarity index 85% rename from models/authorisation_model.php rename to models/AuthorisationModel.php index 010660b..f98030b 100644 --- a/models/authorisation_model.php +++ b/models/AuthorisationModel.php @@ -1,5 +1,7 @@ _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/project_model.php b/models/ProjectModel.php similarity index 73% rename from models/project_model.php rename to models/ProjectModel.php index 04bd1a6..a248884 100644 --- a/models/project_model.php +++ b/models/ProjectModel.php @@ -1,13 +1,16 @@ _db->quote("%" . $strKeywords . "%"); + + $strRq .= $strAnd. " (project_title LIKE ".$strSafeKeywords." + OR project_content LIKE ".$strSafeKeywords.") "; + } if ($intAuthor > 0){ - $strRq .= " AND project_user_id = :author"; - } + $strRq .= $strAnd." user_id = ".$intAuthor; + } if ($intCategory > 0){ - $strRq .= " AND project_category = :category"; + $strRq .= $strAnd." project_category = ".$intCategory; } - if ($boolOlderThan6Months === true) { - $strRq .= " AND project_creation_date <= DATE_SUB(NOW(), INTERVAL 6 MONTH)"; + $strRq .= $strAnd . " project_creation_date <= DATE_SUB(NOW(), INTERVAL 6 MONTH) "; } - if ($intPeriod == 0){ if ($strDate != ''){ - $strRq .= " AND project_creation_date = :date_exacte"; + $strRq .= $strAnd." project_creation_date = '".$strDate."'"; } - } else { + }else{ if ($strStartDate != '' && $strEndDate != ''){ - $strRq .= " AND project_creation_date BETWEEN :date_debut AND :date_fin"; - } else { + $strRq .= $strAnd." project_creation_date BETWEEN '".$strStartDate."' AND '".$strEndDate."'"; + }else{ if ($strStartDate != ''){ - $strRq .= " AND project_creation_date >= :date_debut"; - } else if ($strEndDate != ''){ - $strRq .= " AND project_creation_date <= :date_fin"; + $strRq .= $strAnd." project_creation_date >= '".$strStartDate."'"; + }else if ($strEndDate != ''){ + $strRq .= $strAnd." project_creation_date <= '".$strEndDate."'"; } } } - + $strRq .= " ORDER BY project_creation_date DESC"; if ($intLimit > 0){ - $strRq .= " LIMIT :limit"; + $strRq .= " LIMIT ".$intLimit; } - $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(); + return $this->_db->query($strRq)->fetchAll(); } @@ -121,12 +98,9 @@ $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()); } @@ -146,7 +120,8 @@ 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"; + WHERE project.project_id = :id + AND project.project_deleted_at IS NULL"; $rqPrep = $this->_db->prepare($strRq); $rqPrep->bindValue(":id", $intId, PDO::PARAM_INT); @@ -157,14 +132,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é' + SET project_status = 'publié', + project_edit_date = NOW() WHERE project_id =".$id; return $this->_db->query($strRq); @@ -172,14 +147,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é' + SET project_status = 'refusé', + project_edit_date = NOW() WHERE project_id =".$id; return $this->_db->query($strRq); @@ -187,21 +162,23 @@ /** * 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(int $id){ + 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); - $strRq = "DELETE FROM project - WHERE project_id =".$id; - - return $this->_db->query($strRq); + return $rqPrep->execute(); } /** * 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 */ @@ -211,7 +188,9 @@ SET project_title = :title, project_description = :description, project_content = :content, - project_thumbnail = :thumbnail + project_thumbnail = :thumbnail, + project_status = 'en_attente', + project_edit_date = NOW() WHERE project_id = :id"; $rqPrep = $this->_db->prepare($strRq); @@ -227,7 +206,6 @@ /** * 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 */ @@ -245,7 +223,6 @@ /** * 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 */ @@ -258,12 +235,13 @@ /** * 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); @@ -272,12 +250,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(); @@ -287,7 +265,6 @@ /** * 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 @@ -306,10 +283,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/user_model.php b/models/UserModel.php similarity index 84% rename from models/user_model.php rename to models/UserModel.php index 9c6c7ce..3563238 100644 --- a/models/user_model.php +++ b/models/UserModel.php @@ -1,13 +1,16 @@ 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, @@ -189,6 +215,11 @@ 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 @@ -202,6 +233,11 @@ 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/models/mother_model.php b/models/mother_model.php deleted file mode 100644 index 7758599..0000000 --- a/models/mother_model.php +++ /dev/null @@ -1,36 +0,0 @@ -_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/sfq.txt b/sfq.txt new file mode 100644 index 0000000..e69de29 diff --git a/uploads/profiles/699f20ffe7dcc.webp b/uploads/profiles/699f20ffe7dcc.webp new file mode 100644 index 0000000..cfad533 Binary files /dev/null and b/uploads/profiles/699f20ffe7dcc.webp differ diff --git a/uploads/profiles/69a421bf7770c.webp b/uploads/profiles/69a421bf7770c.webp new file mode 100644 index 0000000..db8dfc7 Binary files /dev/null and b/uploads/profiles/69a421bf7770c.webp differ diff --git a/uploads/projects/1.jpg b/uploads/projects/1.jpg new file mode 100644 index 0000000..49225e0 Binary files /dev/null and b/uploads/projects/1.jpg differ diff --git a/uploads/projects/2.jpg b/uploads/projects/2.jpg new file mode 100644 index 0000000..79d260f Binary files /dev/null and b/uploads/projects/2.jpg differ diff --git a/uploads/projects/3.jpg b/uploads/projects/3.jpg new file mode 100644 index 0000000..01de3c8 Binary files /dev/null and b/uploads/projects/3.jpg differ diff --git a/uploads/projects/4.jpg b/uploads/projects/4.jpg new file mode 100644 index 0000000..22daa29 Binary files /dev/null and b/uploads/projects/4.jpg differ diff --git a/uploads/projects/699f20b493c07.webp b/uploads/projects/699f20b493c07.webp new file mode 100644 index 0000000..d07b20e Binary files /dev/null and b/uploads/projects/699f20b493c07.webp differ diff --git a/uploads/projects/699f20b4a826c_gallery.webp b/uploads/projects/699f20b4a826c_gallery.webp new file mode 100644 index 0000000..76941cd Binary files /dev/null and b/uploads/projects/699f20b4a826c_gallery.webp differ diff --git a/uploads/projects/699f315fe7382.webp b/uploads/projects/699f315fe7382.webp new file mode 100644 index 0000000..8b57651 Binary files /dev/null and b/uploads/projects/699f315fe7382.webp differ diff --git a/uploads/projects/699f316006dea_gallery.webp b/uploads/projects/699f316006dea_gallery.webp new file mode 100644 index 0000000..ab526bb Binary files /dev/null and b/uploads/projects/699f316006dea_gallery.webp differ diff --git a/uploads/projects/699db11d1741e_gallery.webp b/uploads/projects/699f31601272b_gallery.webp similarity index 100% rename from uploads/projects/699db11d1741e_gallery.webp rename to uploads/projects/699f31601272b_gallery.webp diff --git a/uploads/projects/699f31601d2e5_gallery.webp b/uploads/projects/699f31601d2e5_gallery.webp new file mode 100644 index 0000000..bd69290 Binary files /dev/null and b/uploads/projects/699f31601d2e5_gallery.webp differ diff --git a/uploads/projects/699f31602732d_gallery.webp b/uploads/projects/699f31602732d_gallery.webp new file mode 100644 index 0000000..76941cd Binary files /dev/null and b/uploads/projects/699f31602732d_gallery.webp differ diff --git a/uploads/projects/699f31919901d.webp b/uploads/projects/699f31919901d.webp new file mode 100644 index 0000000..8b57651 Binary files /dev/null and b/uploads/projects/699f31919901d.webp differ diff --git a/uploads/projects/699f32e7df968.webp b/uploads/projects/699f32e7df968.webp new file mode 100644 index 0000000..8b57651 Binary files /dev/null and b/uploads/projects/699f32e7df968.webp differ diff --git a/uploads/projects/69a049e86a0f4.webp b/uploads/projects/69a049e86a0f4.webp new file mode 100644 index 0000000..c504287 Binary files /dev/null and b/uploads/projects/69a049e86a0f4.webp differ diff --git a/uploads/projects/69a049e8834a4_gallery.webp b/uploads/projects/69a049e8834a4_gallery.webp new file mode 100644 index 0000000..5cf64d5 Binary files /dev/null and b/uploads/projects/69a049e8834a4_gallery.webp differ diff --git a/uploads/projects/69a07901009c5.webp b/uploads/projects/69a07901009c5.webp new file mode 100644 index 0000000..8b57651 Binary files /dev/null and b/uploads/projects/69a07901009c5.webp differ diff --git a/uploads/projects/69a07901159e9_gallery.webp b/uploads/projects/69a07901159e9_gallery.webp new file mode 100644 index 0000000..ab526bb Binary files /dev/null and b/uploads/projects/69a07901159e9_gallery.webp differ diff --git a/uploads/projects/69a07901209a9_gallery.webp b/uploads/projects/69a07901209a9_gallery.webp new file mode 100644 index 0000000..88d37ae Binary files /dev/null and b/uploads/projects/69a07901209a9_gallery.webp differ diff --git a/uploads/projects/69a079012b538_gallery.webp b/uploads/projects/69a079012b538_gallery.webp new file mode 100644 index 0000000..bd69290 Binary files /dev/null and b/uploads/projects/69a079012b538_gallery.webp differ diff --git a/uploads/projects/69a079013593e_gallery.webp b/uploads/projects/69a079013593e_gallery.webp new file mode 100644 index 0000000..76941cd Binary files /dev/null and b/uploads/projects/69a079013593e_gallery.webp differ diff --git a/uploads/projects/69a07936f13ca_gallery.webp b/uploads/projects/69a07936f13ca_gallery.webp new file mode 100644 index 0000000..ab526bb Binary files /dev/null and b/uploads/projects/69a07936f13ca_gallery.webp differ diff --git a/uploads/projects/69a07937088e1_gallery.webp b/uploads/projects/69a07937088e1_gallery.webp new file mode 100644 index 0000000..88d37ae Binary files /dev/null and b/uploads/projects/69a07937088e1_gallery.webp differ diff --git a/uploads/projects/69a079371c10b_gallery.webp b/uploads/projects/69a079371c10b_gallery.webp new file mode 100644 index 0000000..bd69290 Binary files /dev/null and b/uploads/projects/69a079371c10b_gallery.webp differ diff --git a/uploads/projects/69a07937268f6_gallery.webp b/uploads/projects/69a07937268f6_gallery.webp new file mode 100644 index 0000000..76941cd Binary files /dev/null and b/uploads/projects/69a07937268f6_gallery.webp differ diff --git a/uploads/projects/69a41ebf52f1a.webp b/uploads/projects/69a41ebf52f1a.webp new file mode 100644 index 0000000..e2863da Binary files /dev/null and b/uploads/projects/69a41ebf52f1a.webp differ diff --git a/uploads/projects/69a41f1c43371.webp b/uploads/projects/69a41f1c43371.webp new file mode 100644 index 0000000..951c5d5 Binary files /dev/null and b/uploads/projects/69a41f1c43371.webp differ diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 5451b88..ebfd8a1 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -12,7 +12,9 @@ return array( 'Smarty\\' => array($vendorDir . '/smarty/smarty/src'), 'PhpOption\\' => array($vendorDir . '/phpoption/phpoption/src/PhpOption'), 'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'), - 'Guill\\Guillaume\\' => array($baseDir . '/src'), + 'Models\\' => array($baseDir . '/models'), '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 a7c1951..64f2380 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -26,15 +26,26 @@ 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 ( @@ -62,18 +73,26 @@ class ComposerStaticInit68f8d029d347b4c0c8cdbe33eeb96101 array ( 0 => __DIR__ . '/..' . '/phpmailer/phpmailer/src', ), - 'Guill\\Guillaume\\' => + 'Models\\' => array ( - 0 => __DIR__ . '/../..' . '/src', + 0 => __DIR__ . '/../..' . '/models', ), '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 ba77334..e90b260 100644 --- a/views/_partial/footer.tpl +++ b/views/_partial/footer.tpl @@ -1,34 +1,23 @@ -