valider
This commit is contained in:
parent
6543d0e912
commit
43e7d36667
22
Controleur/ControleurRoles.php
Normal file
22
Controleur/ControleurRoles.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
require_once 'Framework/Controleur.php';
|
||||
require_once 'Modele/Utilisateur.php';
|
||||
require_once 'Modele/Menuvueutilisateur.php';
|
||||
|
||||
class ControleurRoles extends Controleur
|
||||
{
|
||||
private $utilisateur;
|
||||
|
||||
public function __construct() {
|
||||
$this->menuvue = new Menuvueutilisateur();
|
||||
$this->menuvue->getMenuVue('Roles');
|
||||
|
||||
$this->utilisateur = new Utilisateur();
|
||||
}
|
||||
public function index()
|
||||
{
|
||||
$profil = $this->utilisateur->getListeProfilCode();
|
||||
|
||||
$this->genererVue(array('profil' => $profil));
|
||||
}
|
||||
}
|
||||
|
|
@ -130,4 +130,18 @@ class Utilisateur extends Modele {
|
|||
setcookie('lang', $codeNewLang, time()+365*24*3600, '/');
|
||||
}
|
||||
|
||||
public function getListeProfilCode()
|
||||
{
|
||||
if (est_anglophone())
|
||||
{
|
||||
$sql = 'SELECT codeProfil AS `code`, CONCAT(libelleEng, " ( ", codeProfil, " )") AS libelle FROM c_profil WHERE (codeSociete=?) ORDER BY libelleEng';
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = 'SELECT codeProfil AS `code`, CONCAT(libelle, " ( ", codeProfil, " )") AS libelle FROM c_profil WHERE (codeSociete=?) ORDER BY libelle';
|
||||
}
|
||||
|
||||
$liste = $this->executerRequete($sql, array($_SESSION['codeSociete']));
|
||||
return $liste->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
}
|
||||
78
Vue/Roles/index.php
Executable file
78
Vue/Roles/index.php
Executable file
|
|
@ -0,0 +1,78 @@
|
|||
<?php $this->titre = "INTER SANTE - Configuration des Accès"; ?>
|
||||
|
||||
<div class="container-fluid py-4 animate__animated animate__fadeIn">
|
||||
|
||||
<div class="d-flex align-items-center mb-4">
|
||||
<div class="bg-primary text-white p-3 rounded-3 shadow-sm me-3">
|
||||
<i class="fas fa-shield-alt fa-2x"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="mb-0 fw-bold"><?= _("Gestion des Menus & Droits") ?></h4>
|
||||
<p class="text-muted small mb-0"><?= _("Configurez les accès au menu principal selon le profil utilisateur RH") ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card shadow-sm border-0 mb-4">
|
||||
<div class="card-body bg-light p-4 rounded-3 border">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-md-4">
|
||||
<label for="codeProfil" class="form-label small fw-bold text-uppercase text-primary mb-2">
|
||||
<i class="fas fa-user-tag me-2"></i><?= _("Profil Utilisateur cible") ?>
|
||||
</label>
|
||||
<div class="input-group input-group-lg shadow-sm">
|
||||
<select class="form-select fw-bold border-0"
|
||||
id="codeProfil"
|
||||
name="codeProfil"
|
||||
required
|
||||
autofocus
|
||||
onChange="javascript:afficher_menu_principal_profil_assureur();"
|
||||
style="font-size: 11pt;">
|
||||
<?php liste_options($profil, ""); ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8 pt-4">
|
||||
<div class="alert alert-info border-0 shadow-xs mb-0 py-2 px-3 d-flex align-items-center">
|
||||
<i class="fas fa-info-circle me-3 fa-lg"></i>
|
||||
<span class="small">
|
||||
<?= _("La sélection d'un profil chargera automatiquement la liste des menus disponibles pour modification.") ?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="div_menu_profil" class="min-vh-50 rounded-3 d-flex align-items-center justify-content-center border-dashed">
|
||||
<div class="text-center text-muted opacity-50 p-5">
|
||||
<i class="fas fa-th-list fa-4x mb-3"></i>
|
||||
<h5><?= _("En attente de sélection") ?></h5>
|
||||
<p><?= _("Veuillez choisir un profil ci-dessus pour gérer ses accès.") ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.min-vh-50 { min-height: 400px; transition: all 0.3s ease; }
|
||||
|
||||
/* Style pour le conteneur vide */
|
||||
.border-dashed {
|
||||
border: 2px dashed #dee2e6;
|
||||
background-color: #fcfcfc;
|
||||
}
|
||||
|
||||
.form-select:focus {
|
||||
box-shadow: none;
|
||||
border-color: #0d6efd;
|
||||
}
|
||||
|
||||
/* Animation lors du chargement des données */
|
||||
#div_menu_profil:not(:empty) {
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.shadow-xs { box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
|
||||
</style>
|
||||
Loading…
Reference in New Issue
Block a user