Modification et ajout de catégorie fonctionne. Accès page admin protété
This commit is contained in:
parent
2535d13d7c
commit
3a80108ba5
11 changed files with 338 additions and 126 deletions
|
|
@ -18,32 +18,29 @@
|
||||||
class AdminCtrl extends MotherCtrl{
|
class AdminCtrl extends MotherCtrl{
|
||||||
|
|
||||||
public function admin(){
|
public function admin(){
|
||||||
/*accès à la page admin
|
|
||||||
if (!isset($_SESSION['user']) && ($_SESSION['user']['user_status'] != 1 )){
|
if (!isset($_SESSION['user']) && ($_SESSION['user']['user_status'] != 1 )){
|
||||||
header("Location:index.php?ctrl=error&action=error_403");
|
header("Location:index.php?ctrl=error&action=error_403");
|
||||||
exit;
|
exit;
|
||||||
}*/
|
}
|
||||||
$objCategoryModel = new CategoryModel;
|
$objCategoryModel = new CategoryModel;
|
||||||
|
|
||||||
if (!empty($_POST['new_category'])) {
|
if (!empty($_POST['new_category'])) {
|
||||||
$objNewCategory = new Category;
|
$newCat = new Category();
|
||||||
if (!empty($objNewCategory->getName())) {
|
$newCat->setName($_POST['new_category']);
|
||||||
$objNewCategory = $_POST['new_category'];
|
$objCategoryModel->insertCategory($newCat);
|
||||||
$objCategoryModel->insertCategory($objNewCategory);
|
header('Location: index.php?ctrl=admin&action=admin');
|
||||||
header("Location:index.php?ctrl=admin&action=admin");
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($_POST['edit_category'])) {
|
if (!empty($_POST['id_to_edit']) && !empty($_POST['new_name'])) {
|
||||||
$objEditCategory = new Category;
|
$editCat = new Category();
|
||||||
if ($objEditCategory->getId() > 0) {
|
$editCat->setId($_POST['id_to_edit']);
|
||||||
$objEditCategory = $_POST['edit_category'];
|
$editCat->setName($_POST['new_name']);
|
||||||
$objCategoryModel->editCategory($objEditCategory);
|
$objCategoryModel->editCategory($editCat);
|
||||||
header("Location:index.php?ctrl=admin&action=admin");
|
header('Location: index.php?ctrl=admin&action=admin');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$arrCategory = $objCategoryModel->findAllCategory();
|
$arrCategory = $objCategoryModel->findAllCategory();
|
||||||
$arrCategoryToDisplay = array();
|
$arrCategoryToDisplay = array();
|
||||||
|
|
@ -54,8 +51,8 @@
|
||||||
$arrCategoryToDisplay[] = $objCategory;
|
$arrCategoryToDisplay[] = $objCategory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//gérer l'affichage
|
||||||
$this->_arrData['arrCategoryToDisplay'] = $arrCategoryToDisplay;
|
$this->_arrData['arrCategoryToDisplay'] = $arrCategoryToDisplay;
|
||||||
//$this->_arrData['intCategory'] = $objCategoryModel->;
|
|
||||||
$this->_display("admin");
|
$this->_display("admin");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@
|
||||||
try{
|
try{
|
||||||
// Connexion à la base de données
|
// Connexion à la base de données
|
||||||
$this->_db = new PDO(
|
$this->_db = new PDO(
|
||||||
"mysql:host=boulayoune.com;dbname=projet_folliow", // Serveur et BDD
|
"mysql:host=localhost;dbname=projet_folliow", // Serveur et BDD mysql:host=boulayoune.com;dbname=projet_folliow
|
||||||
"projet_user", //Nom d'utilisateur de la base de données
|
"root", //Nom d'utilisateur de la base de données projet_user
|
||||||
"F0lliowRules!",// Mot de passe de la base de données
|
"",// Mot de passe de la base de données F0lliowRules!
|
||||||
array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC) // Mode de renvoi
|
array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC) // Mode de renvoi
|
||||||
);
|
);
|
||||||
// Pour résoudre les problèmes d’encodage
|
// Pour résoudre les problèmes d’encodage
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,164 @@
|
||||||
|
<?php
|
||||||
|
/* Smarty version 5.7.0, created on 2026-02-09 13:22:09
|
||||||
|
from 'file:views/login.tpl' */
|
||||||
|
|
||||||
|
/* @var \Smarty\Template $_smarty_tpl */
|
||||||
|
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||||
|
'version' => '5.7.0',
|
||||||
|
'unifunc' => 'content_6989df814ecac5_82975272',
|
||||||
|
'has_nocache_code' => false,
|
||||||
|
'file_dependency' =>
|
||||||
|
array (
|
||||||
|
'5375cd75c92fd8c801b429efee0d6437582d377e' =>
|
||||||
|
array (
|
||||||
|
0 => 'views/login.tpl',
|
||||||
|
1 => 1770634036,
|
||||||
|
2 => 'file',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'includes' =>
|
||||||
|
array (
|
||||||
|
),
|
||||||
|
))) {
|
||||||
|
function content_6989df814ecac5_82975272 (\Smarty\Template $_smarty_tpl) {
|
||||||
|
$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views';
|
||||||
|
$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_10819558166989df814817a5_66837906', "content");
|
||||||
|
$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
|
||||||
|
}
|
||||||
|
/* {block "content"} */
|
||||||
|
class Block_10819558166989df814817a5_66837906 extends \Smarty\Runtime\Block
|
||||||
|
{
|
||||||
|
public function callBlock(\Smarty\Template $_smarty_tpl) {
|
||||||
|
$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\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 }?>
|
||||||
|
<!-- Contenu principal de la page -->
|
||||||
|
<main class="container py-5">
|
||||||
|
|
||||||
|
<!-- Centrage horizontal du formulaire -->
|
||||||
|
<div class="row justify-content-center">
|
||||||
|
<!-- Contenu principal de la page -->
|
||||||
|
<main class="container py-5">
|
||||||
|
|
||||||
|
<!-- Centrage horizontal du formulaire -->
|
||||||
|
<div class="row justify-content-center">
|
||||||
|
<div class="col-12 col-md-8 col-lg-5">
|
||||||
|
|
||||||
|
<!-- Carte contenant le formulaire de connexion -->
|
||||||
|
<div class="card shadow-sm border-0 rounded-4 p-4 p-lg-5">
|
||||||
|
|
||||||
|
<!-- Titre principal -->
|
||||||
|
<h1 class="h3 fw-bold mb-1">Connexion</h1>
|
||||||
|
|
||||||
|
<!-- Texte descriptif -->
|
||||||
|
<p class="text-secondary mb-4">
|
||||||
|
Connectez-vous à votre compte.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<!-- Formulaire de connexion -->
|
||||||
|
<!-- Le traitement sera effectué en PHP via la méthode POST -->
|
||||||
|
<form method="POST">
|
||||||
|
|
||||||
|
<div class="row g-3">
|
||||||
|
|
||||||
|
<!-- Champ : adresse e-mail de l'utilisateur -->
|
||||||
|
<div class="col-12">
|
||||||
|
<label for="user_mail" class="form-label">
|
||||||
|
Adresse e-mail
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
value="<?php echo (($tmp = $_smarty_tpl->getValue('strMail') ?? null)===null||$tmp==='' ? '' ?? null : $tmp);?>
|
||||||
|
"
|
||||||
|
type="email"
|
||||||
|
class="form-control <?php if ((true && (true && null !== ($_smarty_tpl->getValue('arrError')['mail'] ?? null)))) {?>is-invalid<?php }?>"
|
||||||
|
id="user_mail"
|
||||||
|
name="user_mail"
|
||||||
|
required
|
||||||
|
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Champ : mot de passe -->
|
||||||
|
<div class="col-12">
|
||||||
|
<label for="user_password" class="form-label">
|
||||||
|
Mot de passe
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
type="password"
|
||||||
|
class="form-control <?php if ((true && (true && null !== ($_smarty_tpl->getValue('arrError')['pwd'] ?? null)))) {?>is-invalid<?php }?>"
|
||||||
|
id="user_password"
|
||||||
|
name="user_password"
|
||||||
|
required
|
||||||
|
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Option "Se souvenir de moi" (fonctionnalité optionnelle côté PHP) -->
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" id="remember_me" name="remember_me">
|
||||||
|
<label class="form-check-label" for="remember_me">
|
||||||
|
Se souvenir de moi
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</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">
|
||||||
|
Se connecter
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Lien vers la page d'inscription -->
|
||||||
|
<div class="col-12 text-center">
|
||||||
|
<small class="text-secondary">
|
||||||
|
Pas encore de compte ?
|
||||||
|
<a href="index.php?ctrl=user&action=signin" class="link-primary">Créer un compte</a>
|
||||||
|
</small>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Lien pour la récupération du mot de passe -->
|
||||||
|
<div class="col-12 text-center">
|
||||||
|
<small>
|
||||||
|
<a href="#" class="link-primary">
|
||||||
|
Mot de passe oublié ?
|
||||||
|
</a>
|
||||||
|
</small>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</section>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* {/block "content"} */
|
||||||
|
}
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
/* Smarty version 5.7.0, created on 2026-02-09 12:29:17
|
/* Smarty version 5.7.0, created on 2026-02-09 13:26:33
|
||||||
from 'file:views/layout.tpl' */
|
from 'file:views/layout.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_6989d31d7d28c9_01506908',
|
'unifunc' => 'content_6989e0891f99a9_84268185',
|
||||||
'has_nocache_code' => false,
|
'has_nocache_code' => false,
|
||||||
'file_dependency' =>
|
'file_dependency' =>
|
||||||
array (
|
array (
|
||||||
|
|
@ -22,21 +22,21 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||||
'file:views/_partial/footer.tpl' => 1,
|
'file:views/_partial/footer.tpl' => 1,
|
||||||
),
|
),
|
||||||
))) {
|
))) {
|
||||||
function content_6989d31d7d28c9_01506908 (\Smarty\Template $_smarty_tpl) {
|
function content_6989e0891f99a9_84268185 (\Smarty\Template $_smarty_tpl) {
|
||||||
$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views';
|
$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views';
|
||||||
$_smarty_tpl->getInheritance()->init($_smarty_tpl, false);
|
$_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);
|
$_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
|
<?php
|
||||||
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_8131712286989d31d7cfb58_06071603', "content");
|
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_1226719426989e0891f66b5_10703637', "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);
|
<?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"} */
|
/* {block "content"} */
|
||||||
class Block_8131712286989d31d7cfb58_06071603 extends \Smarty\Runtime\Block
|
class Block_1226719426989e0891f66b5_10703637 extends \Smarty\Runtime\Block
|
||||||
{
|
{
|
||||||
public function callBlock(\Smarty\Template $_smarty_tpl) {
|
public function callBlock(\Smarty\Template $_smarty_tpl) {
|
||||||
$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views';
|
$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views';
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
/* Smarty version 5.7.0, created on 2026-02-09 12:29:17
|
/* Smarty version 5.7.0, created on 2026-02-09 13:26:32
|
||||||
from 'file:views/admin.tpl' */
|
from 'file:views/admin.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_6989d31d65c3a2_79771570',
|
'unifunc' => 'content_6989e088f38338_64666135',
|
||||||
'has_nocache_code' => false,
|
'has_nocache_code' => false,
|
||||||
'file_dependency' =>
|
'file_dependency' =>
|
||||||
array (
|
array (
|
||||||
'ac77f39f91cdf26a0eb3f0963ead4008a7bda8fb' =>
|
'ac77f39f91cdf26a0eb3f0963ead4008a7bda8fb' =>
|
||||||
array (
|
array (
|
||||||
0 => 'views/admin.tpl',
|
0 => 'views/admin.tpl',
|
||||||
1 => 1770640156,
|
1 => 1770643565,
|
||||||
2 => 'file',
|
2 => 'file',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -20,18 +20,18 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||||
array (
|
array (
|
||||||
),
|
),
|
||||||
))) {
|
))) {
|
||||||
function content_6989d31d65c3a2_79771570 (\Smarty\Template $_smarty_tpl) {
|
function content_6989e088f38338_64666135 (\Smarty\Template $_smarty_tpl) {
|
||||||
$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views';
|
$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views';
|
||||||
$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
|
$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_20302301596989d31d64f310_54306383', "content");
|
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_19184882506989e088f2e080_15773704', "content");
|
||||||
$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
|
$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
|
||||||
}
|
}
|
||||||
/* {block "content"} */
|
/* {block "content"} */
|
||||||
class Block_20302301596989d31d64f310_54306383 extends \Smarty\Runtime\Block
|
class Block_19184882506989e088f2e080_15773704 extends \Smarty\Runtime\Block
|
||||||
{
|
{
|
||||||
public function callBlock(\Smarty\Template $_smarty_tpl) {
|
public function callBlock(\Smarty\Template $_smarty_tpl) {
|
||||||
$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views';
|
$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views';
|
||||||
|
|
@ -108,9 +108,9 @@ $_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views';
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sb-sidenav-footer">
|
<div class="sb-sidenav-footer">
|
||||||
<div class="small">Connecté avec le compte :</div>
|
<div class="small">Connecté avec le compte : <?php echo $_SESSION['user']['user_name'];?>
|
||||||
<?php echo $_SESSION['user']['user_name'];?>
|
<?php echo $_SESSION['user']['user_firstname'];?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -152,52 +152,30 @@ $_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
|
||||||
</div>
|
</div>
|
||||||
<!-- catégorie modif -->
|
<!-- catégorie modif -->
|
||||||
<div class="p-3 mt-2 text-primary-emphasis bg-primary-subtle border border-primary-subtle rounded-3">
|
<div class="p-3 mt-2 text-primary-emphasis bg-primary-subtle border border-primary-subtle rounded-3">
|
||||||
<form method="post">
|
|
||||||
<div class="container-fluid pt-2">
|
<div class="container-fluid pt-2">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<select class="form-select" aria-label="Default select example">
|
<form method="post">
|
||||||
<option value="0" <?php if (($_smarty_tpl->getValue('objCategory')->getId() == 0)) {?> selected <?php }?>>Modifier un catégorie existante</option>
|
<select class="form-select" aria-label="Default select example" name="id_to_edit">
|
||||||
|
<option value="0">Modifier un catégorie existante</option>
|
||||||
<?php
|
<?php
|
||||||
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrCategoryToDisplay'), 'arrDetCategory');
|
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrCategoryToDisplay'), 'category');
|
||||||
$foreach1DoElse = true;
|
$foreach1DoElse = true;
|
||||||
foreach ($_from ?? [] as $_smarty_tpl->getVariable('arrDetCategory')->value) {
|
foreach ($_from ?? [] as $_smarty_tpl->getVariable('category')->value) {
|
||||||
$foreach1DoElse = false;
|
$foreach1DoElse = false;
|
||||||
?>
|
?>
|
||||||
|
<option value="<?php echo $_smarty_tpl->getValue('category')->getId();?>
|
||||||
<option value="<?php echo $_smarty_tpl->getValue('objCategory')->getId();?>
|
"><?php echo $_smarty_tpl->getValue('category')->getName();?>
|
||||||
" <?php if (($_smarty_tpl->getValue('objCategory')->getId() == $_smarty_tpl->getValue('arrDetCategory')['category_id'])) {?> selected <?php }?>>
|
</option>
|
||||||
<?php echo $_smarty_tpl->getValue('objCategory')->getName();?>
|
|
||||||
|
|
||||||
<option value="0" selected >Modifier un catégorie existante</option>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
$_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrCategoryToDisplay'), 'arrDetCategory');
|
|
||||||
$foreach2DoElse = true;
|
|
||||||
foreach ($_from ?? [] as $_smarty_tpl->getVariable('arrDetCategory')->value) {
|
|
||||||
$foreach2DoElse = false;
|
|
||||||
?>
|
|
||||||
<option value="<?php echo $_smarty_tpl->getValue('arrDetCategory')->getId();?>
|
|
||||||
" >
|
|
||||||
<?php echo $_smarty_tpl->getValue('arrDetCategory')->getName();?>
|
|
||||||
|
|
||||||
</option>
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
$_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
|
$_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
|
||||||
</select>
|
</select>
|
||||||
<br>
|
<br>
|
||||||
<input type="text" class="form-control" id="floatingInput" name="edit_category">
|
<input type="text" class="form-control" id="floatingInput" name="new_name">
|
||||||
</div>
|
|
||||||
<div class="col-2">
|
|
||||||
<button type="submit" class="btn bg-success text-light rounded-circle"> ✓</button>
|
<button type="submit" class="btn bg-success text-light rounded-circle"> ✓</button>
|
||||||
</div>
|
</form>
|
||||||
<div class="col-2">
|
<div>
|
||||||
<button class="btn bg-danger text-light rounded-circle">X</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
@ -205,15 +183,17 @@ $_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<!-- creation cat-->
|
<!-- creation cat-->
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
|
<form method="POST">
|
||||||
<label>Créer une nouvelle catégorie</label>
|
<label>Créer une nouvelle catégorie</label>
|
||||||
<div class="form-floating mb-3">
|
<div class="form-floating mb-3">
|
||||||
<input type="text" class="form-control" id="floatingInput" name="new_category">
|
<input type="text" class="form-control" id="floatingInput" name="new_category">
|
||||||
<label for="floatingInput">Créer une nouvelle catégorie</label>
|
<label for="floatingInput">Créer une nouvelle catégorie</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="col-2">
|
<div class="col-2">
|
||||||
<button type="submit" class="btn bg-success text-light rounded-circle"> ✓</button>
|
<button type="submit" class="btn bg-success text-light rounded-circle"> ✓</button>
|
||||||
</div>
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
/* Smarty version 5.7.0, created on 2026-02-09 12:23:56
|
/* Smarty version 5.7.0, created on 2026-02-09 13:26:33
|
||||||
from 'file:views/_partial/footer.tpl' */
|
from 'file:views/_partial/footer.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_6989d1dc7c08f9_74223007',
|
'unifunc' => 'content_6989e0893afd86_56926620',
|
||||||
'has_nocache_code' => false,
|
'has_nocache_code' => false,
|
||||||
'file_dependency' =>
|
'file_dependency' =>
|
||||||
array (
|
array (
|
||||||
|
|
@ -20,7 +20,7 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||||
array (
|
array (
|
||||||
),
|
),
|
||||||
))) {
|
))) {
|
||||||
function content_6989d1dc7c08f9_74223007 (\Smarty\Template $_smarty_tpl) {
|
function content_6989e0893afd86_56926620 (\Smarty\Template $_smarty_tpl) {
|
||||||
$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views\\_partial';
|
$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views\\_partial';
|
||||||
?>
|
?>
|
||||||
<footer class="footer container-fluid d-flex justify-content-around">
|
<footer class="footer container-fluid d-flex justify-content-around">
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
/* Smarty version 5.7.0, created on 2026-02-09 12:29:17
|
/* Smarty version 5.7.0, created on 2026-02-09 13:26:33
|
||||||
from 'file:views/_partial/header.tpl' */
|
from 'file:views/_partial/header.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_6989d31d88f180_59508135',
|
'unifunc' => 'content_6989e0892c1ac1_16523199',
|
||||||
'has_nocache_code' => false,
|
'has_nocache_code' => false,
|
||||||
'file_dependency' =>
|
'file_dependency' =>
|
||||||
array (
|
array (
|
||||||
|
|
@ -20,7 +20,7 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||||
array (
|
array (
|
||||||
),
|
),
|
||||||
))) {
|
))) {
|
||||||
function content_6989d31d88f180_59508135 (\Smarty\Template $_smarty_tpl) {
|
function content_6989e0892c1ac1_16523199 (\Smarty\Template $_smarty_tpl) {
|
||||||
$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views\\_partial';
|
$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views\\_partial';
|
||||||
?><!DOCTYPE html>
|
?><!DOCTYPE html>
|
||||||
<html lang="fr">
|
<html lang="fr">
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
/* Smarty version 5.7.0, created on 2026-02-09 12:23:56
|
/* Smarty version 5.7.0, created on 2026-02-09 13:25:02
|
||||||
from 'file:views/_partial/preview.tpl' */
|
from 'file:views/_partial/preview.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_6989d1dc613786_88061115',
|
'unifunc' => 'content_6989e02ebdb495_34139226',
|
||||||
'has_nocache_code' => false,
|
'has_nocache_code' => false,
|
||||||
'file_dependency' =>
|
'file_dependency' =>
|
||||||
array (
|
array (
|
||||||
|
|
@ -20,7 +20,7 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||||
array (
|
array (
|
||||||
),
|
),
|
||||||
))) {
|
))) {
|
||||||
function content_6989d1dc613786_88061115 (\Smarty\Template $_smarty_tpl) {
|
function content_6989e02ebdb495_34139226 (\Smarty\Template $_smarty_tpl) {
|
||||||
$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views\\_partial';
|
$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views\\_partial';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,83 @@
|
||||||
|
<?php
|
||||||
|
/* Smarty version 5.7.0, created on 2026-02-09 13:25:02
|
||||||
|
from 'file:views/home.tpl' */
|
||||||
|
|
||||||
|
/* @var \Smarty\Template $_smarty_tpl */
|
||||||
|
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||||
|
'version' => '5.7.0',
|
||||||
|
'unifunc' => 'content_6989e02e94a704_31389377',
|
||||||
|
'has_nocache_code' => false,
|
||||||
|
'file_dependency' =>
|
||||||
|
array (
|
||||||
|
'ca790de9f8d5a4fc03b03b8d137ec1edb99bdd92' =>
|
||||||
|
array (
|
||||||
|
0 => 'views/home.tpl',
|
||||||
|
1 => 1770639710,
|
||||||
|
2 => 'file',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'includes' =>
|
||||||
|
array (
|
||||||
|
'file:views/_partial/preview.tpl' => 1,
|
||||||
|
),
|
||||||
|
))) {
|
||||||
|
function content_6989e02e94a704_31389377 (\Smarty\Template $_smarty_tpl) {
|
||||||
|
$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views';
|
||||||
|
$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_6558155986989e02e945ff4_36336799', "content");
|
||||||
|
?>
|
||||||
|
|
||||||
|
<?php $_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
|
||||||
|
}
|
||||||
|
/* {block "content"} */
|
||||||
|
class Block_6558155986989e02e945ff4_36336799 extends \Smarty\Runtime\Block
|
||||||
|
{
|
||||||
|
public function callBlock(\Smarty\Template $_smarty_tpl) {
|
||||||
|
$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views';
|
||||||
|
?>
|
||||||
|
|
||||||
|
<section class="container mt-5 p-5 d-flex flex-column align-items-center text-center">
|
||||||
|
<h1 class="logo">Folliow</h1>
|
||||||
|
<h2>Là où 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>
|
||||||
|
|
||||||
|
<!--filtres de "recherche"-->
|
||||||
|
<section class="container mt-5 p-5 d-flex flex-column align-items-center text-center">
|
||||||
|
<div>
|
||||||
|
<form method="GET">
|
||||||
|
<button type="submit" class="btn btn-primary" value="">catégorie 1</button>
|
||||||
|
<button type="submit" class="btn btn-primary" value="">catégorie 2</button>
|
||||||
|
<button type="submit" class="btn btn-primary" value="">Plus de 6 mois</button>
|
||||||
|
<button type="reset" class="btn btn-primary" value="">Tout</button>
|
||||||
|
</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">
|
||||||
|
|
||||||
|
<?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"} */
|
||||||
|
}
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
/* Smarty version 5.7.0, created on 2026-02-09 12:23:56
|
/* Smarty version 5.7.0, created on 2026-02-09 13:24:46
|
||||||
from 'file:views/search.tpl' */
|
from 'file:views/search.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_6989d1dc059b91_90143315',
|
'unifunc' => 'content_6989e01e399336_22269044',
|
||||||
'has_nocache_code' => false,
|
'has_nocache_code' => false,
|
||||||
'file_dependency' =>
|
'file_dependency' =>
|
||||||
array (
|
array (
|
||||||
|
|
@ -21,18 +21,18 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||||
'file:views/_partial/preview.tpl' => 1,
|
'file:views/_partial/preview.tpl' => 1,
|
||||||
),
|
),
|
||||||
))) {
|
))) {
|
||||||
function content_6989d1dc059b91_90143315 (\Smarty\Template $_smarty_tpl) {
|
function content_6989e01e399336_22269044 (\Smarty\Template $_smarty_tpl) {
|
||||||
$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views';
|
$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views';
|
||||||
$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
|
$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_10870486496989d1dbe65e81_99494215', "content");
|
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_17525989336989e01e3837e7_64042990', "content");
|
||||||
$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
|
$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
|
||||||
}
|
}
|
||||||
/* {block "content"} */
|
/* {block "content"} */
|
||||||
class Block_10870486496989d1dbe65e81_99494215 extends \Smarty\Runtime\Block
|
class Block_17525989336989e01e3837e7_64042990 extends \Smarty\Runtime\Block
|
||||||
{
|
{
|
||||||
public function callBlock(\Smarty\Template $_smarty_tpl) {
|
public function callBlock(\Smarty\Template $_smarty_tpl) {
|
||||||
$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views';
|
$_smarty_current_dir = 'C:\\wamp64\\www\\DWWM_2025\\projet2\\views';
|
||||||
|
|
|
||||||
|
|
@ -72,8 +72,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sb-sidenav-footer">
|
<div class="sb-sidenav-footer">
|
||||||
<div class="small">Connecté avec le compte :</div>
|
<div class="small">Connecté avec le compte : {$smarty.session.user.user_name} {$smarty.session.user.user_firstname}</div>
|
||||||
{$smarty.session.user.user_name}
|
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -106,34 +105,21 @@
|
||||||
</div>
|
</div>
|
||||||
<!-- catégorie modif -->
|
<!-- catégorie modif -->
|
||||||
<div class="p-3 mt-2 text-primary-emphasis bg-primary-subtle border border-primary-subtle rounded-3">
|
<div class="p-3 mt-2 text-primary-emphasis bg-primary-subtle border border-primary-subtle rounded-3">
|
||||||
<form method="post">
|
|
||||||
<div class="container-fluid pt-2">
|
<div class="container-fluid pt-2">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<select class="form-select" aria-label="Default select example">
|
<form method="post">
|
||||||
<option value="0" {if ($objCategory->getId() == 0)} selected {/if}>Modifier un catégorie existante</option>
|
<select class="form-select" aria-label="Default select example" name="id_to_edit">
|
||||||
{foreach from=$arrCategoryToDisplay item=arrDetCategory}
|
<option value="0">Modifier un catégorie existante</option>
|
||||||
|
{foreach from=$arrCategoryToDisplay item=category}
|
||||||
<option value="{$objCategory->getId()}" {if ($objCategory->getId() == $arrDetCategory['category_id'])} selected {/if}>
|
<option value="{$category->getId()}">{$category->getName()}</option>
|
||||||
{$objCategory->getName()}
|
|
||||||
<option value="0" selected >Modifier un catégorie existante</option>
|
|
||||||
{/foreach}
|
|
||||||
|
|
||||||
{foreach from=$arrCategoryToDisplay item=arrDetCategory}
|
|
||||||
<option value="{$arrDetCategory->getId()}" >
|
|
||||||
{$arrDetCategory->getName()}
|
|
||||||
</option>
|
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</select>
|
</select>
|
||||||
<br>
|
<br>
|
||||||
<input type="text" class="form-control" id="floatingInput" name="edit_category">
|
<input type="text" class="form-control" id="floatingInput" name="new_name">
|
||||||
</div>
|
|
||||||
<div class="col-2">
|
|
||||||
<button type="submit" class="btn bg-success text-light rounded-circle"> ✓</button>
|
<button type="submit" class="btn bg-success text-light rounded-circle"> ✓</button>
|
||||||
</div>
|
</form>
|
||||||
<div class="col-2">
|
<div>
|
||||||
<button class="btn bg-danger text-light rounded-circle">X</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
@ -141,15 +127,17 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<!-- creation cat-->
|
<!-- creation cat-->
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
|
<form method="POST">
|
||||||
<label>Créer une nouvelle catégorie</label>
|
<label>Créer une nouvelle catégorie</label>
|
||||||
<div class="form-floating mb-3">
|
<div class="form-floating mb-3">
|
||||||
<input type="text" class="form-control" id="floatingInput" name="new_category">
|
<input type="text" class="form-control" id="floatingInput" name="new_category">
|
||||||
<label for="floatingInput">Créer une nouvelle catégorie</label>
|
<label for="floatingInput">Créer une nouvelle catégorie</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="col-2">
|
<div class="col-2">
|
||||||
<button type="submit" class="btn bg-success text-light rounded-circle"> ✓</button>
|
<button type="submit" class="btn bg-success text-light rounded-circle"> ✓</button>
|
||||||
</div>
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue