This commit is contained in:
KANE LAZENI 2026-01-22 19:33:18 +00:00
parent fae9fc8fe1
commit 80adf4d5a2
3 changed files with 166 additions and 3 deletions

View File

@ -0,0 +1,26 @@
<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Client.php';
require_once 'Modele/Menuvueutilisateur.php';
class ControleurUsersrhclient extends Controleur {
private $menuvue;
private $gc;
public function __construct() {
$this->menuvue = new Menuvueutilisateur();
$this->menuvue->getMenuVue("Usersrhclient");
$this->client = new Client();
}
public function index() {
$idClient = $_SESSION['idClient_C'];
$client = $this->client->getClientId($idClient);
$users = $this->client->getusersrhclient($idClient);
$this->genererVue(array('client' => $client, 'users' => $users));
}
}

View File

@ -2,6 +2,16 @@
$this->titre = "INTER-SANTE - Gestion Extranet Client";
$idClient = $_SESSION['idClient_C'];
$extranetActif = $client['extranetActif'];
$validationRhRd = $client['validationRhRd'];
var_dump
(
array(
"extranetActif" => $extranetActif,
"validationRhRd" => $validationRhRd,
)
);
?>
<script type="text/javascript">
@ -14,10 +24,11 @@
<table class="table table-responsive table-condensed" style="font-size:10pt;">
<tbody>
<tr>
<td width="15%" > <?= _("Nom") ?> </td>
<td><INPUT style="font-size:10pt;" class="form-control" TYPE="text" value="<?=$this->nettoyer($_SESSION['nomClient_C'])?>" readonly></td>
<td> </td>
</tr>
<tr>
<td width="15%" > <?= _("Extranet") ?> </td>
<td>
<?php if($extranetActif==1): ?>
<input style="font-size:10pt;" class = "form-control btn btn-danger" type="button" value="<?= _("Désactiver") ?>" onClick="javascript:activer_extranet_client('<?= $idClient ?>', '0');">
@ -25,6 +36,16 @@
<input style="font-size:10pt;" class = "form-control btn btn-primary" type="button" value="<?= _("Activer") ?>" onClick="javascript:activer_extranet_client('<?= $idClient ?>', '1');">
<?php endif; ?>
</td>
<td width="15%" > <?= _("Validation demandes Remboursement") ?> </td>
<td>
<?php if($validationRhRd==1): ?>
<input style="font-size:10pt;" class = "form-control btn btn-danger" type="button" value="<?= _("Désactiver") ?>" onClick="javascript:activer_extranet_client('<?= $idClient ?>', '0');">
<?php else: ?>
<input style="font-size:10pt;" class = "form-control btn btn-primary" type="button" value="<?= _("Activer") ?>" onClick="javascript:activer_extranet_client('<?= $idClient ?>', '1');">
<?php endif; ?>
</td>
</tr>
</tbody>
</table>
</div>

116
Vue/Usersrhclient/index.php Executable file
View File

@ -0,0 +1,116 @@
<?php
$this->titre = "INTER SANTE - Utilisateurs RH";
$idClient = $this->nettoyer($client['idClient']);
$nomClient = $this->nettoyer($client['nom']);
?>
<input class="visually-hidden" type="text" id="idClient" value="<?= $idClient ?>">
<div id="div_liste" class="container-fluid py-3 animate__animated animate__fadeIn">
<h1 class="text-primary"><i class="fas fa-users-cog me-2"></i> <?= _("Utilisateurs Portail RH") ?></h1>
<div class="card-header d-flex justify-content-between align-items-center py-1">
<h5 class="mb-0 fw-bold">
<span class="fw-normal text-dark-50"><?= $nomClient ?></span>
</h5>
<div class="d-flex align-items-center gap-3">
<span class="badge bg-white text-primary rounded-pill px-3 shadow-sm">
<?= count($users) ?> <?= _("comptes") ?>
</span>
</div>
</div>
<div class="card shadow-sm border-0">
<div class="table-responsive">
<table class="table table-hover align-middle mb-0 tabliste compact">
<thead class="table-light">
<tr class="small text-uppercase text-muted border-bottom">
<th class="ps-4" width="12%"><?= _("Identifiant") ?></th>
<th width="20%"><?= _("Nom Complet") ?></th>
<th class="text-center" width="8%"><?= _("Langue") ?></th>
<th class="text-center" width="15%"><?= _("Profil / Rôle") ?></th>
<th class="text-center" width="15%"><?= _("Statut") ?></th>
<th class="text-center pe-4" width="12%"><?= _("Actions") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($users as $user_client):
$idUtilisateur = $user_client['idUtilisateur'];
$codeUtilisateur = $user_client['codeUtilisateur'];
$actif = (int)$user_client['actif'];
$reInit = (int)$user_client['reInit'];
$codeLangue = $user_client['codeLangue'];
// Gestion multilingue du profil
$libelleProfil = est_anglophone() ? $user_client['profilEng'] : $user_client['profil'];
?>
<tr>
<td class="ps-4">
<code class="text-primary fw-bold bg-primary bg-opacity-10 px-2 py-1 rounded">
<?= $this->nettoyer($codeUtilisateur) ?>
</code>
</td>
<td>
<div class="fw-bold text-dark"><?= $this->nettoyer($user_client['utilisateur']) ?></div>
</td>
<td class="text-center">
<span class="badge border text-dark bg-white shadow-xs fw-bold">
<?= strtoupper($codeLangue) ?>
</span>
</td>
<td class="text-center">
<span class="badge bg-info-subtle text-info border border-info-subtle px-2 py-1">
<i class="fas fa-user-shield me-1 small"></i><?= $this->nettoyer($libelleProfil) ?>
</span>
</td>
<td class="text-center">
<?php if($actif === 1): ?>
<button class="btn btn-sm btn-outline-success rounded-pill px-3 fw-bold"
onClick="desactiver_user_rh_client('<?= $codeUtilisateur ?>');">
<i class="fas fa-check-circle me-1"></i> <?= _("Actif") ?>
</button>
<?php else: ?>
<button class="btn btn-sm btn-outline-danger rounded-pill px-3 fw-bold"
onClick="activer_user_rh_client('<?= $codeUtilisateur ?>');">
<i class="fas fa-ban me-1"></i> <?= _("Bloqué") ?>
</button>
<?php endif; ?>
</td>
<td class="text-center pe-4">
<div class="btn-group shadow-sm">
<button class="btn btn-outline-secondary btn-sm"
title="<?= _("Modifier") ?>"
onClick="afficher_users_client_id(<?= $idUtilisateur ?>);">
<i class="fas fa-edit"></i>
</button>
<button class="btn btn-outline-secondary btn-sm <?= ($reInit === 1) ? 'text-danger fw-bold' : '' ?>"
title="<?= _("-initialiser mot de passe") ?>"
onClick="reinitpaswd_user_rh('<?= $codeUtilisateur ?>');">
<i class="fas fa-key"></i>
</button>
</div>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<div class="card-footer bg-white text-muted small py-2">
<i class="fas fa-info-circle me-1"></i>
<?= _("Les comptes bloqués ne peuvent plus se connecter au portail.") ?>
</div>
</div>
</div>
<style>
.shadow-xs { box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.table-hover tbody tr:hover { background-color: rgba(13, 110, 253, 0.02) !important; }
.btn-group .btn { padding: 0.4rem 0.6rem; }
.btn-outline-secondary:hover { background-color: #f8f9fa; color: #0d6efd; }
</style>