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
|
|
@ -1,18 +1,18 @@
|
|||
<?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' */
|
||||
|
||||
/* @var \Smarty\Template $_smarty_tpl */
|
||||
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
||||
'version' => '5.7.0',
|
||||
'unifunc' => 'content_6989d31d65c3a2_79771570',
|
||||
'unifunc' => 'content_6989e088f38338_64666135',
|
||||
'has_nocache_code' => false,
|
||||
'file_dependency' =>
|
||||
array (
|
||||
'ac77f39f91cdf26a0eb3f0963ead4008a7bda8fb' =>
|
||||
array (
|
||||
0 => 'views/admin.tpl',
|
||||
1 => 1770640156,
|
||||
1 => 1770643565,
|
||||
2 => 'file',
|
||||
),
|
||||
),
|
||||
|
|
@ -20,18 +20,18 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, 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_tpl->getInheritance()->init($_smarty_tpl, true);
|
||||
?>
|
||||
|
||||
|
||||
<?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);
|
||||
}
|
||||
/* {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) {
|
||||
$_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 class="sb-sidenav-footer">
|
||||
<div class="small">Connecté avec le compte :</div>
|
||||
<?php echo $_SESSION['user']['user_name'];?>
|
||||
|
||||
<div class="small">Connecté avec le compte : <?php echo $_SESSION['user']['user_name'];?>
|
||||
<?php echo $_SESSION['user']['user_firstname'];?>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
|
|
@ -152,52 +152,30 @@ $_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
|
|||
</div>
|
||||
<!-- catégorie modif -->
|
||||
<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="row">
|
||||
<div class="col-6">
|
||||
<select class="form-select" aria-label="Default select example">
|
||||
<option value="0" <?php if (($_smarty_tpl->getValue('objCategory')->getId() == 0)) {?> selected <?php }?>>Modifier un catégorie existante</option>
|
||||
<?php
|
||||
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrCategoryToDisplay'), 'arrDetCategory');
|
||||
<form method="post">
|
||||
<select class="form-select" aria-label="Default select example" name="id_to_edit">
|
||||
<option value="0">Modifier un catégorie existante</option>
|
||||
<?php
|
||||
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrCategoryToDisplay'), 'category');
|
||||
$foreach1DoElse = true;
|
||||
foreach ($_from ?? [] as $_smarty_tpl->getVariable('arrDetCategory')->value) {
|
||||
foreach ($_from ?? [] as $_smarty_tpl->getVariable('category')->value) {
|
||||
$foreach1DoElse = false;
|
||||
?>
|
||||
|
||||
<option value="<?php echo $_smarty_tpl->getValue('objCategory')->getId();?>
|
||||
" <?php if (($_smarty_tpl->getValue('objCategory')->getId() == $_smarty_tpl->getValue('arrDetCategory')['category_id'])) {?> selected <?php }?>>
|
||||
<?php echo $_smarty_tpl->getValue('objCategory')->getName();?>
|
||||
|
||||
<option value="0" selected >Modifier un catégorie existante</option>
|
||||
<option value="<?php echo $_smarty_tpl->getValue('category')->getId();?>
|
||||
"><?php echo $_smarty_tpl->getValue('category')->getName();?>
|
||||
</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
|
||||
}
|
||||
$_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
|
||||
</select>
|
||||
<br>
|
||||
<input type="text" class="form-control" id="floatingInput" name="edit_category">
|
||||
</div>
|
||||
<div class="col-2">
|
||||
</select>
|
||||
<br>
|
||||
<input type="text" class="form-control" id="floatingInput" name="new_name">
|
||||
<button type="submit" class="btn bg-success text-light rounded-circle"> ✓</button>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<button class="btn bg-danger text-light rounded-circle">X</button>
|
||||
</div>
|
||||
</form>
|
||||
<div>
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
|
|
@ -205,14 +183,16 @@ $_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
|
|||
<div class="row">
|
||||
<!-- creation cat-->
|
||||
<div class="col-6">
|
||||
<label>Créer une nouvelle catégorie</label>
|
||||
<div class="form-floating mb-3">
|
||||
<input type="text" class="form-control" id="floatingInput" name="new_category">
|
||||
<label for="floatingInput">Créer une nouvelle catégorie</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<button type="submit" class="btn bg-success text-light rounded-circle"> ✓</button>
|
||||
<form method="POST">
|
||||
<label>Créer une nouvelle catégorie</label>
|
||||
<div class="form-floating mb-3">
|
||||
<input type="text" class="form-control" id="floatingInput" name="new_category">
|
||||
<label for="floatingInput">Créer une nouvelle catégorie</label>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<button type="submit" class="btn bg-success text-light rounded-circle"> ✓</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue