radiantproduction/Vue/Usersrhclient/index.php
2026-01-22 19:33:18 +00:00

116 lines
6.0 KiB
PHP
Executable File

<?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="<?= _("Ré-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>