160 lines
7.3 KiB
PHP
160 lines
7.3 KiB
PHP
<?php
|
|
/* Smarty version 5.7.0, created on 2026-02-11 16:46:47
|
|
from 'file:views/admin.tpl' */
|
|
|
|
/* @var \Smarty\Template $_smarty_tpl */
|
|
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
|
'version' => '5.7.0',
|
|
'unifunc' => 'content_698cb277dd9632_57655004',
|
|
'has_nocache_code' => false,
|
|
'file_dependency' =>
|
|
array (
|
|
'f80694cc4829becd656ad4f73c431db5dba4722b' =>
|
|
array (
|
|
0 => 'views/admin.tpl',
|
|
1 => 1770827564,
|
|
2 => 'file',
|
|
),
|
|
),
|
|
'includes' =>
|
|
array (
|
|
),
|
|
))) {
|
|
function content_698cb277dd9632_57655004 (\Smarty\Template $_smarty_tpl) {
|
|
$_smarty_current_dir = 'D:\\projetphp\\views';
|
|
$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
|
|
?>
|
|
|
|
|
|
<?php
|
|
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_186078871698cb277dcbef8_81710710', "content");
|
|
$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
|
|
}
|
|
/* {block "content"} */
|
|
class Block_186078871698cb277dcbef8_81710710 extends \Smarty\Runtime\Block
|
|
{
|
|
public function callBlock(\Smarty\Template $_smarty_tpl) {
|
|
$_smarty_current_dir = 'D:\\projetphp\\views';
|
|
?>
|
|
|
|
|
|
<section>
|
|
<div id="layoutSidenav_content">
|
|
<div class="container-fluid px-4">
|
|
<h1 class="mt-4">Dashboard</h1>
|
|
<div class="container-fluid px-4">
|
|
<!-- USER MODIF -->
|
|
<div class="p-3 mt-2 text-primary-emphasis bg-primary-subtle border border-primary-subtle rounded-3">
|
|
<div class="container-fluid pt-2">
|
|
<h2>Gestion de l'utilsateur</h2>
|
|
<p>Changer le statut ou supprimer un utilisateur</p>
|
|
<div class="row">
|
|
<div class="col-2">
|
|
<img src="./assests/img/Logo-Wordmark.svg" alt="" width="100">
|
|
</div>
|
|
<form method="POST">
|
|
<div class="col-6">
|
|
<select class="form-select" aria-label="Default select example" name="user_id">
|
|
<option value="0">Choisir un utilisateur</option>
|
|
<?php
|
|
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrUserToDisplay'), 'user');
|
|
$foreach0DoElse = true;
|
|
foreach ($_from ?? [] as $_smarty_tpl->getVariable('user')->value) {
|
|
$foreach0DoElse = false;
|
|
?>
|
|
<option value="<?php echo $_smarty_tpl->getValue('user')->getId();?>
|
|
"><?php echo $_smarty_tpl->getValue('user')->getName();?>
|
|
<?php echo $_smarty_tpl->getValue('user')->getFirstname();?>
|
|
</option>
|
|
<?php
|
|
}
|
|
$_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
|
|
</select>
|
|
<select class="form-select" aria-label="Default select example" name="new_status">
|
|
<option value="0" selected>Modifier le statut de l'Utilisateur...</option>
|
|
<?php
|
|
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrAuthorisationToDisplay'), 'arrDetAuthorisation');
|
|
$foreach1DoElse = true;
|
|
foreach ($_from ?? [] as $_smarty_tpl->getVariable('arrDetAuthorisation')->value) {
|
|
$foreach1DoElse = false;
|
|
?>
|
|
<option value="<?php echo $_smarty_tpl->getValue('arrDetAuthorisation')->getId();?>
|
|
"><?php echo $_smarty_tpl->getValue('arrDetAuthorisation')->getName();?>
|
|
</option>
|
|
<?php
|
|
}
|
|
$_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
|
|
</select>
|
|
</div>
|
|
<div class="col-2">
|
|
<button type="submit" name="action" value="update_status" class="btn bg-success text-light"> Valider</button>
|
|
<button type="submit" name="action" value="delete_user" class="btn bg-danger text-light">Supprimer l'utilisateur</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- catégorie modif -->
|
|
<div class="p-3 mt-2 text-primary-emphasis bg-primary-subtle border border-primary-subtle rounded-3">
|
|
<div class="container-fluid pt-2">
|
|
<h2>Gestion des catégories</h2>
|
|
<div class="row">
|
|
<div class="col-6">
|
|
<form method="post">
|
|
<p>Modifier une catégorie existante</p>
|
|
<select class="form-select" aria-label="Default select example" name="id_to_edit">
|
|
<option value="0">Choix de la catégorie</option>
|
|
<?php
|
|
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrCategoryToDisplay'), 'category');
|
|
$foreach2DoElse = true;
|
|
foreach ($_from ?? [] as $_smarty_tpl->getVariable('category')->value) {
|
|
$foreach2DoElse = false;
|
|
?>
|
|
<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);?>
|
|
</select>
|
|
<br>
|
|
<div class="form-floating mb-3">
|
|
<input type="text" class="form-control" id="floatingInput" name="new_name">
|
|
<label for="floatingInput">Nouveau nom de la catégorie</label>
|
|
</div>
|
|
<button type="submit" class="btn bg-success text-light rounded-circle"> ✓</button>
|
|
</form>
|
|
<div>
|
|
</div>
|
|
<br>
|
|
<br>
|
|
<div class="row">
|
|
<!-- creation cat-->
|
|
<div class="col-6">
|
|
<form method="POST">
|
|
<p>Créer une nouvelle catégorie</p>
|
|
<div class="form-floating mb-3">
|
|
<input type="text" class="form-control" id="floatingInput" name="new_category">
|
|
<label for="floatingInput">Nom de la 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>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="small">Connecté avec le compte : <?php echo $_SESSION['user']['user_name'];?>
|
|
<?php echo $_SESSION['user']['user_firstname'];?>
|
|
|
|
</section>
|
|
|
|
<?php
|
|
}
|
|
}
|
|
/* {/block "content"} */
|
|
}
|