From ad676024837190d088b27999712af238102ea391 Mon Sep 17 00:00:00 2001 From: Bess1k Date: Tue, 17 Feb 2026 23:17:21 +0100 Subject: [PATCH 01/44] Envoyer mail via mail_message --- controllers/project_controller.php | 164 ++++++++++++++++++----------- 1 file changed, 102 insertions(+), 62 deletions(-) diff --git a/controllers/project_controller.php b/controllers/project_controller.php index af2e9fa..ef05b1b 100644 --- a/controllers/project_controller.php +++ b/controllers/project_controller.php @@ -23,9 +23,20 @@ */ public function home(){ + + + $intCategory = 0; + if (!empty($_GET['filter_cat'])) { + $intCategory = (int) $_GET['filter_cat']; + } + + $boolOld = false; + if (!empty($_GET['filter_old']) && $_GET['filter_old'] == 'true') { + $boolOld = true; + } $objProjectModel = new ProjectModel; - $arrProject = $objProjectModel->findAll(); + $arrProject = $objProjectModel->findAll(0,'',0,0,'','','',$intCategory,$boolOld); $arrProjectToDisplay = array(); foreach($arrProject as $arrDetProject){ $objProject = new Project; @@ -34,8 +45,6 @@ } $this->_arrData['arrProjectToDisplay'] = $arrProjectToDisplay; - - $this->_display("home"); } @@ -43,8 +52,8 @@ /** * Fonction d'affichage de la barre de recherche */ - public function search(){ + //Récupérer les informations du formulaire $strKeywords = $_POST['keywords']??''; $intAuthor = $_POST['author']??0; @@ -76,6 +85,7 @@ $this->_arrData['arrProjectToDisplay'] = $arrProjectToDisplay; $this->_arrData['arrCategory'] = $arrCategory; + $this->_arrData['arrProject'] = $arrProject; $this->_arrData['arrUser'] = $arrUser; @@ -87,62 +97,62 @@ /** * Fonction d'affichage de la page projet */ - - public function project (){ $objProjectModel = new ProjectModel; $arrProject = $objProjectModel->findAll(4); - $arrProjectToDiplay = array(); + $arrProjectToDisplay = array(); foreach($arrProject as $arrDetProject){ $objProject = new Project; $objProject->hydrate($arrDetProject); - $arrProjectToDiplay[] = $objProject; + $arrProjectToDisplay[] = $objProject; } $objImageModel = new ImageModel; $arrImage = $objImageModel->findAllImage(4); - $arrImageToDiplay = array(); + $arrImageToDisplay = array(); foreach($arrImage as $arrDetImage){ $objImage = new Image; $objImage->hydrate($arrDetImage); - $arrImageToDiplay[] = $objImage; + $arrImageToDisplay[] = $objImage; } //Variable data $_SESSION['title'] = $_POST['titleProject']??""; $_SESSION['description'] = $_POST['descProject']??""; $_SESSION['content'] = $_POST['textProject']??""; - $_SESSION['thumbnail'] = $_FILES['imageProject']['name']??""; + $_SESSION['thumbnail'] = $_FILES['imageThumbnail']['name']??""; $_SESSION['status'] = 'en_attente'; + $_SESSION['user_id'] = $_SESSION['user']['user_id']; $objProject = new Project(); /** - /* Créer par Besnik le GOAT et l'autre GOAT de Guillaume - /* - /* @return bool pour savoir si le fichier existe, - /* puis déplace vers le fichier uploads avec les images projet des utilisateurs - /* Communication avec la BDD + * Créer par Besnik le GOAT et l'autre GOAT de Guillaume + * + * @return bool pour savoir si le fichier existe, + * puis déplace vers le fichier uploads avec les images projet des utilisateurs + * Communication avec la BDD */ if (($_SESSION['thumbnail'] != null)){ $strDest = ""; if ((count($_FILES) > 0) && ($_FILES['imageProject']['error'] != 4)){ - $strDest = '../public/uploads/projects/'.$_FILES['imageProject']['name']; - var_dump($strDest); + $strDest = 'uploads/projects/'.$_FILES['imageProject']['name']; move_uploaded_file($_FILES['imageProject']['tmp_name'], $strDest); } } /** En cas d'appuis sur le bouton d'envoie ou celui de remettre a plus tard - /* 1. Changement de status - /* 2. Hydratation avec les informations récupéré de l'utilisateur - /* 3. Envoie des données à la BDD - */ + * 1. Changement de status + * 2. Hydratation avec les informations récupéré de l'utilisateur + * 3. Envoie des données à la BDD + */ if (isset($_POST['sendMessage'])) { $_SESSION['status'] = 'publié'; $objProject->hydrate($_SESSION); - $objProject->setThumbnail($strDest); + $objProject->setThumbnail($strDest); + var_dump($strDest); + var_dump($objProject); $objProjectModel->insert($objProject); } else if (isset($_POST['toContinue'])) { @@ -151,14 +161,12 @@ $objProjectModel->insert($objProject); } - //Débuggage var_dump($_SESSION); var_dump($objProject); - $this->_arrData['arrProjectToDiplay'] = $arrProjectToDiplay; - $this->_arrData['arrImageToDiplay'] = $arrImageToDiplay; + $this->_arrData['arrProjectToDiplay'] = $arrProjectToDisplay; + $this->_arrData['arrImageToDiplay'] = $arrImageToDisplay; $this->_display("project"); - } @@ -174,7 +182,7 @@ $objProject->hydrate($arrProject); $this->_arrData["objProject"] = $objProject; - $this->_display("projet_display"); + $this->_display("project_display"); } else { header("Location: index.php?ctrl=project&action=home"); exit; @@ -187,16 +195,11 @@ public function sendEmail() { - if (count($_POST) > 0) { - + if (count($_POST) > 0) + { $projectId = (int)($_POST['project_id'] ?? 0); $toEmail = trim($_POST['to_email'] ?? ''); - if ($projectId <= 0 || !filter_var($toEmail, FILTER_VALIDATE_EMAIL)) { - header("Location: index.php?ctrl=project&action=display&id=".$projectId."&mail=fail"); - exit; - } - $objProjectModel = new ProjectModel(); $arrProject = $objProjectModel->findOne($projectId); @@ -208,46 +211,37 @@ $objProject = new Project(); $objProject->hydrate($arrProject); - - - $objMail = new PHPMailer(); // Nouvel objet Mail + $objMail = new PHPMailer(); $objMail->IsSMTP(); - $objMail->Mailer = "smtp"; - $objMail->CharSet = PHPMailer::CHARSET_UTF8; + $objMail->Mailer = "smtp"; + $objMail->CharSet = PHPMailer::CHARSET_UTF8; + $objMail->SMTPDebug = 0; - $objMail->SMTPDebug = 0; - - $objMail->SMTPAuth = TRUE; - $objMail->SMTPSecure = "tls"; - $objMail->Port = 587; - $objMail->Host = "smtp.gmail.com"; - $objMail->Username = "projet.folliow@gmail.com"; - $objMail->Password = "dqnw mqbu cwvg enbp"; + $objMail->SMTPAuth = true; + $objMail->SMTPSecure = "tls"; + $objMail->Port = 587; + $objMail->Host = 'smtp-relay.brevo.com'; + $objMail->Username = 'a2a67e001@smtp-brevo.com'; + $objMail->Password = 'xsmtpsib-f2af87e12d3db6f1b99802a92c1acda32d45fc32a8446eeed7e49ec91c4ec7ef-AX8Y7YkRWYSmKHwS'; $objMail->IsHTML(true); - - $objMail->setFrom('projet.folliow@gmail.com', 'Projet Folliow'); - - - // Destinataire + $objMail->setFrom('projet.folliow@hotmail.com', 'Folliow'); $objMail->addAddress($toEmail); - // Mail $objMail->Subject = "Projet : " . $objProject->getTitle(); - $url = "http://localhost/projet_php/public/index.php?ctrl=project&action=display&id=" . $projectId; + $url = "https://php.boulayoune.com/index.php?ctrl=project&action=display&id=" . $projectId; - $objMail->Body = - "

" . $objProject->getTitle() . "

" . - "

" . $objProject->getDescription() . "

" . - "

Voir le projet

"; + $this->_arrData['projectTitle'] = $objProject->getTitle(); + $this->_arrData['projectDescription'] = $objProject->getDescription(); + $this->_arrData['projectUrl'] = $url; + + $objMail->Body = $this->_display("mail_message", false); - // Envoi + redirection if ($objMail->Send()) { header("Location: index.php?ctrl=project&action=display&id=".$projectId."&mail=ok"); } else { - // Pour debug si besoin: echo $objMail->ErrorInfo; exit; header("Location: index.php?ctrl=project&action=display&id=".$projectId."&mail=fail"); } exit; @@ -256,4 +250,50 @@ header("Location: index.php?ctrl=project&action=home"); exit; } - } \ No newline at end of file + + + + + + 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; + } + + 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; + } + + public function delete(){ + + //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->delete($intId); + + //Redirection vers la page + header("Location: index.php"); + exit; + } + } From 48510edae88c537bef85867bf016f941413190f2 Mon Sep 17 00:00:00 2001 From: Bess1k Date: Tue, 17 Feb 2026 23:25:06 +0100 Subject: [PATCH 02/44] changer le nom de fonction pour partage projet --- controllers/project_controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/project_controller.php b/controllers/project_controller.php index ef05b1b..104fecd 100644 --- a/controllers/project_controller.php +++ b/controllers/project_controller.php @@ -193,7 +193,7 @@ } } - public function sendEmail() + public function shareProject() { if (count($_POST) > 0) { From 9f4a2c0b7e7f2a67fa03f4b56cd65fa2d894495a Mon Sep 17 00:00:00 2001 From: Bess1k Date: Tue, 17 Feb 2026 23:25:43 +0100 Subject: [PATCH 03/44] Update projet_display.tpl --- views/projet_display.tpl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/views/projet_display.tpl b/views/projet_display.tpl index 21301dc..1e831c7 100644 --- a/views/projet_display.tpl +++ b/views/projet_display.tpl @@ -35,9 +35,9 @@ - +
-
+ @@ -58,11 +58,11 @@
- - - + + +
{$objProject->getCreatorName()}

@@ -76,4 +76,4 @@

-{/block} \ No newline at end of file +{/block} From 5e3b6ee148fd4d4602ea88aa90fb3823d7db8b50 Mon Sep 17 00:00:00 2001 From: Bess1k Date: Tue, 17 Feb 2026 23:26:33 +0100 Subject: [PATCH 04/44] Add files via upload --- views/mail_message.tpl | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 views/mail_message.tpl diff --git a/views/mail_message.tpl b/views/mail_message.tpl new file mode 100644 index 0000000..4d4a618 --- /dev/null +++ b/views/mail_message.tpl @@ -0,0 +1,26 @@ +

Bonjour,

+ +

+ Un projet a été partagé avec vous via la plateforme Folliow. +

+ +

{$projectTitle}

+ +

+ {$projectDescription} +

+ +

+ Vous pouvez consulter le projet en cliquant sur le lien ci-dessous : +

+ +

+ + {$projectUrl} + +

+ +

+ Cordialement,
+ L’équipe Folliow +

From 09ec39c7bbd06714770c6ec65dfd532360ccdf2c Mon Sep 17 00:00:00 2001 From: Yasder5 <102179445+Yasder5@users.noreply.github.com> Date: Thu, 19 Feb 2026 20:33:24 +0100 Subject: [PATCH 05/44] edit user --- controllers/user_controller.php | 89 +++++++--- index.php | 1 - models/user_model.php | 31 +++- ...94486bfa02ee91c2c5fe68_0.file_home.tpl.php | 12 +- ...82584009ce981aa35e0b_0.file_layout.tpl.php | 12 +- ...56e3cf6837f9df55d7fb_0.file_footer.tpl.php | 8 +- ...2993687bad91a1cf0f6_0.file_preview.tpl.php | 8 +- ...db1687a6d7b7b3c501bb_0.file_search.tpl.php | 22 +-- ...947735d13c8d176ec944_0.file_header.tpl.php | 16 +- views/_partial/header.tpl | 1 - views/useredit.tpl | 161 ++++++++++++++++++ 11 files changed, 293 insertions(+), 68 deletions(-) create mode 100644 views/useredit.tpl diff --git a/controllers/user_controller.php b/controllers/user_controller.php index 1a3b464..8e185a6 100644 --- a/controllers/user_controller.php +++ b/controllers/user_controller.php @@ -151,37 +151,74 @@ class UserCtrl extends MotherCtrl { */ public function user(){ - $intId = isset($_GET['id']) ? (int)$_GET['id'] : 0; + $intId = isset($_GET['id']) ? (int)$_GET['id'] : 0; - if ($intId <= 0) { - header("Location: index.php"); - exit; - } + if ($intId <= 0) { + header("Location: index.php"); + exit; + } - //affichage info utilisateur - $objUserModel = new UserModel; - $arrUserData = $objUserModel->findUserById($intId); + //affichage info utilisateur + $objUserModel = new UserModel; + $arrUserData = $objUserModel->findUserById($intId); - if ($arrUserData === false) { - header("Location: index.php"); - exit; - } - $objUser = new User; - $objUser->hydrate($arrUserData); + if ($arrUserData === false) { + header("Location: index.php"); + exit; + } + $objUser = new User; + $objUser->hydrate($arrUserData); - //affichage projet de l'utilisateur - $objProjectModel = new ProjectModel; - $arrProjects = $objProjectModel->findAll(0,'',$intId); + //affichage projet de l'utilisateur + $objProjectModel = new ProjectModel; + $arrProjects = $objProjectModel->findAll(0,'',$intId); - $arrProjectToDisplay = array(); - foreach($arrProjects as $projectData) { - $objProject = new Project(); - $objProject->hydrate($projectData); - $arrProjectToDisplay[] = $objProject; - } + $arrProjectToDisplay = array(); + foreach($arrProjects as $projectData) { + $objProject = new Project(); + $objProject->hydrate($projectData); + $arrProjectToDisplay[] = $objProject; + } + + $this->_arrData['user'] = $objUser; + $this->_arrData['arrProjectToDisplay'] = $arrProjectToDisplay; + $this->_display("user"); + } + + public function edit(){ + if(!isset($_SESSION['user'])){ + header("Location: index.php"); + exit; + } + + $objUserModel = new UserModel; + $arrError = []; + $objUser = new User; + $arrUserData = $objUserModel->findUserById($_SESSION['user']['user_id']); + $objUser->hydrate($arrUserData); + if (!empty($_POST)) { + if ($objUserModel->mailExists($objUser->getMail()) && ($_POST['user_mail'] != $objUser->getMail())) { + + $arrError['user_mail'] = "Ce mail est déjà associé"; + } else { + $objUser->hydrate($_POST); + $objUser->setId($_SESSION['user']['user_id']); + $boolInsert = $objUserModel->update($objUser); + + if ($boolInsert === true) { + $_SESSION['success'] = "Compte créé avec succès"; + header("Location:?ctrl=user&action=user&id=".$objUser->getId()); + exit; + } else { + $arrError['global'] = "Erreur lors de l'update"; + } + } + } + + + $this->_arrData["arrError"] = $arrError; + $this->_arrData['objUser'] = $objUser; + $this->_display("useredit"); - $this->_arrData['user'] = $objUser; - $this->_arrData['arrProjectToDisplay'] = $arrProjectToDisplay; - $this->_display("user"); } } diff --git a/index.php b/index.php index 090bef2..ae6424c 100644 --- a/index.php +++ b/index.php @@ -9,7 +9,6 @@ $strCtrl = $_GET['ctrl']??'project'; $strMethod = $_GET['action']??'home'; - $intId = $_GET['id']??null; $boolError = false; $strFileName = "./controllers/".$strCtrl."_controller.php"; diff --git a/models/user_model.php b/models/user_model.php index baa46dd..e229af6 100644 --- a/models/user_model.php +++ b/models/user_model.php @@ -52,7 +52,7 @@ */ public function insert(object $objUser):bool{ - $strRq = "INSERT INTO users (user_name, user_firstname, user_pseudo, user_mail, user_password, user_phone, user_work, user_location, user_description) + $strRq = "INSERT INTO users (user_name, user_firstname, user_pseudo, user_mail, user_password, user_phone, user_work, user_location, user_description) VALUES (:name, :firstname, :pseudo,:mail, :pwd, :phone, :work, :location,:description)"; $rqPrep = $this->_db->prepare($strRq); @@ -70,6 +70,35 @@ return $rqPrep->execute(); } + public function update(object $objUser):bool{ + $strRq = "UPDATE users SET + user_name = :name, + user_firstname = :firstname, + user_pseudo = :pseudo, + user_mail = :mail, + user_phone = :phone, + user_work = :work, + user_location = :location, + user_description = :description + WHERE user_id = :id"; + + + $rqPrep = $this->_db->prepare($strRq); + + $rqPrep->bindValue(":id", $objUser->getId(), PDO::PARAM_INT); + $rqPrep->bindValue(":name", $objUser->getName(), PDO::PARAM_STR); + $rqPrep->bindValue(":firstname", $objUser->getFirstname(), PDO::PARAM_STR); + $rqPrep->bindValue(":pseudo", $objUser->getPseudo(), PDO::PARAM_STR); + $rqPrep->bindValue(":mail", $objUser->getMail(), PDO::PARAM_STR); + $rqPrep->bindValue(':phone', $objUser->getPhone() ?? "", PDO::PARAM_STR); + $rqPrep->bindValue(':work', $objUser->getWork() ?? "", PDO::PARAM_STR); + $rqPrep->bindValue(':location', $objUser->getLocation() ?? "", PDO::PARAM_STR); + $rqPrep->bindValue(':description', $objUser->getDescription() ?? "", PDO::PARAM_STR); + + return $rqPrep->execute(); + + } + /** * Fonction de vérification de mail * @param string $mail diff --git a/templates_c/0f54e8b5c9bcafd01d94486bfa02ee91c2c5fe68_0.file_home.tpl.php b/templates_c/0f54e8b5c9bcafd01d94486bfa02ee91c2c5fe68_0.file_home.tpl.php index 55fa0ec..e911eb8 100644 --- a/templates_c/0f54e8b5c9bcafd01d94486bfa02ee91c2c5fe68_0.file_home.tpl.php +++ b/templates_c/0f54e8b5c9bcafd01d94486bfa02ee91c2c5fe68_0.file_home.tpl.php @@ -1,18 +1,18 @@ getCompiled()->isFresh($_smarty_tpl, array ( 'version' => '5.7.0', - 'unifunc' => 'content_6990b269ccba39_37501247', + 'unifunc' => 'content_69974fc49008e7_88350972', 'has_nocache_code' => false, 'file_dependency' => array ( '0f54e8b5c9bcafd01d94486bfa02ee91c2c5fe68' => array ( 0 => 'views/home.tpl', - 1 => 1771010187, + 1 => 1771519241, 2 => 'file', ), ), @@ -21,20 +21,20 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( 'file:views/_partial/preview.tpl' => 1, ), ))) { -function content_6990b269ccba39_37501247 (\Smarty\Template $_smarty_tpl) { +function content_69974fc49008e7_88350972 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'D:\\projetphp\\views'; $_smarty_tpl->getInheritance()->init($_smarty_tpl, true); ?> getInheritance()->instanceBlock($_smarty_tpl, 'Block_11076089026990b269cc7970_84790211', "content"); +$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_147623784469974fc48fc6e0_21060000', "content"); ?> getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir); } /* {block "content"} */ -class Block_11076089026990b269cc7970_84790211 extends \Smarty\Runtime\Block +class Block_147623784469974fc48fc6e0_21060000 extends \Smarty\Runtime\Block { public function callBlock(\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'D:\\projetphp\\views'; diff --git a/templates_c/1c51ad9f5c349145220f82584009ce981aa35e0b_0.file_layout.tpl.php b/templates_c/1c51ad9f5c349145220f82584009ce981aa35e0b_0.file_layout.tpl.php index b72d93d..e69245a 100644 --- a/templates_c/1c51ad9f5c349145220f82584009ce981aa35e0b_0.file_layout.tpl.php +++ b/templates_c/1c51ad9f5c349145220f82584009ce981aa35e0b_0.file_layout.tpl.php @@ -1,18 +1,18 @@ getCompiled()->isFresh($_smarty_tpl, array ( 'version' => '5.7.0', - 'unifunc' => 'content_6990b26c1e79e7_73815255', + 'unifunc' => 'content_69974fc6b5dc95_68713473', 'has_nocache_code' => false, 'file_dependency' => array ( '1c51ad9f5c349145220f82584009ce981aa35e0b' => array ( 0 => 'views/layout.tpl', - 1 => 1770649781, + 1 => 1771520226, 2 => 'file', ), ), @@ -22,21 +22,21 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( 'file:views/_partial/footer.tpl' => 1, ), ))) { -function content_6990b26c1e79e7_73815255 (\Smarty\Template $_smarty_tpl) { +function content_69974fc6b5dc95_68713473 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'D:\\projetphp\\views'; $_smarty_tpl->getInheritance()->init($_smarty_tpl, false); $_smarty_tpl->renderSubTemplate("file:views/_partial/header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir); ?> getInheritance()->instanceBlock($_smarty_tpl, 'Block_2132004286990b26c1e59d6_94176803', "content"); +$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_49941558469974fc6b5c4e0_48832484', "content"); ?> renderSubTemplate("file:views/_partial/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir); } /* {block "content"} */ -class Block_2132004286990b26c1e59d6_94176803 extends \Smarty\Runtime\Block +class Block_49941558469974fc6b5c4e0_48832484 extends \Smarty\Runtime\Block { public function callBlock(\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'D:\\projetphp\\views'; diff --git a/templates_c/264314e384c04e79c5fa56e3cf6837f9df55d7fb_0.file_footer.tpl.php b/templates_c/264314e384c04e79c5fa56e3cf6837f9df55d7fb_0.file_footer.tpl.php index b5d14ba..13bb54e 100644 --- a/templates_c/264314e384c04e79c5fa56e3cf6837f9df55d7fb_0.file_footer.tpl.php +++ b/templates_c/264314e384c04e79c5fa56e3cf6837f9df55d7fb_0.file_footer.tpl.php @@ -1,18 +1,18 @@ getCompiled()->isFresh($_smarty_tpl, array ( 'version' => '5.7.0', - 'unifunc' => 'content_6990b26c437982_38235756', + 'unifunc' => 'content_69974fc6e880f1_33985729', 'has_nocache_code' => false, 'file_dependency' => array ( '264314e384c04e79c5fa56e3cf6837f9df55d7fb' => array ( 0 => 'views/_partial/footer.tpl', - 1 => 1771090184, + 1 => 1771519241, 2 => 'file', ), ), @@ -20,7 +20,7 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( array ( ), ))) { -function content_6990b26c437982_38235756 (\Smarty\Template $_smarty_tpl) { +function content_69974fc6e880f1_33985729 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'D:\\projetphp\\views\\_partial'; ?>
diff --git a/templates_c/67e1ae3a210fc2d1bf8782993687bad91a1cf0f6_0.file_preview.tpl.php b/templates_c/67e1ae3a210fc2d1bf8782993687bad91a1cf0f6_0.file_preview.tpl.php index 0d816ca..03ad851 100644 --- a/templates_c/67e1ae3a210fc2d1bf8782993687bad91a1cf0f6_0.file_preview.tpl.php +++ b/templates_c/67e1ae3a210fc2d1bf8782993687bad91a1cf0f6_0.file_preview.tpl.php @@ -1,18 +1,18 @@ getCompiled()->isFresh($_smarty_tpl, array ( 'version' => '5.7.0', - 'unifunc' => 'content_6990b26c2fd501_13041464', + 'unifunc' => 'content_69974fc6d37d90_86084313', 'has_nocache_code' => false, 'file_dependency' => array ( '67e1ae3a210fc2d1bf8782993687bad91a1cf0f6' => array ( 0 => 'views/_partial/preview.tpl', - 1 => 1771011101, + 1 => 1771519241, 2 => 'file', ), ), @@ -20,7 +20,7 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( array ( ), ))) { -function content_6990b26c2fd501_13041464 (\Smarty\Template $_smarty_tpl) { +function content_69974fc6d37d90_86084313 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'D:\\projetphp\\views\\_partial'; ?>
diff --git a/templates_c/72e5e5c0ee2729980deadb1687a6d7b7b3c501bb_0.file_search.tpl.php b/templates_c/72e5e5c0ee2729980deadb1687a6d7b7b3c501bb_0.file_search.tpl.php index 3155460..5b7fb26 100644 --- a/templates_c/72e5e5c0ee2729980deadb1687a6d7b7b3c501bb_0.file_search.tpl.php +++ b/templates_c/72e5e5c0ee2729980deadb1687a6d7b7b3c501bb_0.file_search.tpl.php @@ -1,18 +1,18 @@ getCompiled()->isFresh($_smarty_tpl, array ( 'version' => '5.7.0', - 'unifunc' => 'content_6990b26c035cd6_15007530', + 'unifunc' => 'content_69974d3a2fa051_88043479', 'has_nocache_code' => false, 'file_dependency' => array ( '72e5e5c0ee2729980deadb1687a6d7b7b3c501bb' => array ( 0 => 'views/search.tpl', - 1 => 1770649781, + 1 => 1771519241, 2 => 'file', ), ), @@ -21,18 +21,18 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( 'file:views/_partial/preview.tpl' => 1, ), ))) { -function content_6990b26c035cd6_15007530 (\Smarty\Template $_smarty_tpl) { +function content_69974d3a2fa051_88043479 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'D:\\projetphp\\views'; $_smarty_tpl->getInheritance()->init($_smarty_tpl, true); ?> getInheritance()->instanceBlock($_smarty_tpl, 'Block_19164984906990b26c022a65_59433489', "content"); +$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_129547300169974d3a2e7e19_65257480', "content"); $_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir); } /* {block "content"} */ -class Block_19164984906990b26c022a65_59433489 extends \Smarty\Runtime\Block +class Block_129547300169974d3a2e7e19_65257480 extends \Smarty\Runtime\Block { public function callBlock(\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'D:\\projetphp\\views'; @@ -57,7 +57,7 @@ $_smarty_current_dir = 'D:\\projetphp\\views'; class="form-control" id="keywords" name="keywords" - placeholder="Ex: JavaScript, CSS..." + placeholder="Design, IA, back-end" aria-describedby="keywords-help"> Recherchez dans les titres et contenus @@ -91,7 +91,7 @@ $_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
- Type de recherche par date + Recherche par date
getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
- Type de recherche par catégories + Recherche par catégories
+
+ +
+ + +
+ +
+ +
+ @ + +
+
+
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+
+ +
+ + + + +
+ + +
+ +
+
+ +{/block} \ No newline at end of file From 190554d966835956ae7a527a063163b54677c8df Mon Sep 17 00:00:00 2001 From: Yasder5 <102179445+Yasder5@users.noreply.github.com> Date: Thu, 19 Feb 2026 20:38:19 +0100 Subject: [PATCH 06/44] =?UTF-8?q?ajouter=20btn=20edit=20account=20page=20p?= =?UTF-8?q?rofile,=20lien=20cliquable=20img=20user=20connect=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...bcafd01d94486bfa02ee91c2c5fe68_0.file_home.tpl.php | 10 +++++----- ...9145220f82584009ce981aa35e0b_0.file_layout.tpl.php | 10 +++++----- ...4e79c5fa56e3cf6837f9df55d7fb_0.file_footer.tpl.php | 6 +++--- ...2d1bf8782993687bad91a1cf0f6_0.file_preview.tpl.php | 6 +++--- ...28be5e36947735d13c8d176ec944_0.file_header.tpl.php | 11 ++++++----- views/_partial/header.tpl | 2 +- views/user.tpl | 5 +++++ 7 files changed, 28 insertions(+), 22 deletions(-) diff --git a/templates_c/0f54e8b5c9bcafd01d94486bfa02ee91c2c5fe68_0.file_home.tpl.php b/templates_c/0f54e8b5c9bcafd01d94486bfa02ee91c2c5fe68_0.file_home.tpl.php index e911eb8..72d7240 100644 --- a/templates_c/0f54e8b5c9bcafd01d94486bfa02ee91c2c5fe68_0.file_home.tpl.php +++ b/templates_c/0f54e8b5c9bcafd01d94486bfa02ee91c2c5fe68_0.file_home.tpl.php @@ -1,11 +1,11 @@ getCompiled()->isFresh($_smarty_tpl, array ( 'version' => '5.7.0', - 'unifunc' => 'content_69974fc49008e7_88350972', + 'unifunc' => 'content_69976682c1c284_75435092', 'has_nocache_code' => false, 'file_dependency' => array ( @@ -21,20 +21,20 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( 'file:views/_partial/preview.tpl' => 1, ), ))) { -function content_69974fc49008e7_88350972 (\Smarty\Template $_smarty_tpl) { +function content_69976682c1c284_75435092 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'D:\\projetphp\\views'; $_smarty_tpl->getInheritance()->init($_smarty_tpl, true); ?> getInheritance()->instanceBlock($_smarty_tpl, 'Block_147623784469974fc48fc6e0_21060000', "content"); +$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_144579886869976682c18113_46108017', "content"); ?> getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir); } /* {block "content"} */ -class Block_147623784469974fc48fc6e0_21060000 extends \Smarty\Runtime\Block +class Block_144579886869976682c18113_46108017 extends \Smarty\Runtime\Block { public function callBlock(\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'D:\\projetphp\\views'; diff --git a/templates_c/1c51ad9f5c349145220f82584009ce981aa35e0b_0.file_layout.tpl.php b/templates_c/1c51ad9f5c349145220f82584009ce981aa35e0b_0.file_layout.tpl.php index e69245a..79b8088 100644 --- a/templates_c/1c51ad9f5c349145220f82584009ce981aa35e0b_0.file_layout.tpl.php +++ b/templates_c/1c51ad9f5c349145220f82584009ce981aa35e0b_0.file_layout.tpl.php @@ -1,11 +1,11 @@ getCompiled()->isFresh($_smarty_tpl, array ( 'version' => '5.7.0', - 'unifunc' => 'content_69974fc6b5dc95_68713473', + 'unifunc' => 'content_69976689b01014_92688396', 'has_nocache_code' => false, 'file_dependency' => array ( @@ -22,21 +22,21 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( 'file:views/_partial/footer.tpl' => 1, ), ))) { -function content_69974fc6b5dc95_68713473 (\Smarty\Template $_smarty_tpl) { +function content_69976689b01014_92688396 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'D:\\projetphp\\views'; $_smarty_tpl->getInheritance()->init($_smarty_tpl, false); $_smarty_tpl->renderSubTemplate("file:views/_partial/header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir); ?> getInheritance()->instanceBlock($_smarty_tpl, 'Block_49941558469974fc6b5c4e0_48832484', "content"); +$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_210858053669976689aff6c2_11310529', "content"); ?> renderSubTemplate("file:views/_partial/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir); } /* {block "content"} */ -class Block_49941558469974fc6b5c4e0_48832484 extends \Smarty\Runtime\Block +class Block_210858053669976689aff6c2_11310529 extends \Smarty\Runtime\Block { public function callBlock(\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'D:\\projetphp\\views'; diff --git a/templates_c/264314e384c04e79c5fa56e3cf6837f9df55d7fb_0.file_footer.tpl.php b/templates_c/264314e384c04e79c5fa56e3cf6837f9df55d7fb_0.file_footer.tpl.php index 13bb54e..27fa401 100644 --- a/templates_c/264314e384c04e79c5fa56e3cf6837f9df55d7fb_0.file_footer.tpl.php +++ b/templates_c/264314e384c04e79c5fa56e3cf6837f9df55d7fb_0.file_footer.tpl.php @@ -1,11 +1,11 @@ getCompiled()->isFresh($_smarty_tpl, array ( 'version' => '5.7.0', - 'unifunc' => 'content_69974fc6e880f1_33985729', + 'unifunc' => 'content_69976689ccd1e8_62225255', 'has_nocache_code' => false, 'file_dependency' => array ( @@ -20,7 +20,7 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( array ( ), ))) { -function content_69974fc6e880f1_33985729 (\Smarty\Template $_smarty_tpl) { +function content_69976689ccd1e8_62225255 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'D:\\projetphp\\views\\_partial'; ?>
diff --git a/templates_c/67e1ae3a210fc2d1bf8782993687bad91a1cf0f6_0.file_preview.tpl.php b/templates_c/67e1ae3a210fc2d1bf8782993687bad91a1cf0f6_0.file_preview.tpl.php index 03ad851..4a83a36 100644 --- a/templates_c/67e1ae3a210fc2d1bf8782993687bad91a1cf0f6_0.file_preview.tpl.php +++ b/templates_c/67e1ae3a210fc2d1bf8782993687bad91a1cf0f6_0.file_preview.tpl.php @@ -1,11 +1,11 @@ getCompiled()->isFresh($_smarty_tpl, array ( 'version' => '5.7.0', - 'unifunc' => 'content_69974fc6d37d90_86084313', + 'unifunc' => 'content_69976687c2cde7_58748034', 'has_nocache_code' => false, 'file_dependency' => array ( @@ -20,7 +20,7 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( array ( ), ))) { -function content_69974fc6d37d90_86084313 (\Smarty\Template $_smarty_tpl) { +function content_69976687c2cde7_58748034 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'D:\\projetphp\\views\\_partial'; ?>
diff --git a/templates_c/8056b95e7f6b28be5e36947735d13c8d176ec944_0.file_header.tpl.php b/templates_c/8056b95e7f6b28be5e36947735d13c8d176ec944_0.file_header.tpl.php index 8035048..c617879 100644 --- a/templates_c/8056b95e7f6b28be5e36947735d13c8d176ec944_0.file_header.tpl.php +++ b/templates_c/8056b95e7f6b28be5e36947735d13c8d176ec944_0.file_header.tpl.php @@ -1,18 +1,18 @@ getCompiled()->isFresh($_smarty_tpl, array ( 'version' => '5.7.0', - 'unifunc' => 'content_69974fc6bd10a6_20132978', + 'unifunc' => 'content_69976689b86271_22891813', 'has_nocache_code' => false, 'file_dependency' => array ( '8056b95e7f6b28be5e36947735d13c8d176ec944' => array ( 0 => 'views/_partial/header.tpl', - 1 => 1771520240, + 1 => 1771529669, 2 => 'file', ), ), @@ -21,7 +21,7 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( 'file:views/_partial/messages.tpl' => 1, ), ))) { -function content_69974fc6bd10a6_20132978 (\Smarty\Template $_smarty_tpl) { +function content_69976689b86271_22891813 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'D:\\projetphp\\views\\_partial'; ?> @@ -86,7 +86,8 @@ $_smarty_current_dir = 'D:\\projetphp\\views\\_partial';
+
From b11f67793a2b02bba4e65f801ce1360591d66125 Mon Sep 17 00:00:00 2001 From: Yasder5 <102179445+Yasder5@users.noreply.github.com> Date: Thu, 19 Feb 2026 21:10:24 +0100 Subject: [PATCH 07/44] modification pour afficher user par pseudo et non par id --- controllers/user_controller.php | 15 +++++++++++++-- models/project_model.php | 2 +- models/user_model.php | 11 +++++++++++ ...d01d94486bfa02ee91c2c5fe68_0.file_home.tpl.php | 10 +++++----- ...220f82584009ce981aa35e0b_0.file_layout.tpl.php | 10 +++++----- ...c5fa56e3cf6837f9df55d7fb_0.file_footer.tpl.php | 6 +++--- ...f8782993687bad91a1cf0f6_0.file_preview.tpl.php | 10 +++++----- ...5e36947735d13c8d176ec944_0.file_header.tpl.php | 6 +++--- views/_partial/preview.tpl | 2 +- 9 files changed, 47 insertions(+), 25 deletions(-) diff --git a/controllers/user_controller.php b/controllers/user_controller.php index 8e185a6..ee19f09 100644 --- a/controllers/user_controller.php +++ b/controllers/user_controller.php @@ -151,7 +151,7 @@ class UserCtrl extends MotherCtrl { */ public function user(){ - $intId = isset($_GET['id']) ? (int)$_GET['id'] : 0; + /**$intId = isset($_GET['id']) ? (int)$_GET['id'] : 0; if ($intId <= 0) { header("Location: index.php"); @@ -162,16 +162,27 @@ class UserCtrl extends MotherCtrl { $objUserModel = new UserModel; $arrUserData = $objUserModel->findUserById($intId); + if ($arrUserData === false) { + header("Location: index.php"); + exit; + }*/ + + $strPseudo = $_GET['pseudo']??''; + + $objUserModel = new UserModel; + $arrUserData = $objUserModel->findUserByPseudo($strPseudo); + if ($arrUserData === false) { header("Location: index.php"); exit; } + $objUser = new User; $objUser->hydrate($arrUserData); //affichage projet de l'utilisateur $objProjectModel = new ProjectModel; - $arrProjects = $objProjectModel->findAll(0,'',$intId); + $arrProjects = $objProjectModel->findAll(0,'',$objUser->getId()); $arrProjectToDisplay = array(); foreach($arrProjects as $projectData) { diff --git a/models/project_model.php b/models/project_model.php index 56b88d2..afa8380 100644 --- a/models/project_model.php +++ b/models/project_model.php @@ -20,7 +20,7 @@ string $strEndDate='', int $intCategory=0, bool $bool6Months=false):array{ $strRq = "SELECT project.*, - CONCAT(user_firstname, ' ', user_name) AS 'project_creatorname', + user_pseudo AS 'project_creatorname', user_image FROM project INNER JOIN users ON user_id = project_user_id"; diff --git a/models/user_model.php b/models/user_model.php index e229af6..253c2f2 100644 --- a/models/user_model.php +++ b/models/user_model.php @@ -162,4 +162,15 @@ return $prep->fetch(); } + + public function findUserByPseudo(string $strPseudo): array|bool { + + $strRq = "SELECT * FROM users WHERE user_pseudo = :pseudo"; + + $prep = $this->_db->prepare($strRq); + $prep->bindValue(':pseudo', $strPseudo, PDO::PARAM_STR); + $prep->execute(); + + return $prep->fetch(); + } } diff --git a/templates_c/0f54e8b5c9bcafd01d94486bfa02ee91c2c5fe68_0.file_home.tpl.php b/templates_c/0f54e8b5c9bcafd01d94486bfa02ee91c2c5fe68_0.file_home.tpl.php index 72d7240..1ca88db 100644 --- a/templates_c/0f54e8b5c9bcafd01d94486bfa02ee91c2c5fe68_0.file_home.tpl.php +++ b/templates_c/0f54e8b5c9bcafd01d94486bfa02ee91c2c5fe68_0.file_home.tpl.php @@ -1,11 +1,11 @@ getCompiled()->isFresh($_smarty_tpl, array ( 'version' => '5.7.0', - 'unifunc' => 'content_69976682c1c284_75435092', + 'unifunc' => 'content_69976def59c414_70095814', 'has_nocache_code' => false, 'file_dependency' => array ( @@ -21,20 +21,20 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( 'file:views/_partial/preview.tpl' => 1, ), ))) { -function content_69976682c1c284_75435092 (\Smarty\Template $_smarty_tpl) { +function content_69976def59c414_70095814 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'D:\\projetphp\\views'; $_smarty_tpl->getInheritance()->init($_smarty_tpl, true); ?> getInheritance()->instanceBlock($_smarty_tpl, 'Block_144579886869976682c18113_46108017', "content"); +$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_133394531269976def598252_85195320', "content"); ?> getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir); } /* {block "content"} */ -class Block_144579886869976682c18113_46108017 extends \Smarty\Runtime\Block +class Block_133394531269976def598252_85195320 extends \Smarty\Runtime\Block { public function callBlock(\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'D:\\projetphp\\views'; diff --git a/templates_c/1c51ad9f5c349145220f82584009ce981aa35e0b_0.file_layout.tpl.php b/templates_c/1c51ad9f5c349145220f82584009ce981aa35e0b_0.file_layout.tpl.php index 79b8088..b1983b7 100644 --- a/templates_c/1c51ad9f5c349145220f82584009ce981aa35e0b_0.file_layout.tpl.php +++ b/templates_c/1c51ad9f5c349145220f82584009ce981aa35e0b_0.file_layout.tpl.php @@ -1,11 +1,11 @@ getCompiled()->isFresh($_smarty_tpl, array ( 'version' => '5.7.0', - 'unifunc' => 'content_69976689b01014_92688396', + 'unifunc' => 'content_69976e0ca03d67_47539078', 'has_nocache_code' => false, 'file_dependency' => array ( @@ -22,21 +22,21 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( 'file:views/_partial/footer.tpl' => 1, ), ))) { -function content_69976689b01014_92688396 (\Smarty\Template $_smarty_tpl) { +function content_69976e0ca03d67_47539078 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'D:\\projetphp\\views'; $_smarty_tpl->getInheritance()->init($_smarty_tpl, false); $_smarty_tpl->renderSubTemplate("file:views/_partial/header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir); ?> getInheritance()->instanceBlock($_smarty_tpl, 'Block_210858053669976689aff6c2_11310529', "content"); +$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_27929295869976e0ca01fb9_36548139', "content"); ?> renderSubTemplate("file:views/_partial/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir); } /* {block "content"} */ -class Block_210858053669976689aff6c2_11310529 extends \Smarty\Runtime\Block +class Block_27929295869976e0ca01fb9_36548139 extends \Smarty\Runtime\Block { public function callBlock(\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'D:\\projetphp\\views'; diff --git a/templates_c/264314e384c04e79c5fa56e3cf6837f9df55d7fb_0.file_footer.tpl.php b/templates_c/264314e384c04e79c5fa56e3cf6837f9df55d7fb_0.file_footer.tpl.php index 27fa401..7a9242a 100644 --- a/templates_c/264314e384c04e79c5fa56e3cf6837f9df55d7fb_0.file_footer.tpl.php +++ b/templates_c/264314e384c04e79c5fa56e3cf6837f9df55d7fb_0.file_footer.tpl.php @@ -1,11 +1,11 @@ getCompiled()->isFresh($_smarty_tpl, array ( 'version' => '5.7.0', - 'unifunc' => 'content_69976689ccd1e8_62225255', + 'unifunc' => 'content_69976e0cbdbc02_44067705', 'has_nocache_code' => false, 'file_dependency' => array ( @@ -20,7 +20,7 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( array ( ), ))) { -function content_69976689ccd1e8_62225255 (\Smarty\Template $_smarty_tpl) { +function content_69976e0cbdbc02_44067705 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'D:\\projetphp\\views\\_partial'; ?>