From 2535d13d7c7316385dfe53ed237afbba03be0e50 Mon Sep 17 00:00:00 2001 From: "laura.chevillet" Date: Mon, 9 Feb 2026 13:35:44 +0100 Subject: [PATCH] =?UTF-8?q?r=C3=A9cup=C3=A9ration=20du=20back=20up?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/admin_controller.php | 1 - models/category_model.php | 50 +++- ...af2d8a8255035d91b950_0.file_layout.tpl.php | 50 ++++ ...3f0963ead4008a7bda8fb_0.file_admin.tpl.php | 230 +++++++++++++++ ...809f87f59bd19d86da99_0.file_footer.tpl.php | 63 +++++ ...531347290b4e4994470b_0.file_header.tpl.php | 115 ++++++++ ...7634a5658ae38c7b520_0.file_preview.tpl.php | 69 +++++ ...f497c64277110a78bc40_0.file_search.tpl.php | 261 ++++++++++++++++++ views/admin.tpl | 9 +- views/home.tpl | 12 + 10 files changed, 852 insertions(+), 8 deletions(-) create mode 100644 templates_c/947d9aa54bf412a952e2af2d8a8255035d91b950_0.file_layout.tpl.php create mode 100644 templates_c/ac77f39f91cdf26a0eb3f0963ead4008a7bda8fb_0.file_admin.tpl.php create mode 100644 templates_c/b1b065356827f03a32a2809f87f59bd19d86da99_0.file_footer.tpl.php create mode 100644 templates_c/b3c0a235f975d8741b25531347290b4e4994470b_0.file_header.tpl.php create mode 100644 templates_c/b70ee0d22061ca6100f647634a5658ae38c7b520_0.file_preview.tpl.php create mode 100644 templates_c/ebfd968608976813e893f497c64277110a78bc40_0.file_search.tpl.php diff --git a/controllers/admin_controller.php b/controllers/admin_controller.php index 63e92a1..ea4ee7b 100644 --- a/controllers/admin_controller.php +++ b/controllers/admin_controller.php @@ -54,7 +54,6 @@ $arrCategoryToDisplay[] = $objCategory; } - // Il faudra donner à maman et gérer l'affichage quand Smarty sera prêt $this->_arrData['arrCategoryToDisplay'] = $arrCategoryToDisplay; //$this->_arrData['intCategory'] = $objCategoryModel->; $this->_display("admin"); diff --git a/models/category_model.php b/models/category_model.php index 6432a9a..a23907e 100644 --- a/models/category_model.php +++ b/models/category_model.php @@ -27,21 +27,59 @@ /** * fonction d'insertion d'une nouvelle catégorie dans la bdd - * @param object $objUser L'objet utilisateur + * @param object $objCategory l'objet catégorie * @return bool Est-ce que la requête s'est bien passée (true/false) */ - public function insert(object $objCategory):bool{ + public function insertCategory(object $objCategory):bool{ - $strRq = "INSERT INTO category (category_name, category_parent) - VALUES (:name, :parent)"; + $strRq = "INSERT INTO category (category_name) + VALUES (:name)"; $rqPrep = $this->_db->prepare($strRq); $rqPrep->bindValue(":name", $objCategory->getName(), PDO::PARAM_STR); - $rqPrep->bindValue(":parent", $objCategory->getParent(), PDO::PARAM_STR); return $rqPrep->execute(); } - } \ No newline at end of file + + /** + * fonction de suppression d'une catégorie dans la bdd + * @param object $objCategory l'objet catégorie + * @return bool Est-ce que la requête s'est bien passée (true/false) + */ + + public function deleteCategory(object $objCategory):bool{ + + $strRq = "DELETE FROM category + WHERE category_id= :id"; + + $rqPrep = $this->_db->prepare($strRq); + + $rqPrep->bindValue(":id", $objCategory->getId(), PDO::PARAM_INT); + + return $rqPrep->execute(); + } + + /** + * fonction de modification d'une catégorie dans la bdd + * @param object $objCategory l'objet catégorie + * @return bool Est-ce que la requête s'est bien passée (true/false) + */ + + public function editCategory(object $objCategory):bool{ + + $strRq = "UPDATE category + SET category_name = :name + WHERE category_id = :id"; + + $rqPrep = $this->_db->prepare($strRq); + + $rqPrep->bindValue(":id", $objCategory->getId(), PDO::PARAM_INT); + $rqPrep->bindValue(":name", $objCategory->getName(), PDO::PARAM_STR); + + return $rqPrep->execute(); + } + } + \ No newline at end of file diff --git a/templates_c/947d9aa54bf412a952e2af2d8a8255035d91b950_0.file_layout.tpl.php b/templates_c/947d9aa54bf412a952e2af2d8a8255035d91b950_0.file_layout.tpl.php new file mode 100644 index 0000000..90efc5c --- /dev/null +++ b/templates_c/947d9aa54bf412a952e2af2d8a8255035d91b950_0.file_layout.tpl.php @@ -0,0 +1,50 @@ +getCompiled()->isFresh($_smarty_tpl, array ( + 'version' => '5.7.0', + 'unifunc' => 'content_6989d31d7d28c9_01506908', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + '947d9aa54bf412a952e2af2d8a8255035d91b950' => + array ( + 0 => 'views/layout.tpl', + 1 => 1770634036, + 2 => 'file', + ), + ), + 'includes' => + array ( + 'file:views/_partial/header.tpl' => 1, + 'file:views/_partial/footer.tpl' => 1, + ), +))) { +function content_6989d31d7d28c9_01506908 (\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"); +?> + + +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 +{ +public function callBlock(\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views'; +?> + + +getCompiled()->isFresh($_smarty_tpl, array ( + 'version' => '5.7.0', + 'unifunc' => 'content_6989d31d65c3a2_79771570', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + 'ac77f39f91cdf26a0eb3f0963ead4008a7bda8fb' => + array ( + 0 => 'views/admin.tpl', + 1 => 1770640156, + 2 => 'file', + ), + ), + 'includes' => + array ( + ), +))) { +function content_6989d31d65c3a2_79771570 (\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()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir); +} +/* {block "content"} */ +class Block_20302301596989d31d64f310_54306383 extends \Smarty\Runtime\Block +{ +public function callBlock(\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views'; +?> + + +
+ + + +
+
+ +
+ +
+
+
+

Dashboard

+
+ +
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+
+
+
+ +
+ +
+ + +
+
+
+ +
+
+
+
+
+
+
+
+
+ +getCompiled()->isFresh($_smarty_tpl, array ( + 'version' => '5.7.0', + 'unifunc' => 'content_6989d1dc7c08f9_74223007', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + 'b1b065356827f03a32a2809f87f59bd19d86da99' => + array ( + 0 => 'views/_partial/footer.tpl', + 1 => 1770634036, + 2 => 'file', + ), + ), + 'includes' => + array ( + ), +))) { +function content_6989d1dc7c08f9_74223007 (\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views\\_partial'; +?> + + + src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"> +> + + src="js/scripts.js"> +> + +getCompiled()->isFresh($_smarty_tpl, array ( + 'version' => '5.7.0', + 'unifunc' => 'content_6989d31d88f180_59508135', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + 'b3c0a235f975d8741b25531347290b4e4994470b' => + array ( + 0 => 'views/_partial/header.tpl', + 1 => 1770634036, + 2 => 'file', + ), + ), + 'includes' => + array ( + ), +))) { +function content_6989d31d88f180_59508135 (\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\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_6989d1dc613786_88061115', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + 'b70ee0d22061ca6100f647634a5658ae38c7b520' => + array ( + 0 => 'views/_partial/preview.tpl', + 1 => 1770634036, + 2 => 'file', + ), + ), + 'includes' => + array ( + ), +))) { +function content_6989d1dc613786_88061115 (\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views\\_partial'; +?> + + +
+
+ +
+ +
+ +
+ + Photo de profil + +
+

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

+ + + + – getValue('objProject')->getCreatorname();?> + + + + + Lire la suite → + +
+ +
+ +
+
getCompiled()->isFresh($_smarty_tpl, array ( + 'version' => '5.7.0', + 'unifunc' => 'content_6989d1dc059b91_90143315', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + 'ebfd968608976813e893f497c64277110a78bc40' => + array ( + 0 => 'views/search.tpl', + 1 => 1770634036, + 2 => 'file', + ), + ), + 'includes' => + array ( + 'file:views/_partial/preview.tpl' => 1, + ), +))) { +function content_6989d1dc059b91_90143315 (\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()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir); +} +/* {block "content"} */ +class Block_10870486496989d1dbe65e81_99494215 extends \Smarty\Runtime\Block +{ +public function callBlock(\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\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(); + +> + - +