Ajout des boutons de Modération dans la page projet

This commit is contained in:
GuillaumeH-Cci 2026-02-13 15:39:29 +01:00
parent 7be3bac167
commit 0579eddf81
23 changed files with 281 additions and 226 deletions

View file

@ -1,18 +1,18 @@
<?php
/* Smarty version 5.7.0, created on 2026-02-11 16:46:47
/* Smarty version 5.7.0, created on 2026-02-09 10:06:01
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',
'unifunc' => 'content_6989b189902285_60575184',
'has_nocache_code' => false,
'file_dependency' =>
array (
'f80694cc4829becd656ad4f73c431db5dba4722b' =>
array (
0 => 'views/admin.tpl',
1 => 1770827564,
1 => 1770630804,
2 => 'file',
),
),
@ -20,139 +20,193 @@ if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
array (
),
))) {
function content_698cb277dd9632_57655004 (\Smarty\Template $_smarty_tpl) {
function content_6989b189902285_60575184 (\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()->instanceBlock($_smarty_tpl, 'Block_13716580806989b1898f9564_82803825', "content");
$_smarty_tpl->getInheritance()->endChild($_smarty_tpl, "views/layout.tpl", $_smarty_current_dir);
}
/* {block "content"} */
class Block_186078871698cb277dcbef8_81710710 extends \Smarty\Runtime\Block
class Block_13716580806989b1898f9564_82803825 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">
<section class="sb-nav-fixed">
<nav class="sb-topnav navbar navbar-expand navbar-dark bg-dark">
<a class="navbar-brand ps-3" href="index.php?ctrl=project&action=home"><img src="assests/img/Logo-Wordmark.svg" alt="Logo du site" width="150px"></a>
<button class="btn btn-link btn-sm order-1 order-lg-0 me-4 me-lg-0" id="sidebarToggle" href="#!"><i class="fas fa-bars"></i></button>
<form class="d-none d-md-inline-block form-inline ms-auto me-0 me-md-3 my-2 my-md-0">
<div class="input-group">
<input class="form-control" type="text" placeholder="Recherche par pseudo..." aria-label="Recherche pseudo" aria-describedby="btnNavbarSearch" />
<button class="btn btn-primary" id="btnNavbarSearch" type="button"><i class="fas fa-search"></i></button>
</div>
</form>
<!-- Navbar - User-->
<ul class="navbar-nav ms-auto ms-md-0 me-3 me-lg-4">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="navbarDropdown" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false"><i class="fas fa-user fa-fw"></i></a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" href="/option.php">Paramètre</a></li>
<li><hr class="dropdown-divider" /></li>
<li><a class="dropdown-item" href="/deconnexion.php">Déconnexion</a></li>
</ul>
</li>
</ul>
</nav>
<!-- SideNav Infos -->
<div id="layoutSidenav">
<div id="layoutSidenav_nav">
<nav class="sb-sidenav accordion sb-sidenav-dark" id="sidenavAccordion">
<div class="sb-sidenav-menu">
<div class="nav">
<div class="sb-sidenav-menu-heading"></div>
<a class="nav-link" href="index.html">
<div class="sb-nav-link-icon"><i class="fas fa-tachometer-alt"></i></div>
Rafraichir la page
</a>
<div class="sb-sidenav-menu-heading"></div>
<div class="collapse" id="collapseLayouts" aria-labelledby="headingOne" data-bs-parent="#sidenavAccordion">
</div>
<form action="post">
<div class="container-fluid ps-2">
<div class="row">
<div class="col-6">
<label for="checkbox1">Par date</label>
</div>
<div class="col-6 text-center">
<input type="checkbox" name="search_date" id="">
</div>
<div class="col-6">
<label for="checkbox2">Par date de creation de compte</label>
</div>
<div class="col-6 text-center">
<input type="checkbox" name="search_creationdate" id="">
</div>
<div class="col-6">
<label for="checkbox3">Recherche par date</label>
</div>
<div class="col-6 text-center">
<input type="checkbox" name="search_date" id="">
</div>
<div class="col-12 text-center">
<button type="submit" class="btn mt-3 bg-primary text-light">Recherche</button>
</div>
</div>
</div>
</form>
</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');
</div>
<div class="sb-sidenav-footer">
<div class="small">Connecté avec le compte :</div>
<?php echo $_SESSION['user']['user_name'];?>
</div>
</nav>
</div>
<div id="layoutSidenav_content">
<main>
<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">
<div class="row">
<div class="col-4">
<img src="./assests/img/Logo-Wordmark.svg" alt="" width="100">
</div>
<div class="col-4">
<select class="form-select" aria-label="Default select example">
<option value="0" selected>Modifier le statut de l'Utilisateur...</option>
<?php
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrStatusToDisplay'), 'arrDetStatus');
$foreach0DoElse = true;
foreach ($_from ?? [] as $_smarty_tpl->getVariable('user')->value) {
foreach ($_from ?? [] as $_smarty_tpl->getVariable('arrDetStatus')->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 value="<?php echo $_smarty_tpl->getValue('arrDetStatus')->getId();?>
"><?php echo $_smarty_tpl->getValue('arrDetStatus')->getStatusName();?>
</option>
<?php
<?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');
</select>
</div>
<div class="col-4">
<button class="btn bg-danger text-light rounded-circle">X</button>
</div>
</div>
</div>
</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" selected >Modifier un catégorie existante</option>
<?php
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrCategoryToDisplay'), 'arrDetCategory');
$foreach1DoElse = true;
foreach ($_from ?? [] as $_smarty_tpl->getVariable('arrDetAuthorisation')->value) {
foreach ($_from ?? [] as $_smarty_tpl->getVariable('arrDetCategory')->value) {
$foreach1DoElse = false;
?>
<option value="<?php echo $_smarty_tpl->getValue('arrDetAuthorisation')->getId();?>
"><?php echo $_smarty_tpl->getValue('arrDetAuthorisation')->getName();?>
</option>
<?php
<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>
</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>
</select>
<br>
<input type="text" class="form-control" id="floatingInput" name="edit_category">
</div>
<div class="col-2">
<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>
</div>
<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>
<br>
<br>
<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>
</div>
</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>
</form>
</div>
</div>
</form>
</main>
</div>
</div>
</div>
<div class="small">Connecté avec le compte : <?php echo $_SESSION['user']['user_name'];?>
<?php echo $_SESSION['user']['user_firstname'];?>
</section>
</section>
<?php
}
}