This commit is contained in:
Yass 2026-02-08 19:49:17 +01:00
parent aec3c845e0
commit edb6c00219
22 changed files with 941 additions and 69 deletions

View file

@ -1,13 +1,15 @@
<?php <?php
require("../app/models/project_model.php"); require("models/project_model.php");
require("../app/entities/project_entity.php"); require("entities/project_entity.php");
require("../app/models/category_model.php"); require("models/category_model.php");
require("../app/entities/category_entity.php"); require("entities/category_entity.php");
require("../app/models/image_model.php"); require("models/image_model.php");
require("../app/entities/image_entity.php"); require("entities/image_entity.php");
require("../app/models/user_model.php"); require("models/user_model.php");
require("../app/entities/user_entity.php"); require("entities/user_entity.php");
require("mother_controller.php");
/** /**
* Le controller de la partie accessible uniquement par l'admin * Le controller de la partie accessible uniquement par l'admin

View file

@ -20,7 +20,7 @@
public function home(){ public function home(){
$objProjectModel = new ProjectModel; $objProjectModel = new ProjectModel;
$arrProject = $objProjectModel->findAll(4); $arrProject = $objProjectModel->findAll();
$arrProjectToDisplay = array(); $arrProjectToDisplay = array();
foreach($arrProject as $arrDetProject){ foreach($arrProject as $arrDetProject){
$objProject = new Project; $objProject = new Project;
@ -28,9 +28,8 @@
$arrProjectToDisplay[] = $objProject; $arrProjectToDisplay[] = $objProject;
} }
//$this->_arrData['arrArticleToDisplay'] = $arrArticleToDisplay; $this->_arrData['arrProjectToDisplay'] = $arrProjectToDisplay;
var_dump($this->_arrData);
$this->_display("home"); $this->_display("home");
@ -71,9 +70,14 @@
$objCategoryModel = new CategoryModel; $objCategoryModel = new CategoryModel;
$arrCategory = $objCategoryModel->findAllCategory(); $arrCategory = $objCategoryModel->findAllCategory();
$this->_arrData['arrProjectToDisplay'] = $arrProjectToDisplay;
$this->_arrData['arrCategory'] = $arrCategory;
$this->_arrData['arrUser'] = $arrUser;
include('../app/views/search.php'); include('../app/views/search.php');
include('../app/views/partials/footer.php');
} }
/** /**

View file

@ -1,42 +1,41 @@
<?php <?php
/* Smarty version 5.7.0, created on 2026-02-04 21:47:55 /* Smarty version 5.7.0, created on 2026-02-06 08:21:14
from 'file:views/home.tpl' */ from 'file:views/home.tpl' */
/* @var \Smarty\Template $_smarty_tpl */ /* @var \Smarty\Template $_smarty_tpl */
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array ( if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
'version' => '5.7.0', 'version' => '5.7.0',
'unifunc' => 'content_6983be8b334a57_18130562', 'unifunc' => 'content_6985a47abcda40_19846426',
'has_nocache_code' => false, 'has_nocache_code' => false,
'file_dependency' => 'file_dependency' =>
array ( array (
'0f54e8b5c9bcafd01d94486bfa02ee91c2c5fe68' => '299f75d7692a19207f23bf5795a2721f507c3fc6' =>
array ( array (
0 => 'views/home.tpl', 0 => 'views/home.tpl',
1 => 1770240896, 1 => 1770365364,
2 => 'file', 2 => 'file',
), ),
), ),
'includes' => 'includes' =>
array ( array (
'file:views/partials/preview.php' => 1, 'file:views/_partial/preview.tpl' => 1,
), ),
))) { ))) {
function content_6983be8b334a57_18130562 (\Smarty\Template $_smarty_tpl) { function content_6985a47abcda40_19846426 (\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'D:\\projetphp\\views'; $_smarty_current_dir = 'C:\\wamp64\\www\\projetphp\\views';
$_smarty_tpl->getInheritance()->init($_smarty_tpl, false); $_smarty_tpl->getInheritance()->init($_smarty_tpl, false);
?> ?>
<?php ob_start(); <?php
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_16697957106983be8b32f404_81038557', "content"); $_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_3150142016985a47abb6c29_00747518', "content");
$_prefixVariable1 = ob_get_clean(); ?>
echo $_prefixVariable1;?>
<?php } <?php }
/* {block "content"} */ /* {block "content"} */
class Block_16697957106983be8b32f404_81038557 extends \Smarty\Runtime\Block class Block_3150142016985a47abb6c29_00747518 extends \Smarty\Runtime\Block
{ {
public function callBlock(\Smarty\Template $_smarty_tpl) { public function callBlock(\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'D:\\projetphp\\views'; $_smarty_current_dir = 'C:\\wamp64\\www\\projetphp\\views';
?> ?>
<section class="container mt-5 p-5 d-flex flex-column align-items-center text-center"> <section class="container mt-5 p-5 d-flex flex-column align-items-center text-center">
@ -52,12 +51,12 @@ $_smarty_current_dir = 'D:\\projetphp\\views';
<div class="row mb-2"> <div class="row mb-2">
<?php <?php
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrArticleToDisplay'), 'objArticle'); $_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrProjectToDisplay'), 'objProject');
$foreach0DoElse = true; $foreach0DoElse = true;
foreach ($_from ?? [] as $_smarty_tpl->getVariable('objArticle')->value) { foreach ($_from ?? [] as $_smarty_tpl->getVariable('objProject')->value) {
$foreach0DoElse = false; $foreach0DoElse = false;
?> ?>
<?php $_smarty_tpl->renderSubTemplate("file:views/partials/preview.php", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir); <?php $_smarty_tpl->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);
?> ?>
<?php <?php
} }

View file

@ -0,0 +1,66 @@
<?php
/* Smarty version 5.7.0, created on 2026-02-06 08:21:14
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_6985a47ad585d5_25749521',
'has_nocache_code' => false,
'file_dependency' =>
array (
'c724044e55872f26030b02de6dcd14dc34a20b16' =>
array (
0 => 'views/_partial/preview.tpl',
1 => 1770365554,
2 => 'file',
),
),
'includes' =>
array (
),
))) {
function content_6985a47ad585d5_25749521 (\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\projetphp\\views\\_partial';
?><article class="col-md-3 mb-4">
<div class="card h-100 shadow-sm article-card">
<div class="ratio ratio-16x9">
<img src=".<?php echo $_smarty_tpl->getValue('objProject')->getThumbnail();?>
"
class="w-100 h-100 object-fit-cover"
alt=""
loading="lazy">
</div>
<div class="d-flex align-items-start gap-3">
<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;"
alt="Photo de profil">
<div class="flex-grow-1 card-body p-3">
<h3 class="h6 mb-1"><?php echo $_smarty_tpl->getValue('objProject')->getTitle();?>
</h3>
<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();?>
</small>
<a href="?id=<?php echo $_smarty_tpl->getValue('objProject')->getId();?>
"
class="stretched-link small">
Lire la suite
</a>
</div>
</div>
</div>
</article><?php }
}

View file

@ -1,12 +1,12 @@
<?php <?php
require("../app/models/user_model.php"); require("models/user_model.php");
require("../app/entities/user_entity.php"); require("entities/user_entity.php");
require("mother_controller.php");
class UserCtrl{ class UserCtrl extends MotherCtrl {
public function login(){ public function login(){
include("../app/views/partials/header.php");
$strMail = $_POST['mail']??""; $strMail = $_POST['mail']??"";
$strPwd = $_POST['pwd']??""; $strPwd = $_POST['pwd']??"";
@ -40,8 +40,12 @@ class UserCtrl{
} }
} }
} }
include("../app/views/login.php"); $this->_arrData['arrError'] = $arrError;
include("../app/views/partials/footer.php");
$this->_display("login");
} }
@ -63,9 +67,6 @@ class UserCtrl{
public function signin(){ public function signin(){
// Inclusion du header
include("../app/views/partials/header.php");
// Entité pour réafficher les valeurs dans le formulaire // Entité pour réafficher les valeurs dans le formulaire
$objUser = new User(); $objUser = new User();
@ -138,8 +139,7 @@ class UserCtrl{
} }
// Affichage de la vue inscription // Affichage de la vue inscription
include("../app/views/inscription.php"); $this->_display("inscription");
include("../app/views/partials/footer.php");
} }

View file

@ -0,0 +1,218 @@
<?php
/* Smarty version 5.7.0, created on 2026-02-06 08:34:07
from 'file:views/inscription.tpl' */
/* @var \Smarty\Template $_smarty_tpl */
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
'version' => '5.7.0',
'unifunc' => 'content_6985a77f8dfcd0_35158098',
'has_nocache_code' => false,
'file_dependency' =>
array (
'6a0422fe7dc4be4b812fa3545dad4b27dd58fe64' =>
array (
0 => 'views/inscription.tpl',
1 => 1770366787,
2 => 'file',
),
),
'includes' =>
array (
),
))) {
function content_6985a77f8dfcd0_35158098 (\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\projetphp\\views';
$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
?>
<?php
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_4039535986985a77f8da504_37962670', "content");
$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
}
/* {block "content"} */
class Block_4039535986985a77f8da504_37962670 extends \Smarty\Runtime\Block
{
public function callBlock(\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\projetphp\\views';
?>
<!-- Page : Inscription -->
<main class="container py-5">
<!-- Centrage horizontal du formulaire -->
<div class="row justify-content-center">
<div class="col-12 col-md-10 col-lg-6">
<!-- Carte contenant le formulaire d'inscription -->
<div class="card shadow-sm border-0 rounded-4 p-4 p-lg-5">
<!-- Titre principal de la page -->
<h1 class="h3 fw-bold mb-1">Inscription</h1>
<!-- Texte descriptif -->
<p class="text-secondary mb-4">
Créez votre compte utilisateur.
</p>
<!-- Formulaire d'inscription -->
<!-- Les données seront traitées côté serveur en PHP via la méthode POST -->
<form method="POST">
<div class="row g-3">
<!-- Champ : prénom de l'utilisateur -->
<div class="col-md-6">
<label class="form-label" for="user_firstname">
Prénom *
</label>
<input
class="form-control"
type="text"
id="user_firstname"
name="user_firstname"
required >
</div>
<!-- Champ : nom de l'utilisateur -->
<div class="col-md-6">
<label class="form-label" for="user_name">
Nom *
</label>
<input
class="form-control"
type="text"
id="user_name"
name="user_name"
required
>
</div>
<!-- Champ : pseudo -->
<div class="col-12">
<label class="form-label" for="user_pseudo">
Pseudo *
</label>
<div class="input-group">
<span class="input-group-text">@</span>
<input
class="form-control"
type="text"
id="user_pseudo"
name="user_pseudo"
required
>
</div>
</div>
<!-- Champ : adresse e-mail -->
<div class="col-12">
<label class="form-label" for="user_mail">
Adresse e-mail *
</label>
<input
class="form-control"
type="email"
id="user_mail"
name="user_mail"
required
>
</div>
<!-- Champ : mot de passe -->
<div class="col-12">
<label class="form-label" for="user_password">
Mot de passe *
</label>
<input
class="form-control"
type="password"
id="user_password"
name="user_password"
required
>
</div>
<!-- Champ optionnel : numéro de téléphone -->
<div class="col-12">
<label class="form-label" for="user_phone">
Téléphone
</label>
<input
class="form-control"
type="text"
id="user_phone"
name="user_phone"
>
</div>
<!-- Champ optionnel : profession de l'utilisateur -->
<div class="col-12">
<label class="form-label" for="user_work">
Profession
</label>
<input
class="form-control"
type="text"
id="user_work"
name="user_work"
>
</div>
<!-- Champ optionnel : localisation de l'utilisateur -->
<div class="col-12">
<label class="form-label" for="user_location">
Localisation
</label>
<input
class="form-control"
type="text"
id="user_location"
name="user_location"
>
</div>
<!-- Champ optionnel : phrase d'accroche -->
<div class="col-12">
<label class="form-label" for="user_description">
Phrase d'accroche
</label>
<textarea
class="form-control"
id="user_description"
name="user_description"
rows="3"
></textarea>
</div>
<!-- Bouton de soumission du formulaire -->
<div class="col-12 d-grid mt-2">
<button type="submit" class="btn btn-primary btn-lg rounded-3">
Créer mon compte
</button>
</div>
<!-- Lien vers la page de connexion -->
<div class="col-12 text-center">
<small class="text-secondary">
Déjà un compte ?
<a href="index.php?ctrl=user&action=login">Se connecter</a>
</small>
</div>
</form>
</div>
</div>
</div>
</div>
</main>
<?php
}
}
/* {/block "content"} */
}

View file

@ -0,0 +1,83 @@
<?php
/* Smarty version 5.7.0, created on 2026-02-06 08:34:12
from 'file:views/login.tpl' */
/* @var \Smarty\Template $_smarty_tpl */
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
'version' => '5.7.0',
'unifunc' => 'content_6985a7843b8a09_57121812',
'has_nocache_code' => false,
'file_dependency' =>
array (
'7a5d14230a80bcfb142dfc9d5f8ae68eb5c308ba' =>
array (
0 => 'views/login.tpl',
1 => 1770366310,
2 => 'file',
),
),
'includes' =>
array (
),
))) {
function content_6985a7843b8a09_57121812 (\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\projetphp\\views';
$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
?>
<?php
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_10260818746985a7843a3c23_56661515', "content");
$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
}
/* {block "content"} */
class Block_10260818746985a7843a3c23_56661515 extends \Smarty\Runtime\Block
{
public function callBlock(\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\projetphp\\views';
?>
<section aria-label="Se connecter">
<?php if ($_smarty_tpl->getSmarty()->getModifierCallback('count')($_smarty_tpl->getValue('arrError')) > 0) {?>
<div class="alert alert-danger">
<?php
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrError'), 'strError');
$foreach0DoElse = true;
foreach ($_from ?? [] as $_smarty_tpl->getVariable('strError')->value) {
$foreach0DoElse = false;
?>
<p><?php echo $_smarty_tpl->getValue('strError');?>
</p>
<?php
}
$_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
</div>
<?php }?>
<form method="post">
<p>
<label>Mail:</label>
<input name="mail"
value="<?php echo (($tmp = $_smarty_tpl->getValue('strMail') ?? null)===null||$tmp==='' ? '' ?? null : $tmp);?>
"
class="form-control <?php if ((true && (true && null !== ($_smarty_tpl->getValue('arrError')['mail'] ?? null)))) {?>is-invalid<?php }?>"
type="email">
</p>
<p>
<label>Mot de passe:</label>
<input name="pwd"
class="form-control <?php if ((true && (true && null !== ($_smarty_tpl->getValue('arrError')['pwd'] ?? null)))) {?>is-invalid<?php }?>"
type="password">
</p>
<p>
<input class="form-control btn btn-primary" type="submit" value="Se connecter">
</p>
</form>
</section>
<?php
}
}
/* {/block "content"} */
}

View file

@ -0,0 +1,69 @@
<?php
/* Smarty version 5.7.0, created on 2026-02-06 12:00:58
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_6985d7fac4c158_24962671',
'has_nocache_code' => false,
'file_dependency' =>
array (
'8a75168f6980e04270d359ecf544040a414ed627' =>
array (
0 => 'views/_partial/preview.tpl',
1 => 1770366777,
2 => 'file',
),
),
'includes' =>
array (
),
))) {
function content_6985d7fac4c158_24962671 (\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\projetphp\\views\\_partial';
?>
<article class="col-md-3 mb-4">
<div class="card h-100 shadow-sm article-card">
<div class="ratio ratio-16x9">
<img src=".<?php echo $_smarty_tpl->getValue('objProject')->getThumbnail();?>
"
class="w-100 h-100 object-fit-cover"
alt=""
loading="lazy">
</div>
<div class="d-flex align-items-start gap-3">
<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;"
alt="Photo de profil">
<div class="flex-grow-1 card-body p-3">
<h3 class="h6 mb-1"><?php echo $_smarty_tpl->getValue('objProject')->getTitle();?>
</h3>
<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();?>
</small>
<a href="?id=<?php echo $_smarty_tpl->getValue('objProject')->getId();?>
"
class="stretched-link small">
Lire la suite
</a>
</div>
</div>
</div>
</article><?php }
}

View file

@ -0,0 +1,63 @@
<?php
/* Smarty version 5.7.0, created on 2026-02-06 12:00:58
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_6985d7fad9ae79_00567614',
'has_nocache_code' => false,
'file_dependency' =>
array (
'98cc8c099e0c6b2a1fe1eaa5fc81e6e357127f49' =>
array (
0 => 'views/_partial/footer.tpl',
1 => 1770363982,
2 => 'file',
),
),
'includes' =>
array (
),
))) {
function content_6985d7fad9ae79_00567614 (\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\projetphp\\views\\_partial';
?>
<footer class="footer container-fluid d-flex justify-content-around">
<div class="col-3">
<ul>
<li><a href="#">Découvrir</a>
<li><a href="#">Customisation</a>
<li><a href="#">Emploi</a>
<li><a href="#">A propos</a>
</ul>
</div>
<div class="col-3">
<ul>
<li><a href="#">Recruter</a>
<li><a href="#">Partenariat</a>
<li><a href="#">Blog</a>
<li><a href="#">Aide et support</a>
</ul>
</div>
<div class="col-3">
<ul>
<li><a href="#">Politique de confidentialité</a>
<li><a href="#">Politique sur les données</a>
<li><a href="#">CGU</a>
<li><a href="#">CGV</a>
</ul>
</div>
<div class="col-3">
<p>Suivez-nous</p>
</div>
</footer>
<?php echo '<script'; ?>
src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"><?php echo '</script'; ?>
>
<?php echo '<script'; ?>
src="js/scripts.js"><?php echo '</script'; ?>
>
</body>
</html><?php }
}

View file

@ -0,0 +1,50 @@
<?php
/* Smarty version 5.7.0, created on 2026-02-06 12:00:58
from 'file:views/layout.tpl' */
/* @var \Smarty\Template $_smarty_tpl */
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
'version' => '5.7.0',
'unifunc' => 'content_6985d7faa97148_49592200',
'has_nocache_code' => false,
'file_dependency' =>
array (
'e18412d61db50ad0096e53056a7c17f1dc50fcde' =>
array (
0 => 'views/layout.tpl',
1 => 1770366174,
2 => 'file',
),
),
'includes' =>
array (
'file:views/_partial/header.tpl' => 1,
'file:views/_partial/footer.tpl' => 1,
),
))) {
function content_6985d7faa97148_49592200 (\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\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);
?>
<?php
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_5420313386985d7faa93b13_94487614', "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_5420313386985d7faa93b13_94487614 extends \Smarty\Runtime\Block
{
public function callBlock(\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\projetphp\\views';
?>
<?php
}
}
/* {/block "content"} */
}

View file

@ -0,0 +1,71 @@
<?php
/* Smarty version 5.7.0, created on 2026-02-06 12:00:58
from 'file:views/home.tpl' */
/* @var \Smarty\Template $_smarty_tpl */
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
'version' => '5.7.0',
'unifunc' => 'content_6985d7fa8af3a1_55395258',
'has_nocache_code' => false,
'file_dependency' =>
array (
'ec3d3ee358d0cb60e3d7bc28a51149e2e63b3bf1' =>
array (
0 => 'views/home.tpl',
1 => 1770366165,
2 => 'file',
),
),
'includes' =>
array (
'file:views/_partial/preview.tpl' => 1,
),
))) {
function content_6985d7fa8af3a1_55395258 (\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\projetphp\\views';
$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
?>
<?php
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_10419637376985d7fa8a0f96_31902176', "content");
?>
<?php $_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
}
/* {block "content"} */
class Block_10419637376985d7fa8a0f96_31902176 extends \Smarty\Runtime\Block
{
public function callBlock(\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\projetphp\\views';
?>
<section class="container mt-5 p-5 d-flex flex-column align-items-center text-center">
<h1 class="logo">Folliow</h1>
<h2> les talents rencontrent leur avenir</h2>
<p class="col-6">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.</p>
</section>
<section class="container" aria-label="Articles récents">
<h2 class="visually-hidden">Les 4 derniers articles</h2>
<div class="row mb-2">
<?php
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrProjectToDisplay'), 'objProject');
$foreach0DoElse = true;
foreach ($_from ?? [] as $_smarty_tpl->getVariable('objProject')->value) {
$foreach0DoElse = false;
?>
<?php $_smarty_tpl->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);
?>
<?php
}
$_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
</section>
<?php
}
}
/* {/block "content"} */
}

View file

@ -0,0 +1,108 @@
<?php
/* Smarty version 5.7.0, created on 2026-02-06 12:00:58
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_6985d7fab71ca5_68849299',
'has_nocache_code' => false,
'file_dependency' =>
array (
'fa32ecfd2db3b295fbf8f80cb970eb1abb3c21fb' =>
array (
0 => 'views/_partial/header.tpl',
1 => 1770363982,
2 => 'file',
),
),
'includes' =>
array (
),
))) {
function content_6985d7fab71ca5_68849299 (\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\projetphp\\views\\_partial';
?><!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="assests/css/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
<?php echo '<script'; ?>
src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"><?php echo '</script'; ?>
>
<title>Folliow</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light">
<div class="container-fluid">
<a class="navbar-brand d-flex align-items-center" href="#">
<img src="assests/img/logo.png" alt="Logo" class="logo-image">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<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>
<li class="nav-item">
<a class="nav-link" href="?ctrl=project&action=search">Rechercher</a>
</li>
</ul>
<nav class="col-4 d-flex justify-content-end align-items-center" aria-label="Connexion utilisateur">
<?php if (!(true && (true && null !== ($_SESSION['user'] ?? null)))) {?>
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="index.php?ctrl=user&action=signin" title="Créer un compte" aria-label="Créer un compte">
S'inscrire
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="index.php?ctrl=user&action=login" title="Se connecter" aria-label="Se connecter">
Se connecter
</a>
</li>
</ul>
<?php } else { ?>
<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'];?>
"
class="rounded-circle flex-shrink-0 mt-2 ml-5"
style="width: 36px; height: 36px; object-fit: cover;"
alt="Photo de profil">
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="index.php?ctrl=user&action=logout" title="Se déconnecter" aria-label="Se déconnecter">
Logout
</a>
</li>
</ul>
<?php }?>
</nav>
</div>
</div>
</nav>
</body>
</html><?php }
}

View file

@ -1,3 +1,6 @@
<article class="col-md-3 mb-4"> <article class="col-md-3 mb-4">
<div class="card h-100 shadow-sm article-card"> <div class="card h-100 shadow-sm article-card">

34
views/footer.tpl Normal file
View file

@ -0,0 +1,34 @@
<footer class="footer container-fluid d-flex justify-content-around">
<div class="col-3">
<ul>
<li><a href="#">Découvrir</a>
<li><a href="#">Customisation</a>
<li><a href="#">Emploi</a>
<li><a href="#">A propos</a>
</ul>
</div>
<div class="col-3">
<ul>
<li><a href="#">Recruter</a>
<li><a href="#">Partenariat</a>
<li><a href="#">Blog</a>
<li><a href="#">Aide et support</a>
</ul>
</div>
<div class="col-3">
<ul>
<li><a href="#">Politique de confidentialité</a>
<li><a href="#">Politique sur les données</a>
<li><a href="#">CGU</a>
<li><a href="#">CGV</a>
</ul>
</div>
<div class="col-3">
<p>Suivez-nous</p>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
<script src="js/scripts.js"></script>
</body>
</html>

86
views/header.tpl Normal file
View file

@ -0,0 +1,86 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="assests/css/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
<script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script>
<title>Folliow</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light">
<div class="container-fluid">
{* Logo *}
<a class="navbar-brand d-flex align-items-center" href="#">
<img src="assests/img/logo.png" alt="Logo" class="logo-image">
</a>
{* Toggler pour mobile *}
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
{* Menu de navigation *}
<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>
<li class="nav-item">
<a class="nav-link" href="?ctrl=project&action=search">Rechercher</a>
</li>
</ul>
{* Menu secondaire *}
<nav class="col-4 d-flex justify-content-end align-items-center" aria-label="Connexion utilisateur">
{if !isset($smarty.session.user)}
{* Utilisateur non connecté *}
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="index.php?ctrl=user&action=signin" title="Créer un compte" aria-label="Créer un compte">
S'inscrire
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="index.php?ctrl=user&action=login" title="Se connecter" aria-label="Se connecter">
Se connecter
</a>
</li>
</ul>
{else}
{* Utilisateur connecté *}
<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=".{$smarty.session.user.user_image}"
class="rounded-circle flex-shrink-0 mt-2 ml-5"
style="width: 36px; height: 36px; object-fit: cover;"
alt="Photo de profil">
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="index.php?ctrl=user&action=logout" title="Se déconnecter" aria-label="Se déconnecter">
Logout
</a>
</li>
</ul>
{/if}
</nav>
</div>
</div>
</nav>
</body>
</html>

View file

@ -1,3 +1,4 @@
{extends file="views/layout.tpl"}
{block name="content"} {block name="content"}
<section class="container mt-5 p-5 d-flex flex-column align-items-center text-center"> <section class="container mt-5 p-5 d-flex flex-column align-items-center text-center">
@ -12,8 +13,8 @@
<h2 class="visually-hidden">Les 4 derniers articles</h2> <h2 class="visually-hidden">Les 4 derniers articles</h2>
<div class="row mb-2"> <div class="row mb-2">
{foreach from=$arrArticleToDisplay item=objArticle} {foreach from=$arrProjectToDisplay item=objProject}
{include file="views/partials/preview.php"} {include file="views/_partial/preview.tpl"}
{/foreach} {/foreach}
</section> </section>
{{/block}} {/block}

View file

@ -1,4 +1,6 @@
{extends file="views/layout.tpl"}
{block name="content"}
<!-- Page : Inscription --> <!-- Page : Inscription -->
@ -173,3 +175,4 @@
</div> </div>
</div> </div>
</main> </main>
{/block}

View file

@ -1,7 +1,7 @@
{include file="./views/partials/header.tpl"} {include file="views/_partial/header.tpl"}
{block name="content"} {block name="content"}
{/block} {/block}
{include file="./views/partials/footer.tpl"} {include file="views/_partial/footer.tpl"}

View file

@ -1,23 +0,0 @@
<section aria-label="Se connecter">
<?php if (count($arrError) > 0) {?>
<div class="alert alert-danger">
<?php foreach ($arrError as $strError){ ?>
<p><?php echo $strError; ?></p>
<?php } ?>
</div>
<?php } ?>
<form method="post">
<p>
<label>Mail:</label>
<input name="mail" value="<?php echo($strMail); ?>"
class="form-control <?php if (isset($arrError['mail'])) { echo 'is-invalid'; } ?> " type="text" >
</p>
<p>
<label>Mot de passe:</label>
<input name="pwd" class="form-control <?php if (isset($arrError['pwd'])) { echo 'is-invalid'; } ?> " type="text" >
</p>
<p>
<input class="form-control btn btn-primary" type="submit" >
</p>
</form>
</section>

35
views/login.tpl Normal file
View file

@ -0,0 +1,35 @@
{extends file="views/layout.tpl"}
{block name="content"}
<section aria-label="Se connecter">
{* Affichage des erreurs *}
{if $arrError|count > 0}
<div class="alert alert-danger">
{foreach from=$arrError item=strError}
<p>{$strError}</p>
{/foreach}
</div>
{/if}
<form method="post">
<p>
<label>Mail:</label>
<input name="mail"
value="{$strMail|default:''}"
class="form-control {if isset($arrError.mail)}is-invalid{/if}"
type="email">
</p>
<p>
<label>Mot de passe:</label>
<input name="pwd"
class="form-control {if isset($arrError.pwd)}is-invalid{/if}"
type="password">
</p>
<p>
<input class="form-control btn btn-primary" type="submit" value="Se connecter">
</p>
</form>
</section>
{/block}