From 4e9b27772bb3aec1465f6fcf9a13e2abc4462216 Mon Sep 17 00:00:00 2001 From: GuillaumeH-Cci Date: Tue, 10 Feb 2026 08:42:18 +0100 Subject: [PATCH] =?UTF-8?q?Fonctionnalit=C3=A9=20Mod=C3=A9ration=20sous=20?= =?UTF-8?q?Smarty=20+=20D=C3=A9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/project_controller.php | 42 +++ controllers/user_controller.php | 3 - models/mother_model.php | 14 +- models/project_model.php | 28 ++ ...149077158460_0.file_projet_display.tpl.php | 128 +++++++++ ...519973f0177a783a4561_0.file_header.tpl.php | 115 ++++++++ ...803dc4119c46e490c52_0.file_preview.tpl.php | 81 ++++++ ...12628e44c1dff2d9365b_0.file_search.tpl.php | 261 ++++++++++++++++++ ...8ed73fcd1924b1bda41b_0.file_layout.tpl.php | 50 ++++ ...f5b7b444b7670474263f88_0.file_home.tpl.php | 71 +++++ ...0dc5baa93ac9d38bfe874_0.file_login.tpl.php | 164 +++++++++++ ...9dcacc6c7b4e161e98a2_0.file_footer.tpl.php | 63 +++++ views/_partial/preview.tpl | 48 ++-- 13 files changed, 1046 insertions(+), 22 deletions(-) create mode 100644 templates_c/061ec8f4caa90f6cac9dd0d1f101149077158460_0.file_projet_display.tpl.php create mode 100644 templates_c/20a11b6ecdc7e0959bdb519973f0177a783a4561_0.file_header.tpl.php create mode 100644 templates_c/3848b4db17319a951391d803dc4119c46e490c52_0.file_preview.tpl.php create mode 100644 templates_c/55cbb497c7dde2dae3a712628e44c1dff2d9365b_0.file_search.tpl.php create mode 100644 templates_c/708269d7487a64eac6b48ed73fcd1924b1bda41b_0.file_layout.tpl.php create mode 100644 templates_c/7e6dbbb1e41ad859e7f5b7b444b7670474263f88_0.file_home.tpl.php create mode 100644 templates_c/b7b39f4634df66c24660dc5baa93ac9d38bfe874_0.file_login.tpl.php create mode 100644 templates_c/cef94db5b9dde613f0f79dcacc6c7b4e161e98a2_0.file_footer.tpl.php diff --git a/controllers/project_controller.php b/controllers/project_controller.php index af2e9fa..244753b 100644 --- a/controllers/project_controller.php +++ b/controllers/project_controller.php @@ -256,4 +256,46 @@ header("Location: index.php?ctrl=project&action=home"); exit; } + + 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; + } } \ No newline at end of file diff --git a/controllers/user_controller.php b/controllers/user_controller.php index 70e2599..b6938e1 100644 --- a/controllers/user_controller.php +++ b/controllers/user_controller.php @@ -147,7 +147,4 @@ class UserCtrl extends MotherCtrl { // Affichage de la vue inscription $this->_display("inscription"); } - - - } diff --git a/models/mother_model.php b/models/mother_model.php index c259719..f70ed7a 100644 --- a/models/mother_model.php +++ b/models/mother_model.php @@ -20,4 +20,16 @@ echo "Échec : " . $e->getMessage(); } } - } \ No newline at end of file + } + + /** + 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 + + Pour passer en local: + "mysql:host=localhost;dbname=projet_folliow", // Serveur et BDD + "root", //Nom d'utilisateur de la base de données + "",// Mot de passe de la base de données + */ \ No newline at end of file diff --git a/models/project_model.php b/models/project_model.php index d88e02d..95168d1 100644 --- a/models/project_model.php +++ b/models/project_model.php @@ -112,4 +112,32 @@ return $rqPrep->fetch(); } + + public function accept(int $id){ + + //SQL pour changer le status en accept + $strRq = "UPDATE project + SET project_status= 'publié' + WHERE project_id =".$id; + + //retourne la commande + return $this->_db->query($strRq); + } + + public function refuse(int $id){ + + $strRq = "UPDATE project + SET project_status= 'refusé' + WHERE project_id =".$id; + + return $this->_db->query($strRq); + } + + public function delete(int $id){ + + $strRq = "DELETE FROM project + WHERE project_id =".$id; + + return $this->_db->query($strRq); + } } \ No newline at end of file diff --git a/templates_c/061ec8f4caa90f6cac9dd0d1f101149077158460_0.file_projet_display.tpl.php b/templates_c/061ec8f4caa90f6cac9dd0d1f101149077158460_0.file_projet_display.tpl.php new file mode 100644 index 0000000..825c29f --- /dev/null +++ b/templates_c/061ec8f4caa90f6cac9dd0d1f101149077158460_0.file_projet_display.tpl.php @@ -0,0 +1,128 @@ +getCompiled()->isFresh($_smarty_tpl, array ( + 'version' => '5.7.0', + 'unifunc' => 'content_6989e58c411304_60305191', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + '061ec8f4caa90f6cac9dd0d1f101149077158460' => + array ( + 0 => 'views/projet_display.tpl', + 1 => 1770639154, + 2 => 'file', + ), + ), + 'includes' => + array ( + ), +))) { +function content_6989e58c411304_60305191 (\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views'; +$_smarty_tpl->getInheritance()->init($_smarty_tpl, true); +?> + + +getInheritance()->instanceBlock($_smarty_tpl, 'Block_13978244256989e58c406518_61332798', "content"); +$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir); +} +/* {block "content"} */ +class Block_13978244256989e58c406518_61332798 extends \Smarty\Runtime\Block +{ +public function callBlock(\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views'; +?> + +
+ + + +
Email envoyé avec succès.
+ +
Erreur lors de l'envoi de l'email.
+ + +
+ + +
+ +

getValue('objProject')->getTitle();?> +

+ +

+ getValue('arrProject')['category_name'] ?? 'Général';?> + +

+ +
+ +
+ +
+

Description

+

getValue('objProject')->getDescription();?> +

+ +
+ getValue('objProject')->getContent();?> + +
+
+ + +
+
+ + + + + + + +
+
+ +
+ + +
+
+ + + +
getValue('objProject')->getCreatorName();?> +
+ +

+ Publié le getValue('objProject')->getCreation_date();?> + +

+ + + +
+
+ +
+
+getCompiled()->isFresh($_smarty_tpl, array ( + 'version' => '5.7.0', + 'unifunc' => 'content_6989f726978651_30802796', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + '20a11b6ecdc7e0959bdb519973f0177a783a4561' => + array ( + 0 => 'views/_partial/header.tpl', + 1 => 1770639154, + 2 => 'file', + ), + ), + 'includes' => + array ( + ), +))) { +function content_6989f726978651_30802796 (\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views\\_partial'; +?> + + + + + + + + + src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"> +> + Folliow + + + + +getCompiled()->isFresh($_smarty_tpl, array ( + 'version' => '5.7.0', + 'unifunc' => 'content_6989f7269f97f7_68511256', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + '3848b4db17319a951391d803dc4119c46e490c52' => + array ( + 0 => 'views/_partial/preview.tpl', + 1 => 1770646177, + 2 => 'file', + ), + ), + 'includes' => + array ( + ), +))) { +function content_6989f7269f97f7_68511256 (\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views\\_partial'; +?> + + +
+
+ +
+ +
+ +
+ + Photo de profil + +
+

getValue('objProject')->getTitle();?> +

+ + + + – getValue('objProject')->getCreatorname();?> + + + + + Lire la suite → + +
+ +
+ +
+ getValue('objProject')->getStatus() == "en_attente") {?> + + getValue('projectStatus') == "refusé") {?> +

Portfolio refusé

+ +
getCompiled()->isFresh($_smarty_tpl, array ( + 'version' => '5.7.0', + 'unifunc' => 'content_6989e5b1383d99_95399806', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + '55cbb497c7dde2dae3a712628e44c1dff2d9365b' => + array ( + 0 => 'views/search.tpl', + 1 => 1770639154, + 2 => 'file', + ), + ), + 'includes' => + array ( + 'file:views/_partial/preview.tpl' => 1, + ), +))) { +function content_6989e5b1383d99_95399806 (\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views'; +$_smarty_tpl->getInheritance()->init($_smarty_tpl, true); +?> + + +getInheritance()->instanceBlock($_smarty_tpl, 'Block_10517171146989e5b1375aa5_10994726', "content"); +$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir); +} +/* {block "content"} */ +class Block_10517171146989e5b1375aa5_10994726 extends \Smarty\Runtime\Block +{ +public function callBlock(\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views'; +?> + +
+

Rechercher parmi les articles

+
+
+
+

+ + Rechercher des articles +

+ +
+
+ + + + Recherchez dans les titres et contenus + +
+ +
+ + +
+ + +
+
+ Type de recherche par date +
+ getValue('intPeriod') == 0) {?>checked + aria-controls="date-exact date-range"> + +
+
+ getValue('intPeriod') == 1) {?>checked + aria-controls="date-exact date-range"> + +
+
+
+ +
+
+ Type de recherche par catégories +
+ + +
+
+
+ +
+ + + + Format: JJ/MM/AAAA + +
+ + + +
+ + +
+
+
+
+ + +
+

Liste des projets

+
+ getSmarty()->getModifierCallback('count')($_smarty_tpl->getValue('arrProject')) == 0) {?> +
+

Pas de résultats

+
+ + getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrProjectToDisplay'), 'objProject'); +$foreach2DoElse = true; +foreach ($_from ?? [] as $_smarty_tpl->getVariable('objProject')->value) { +$foreach2DoElse = false; +?> + renderSubTemplate("file:views/_partial/preview.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir); +?> + getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?> +
+
+
+
+ +> + // Gestion de l'affichage des champs de date + const periodRadios = document.querySelectorAll('input[name="period"]'); + const dateExact = document.getElementById('date-exact'); + const dateRange = document.getElementById('date-range'); + + function toggleDateFields() { + const selectedPeriod = document.querySelector('input[name="period"]:checked').value; + + if (selectedPeriod === '0') { + dateExact.style.display = 'block'; + dateRange.style.display = 'none'; + } else { + dateExact.style.display = 'none'; + dateRange.style.display = 'block'; + } + } + + periodRadios.forEach(radio => { + radio.addEventListener('change', toggleDateFields); + }); + + // Initialisation au chargement + toggleDateFields(); + +> +getCompiled()->isFresh($_smarty_tpl, array ( + 'version' => '5.7.0', + 'unifunc' => 'content_6989f726914163_83904848', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + '708269d7487a64eac6b48ed73fcd1924b1bda41b' => + array ( + 0 => 'views/layout.tpl', + 1 => 1770639154, + 2 => 'file', + ), + ), + 'includes' => + array ( + 'file:views/_partial/header.tpl' => 1, + 'file:views/_partial/footer.tpl' => 1, + ), +))) { +function content_6989f726914163_83904848 (\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\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_14089017836989f726912e95_86271581', "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_14089017836989f726912e95_86271581 extends \Smarty\Runtime\Block +{ +public function callBlock(\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views'; +?> + + +getCompiled()->isFresh($_smarty_tpl, array ( + 'version' => '5.7.0', + 'unifunc' => 'content_6989f72687e0c8_78461032', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + '7e6dbbb1e41ad859e7f5b7b444b7670474263f88' => + array ( + 0 => 'views/home.tpl', + 1 => 1770639154, + 2 => 'file', + ), + ), + 'includes' => + array ( + 'file:views/_partial/preview.tpl' => 1, + ), +))) { +function content_6989f72687e0c8_78461032 (\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views'; +$_smarty_tpl->getInheritance()->init($_smarty_tpl, true); +?> + + +getInheritance()->instanceBlock($_smarty_tpl, 'Block_15962470546989f72687a521_39502617', "content"); +?> + +getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir); +} +/* {block "content"} */ +class Block_15962470546989f72687a521_39502617 extends \Smarty\Runtime\Block +{ +public function callBlock(\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views'; +?> + +
+

Folliow

+

Là où les talents rencontrent leur avenir

+

Une plateforme de portfolio adapté à vos besoins et aux besoins des entreprises. + Créer un portfolio réellement pertinent aux exigences du marché et rentrez + directement en contact avec les entreprises.

+
+ +
+

Les 4 derniers articles

+
+ + getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrProjectToDisplay'), 'objProject'); +$foreach0DoElse = true; +foreach ($_from ?? [] as $_smarty_tpl->getVariable('objProject')->value) { +$foreach0DoElse = false; +?> + renderSubTemplate("file:views/_partial/preview.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir); +?> + getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?> +
+getCompiled()->isFresh($_smarty_tpl, array ( + 'version' => '5.7.0', + 'unifunc' => 'content_6989f71c761896_25894348', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + 'b7b39f4634df66c24660dc5baa93ac9d38bfe874' => + array ( + 0 => 'views/login.tpl', + 1 => 1770639154, + 2 => 'file', + ), + ), + 'includes' => + array ( + ), +))) { +function content_6989f71c761896_25894348 (\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views'; +$_smarty_tpl->getInheritance()->init($_smarty_tpl, true); +?> + + +getInheritance()->instanceBlock($_smarty_tpl, 'Block_19992775976989f71c758fc2_34188356', "content"); +$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir); +} +/* {block "content"} */ +class Block_19992775976989f71c758fc2_34188356 extends \Smarty\Runtime\Block +{ +public function callBlock(\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views'; +?> + +
+ getSmarty()->getModifierCallback('count')($_smarty_tpl->getValue('arrError')) > 0) {?> +
+ getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrError'), 'strError'); +$foreach0DoElse = true; +foreach ($_from ?? [] as $_smarty_tpl->getVariable('strError')->value) { +$foreach0DoElse = false; +?> +

getValue('strError');?> +

+ getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?> +
+ + +
+ + +
+ +
+ + +
+
+ + +
+ + +

Connexion

+ + +

+ Connectez-vous à votre compte. +

+ + + +
+ +
+ + +
+ + +
+ + +
+ + +
+ + +
+
+ + +
+
+ + +
+ +
+ + +
+ + Pas encore de compte ? + Créer un compte + +
+ + + + +
+
+ +
+ +
+
+
+
+getCompiled()->isFresh($_smarty_tpl, array ( + 'version' => '5.7.0', + 'unifunc' => 'content_6989f726ac4850_67307943', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + 'cef94db5b9dde613f0f79dcacc6c7b4e161e98a2' => + array ( + 0 => 'views/_partial/footer.tpl', + 1 => 1770639154, + 2 => 'file', + ), + ), + 'includes' => + array ( + ), +))) { +function content_6989f726ac4850_67307943 (\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views\\_partial'; +?> + + + src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"> +> + + src="js/scripts.js"> +> + + - {* PHOTO DE PROFIL *} - Photo de profil + {* PHOTO DE PROFIL *} + Photo de profil - {* INFOS *} -
-

{$objProject->getTitle()}

+ {* INFOS *} +
+

{$objProject->getTitle()}

- - - – {$objProject->getCreatorname()} - + + + – {$objProject->getCreatorname()} + - - Lire la suite → - -
+ + Lire la suite → + +
- + + {*Controle de l'utilisateur ainsi que du status du projet*} + {if isset($smarty.session.user) + and $smarty.session.user.user_status == 2 + and $objProject->getStatus() eq "en_attente"} +
+ Accepter + Refuser + Supprimer +
+ {elseif $projectStatus eq "refusé"} +

Portfolio refusé

+ {/if} \ No newline at end of file