Débug de l'affichage des projet hors connexion

This commit is contained in:
GuillaumeH-Cci 2026-02-17 17:53:41 +01:00
parent a448d0e2b4
commit c91eb6cf89
9 changed files with 225 additions and 90 deletions

View file

@ -1,18 +1,18 @@
<?php
/* Smarty version 5.7.0, created on 2026-02-09 15:03:02
/* Smarty version 5.7.0, created on 2026-02-17 16:52:37
from 'file:views/_partial/header.tpl' */
/* @var \Smarty\Template $_smarty_tpl */
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
'version' => '5.7.0',
'unifunc' => 'content_6989f726978651_30802796',
'unifunc' => 'content_69949cd5a907e4_36611222',
'has_nocache_code' => false,
'file_dependency' =>
array (
'20a11b6ecdc7e0959bdb519973f0177a783a4561' =>
array (
0 => 'views/_partial/header.tpl',
1 => 1770639154,
1 => 1771345389,
2 => 'file',
),
),
@ -20,7 +20,7 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
array (
),
))) {
function content_6989f726978651_30802796 (\Smarty\Template $_smarty_tpl) {
function content_69949cd5a907e4_36611222 (\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views\\_partial';
?><!DOCTYPE html>
<html lang="fr">
@ -38,7 +38,7 @@ $_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views\\_
<body>
<nav class="navbar navbar-expand-lg navbar-light">
<div class="container-fluid">
<a class="navbar-brand d-flex align-items-center" href="#">
<a class="navbar-brand d-flex align-items-center" href="index.php">
<img src="assests/img/logo.png" alt="Logo" class="logo-image">
</a>
@ -48,15 +48,7 @@ $_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views\\_
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav me-auto">
<li class="nav-item">
<a class="nav-link" href="?ctrl=&action=">Découvrir</a>
</li>
<li class="nav-item">
<a class="nav-link" href="?ctrl=&action=">Customisation</a>
</li>
<li class="nav-item">
<a class="nav-link" href="?ctrl=&action=">Orientation</a>
</li>
<li class="nav-item">
<a class="nav-link" href="?ctrl=&action=">À propos</a>
</li>
@ -65,6 +57,9 @@ $_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views\\_
<a class="nav-link" href="?ctrl=project&action=search">Rechercher</a>
</li>
<?php if ((true && (true && null !== ($_SESSION['user'] ?? null)))) {?>
<li class="nav-item">
<a class="nav-link" href="?ctrl=project&action=addedit_project">Ajouter un projet</a>
</li>
<?php if ($_SESSION['user']['authorisation_name'] == "Administrateur") {?>
<li class="nav-item">
<a class="nav-link" href="?ctrl=admin&action=admin">Admin</a>
@ -91,7 +86,7 @@ $_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views\\_
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="edit_account.php" title="Modifier mon compte" aria-label="Modifier mon compte">
<img src=".<?php echo $_SESSION['user']['user_image'];?>
<img src="<?php echo $_SESSION['user']['user_image'];?>
"
class="rounded-circle flex-shrink-0 mt-2 ml-5"
style="width: 36px; height: 36px; object-fit: cover;"
@ -111,5 +106,6 @@ $_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views\\_
</div>
</nav>
</body>
</html><?php }
</html>
<?php }
}

View file

@ -1,18 +1,18 @@
<?php
/* Smarty version 5.7.0, created on 2026-02-09 15:03:02
/* Smarty version 5.7.0, created on 2026-02-17 16:52:26
from 'file:views/_partial/preview.tpl' */
/* @var \Smarty\Template $_smarty_tpl */
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
'version' => '5.7.0',
'unifunc' => 'content_6989f7269f97f7_68511256',
'unifunc' => 'content_69949cca585988_04307644',
'has_nocache_code' => false,
'file_dependency' =>
array (
'3848b4db17319a951391d803dc4119c46e490c52' =>
array (
0 => 'views/_partial/preview.tpl',
1 => 1770646177,
1 => 1770991201,
2 => 'file',
),
),
@ -20,12 +20,12 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
array (
),
))) {
function content_6989f7269f97f7_68511256 (\Smarty\Template $_smarty_tpl) {
function content_69949cca585988_04307644 (\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views\\_partial';
?>
<article class="col-md-3 mb-4">
<article class="col-md-3 mb-5 <?php if ((true && (true && null !== ($_SESSION['user'] ?? null))) && $_SESSION['user']['user_status'] == 2) {?> pb-5 <?php }?>">
<div class="card h-100 shadow-sm article-card">
<div class="ratio ratio-16x9">
@ -38,7 +38,7 @@ $_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views\\_
<div class="d-flex align-items-start gap-3">
<img src=".<?php echo $_smarty_tpl->getValue('objProject')->getUser_image();?>
<img src="<?php echo $_smarty_tpl->getValue('objProject')->getUser_image();?>
"
class="rounded-circle flex-shrink-0 mt-2 ml-5"
style="width: 48px; height: 48px; object-fit: cover;"
@ -51,8 +51,14 @@ $_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views\\_
<small class="text-body-secondary d-block mb-1">
<time><?php echo $_smarty_tpl->getValue('objProject')->getCreation_date();?>
</time>
<?php echo $_smarty_tpl->getValue('objProject')->getCreatorname();?>
<a href="index.php?ctrl=user&action=user&id=<?php echo $_smarty_tpl->getValue('objProject')->getUser_id();?>
"
class="text-decoration-none"
style="position: relative; z-index: 2;">
<?php echo $_smarty_tpl->getValue('objProject')->getCreatorname();?>
</a>
</small>
<a href="index.php?ctrl=project&action=display&id=<?php echo $_smarty_tpl->getValue('objProject')->getId();?>
@ -60,22 +66,34 @@ $_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views\\_
class="stretched-link small">
Lire la suite
</a>
<?php if ((true && (true && null !== ($_SESSION['user'] ?? null)))) {?>
<?php if ($_SESSION['user']['user_id'] == $_smarty_tpl->getValue('objProject')->getUser_id()) {?>
<a href="index.php?ctrl=project&action=display&id=<?php echo $_smarty_tpl->getValue('objProject')->getId();?>
"
class="stretched-link small">
Editer
</a>
<?php }?>
<?php }?>
</div>
</div>
</div>
<?php if ((true && (true && null !== ($_SESSION['user'] ?? null))) && $_SESSION['user']['user_status'] == 2 && $_smarty_tpl->getValue('objProject')->getStatus() == "en_attente") {?>
<?php if ((true && (true && null !== ($_SESSION['user'] ?? null))) && $_SESSION['user']['user_status'] == 2) {?>
<div class="border rounded text-center">
<a class="btn btn-sm m-1 btn-danger" href="?ctrl=project&action=delete&id=<?php echo $_smarty_tpl->getValue('objProject')->getId();?>
" name="toDelete">Supprimer</a>
<?php }?>
<?php if ((true && (true && null !== ($_SESSION['user'] ?? null))) && $_smarty_tpl->getValue('objProject')->getStatus() == "en_attente" && $_SESSION['user']['user_status'] == 2) {?>
<a class="btn btn-sm m-1 btn-success" href="?ctrl=project&action=accept&id=<?php echo $_smarty_tpl->getValue('objProject')->getId();?>
" name="toPublished">Accepter</a>
<a class="btn btn-sm m-1 btn-warning" href="?ctrl=project&action=refuse&id=<?php echo $_smarty_tpl->getValue('objProject')->getId();?>
" name="toRefused">Refuser</a>
<a class="btn btn-sm m-1 btn-danger" href="?ctrl=project&action=delete&id=<?php echo $_smarty_tpl->getValue('objProject')->getId();?>
" name="toDelete">Supprimer</a>
</div>
<?php } elseif ($_smarty_tpl->getValue('projectStatus') == "refusé") {?>
<p class="text-danger fw-bold">Portfolio refusé</p>
<?php }?>
</article><?php }
</article>
<?php }
}

View file

@ -1,11 +1,11 @@
<?php
/* Smarty version 5.7.0, created on 2026-02-09 15:03:02
/* Smarty version 5.7.0, created on 2026-02-17 16:52:37
from 'file:views/layout.tpl' */
/* @var \Smarty\Template $_smarty_tpl */
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
'version' => '5.7.0',
'unifunc' => 'content_6989f726914163_83904848',
'unifunc' => 'content_69949cd5a22020_02990218',
'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_6989f726914163_83904848 (\Smarty\Template $_smarty_tpl) {
function content_69949cd5a22020_02990218 (\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);
?>
<?php
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_14089017836989f726912e95_86271581', "content");
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_38239549469949cd5a20c56_48859268', "content");
?>
<?php $_smarty_tpl->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
class Block_38239549469949cd5a20c56_48859268 extends \Smarty\Runtime\Block
{
public function callBlock(\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views';

View file

@ -1,18 +1,18 @@
<?php
/* Smarty version 5.7.0, created on 2026-02-09 15:03:02
/* Smarty version 5.7.0, created on 2026-02-17 16:52:26
from 'file:views/home.tpl' */
/* @var \Smarty\Template $_smarty_tpl */
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
'version' => '5.7.0',
'unifunc' => 'content_6989f72687e0c8_78461032',
'unifunc' => 'content_69949cca3eb5d3_41418023',
'has_nocache_code' => false,
'file_dependency' =>
array (
'7e6dbbb1e41ad859e7f5b7b444b7670474263f88' =>
array (
0 => 'views/home.tpl',
1 => 1770639154,
1 => 1771345389,
2 => 'file',
),
),
@ -21,20 +21,20 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
'file:views/_partial/preview.tpl' => 1,
),
))) {
function content_6989f72687e0c8_78461032 (\Smarty\Template $_smarty_tpl) {
function content_69949cca3eb5d3_41418023 (\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views';
$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
?>
<?php
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_15962470546989f72687a521_39502617', "content");
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_170960686969949cca3e7560_93553609', "content");
?>
<?php $_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
}
/* {block "content"} */
class Block_15962470546989f72687a521_39502617 extends \Smarty\Runtime\Block
class Block_170960686969949cca3e7560_93553609 extends \Smarty\Runtime\Block
{
public function callBlock(\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views';
@ -48,6 +48,19 @@ $_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views';
directement en contact avec les entreprises.</p>
</section>
<section class="container mt-5 p-5 d-flex flex-column align-items-center text-center">
<div class="mb-4">
<form method="GET" action="index.php">
<input type="hidden" name="ctrl" value="project">
<input type="hidden" name="action" value="home">
<button type="submit" name="filter_cat" value="1" class="btn btn-primary">Design</button>
<button type="submit" name="filter_cat" value="2" class="btn btn-primary">Développement Web</button>
<button type="submit" name="filter_old" value="true" class="btn btn-primary">Plus de 6 mois</button>
<a href="index.php?ctrl=project&action=home" class="btn btn-primary">Tout</a>
</form>
</div>
</section>
<section class="container" aria-label="Articles récents">
<h2 class="visually-hidden">Les 4 derniers articles</h2>
<div class="row mb-2">

View file

@ -1,11 +1,11 @@
<?php
/* Smarty version 5.7.0, created on 2026-02-09 15:02:52
/* Smarty version 5.7.0, created on 2026-02-17 16:52:19
from 'file:views/login.tpl' */
/* @var \Smarty\Template $_smarty_tpl */
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
'version' => '5.7.0',
'unifunc' => 'content_6989f71c761896_25894348',
'unifunc' => 'content_69949cc31946f2_99570077',
'has_nocache_code' => false,
'file_dependency' =>
array (
@ -20,18 +20,18 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
array (
),
))) {
function content_6989f71c761896_25894348 (\Smarty\Template $_smarty_tpl) {
function content_69949cc31946f2_99570077 (\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views';
$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
?>
<?php
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_19992775976989f71c758fc2_34188356', "content");
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_48413822169949cc30e4725_27989269', "content");
$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
}
/* {block "content"} */
class Block_19992775976989f71c758fc2_34188356 extends \Smarty\Runtime\Block
class Block_48413822169949cc30e4725_27989269 extends \Smarty\Runtime\Block
{
public function callBlock(\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views';

View file

@ -1,11 +1,11 @@
<?php
/* Smarty version 5.7.0, created on 2026-02-09 15:03:02
/* Smarty version 5.7.0, created on 2026-02-17 16:52:37
from 'file:views/_partial/footer.tpl' */
/* @var \Smarty\Template $_smarty_tpl */
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
'version' => '5.7.0',
'unifunc' => 'content_6989f726ac4850_67307943',
'unifunc' => 'content_69949cd5b10bc9_79471252',
'has_nocache_code' => false,
'file_dependency' =>
array (
@ -20,7 +20,7 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
array (
),
))) {
function content_6989f726ac4850_67307943 (\Smarty\Template $_smarty_tpl) {
function content_69949cd5b10bc9_79471252 (\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views\\_partial';
?>
<footer class="footer container-fluid d-flex justify-content-around">

View file

@ -1,18 +1,18 @@
<?php
/* Smarty version 5.7.0, created on 2026-02-10 15:07:18
/* Smarty version 5.7.0, created on 2026-02-17 16:50:35
from 'file:views/project.tpl' */
/* @var \Smarty\Template $_smarty_tpl */
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
'version' => '5.7.0',
'unifunc' => 'content_698b49a6958128_21190238',
'unifunc' => 'content_69949c5bba2e78_15118675',
'has_nocache_code' => false,
'file_dependency' =>
array (
'e3f999d4206c004969123c0e3f74733796438d51' =>
array (
0 => 'views/project.tpl',
1 => 1770734029,
1 => 1771345389,
2 => 'file',
),
),
@ -21,18 +21,18 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
'file:../app/views/partials/preview.tpl' => 1,
),
))) {
function content_698b49a6958128_21190238 (\Smarty\Template $_smarty_tpl) {
function content_69949c5bba2e78_15118675 (\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views';
$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
?>
<?php
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_733012504698b49a694f3a4_14549542', "content");
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_168273369269949c5bb97b88_70245840', "content");
$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
}
/* {block "content"} */
class Block_733012504698b49a694f3a4_14549542 extends \Smarty\Runtime\Block
class Block_168273369269949c5bb97b88_70245840 extends \Smarty\Runtime\Block
{
public function callBlock(\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views';
@ -64,6 +64,33 @@ $_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views';
<label>Texte Portfolio</label>
<input type="text" name="textProject">
</div>
<div class="col-6">
<fieldset>
<legend class="form-label">Type de recherche par catégories</legend>
<div class="col-md-6">
<label for="author" class="form-label">Catégorie</label>
<select class="form-select" id="category" name="category">
<option value="0" <?php if ($_smarty_tpl->getValue('intCategory') == 0) {?>selected<?php }?>>Toutes les catégories</option>
<?php
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrCategory'), 'arrDetCategory');
$foreach0DoElse = true;
foreach ($_from ?? [] as $_smarty_tpl->getVariable('arrDetCategory')->value) {
$foreach0DoElse = false;
?>
<option value="<?php echo $_smarty_tpl->getValue('arrDetCategory')['category_id'];?>
"
<?php if ($_smarty_tpl->getValue('intCategory') == $_smarty_tpl->getValue('arrDetCategory')['category_id']) {?>selected<?php }?>
>
<?php echo $_smarty_tpl->getValue('arrDetCategory')['category_name'];?>
</option>
<?php
}
$_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
</select>
</div>
</fieldset>
</div>
<div>
<h3>Image thumbnail</h3>
<input name="imageThumbnail" class="form-control" type="file">
@ -73,7 +100,7 @@ $_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views';
<input name="imageProject" class="form-control" type="file">
</div>
<div class="mt-2">
<button type="submit" class="btn btn-primary btn-md" name="sendMessage">Envoyer</button>
<button type="submit" class="btn btn-primary btn-md" name="sendProject">Envoyer</button>
<button type="submit" class="btn btn-warning btn-md" name="toContinue">Remettre à plus tard</button>
</div>
</form>
@ -102,9 +129,9 @@ $_smarty_current_dir = 'C:\\wamp64\\www\\Folliow\\projet_php-guillaume\\views';
<div class="row mb-2">
<?php
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrProjectToDisplay'), 'objProject');
$foreach0DoElse = true;
$foreach1DoElse = true;
foreach ($_from ?? [] as $_smarty_tpl->getVariable('objProject')->value) {
$foreach0DoElse = false;
$foreach1DoElse = false;
?>
<?php $_smarty_tpl->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);
?>

View file

@ -74,24 +74,26 @@
</div>
{*Controle de l'utilisateur ainsi que du status du projet + Suppression disponible pour l'utilisateur possédant le projet*}
{if isset($smarty.session.user) and $smarty.session.user.user_status eq 2 or $smarty.session.user.user_id eq $objProject->getUser_id()}
{if isset($smarty.session.user)}
{if ($smarty.session.user.user_status == 2 || $smarty.session.user.user_id == $objProject->getUser_id())}
<div class="border rounded text-center">
<a class="btn btn-sm m-1 btn-danger" href="?ctrl=project&action=delete&id={$objProject->getId()}" name="toDelete">Supprimer le projet</a>
{/if}
{if isset($smarty.session.user) and $smarty.session.user.user_id eq $objProject->getUser_id()}
{if $smarty.session.user.user_id == $objProject->getUser_id()}
<a class="btn btn-sm m-1 btn-warning" href="?ctrl=project&action=addedit&id={$objProject->getId()}" name="toEdit">Modifier le projet</a>
{/if}
{*Conditions permettant au Modérateur de modifier le status d'un projet*}
{if isset($smarty.session.user) and $smarty.session.user.user_status eq 2 and $objProject->getStatus() eq "en_attente"}
{if $smarty.session.user.user_status == 2 && $objProject->getStatus() == "en_attente"}
<a class="btn btn-sm m-1 btn-success" href="?ctrl=project&action=accept&id={$objProject->getId()}" name="toPublished">Accepter</a>
<a class="btn btn-sm m-1 btn-warning" href="?ctrl=project&action=refuse&id={$objProject->getId()}" name="toRefused">Refuser</a>
</div>
{elseif $projectStatus eq "refusé"}
{elseif $projectStatus == "refusé"}
<p class="text-danger fw-bold">Portfolio refusé</p>
{/if}
{/if}
</div>

79
views/projet_display.tpl Normal file
View file

@ -0,0 +1,79 @@
{extends file="views/layout.tpl"}
{block name="content"}
<main class="container mt-5 py-5">
<!-- Message après l'envoi d'email -->
{if isset($smarty.get.mail) && $smarty.get.mail === 'ok'}
<div class="alert alert-success">Email envoyé avec succès.</div>
{elseif isset($smarty.get.mail) && $smarty.get.mail === 'fail'}
<div class="alert alert-danger">Erreur lors de l'envoi de l'email.</div>
{/if}
<div class="row g-4">
<!-- Contenu principal du projet -->
<div class="col-lg-8">
<h1 class="fw-bold">{$objProject->getTitle()}</h1>
<p class="text-muted">
{$arrProject.category_name ?? 'Général'}
</p>
<div class="mb-4 shadow-sm">
<img src=".{$objProject->getThumbnail()}"
class="img-fluid rounded w-100">
</div>
<div class="bg-light p-4 rounded mb-4">
<h4 class="border-bottom pb-2">Description</h4>
<p class="lead">{$objProject->getDescription()}</p>
<div class="mt-4">
{$objProject->getContent()}
</div>
</div>
<!-- Formulaire qui envoie la demande au contrôleur (sendEmail) -->
<div class="card shadow-sm p-4 mb-5">
<form method="post" action="index.php?ctrl=project&action=sendEmail">
<input type="hidden" name="project_id"
value="{$objProject->getId()}">
<input type="email" name="to_email"
class="form-control mb-3"
placeholder="Adresse email" required>
<button type="submit" class="btn btn-primary w-100">
Envoyer par email
</button>
</form>
</div>
</div>
<!-- Sidebar : informations du créateur -->
<div class="col-lg-4">
<div class="card text-center shadow-sm p-4">
<img src=".{$objProject->getUser_image()}"
class="rounded-circle mb-3 mx-auto"
style="width:100px;height:100px;object-fit:cover;">
<h5>{$objProject->getCreatorName()}</h5>
<p class="text-muted small">
Publié le {$objProject->getCreation_date()}
</p>
<button class="btn btn-primary">Contacter le talent</button>
</div>
</div>
</div>
</main>
{/block}