diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2196147 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/templates_c/ +/templates_c/** \ No newline at end of file diff --git a/controllers/project_controller.php b/controllers/project_controller.php index 9dacb3d..47f9372 100644 --- a/controllers/project_controller.php +++ b/controllers/project_controller.php @@ -116,18 +116,19 @@ $objImage->hydrate($arrDetImage); $arrImageToDisplay[] = $objImage; } - //Variable data $_SESSION['title'] = $_POST['titleProject']??""; $_SESSION['description'] = $_POST['descProject']??""; $_SESSION['content'] = $_POST['textProject']??""; $_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 Guillaume + * 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 @@ -137,20 +138,23 @@ $strDest = ""; if ((count($_FILES) > 0) && ($_FILES['imageProject']['error'] != 4)){ $strDest = 'uploads/projects/'.$_FILES['imageProject']['name']; - var_dump($strDest); 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 ou pas + * 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'])) { $objProject->hydrate($_SESSION); $objProject->setThumbnail($strDest); @@ -159,7 +163,6 @@ var_dump($_SESSION); var_dump($objProject); - $this->_arrData['arrProjectToDiplay'] = $arrProjectToDisplay; $this->_arrData['arrImageToDiplay'] = $arrImageToDisplay; @@ -221,6 +224,7 @@ $objMail->SMTPDebug = 0; + $objMail->SMTPAuth = TRUE; $objMail->SMTPSecure = "tls"; $objMail->Port = 587; diff --git a/entities/project_entity.php b/entities/project_entity.php index 0a389bf..cb8548a 100644 --- a/entities/project_entity.php +++ b/entities/project_entity.php @@ -157,7 +157,7 @@ class Project extends Entity{ * Récupération de l'utilisateur * @return int id de l'utilisateur */ - public function getUser(){ + public function getUser_id(){ return $this->_user; } @@ -165,7 +165,7 @@ class Project extends Entity{ * Mise à jour de l'utilisateur * @param int id de l'utilisateur */ - public function setUser($user){ + public function setUser_id($user){ $this->_user = $user; } diff --git a/models/project_model.php b/models/project_model.php index 53e33aa..9ca240f 100644 --- a/models/project_model.php +++ b/models/project_model.php @@ -105,14 +105,14 @@ * Fonction de recherche d'un seul projet * @param int $intId * @return array - */ + */ public function findOne(int $intId) :array{ $strRq = "SELECT project.*, CONCAT(users.user_firstname, ' ', users.user_name) AS 'project_creatorname', users.user_image, category.category_name FROM project - INNER JOIN users ON users.user_id = project.project_user + INNER JOIN users ON users.user_id = project.project_user_id LEFT JOIN category ON category.category_id = project.project_category WHERE project.project_id = :id"; diff --git a/templates_c/0f54e8b5c9bcafd01d94486bfa02ee91c2c5fe68_0.file_home.tpl.php b/templates_c/0f54e8b5c9bcafd01d94486bfa02ee91c2c5fe68_0.file_home.tpl.php index 19e2b80..ed1df75 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_698cb3489df022_21637833', + 'unifunc' => 'content_698ce8475ca6c5_70769879', '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_698cb3489df022_21637833 (\Smarty\Template $_smarty_tpl) { +function content_698ce8475ca6c5_70769879 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'D:\\projetphp\\views'; $_smarty_tpl->getInheritance()->init($_smarty_tpl, true); ?> getInheritance()->instanceBlock($_smarty_tpl, 'Block_625675898698cb3489daba8_53798441', "content"); +$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_1240817329698ce8475c5f82_37934128', "content"); ?> getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir); } /* {block "content"} */ -class Block_625675898698cb3489daba8_53798441 extends \Smarty\Runtime\Block +class Block_1240817329698ce8475c5f82_37934128 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 b2af63a..5225d20 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_698cba62b4e137_64473486', + 'unifunc' => 'content_698ce84e84dcc1_11117501', '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_698cba62b4e137_64473486 (\Smarty\Template $_smarty_tpl) { +function content_698ce84e84dcc1_11117501 (\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_1102964570698cba62b4c8c6_53649331', "content"); +$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_2114043754698ce84e84c177_54195501', "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_1102964570698cba62b4c8c6_53649331 extends \Smarty\Runtime\Block +class Block_2114043754698ce84e84c177_54195501 extends \Smarty\Runtime\Block { public function callBlock(\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'D:\\projetphp\\views'; diff --git a/templates_c/20a11b6ecdc7e0959bdb519973f0177a783a4561_0.file_header.tpl.php b/templates_c/20a11b6ecdc7e0959bdb519973f0177a783a4561_0.file_header.tpl.php index 42ebec8..ab2a5b4 100644 --- a/templates_c/20a11b6ecdc7e0959bdb519973f0177a783a4561_0.file_header.tpl.php +++ b/templates_c/20a11b6ecdc7e0959bdb519973f0177a783a4561_0.file_header.tpl.php @@ -1,11 +1,11 @@ getCompiled()->isFresh($_smarty_tpl, array ( 'version' => '5.7.0', - 'unifunc' => 'content_698b49a6a94424_69678291', + 'unifunc' => 'content_6989f726978651_30802796', 'has_nocache_code' => false, 'file_dependency' => array ( @@ -20,7 +20,7 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( array ( ), ))) { -function content_698b49a6a94424_69678291 (\Smarty\Template $_smarty_tpl) { +function content_6989f726978651_30802796 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views\\_partial'; ?> diff --git a/templates_c/264314e384c04e79c5fa56e3cf6837f9df55d7fb_0.file_footer.tpl.php b/templates_c/264314e384c04e79c5fa56e3cf6837f9df55d7fb_0.file_footer.tpl.php index 1eabb22..edc0f04 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_698cba62c7aed8_62552440', + 'unifunc' => 'content_698ce84e9b1e51_40033913', 'has_nocache_code' => false, 'file_dependency' => array ( @@ -20,7 +20,7 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( array ( ), ))) { -function content_698cba62c7aed8_62552440 (\Smarty\Template $_smarty_tpl) { +function content_698ce84e9b1e51_40033913 (\Smarty\Template $_smarty_tpl) { $_smarty_current_dir = 'D:\\projetphp\\views\\_partial'; ?>