diff --git a/controllers/admin_controller.php b/controllers/admin_controller.php index 63e92a1..8e4a509 100644 --- a/controllers/admin_controller.php +++ b/controllers/admin_controller.php @@ -8,6 +8,8 @@ require("./entities/image_entity.php"); require("./models/user_model.php"); require("./entities/user_entity.php"); + require("./models/authorisation_model.php"); + require("./entities/authorisation_entity.php"); require("mother_controller.php"); /** @@ -18,33 +20,33 @@ 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; - }*/ + } + + //gestion de l'user $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; } + //affichage select des catégories $arrCategory = $objCategoryModel->findAllCategory(); $arrCategoryToDisplay = array(); @@ -53,10 +55,56 @@ $objCategory->hydrate($arrDetCategory); $arrCategoryToDisplay[] = $objCategory; } + + //gestion de l'user + $objUserModel = new UserModel; + + if (!empty($_POST['action'])) { + $intUserId = (int)$_POST['user_id']; + + if ($intUserId > 0) { + if ($_POST['action'] === 'update_status' && !empty($_POST['new_status'])) { + $objUser = new User(); + $objUser->setId($intUserId); + $objUser->setStatus((int)$_POST['new_status']); + if ($objUserModel->editStatus($objUser)) { + $_SESSION['message_success'] = "Le statut a bien été modifié !"; + } + } + elseif ($_POST['action'] === 'delete_user') { + $objUserModel->delete_soft($intUserId); + $_SESSION['message_success'] = "L'utilisateur a été supprimé."; + } + header("Location: index.php?ctrl=admin&action=admin"); + exit; + } + } + + //affichage select des users + $arrUser = $objUserModel->findAllUsers(); + $arrUserToDisplay = array(); + + foreach($arrUser as $arrDetUser){ + $objUser = new User; + $objUser->hydrate($arrDetUser); + $arrUserToDisplay[] = $objUser; + } + + //affichage select des authorisations + $objAuthorisationModel = new AuthorisationModel; + $arrAuthorisation = $objAuthorisationModel->findAllAuthorisation(); + $arrAuthorisationToDisplay = array(); + + foreach($arrAuthorisation as $arrDetAuthorisation){ + $objAuthorisation = new Authorisation; + $objAuthorisation->hydrate($arrDetAuthorisation); + $arrAuthorisationToDisplay[] = $objAuthorisation; + } - // Il faudra donner à maman et gérer l'affichage quand Smarty sera prêt - $this->_arrData['arrCategoryToDisplay'] = $arrCategoryToDisplay; - //$this->_arrData['intCategory'] = $objCategoryModel->; + //gérer l'affichage + $this->_arrData['arrCategoryToDisplay'] = $arrCategoryToDisplay; + $this->_arrData['arrUserToDisplay'] = $arrUserToDisplay; + $this->_arrData['arrAuthorisationToDisplay'] = $arrAuthorisationToDisplay; $this->_display("admin"); } } diff --git a/controllers/project_controller.php b/controllers/project_controller.php index af2e9fa..6f469f0 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; @@ -87,8 +96,6 @@ /** * Fonction d'affichage de la page projet */ - - public function project (){ $objProjectModel = new ProjectModel; @@ -151,9 +158,9 @@ $objProjectModel->insert($objProject); } - //Débuggage + /*Débuggage var_dump($_SESSION); - var_dump($objProject); + var_dump($objProject);*/ $this->_arrData['arrProjectToDiplay'] = $arrProjectToDiplay; $this->_arrData['arrImageToDiplay'] = $arrImageToDiplay; diff --git a/entities/authorisation_entity.php b/entities/authorisation_entity.php new file mode 100644 index 0000000..1cb600b --- /dev/null +++ b/entities/authorisation_entity.php @@ -0,0 +1,24 @@ +_prefix = 'authorisation_'; + } + + public function getId():int{ + return $this->_id; + } + public function setId(int $id){ + $this->_id = $id; + } + + public function getName():string{ + return $this->_name; + } + + } \ No newline at end of file diff --git a/models/authorisation_model.php b/models/authorisation_model.php new file mode 100644 index 0000000..010660b --- /dev/null +++ b/models/authorisation_model.php @@ -0,0 +1,28 @@ +_db->query($strRq)->fetchAll(); + } + + } \ No newline at end of file diff --git a/models/category_model.php b/models/category_model.php index 6432a9a..6c48379 100644 --- a/models/category_model.php +++ b/models/category_model.php @@ -10,6 +10,7 @@ /** * Fonction de récupération des catégories + * @param int $intLimit * @return array */ @@ -27,21 +28,56 @@ /** * fonction d'insertion d'une nouvelle catégorie dans la bdd - * @param object $objUser L'objet utilisateur - * @return bool Est-ce que la requête s'est bien passée (true/false) + * @param object $objCategory l'objet catégorie + * @return bool Est-ce que la requête s'est bien passée */ + public function insertCategory(object $objCategory):bool{ - public function insert(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 + */ + 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 + */ + 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/models/image_model.php b/models/image_model.php index 2511f06..39e8158 100644 --- a/models/image_model.php +++ b/models/image_model.php @@ -11,6 +11,7 @@ /** * Fonction de récupération des images + * @param int $intLimit * @return array */ 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/models/project_model.php b/models/project_model.php index d88e02d..c0ffece 100644 --- a/models/project_model.php +++ b/models/project_model.php @@ -8,12 +8,17 @@ */ class ProjectModel extends Connect{ - + + + /** + * Fonction de recherche des projets + * @param type string, int et bool + * @return array + */ public function findAll(int $intLimit=0, string $strKeywords='', int $intAuthor=0, int $intPeriod=0, string $strDate='', string $strStartDate='', - string $strEndDate='', int $intCategory=0):array{ + string $strEndDate='', int $intCategory=0, bool $bool6Months=false):array{ - // Ecrire la requête $strRq = "SELECT project.*, CONCAT(user_firstname, ' ', user_name) AS 'project_creatorname', user_image @@ -21,6 +26,7 @@ INNER JOIN users ON user_id = project_user"; $strWhere = " WHERE "; + // Recherche par mot clé if ($strKeywords != '') { $strRq .= " WHERE (project_title LIKE '%".$strKeywords."%' @@ -41,23 +47,25 @@ $strRq .= $strWhere." project_category = ".$intCategory; $strWhere = " AND "; } + + //recherche par ancienneté + if ($bool6Months === true) { + $strRq .= $strWhere . " project_creation_date <= DATE_SUB(NOW(), INTERVAL 6 MONTH) "; + $strWhere = " AND "; + } // Recherche par dates if ($intPeriod == 0){ - // Par date exacte if ($strDate != ''){ $strRq .= $strWhere." project_creation_date = '".$strDate."'"; } }else{ - // Par période de dates if ($strStartDate != '' && $strEndDate != ''){ $strRq .= $strWhere." project_creation_date BETWEEN '".$strStartDate."' AND '".$strEndDate."'"; }else{ if ($strStartDate != ''){ - // A partir de $strRq .= $strWhere." project_creation_date >= '".$strStartDate."'"; }else if ($strEndDate != ''){ - // Avant le $strRq .= $strWhere." project_creation_date <= '".$strEndDate."'"; } } @@ -65,37 +73,39 @@ $strRq .= " ORDER BY project_creation_date DESC"; - if ($intLimit > 0){ $strRq .= " LIMIT ".$intLimit; } - // Lancer la requête et récupérer les résultats return $this->_db->query($strRq)->fetchAll(); } - //Fonction d'insertion d'information dans la BDD (Repris de la partie BLOG vu en cours..) + /** + * Fonction d'insertion d'un nouveau projet dans la bdd + * @param object $objProject l'objet projet + * @return bool Est-ce que la requête s'est bien passée + */ public function insert(object $objProject):bool{ - //Construire la requête $strRq = "INSERT INTO project (project_title, project_description, project_thumbnail, project_content, project_status, project_creation_date) VALUES (:title, :description, :thumbnail, :content, :status, DATE(NOW()))"; - // Préparer la requête $rqPrep = $this->_db->prepare($strRq); - // Donne les informations + $rqPrep->bindValue(":title", $objProject->getTitle(), PDO::PARAM_STR); $rqPrep->bindValue(":description", $objProject->getDescription(), PDO::PARAM_STR); $rqPrep->bindValue(":thumbnail", $objProject->getThumbnail(), PDO::PARAM_STR); $rqPrep->bindValue(":content", $objProject->getContent(), PDO::PARAM_STR); $rqPrep->bindValue(":status", $objProject->getStatus(), PDO::PARAM_STR); - //Executer la requête - //var_dump($strRq);die; - //return $db->exec($strRq); return $rqPrep->execute(); } + /** + * Fonction de recherche d'un seul projet + * @param int $intId + * @return + */ public function findOne(int $intId) { $strRq = "SELECT project.*, CONCAT(users.user_firstname, ' ', users.user_name) AS 'project_creatorname', diff --git a/models/user_model.php b/models/user_model.php index 72f1ada..d20b743 100644 --- a/models/user_model.php +++ b/models/user_model.php @@ -5,66 +5,58 @@ /** * Traitement des requêtes pour les utilisateurs * @author : meilleurGroup - * @version : V0.5 */ + class UserModel extends Connect{ - // Attributs - - - // Méthodes + public function __construct(){ parent::__construct(); } /** + * Fonction de recherche des utilisateurs et leur niveau d'autorisation * @return array */ public function findAllUsers():array{ - // Ecrire la requête $strRq = "SELECT user_id, user_firstname, user_name, user_image, user_status, authorisation_name - FROM users INNER JOIN authorisation ON authorisation.authorisation_id = users.user_status"; - // Lancer la requête et récupérer les résultats + FROM users INNER JOIN authorisation ON authorisation.authorisation_id = users.user_status + WHERE user_deleted_at IS NULL"; return $this->_db->query($strRq)->fetchAll(); } /** + * Fonction de vérification des utilisateurs * @param string $strMail * @param string $strPwd * @return array|bool */ public function verifUser(string $strMail, string $strPwd):array|bool{ - // 2. Construire la requête + $strRq = "SELECT user_id, user_name, user_firstname, user_password, user_image, user_status, authorisation_name FROM users INNER JOIN authorisation ON authorisation.authorisation_id = users.user_status WHERE user_mail = '".$strMail."'"; - // Récupère mon utilisateur - // Executer la requête et récupérer les résultats + $arrUser = $this->_db->query($strRq)->fetch(); - // Vérification du mot de passe haché if (password_verify($strPwd, $arrUser['user_password'])){ - // Renvoi l'utilisateur - unset($arrUser['user_password']); // on enlève le pwd + unset($arrUser['user_password']); return $arrUser; }else{ return false; } } - //public function insert(string $strName, string $strFirstname, string $strMail, string $strPwd):int{ /** * Fonction d'insertion d'un utilisateur en BDD * @param object $objUser L'objet utilisateur - * @return bool Est-ce que la requête s'est bien passée (true/false) + * @return bool Est-ce que la requête s'est bien passée */ public function insert(object $objUser):bool{ - - // 2. Construire la requête $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)"; - // Préparer la requête + $rqPrep = $this->_db->prepare($strRq); - // Donne les informations + $rqPrep->bindValue(":name", $objUser->getName(), PDO::PARAM_STR); $rqPrep->bindValue(":firstname", $objUser->getFirstname(), PDO::PARAM_STR); $rqPrep->bindValue(":pseudo", $objUser->getPseudo(), PDO::PARAM_STR); @@ -75,19 +67,54 @@ $rqPrep->bindValue(':location', $objUser->getLocation() ?? "", PDO::PARAM_STR); $rqPrep->bindValue(':description', $objUser->getDescription() ?? "", PDO::PARAM_STR); - - - // 3. Executer la requête - //var_dump($strRq);die; - //return $db->exec($strRq); return $rqPrep->execute(); } - public function mailExists(string $mail): bool - { + + /** + * Fonction de vérification de mail + * @param string $mail + * @return bool Est-ce que la requête s'est bien passée + */ + public function mailExists(string $mail): bool{ + $rq = $this->_db->prepare("SELECT 1 FROM users WHERE user_mail = :mail LIMIT 1"); $rq->bindValue(":mail", $mail); $rq->execute(); return (bool)$rq->fetchColumn(); } + + /** + * Fonction de changement de status d'un utilisateur + * @param object $objUser L'objet utilisateur + * @return bool Est-ce que la requête s'est bien passée + */ + + public function editStatus(object $objUser):bool{ + + $strRq = "UPDATE users + SET user_status = :status + WHERE user_id = :id"; + + $rqPrep = $this->_db->prepare($strRq); + $rqPrep->bindValue(":id", $objUser->getId(), PDO::PARAM_INT); + $rqPrep->bindValue(":status", $objUser->getStatus(), PDO::PARAM_INT); + return $rqPrep->execute(); + } + + /** + * Fonction permettant de supprimer un utilisateur avec une date de suppression + * @param int $intId L'identifiant de l'utilisateur + * @return bool Est-ce que la requête s'est bien passée + */ + public function delete_soft(int $intId):bool{ + + $strRq = "UPDATE users + SET user_deleted_at = NOW() + WHERE user_id = :id"; + + $rqPrep = $this->_db->prepare($strRq); + $rqPrep->bindValue(":id", $intId, PDO::PARAM_INT); + return $rqPrep->execute(); + } } diff --git a/templates_c/3309f8a981537e6cbbf8869c67d6dd307aa06ae3_0.file_project.tpl.php b/templates_c/3309f8a981537e6cbbf8869c67d6dd307aa06ae3_0.file_project.tpl.php new file mode 100644 index 0000000..ecebd4d --- /dev/null +++ b/templates_c/3309f8a981537e6cbbf8869c67d6dd307aa06ae3_0.file_project.tpl.php @@ -0,0 +1,110 @@ +getCompiled()->isFresh($_smarty_tpl, array ( + 'version' => '5.7.0', + 'unifunc' => 'content_698ae9a3ee5104_18468093', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + '3309f8a981537e6cbbf8869c67d6dd307aa06ae3' => + array ( + 0 => 'views/project.tpl', + 1 => 1770634036, + 2 => 'file', + ), + ), + 'includes' => + array ( + 'file:../app/views/partials/preview.tpl' => 1, + ), +))) { +function content_698ae9a3ee5104_18468093 (\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_2126029828698ae9a3edc808_29541958', "content"); +$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir); +} +/* {block "content"} */ +class Block_2126029828698ae9a3edc808_29541958 extends \Smarty\Runtime\Block +{ +public function callBlock(\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views'; +?> + + +
+
+

Alimenter votre projet

+
+ + + + +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ + +
+ + +
+
+

Description

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. + Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. + Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+
+
+

Photos behind the scene

+
+ +
+
+
+

Other projects

+
+ 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:../app/views/partials/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_698ae9506da109_21542800', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + '52c011ce77c5dc743b6591550c55ce4a78a4dbca' => + array ( + 0 => 'views/projet_display.tpl', + 1 => 1770634036, + 2 => 'file', + ), + ), + 'includes' => + array ( + ), +))) { +function content_698ae9506da109_21542800 (\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_919254056698ae95061e435_82964089', "content"); +$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir); +} +/* {block "content"} */ +class Block_919254056698ae95061e435_82964089 extends \Smarty\Runtime\Block +{ +public function callBlock(\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\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_698ae969a7db02_27363144', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + '5375cd75c92fd8c801b429efee0d6437582d377e' => + array ( + 0 => 'views/login.tpl', + 1 => 1770634036, + 2 => 'file', + ), + ), + 'includes' => + array ( + ), +))) { +function content_698ae969a7db02_27363144 (\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_342031104698ae969942f96_18698715', "content"); +$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir); +} +/* {block "content"} */ +class Block_342031104698ae969942f96_18698715 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_698aed2fd402f7_78850375', + '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_698aed2fd402f7_78850375 (\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_691069574698aed2fd3d8f8_28027733', "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_691069574698aed2fd3d8f8_28027733 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_698aed2fac7079_66630300', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + 'ac77f39f91cdf26a0eb3f0963ead4008a7bda8fb' => + array ( + 0 => 'views/admin.tpl', + 1 => 1770712365, + 2 => 'file', + ), + ), + 'includes' => + array ( + ), +))) { +function content_698aed2fac7079_66630300 (\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_701047722698aed2faa98f9_91663021', "content"); +$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir); +} +/* {block "content"} */ +class Block_701047722698aed2faa98f9_91663021 extends \Smarty\Runtime\Block +{ +public function callBlock(\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views'; +?> + + +
+ + + +
+
+ +
+ +
+
+
+

Dashboard

+
+ +
+
+

Gestion de l'utilsateur

+

Changer le statut ou supprimer un utilisateur

+
+
+ +
+
+
+ + +
+
+ + +
+
+
+
+
+ +
+
+

Gestion des catégories

+
+
+
+

Modifier une catégorie existante

+ +
+
+ + +
+ +
+
+
+
+
+
+ +
+
+

Créer une nouvelle catégorie

+
+ + +
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +getCompiled()->isFresh($_smarty_tpl, array ( + 'version' => '5.7.0', + 'unifunc' => 'content_698aed2fea7fd1_77495932', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + 'b1b065356827f03a32a2809f87f59bd19d86da99' => + array ( + 0 => 'views/_partial/footer.tpl', + 1 => 1770634036, + 2 => 'file', + ), + ), + 'includes' => + array ( + ), +))) { +function content_698aed2fea7fd1_77495932 (\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_698aed2fe0e338_92194390', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + 'b3c0a235f975d8741b25531347290b4e4994470b' => + array ( + 0 => 'views/_partial/header.tpl', + 1 => 1770634036, + 2 => 'file', + ), + ), + 'includes' => + array ( + ), +))) { +function content_698aed2fe0e338_92194390 (\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_698ae96d52fa95_22666517', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + 'b70ee0d22061ca6100f647634a5658ae38c7b520' => + array ( + 0 => 'views/_partial/preview.tpl', + 1 => 1770634036, + 2 => 'file', + ), + ), + 'includes' => + array ( + ), +))) { +function content_698ae96d52fa95_22666517 (\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_698ae96d2e58d9_91616548', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + 'ca790de9f8d5a4fc03b03b8d137ec1edb99bdd92' => + array ( + 0 => 'views/home.tpl', + 1 => 1770711346, + 2 => 'file', + ), + ), + 'includes' => + array ( + 'file:views/_partial/preview.tpl' => 1, + ), +))) { +function content_698ae96d2e58d9_91616548 (\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_826938963698ae96d2e14b1_12340515', "content"); +?> + +getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir); +} +/* {block "content"} */ +class Block_826938963698ae96d2e14b1_12340515 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.

+
+ +
+
+
+ + + + + + Tout +
+
+
+ +
+

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_698ada80e47fc8_23614044', + '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_698ada80e47fc8_23614044 (\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_1614324265698ada80a61e02_00521357', "content"); +$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir); +} +/* {block "content"} */ +class Block_1614324265698ada80a61e02_00521357 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(); + +> +getCompiled()->isFresh($_smarty_tpl, array ( + 'version' => '5.7.0', + 'unifunc' => 'content_6989f3e29dbce4_20550543', + 'has_nocache_code' => false, + 'file_dependency' => + array ( + 'ee86afd5d4dff200944f3436866afa34a71b920e' => + array ( + 0 => 'views/inscription.tpl', + 1 => 1770634036, + 2 => 'file', + ), + ), + 'includes' => + array ( + ), +))) { +function content_6989f3e29dbce4_20550543 (\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_18645663486989f3e29da446_83083224', "content"); +$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir); +} +/* {block "content"} */ +class Block_18645663486989f3e29da446_83083224 extends \Smarty\Runtime\Block +{ +public function callBlock(\Smarty\Template $_smarty_tpl) { +$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views'; +?> + + + + +
+ + +
+
+ + +
+ + +

Inscription

+ + +

+ Créez votre compte utilisateur. +

+ + + +
+ +
+ + +
+ + +
+ + +
+ + +
+ + +
+ +
+ @ + +
+
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ +
+ + +
+ + Déjà un compte ? + Se connecter + +
+ + +
+ + +
+ +
+
+
+ @@ -86,63 +85,73 @@
+

Gestion de l'utilsateur

+

Changer le statut ou supprimer un utilisateur

-
+
-
- -
-
- -
+
+
+ + +
+
+ + +
+
- +
-
+

Gestion des catégories

- -
- -
-
+ +

Modifier une catégorie existante

+ +
+
+ + +
-
-
- -
+ +


-
- -
- - -
-
-
- +
+

Créer une nouvelle catégorie

+
+ + +
+
+ +
+
@@ -152,4 +161,5 @@
+ {/block} \ No newline at end of file diff --git a/views/home.tpl b/views/home.tpl index 7236cc4..49c9c0f 100644 --- a/views/home.tpl +++ b/views/home.tpl @@ -9,6 +9,19 @@ directement en contact avec les entreprises.

+
+
+
+ + + + + + Tout +
+
+
+

Les 4 derniers articles