From 3a80108ba5b415915afeb4ac8cf5533ab7521d55 Mon Sep 17 00:00:00 2001 From: "laura.chevillet" Date: Mon, 9 Feb 2026 14:29:17 +0100 Subject: [PATCH] =?UTF-8?q?Modification=20et=20ajout=20de=20cat=C3=A9gorie?= =?UTF-8?q?=20fonctionne.=20Acc=C3=A8s=20page=20admin=20prot=C3=A9t=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/admin_controller.php | 33 ++-- models/mother_model.php | 6 +- ...429efee0d6437582d377e_0.file_login.tpl.php | 164 ++++++++++++++++++ ...af2d8a8255035d91b950_0.file_layout.tpl.php | 10 +- ...3f0963ead4008a7bda8fb_0.file_admin.tpl.php | 86 ++++----- ...809f87f59bd19d86da99_0.file_footer.tpl.php | 6 +- ...531347290b4e4994470b_0.file_header.tpl.php | 6 +- ...7634a5658ae38c7b520_0.file_preview.tpl.php | 6 +- ...b03b8d137ec1edb99bdd92_0.file_home.tpl.php | 83 +++++++++ ...f497c64277110a78bc40_0.file_search.tpl.php | 10 +- views/admin.tpl | 54 +++--- 11 files changed, 338 insertions(+), 126 deletions(-) create mode 100644 templates_c/5375cd75c92fd8c801b429efee0d6437582d377e_0.file_login.tpl.php create mode 100644 templates_c/ca790de9f8d5a4fc03b03b8d137ec1edb99bdd92_0.file_home.tpl.php diff --git a/controllers/admin_controller.php b/controllers/admin_controller.php index ea4ee7b..9b38286 100644 --- a/controllers/admin_controller.php +++ b/controllers/admin_controller.php @@ -18,31 +18,28 @@ class AdminCtrl extends MotherCtrl{ public function admin(){ - /*accès à la page admin + if (!isset($_SESSION['user']) && ($_SESSION['user']['user_status'] != 1 )){ header("Location:index.php?ctrl=error&action=error_403"); exit; - }*/ + } $objCategoryModel = new CategoryModel; if (!empty($_POST['new_category'])) { - $objNewCategory = new Category; - if (!empty($objNewCategory->getName())) { - $objNewCategory = $_POST['new_category']; - $objCategoryModel->insertCategory($objNewCategory); - header("Location:index.php?ctrl=admin&action=admin"); - exit; - } + $newCat = new Category(); + $newCat->setName($_POST['new_category']); + $objCategoryModel->insertCategory($newCat); + header('Location: index.php?ctrl=admin&action=admin'); + exit; } - if (!empty($_POST['edit_category'])) { - $objEditCategory = new Category; - if ($objEditCategory->getId() > 0) { - $objEditCategory = $_POST['edit_category']; - $objCategoryModel->editCategory($objEditCategory); - header("Location:index.php?ctrl=admin&action=admin"); - exit; - } + if (!empty($_POST['id_to_edit']) && !empty($_POST['new_name'])) { + $editCat = new Category(); + $editCat->setId($_POST['id_to_edit']); + $editCat->setName($_POST['new_name']); + $objCategoryModel->editCategory($editCat); + header('Location: index.php?ctrl=admin&action=admin'); + exit; } $arrCategory = $objCategoryModel->findAllCategory(); @@ -54,8 +51,8 @@ $arrCategoryToDisplay[] = $objCategory; } + //gérer l'affichage $this->_arrData['arrCategoryToDisplay'] = $arrCategoryToDisplay; - //$this->_arrData['intCategory'] = $objCategoryModel->; $this->_display("admin"); } } diff --git a/models/mother_model.php b/models/mother_model.php index c259719..d43d0fa 100644 --- a/models/mother_model.php +++ b/models/mother_model.php @@ -7,9 +7,9 @@ try{ // Connexion à la base de données $this->_db = new PDO( - "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 + "mysql:host=localhost;dbname=projet_folliow", // Serveur et BDD mysql:host=boulayoune.com;dbname=projet_folliow + "root", //Nom d'utilisateur de la base de données projet_user + "",// Mot de passe de la base de données F0lliowRules! array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC) // Mode de renvoi ); // Pour résoudre les problèmes d’encodage diff --git a/templates_c/5375cd75c92fd8c801b429efee0d6437582d377e_0.file_login.tpl.php b/templates_c/5375cd75c92fd8c801b429efee0d6437582d377e_0.file_login.tpl.php new file mode 100644 index 0000000..c008541 --- /dev/null +++ b/templates_c/5375cd75c92fd8c801b429efee0d6437582d377e_0.file_login.tpl.php @@ -0,0 +1,164 @@ +getCompiled()->isFresh($_smarty_tpl, array ( + 'version' => '5.7.0', + 'unifunc' => 'content_6989df814ecac5_82975272', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + '5375cd75c92fd8c801b429efee0d6437582d377e' => + array ( + 0 => 'views/login.tpl', + 1 => 1770634036, + 2 => 'file', + ), + ), + 'includes' => + array ( + ), +))) { +function content_6989df814ecac5_82975272 (\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views'; +$_smarty_tpl->getInheritance()->init($_smarty_tpl, true); +?> + + +getInheritance()->instanceBlock($_smarty_tpl, 'Block_10819558166989df814817a5_66837906', "content"); +$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir); +} +/* {block "content"} */ +class Block_10819558166989df814817a5_66837906 extends \Smarty\Runtime\Block +{ +public function callBlock(\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\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_6989d31d7d28c9_01506908', + 'unifunc' => 'content_6989e0891f99a9_84268185', '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_6989d31d7d28c9_01506908 (\Smarty\Template $_smarty_tpl) { +function content_6989e0891f99a9_84268185 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\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_8131712286989d31d7cfb58_06071603', "content"); +$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_1226719426989e0891f66b5_10703637', "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_8131712286989d31d7cfb58_06071603 extends \Smarty\Runtime\Block +class Block_1226719426989e0891f66b5_10703637 extends \Smarty\Runtime\Block { public function callBlock(\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views'; diff --git a/templates_c/ac77f39f91cdf26a0eb3f0963ead4008a7bda8fb_0.file_admin.tpl.php b/templates_c/ac77f39f91cdf26a0eb3f0963ead4008a7bda8fb_0.file_admin.tpl.php index f674aeb..d200d8c 100644 --- a/templates_c/ac77f39f91cdf26a0eb3f0963ead4008a7bda8fb_0.file_admin.tpl.php +++ b/templates_c/ac77f39f91cdf26a0eb3f0963ead4008a7bda8fb_0.file_admin.tpl.php @@ -1,18 +1,18 @@ getCompiled()->isFresh($_smarty_tpl, array ( 'version' => '5.7.0', - 'unifunc' => 'content_6989d31d65c3a2_79771570', + 'unifunc' => 'content_6989e088f38338_64666135', 'has_nocache_code' => false, 'file_dependency' => array ( 'ac77f39f91cdf26a0eb3f0963ead4008a7bda8fb' => array ( 0 => 'views/admin.tpl', - 1 => 1770640156, + 1 => 1770643565, 2 => 'file', ), ), @@ -20,18 +20,18 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( array ( ), ))) { -function content_6989d31d65c3a2_79771570 (\Smarty\Template $_smarty_tpl) { +function content_6989e088f38338_64666135 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views'; $_smarty_tpl->getInheritance()->init($_smarty_tpl, true); ?> getInheritance()->instanceBlock($_smarty_tpl, 'Block_20302301596989d31d64f310_54306383', "content"); +$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_19184882506989e088f2e080_15773704', "content"); $_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir); } /* {block "content"} */ -class Block_20302301596989d31d64f310_54306383 extends \Smarty\Runtime\Block +class Block_19184882506989e088f2e080_15773704 extends \Smarty\Runtime\Block { public function callBlock(\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views'; @@ -108,9 +108,9 @@ $_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views'; @@ -152,52 +152,30 @@ $_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
-
- + + getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrCategoryToDisplay'), 'category'); $foreach1DoElse = true; -foreach ($_from ?? [] as $_smarty_tpl->getVariable('arrDetCategory')->value) { +foreach ($_from ?? [] as $_smarty_tpl->getVariable('category')->value) { $foreach1DoElse = false; ?> - - + getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?> - - getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrCategoryToDisplay'), 'arrDetCategory'); -$foreach2DoElse = true; -foreach ($_from ?? [] as $_smarty_tpl->getVariable('arrDetCategory')->value) { -$foreach2DoElse = false; -?> - - getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?> - -
- -
-
+ +
+ -
-
- -
+ +


@@ -205,14 +183,16 @@ $_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
- -
- - -
-
-
- +
+ +
+ + +
+
+ +
+
diff --git a/templates_c/b1b065356827f03a32a2809f87f59bd19d86da99_0.file_footer.tpl.php b/templates_c/b1b065356827f03a32a2809f87f59bd19d86da99_0.file_footer.tpl.php index bde3315..7788209 100644 --- a/templates_c/b1b065356827f03a32a2809f87f59bd19d86da99_0.file_footer.tpl.php +++ b/templates_c/b1b065356827f03a32a2809f87f59bd19d86da99_0.file_footer.tpl.php @@ -1,11 +1,11 @@ getCompiled()->isFresh($_smarty_tpl, array ( 'version' => '5.7.0', - 'unifunc' => 'content_6989d1dc7c08f9_74223007', + 'unifunc' => 'content_6989e0893afd86_56926620', 'has_nocache_code' => false, 'file_dependency' => array ( @@ -20,7 +20,7 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( array ( ), ))) { -function content_6989d1dc7c08f9_74223007 (\Smarty\Template $_smarty_tpl) { +function content_6989e0893afd86_56926620 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views\\_partial'; ?>
diff --git a/templates_c/b3c0a235f975d8741b25531347290b4e4994470b_0.file_header.tpl.php b/templates_c/b3c0a235f975d8741b25531347290b4e4994470b_0.file_header.tpl.php index 2037e59..ea41c4f 100644 --- a/templates_c/b3c0a235f975d8741b25531347290b4e4994470b_0.file_header.tpl.php +++ b/templates_c/b3c0a235f975d8741b25531347290b4e4994470b_0.file_header.tpl.php @@ -1,11 +1,11 @@ getCompiled()->isFresh($_smarty_tpl, array ( 'version' => '5.7.0', - 'unifunc' => 'content_6989d31d88f180_59508135', + 'unifunc' => 'content_6989e0892c1ac1_16523199', 'has_nocache_code' => false, 'file_dependency' => array ( @@ -20,7 +20,7 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( array ( ), ))) { -function content_6989d31d88f180_59508135 (\Smarty\Template $_smarty_tpl) { +function content_6989e0892c1ac1_16523199 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views\\_partial'; ?> diff --git a/templates_c/b70ee0d22061ca6100f647634a5658ae38c7b520_0.file_preview.tpl.php b/templates_c/b70ee0d22061ca6100f647634a5658ae38c7b520_0.file_preview.tpl.php index fa77fa8..a805224 100644 --- a/templates_c/b70ee0d22061ca6100f647634a5658ae38c7b520_0.file_preview.tpl.php +++ b/templates_c/b70ee0d22061ca6100f647634a5658ae38c7b520_0.file_preview.tpl.php @@ -1,11 +1,11 @@ getCompiled()->isFresh($_smarty_tpl, array ( 'version' => '5.7.0', - 'unifunc' => 'content_6989d1dc613786_88061115', + 'unifunc' => 'content_6989e02ebdb495_34139226', 'has_nocache_code' => false, 'file_dependency' => array ( @@ -20,7 +20,7 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( array ( ), ))) { -function content_6989d1dc613786_88061115 (\Smarty\Template $_smarty_tpl) { +function content_6989e02ebdb495_34139226 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views\\_partial'; ?> diff --git a/templates_c/ca790de9f8d5a4fc03b03b8d137ec1edb99bdd92_0.file_home.tpl.php b/templates_c/ca790de9f8d5a4fc03b03b8d137ec1edb99bdd92_0.file_home.tpl.php new file mode 100644 index 0000000..d2cd1e7 --- /dev/null +++ b/templates_c/ca790de9f8d5a4fc03b03b8d137ec1edb99bdd92_0.file_home.tpl.php @@ -0,0 +1,83 @@ +getCompiled()->isFresh($_smarty_tpl, array ( + 'version' => '5.7.0', + 'unifunc' => 'content_6989e02e94a704_31389377', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + 'ca790de9f8d5a4fc03b03b8d137ec1edb99bdd92' => + array ( + 0 => 'views/home.tpl', + 1 => 1770639710, + 2 => 'file', + ), + ), + 'includes' => + array ( + 'file:views/_partial/preview.tpl' => 1, + ), +))) { +function content_6989e02e94a704_31389377 (\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views'; +$_smarty_tpl->getInheritance()->init($_smarty_tpl, true); +?> + + +getInheritance()->instanceBlock($_smarty_tpl, 'Block_6558155986989e02e945ff4_36336799', "content"); +?> + +getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir); +} +/* {block "content"} */ +class Block_6558155986989e02e945ff4_36336799 extends \Smarty\Runtime\Block +{ +public function callBlock(\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\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_6989d1dc059b91_90143315', + 'unifunc' => 'content_6989e01e399336_22269044', 'has_nocache_code' => false, 'file_dependency' => array ( @@ -21,18 +21,18 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( 'file:views/_partial/preview.tpl' => 1, ), ))) { -function content_6989d1dc059b91_90143315 (\Smarty\Template $_smarty_tpl) { +function content_6989e01e399336_22269044 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views'; $_smarty_tpl->getInheritance()->init($_smarty_tpl, true); ?> getInheritance()->instanceBlock($_smarty_tpl, 'Block_10870486496989d1dbe65e81_99494215', "content"); +$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_17525989336989e01e3837e7_64042990', "content"); $_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir); } /* {block "content"} */ -class Block_10870486496989d1dbe65e81_99494215 extends \Smarty\Runtime\Block +class Block_17525989336989e01e3837e7_64042990 extends \Smarty\Runtime\Block { public function callBlock(\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views'; diff --git a/views/admin.tpl b/views/admin.tpl index b4c18f9..30d2697 100644 --- a/views/admin.tpl +++ b/views/admin.tpl @@ -72,8 +72,7 @@
@@ -106,34 +105,21 @@
-
- + + {foreach from=$arrCategoryToDisplay item=category} + {/foreach} - - {foreach from=$arrCategoryToDisplay item=arrDetCategory} - - {/foreach} - -
- -
-
+ +
+ -
-
- -
+ +


@@ -141,14 +127,16 @@
- -
- - -
-
-
- +
+ +
+ + +
+
+ +
+