This commit is contained in:
KONE SOREL 2026-03-15 18:18:19 +00:00
parent 09e1f6bd2f
commit c9f593a5b1

View File

@ -1,5 +1,4 @@
<?php
$this->titre = "INTER SANTE - Utilisateurs Portail Garant";
$codeGcAssureur = $this->nettoyer($gc['codeGcAssureur']);
$nomGcAssureur = $this->nettoyer($gc['libelle']);
?>
@ -9,15 +8,15 @@
<div class="d-flex align-items-center justify-content-between bg-white p-3 shadow-sm border-start border-primary border-4" style="border-radius: var(--radius-md);">
<div class="d-flex align-items-center">
<div class="icon-shape bg-primary-ghost text-primary rounded-circle me-3" style="width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;">
<i class="fas fa-users-cog fs-4"></i>
<i class="fas fa-user-shield fs-4"></i>
</div>
<div>
<h4 class="mb-0 fw-bold text-uppercase"><?= _("Utilisateurs Portail Garant") ?></h4>
<p class="text-muted small mb-0"><?= $nomGcAssureur ?> — <?= _("Gestion des accès et permissions") ?></p>
<h4 class="mb-0 fw-bold text-uppercase"><?= _("Gestion des accès Garant") ?></h4>
<p class="text-muted small mb-0"><?= $nomGcAssureur ?> — <?= _("Contrôle de la confidentialité et des utilisateurs") ?></p>
</div>
</div>
<button class="btn btn-primary rounded-pill px-4 fw-bold shadow-sm btn-sm" onclick="ajouter_utilisateur_gc();">
<i class="fas fa-plus me-1"></i> <?= _("Nouvel Utilisateur") ?>
<i class="fas fa-user-plus me-1"></i> <?= _("Nouvel Utilisateur") ?>
</button>
</div>
</div>
@ -32,63 +31,82 @@
<thead class="bg-light">
<tr>
<th class="py-3 ps-3">Login</th>
<th class="py-3"><?= _("Nom & Prénoms") ?></th>
<th class="py-3"><?= _("Utilisateur") ?></th>
<th class="py-3 text-center"><?= _("Langue") ?></th>
<th class="py-3 text-center"><?= _("Accès Actes") ?></th>
<th class="py-3 text-center"><?= _("Accès Affec.") ?></th>
<th class="py-3 text-center"><?= _("Visibilité Actes") ?></th>
<th class="py-3 text-center"><?= _("Visibilité Affec.") ?></th>
<th class="py-3 text-center"><?= _("État Compte") ?></th>
<th class="py-3 text-center" width="150px"><?= _("Actions") ?></th>
<th class="py-3 text-center"><?= _("Actions") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($users as $user_gc):
$id = $user_gc['idUtilisateur'];
$code = $user_gc['codeUtilisateur'];
$isActVisible = ($user_gc['actVisible'] == 1);
$isAffectionVisible = ($user_gc['AffectionVisible'] == 1);
$isActif = ($user_gc['actif'] == 1);
// Logique des drapeaux
$flag = ($user_gc['codeLangue'] == "en_US") ? "us.png" : "fr.png";
?>
<tr>
<td class="ps-3 fw-bold text-primary"><?= $this->nettoyer($code) ?></td>
<td><?= $this->nettoyer($user_gc['utilisateur']) ?></td>
<td>
<div class="fw-bold"><?= $this->nettoyer($user_gc['utilisateur']) ?></div>
<small class="text-muted">ID: #<?= $id ?></small>
</td>
<td class="text-center">
<span class="badge bg-light text-dark border"><?= $user_gc['codeLangue'] ?></span>
<img src="<?= $_SESSION['racineWeb'] ?>assets/img/flags/<?= $flag ?>"
alt="<?= $user_gc['codeLangue'] ?>"
title="<?= $user_gc['codeLangue'] ?>"
class="shadow-xs border"
style="width: 22px; border-radius: 2px;">
</td>
<td class="text-center">
<div class="form-check form-switch d-inline-block">
<input class="form-check-input cursor-pointer" type="checkbox"
<?= ($user_gc['actVisible'] == 1) ? 'checked' : '' ?>
<?= ($isActVisible) ? 'checked' : '' ?>
onchange="gerer_acces_actes_gc('<?= $code ?>', '<?= $user_gc['actVisible'] ?>');">
<i class="fas <?= ($isActVisible) ? 'fa-eye text-success' : 'fa-eye-slash text-muted' ?> ms-1"></i>
</div>
</td>
<td class="text-center">
<div class="form-check form-switch d-inline-block">
<input class="form-check-input cursor-pointer" type="checkbox"
<?= ($user_gc['AffectionVisible'] == 1) ? 'checked' : '' ?>
<?= ($isAffectionVisible) ? 'checked' : '' ?>
onchange="gerer_acces_affection_gc('<?= $code ?>', '<?= $user_gc['AffectionVisible'] ?>');">
<i class="fas <?= ($isAffectionVisible) ? 'fa-eye text-success' : 'fa-eye-slash text-muted' ?> ms-1"></i>
</div>
</td>
<td class="text-center">
<?php if($user_gc['actif'] == 1): ?>
<span class="badge rounded-pill bg-success-light text-success px-3"><?= _("Actif") ?></span>
<?php if($isActif): ?>
<span class="badge rounded-pill bg-success-light text-success px-3 py-2">
<i class="fas fa-lock-open me-1"></i> <?= _("Ouvert") ?>
</span>
<?php else: ?>
<span class="badge rounded-pill bg-danger-light text-danger px-3"><?= _("Désactivé") ?></span>
<span class="badge rounded-pill bg-danger-light text-danger px-3 py-2">
<i class="fas fa-lock me-1"></i> <?= _("Bloqué") ?>
</span>
<?php endif; ?>
</td>
<td class="text-center">
<div class="btn-group shadow-xs rounded-pill bg-white border p-1">
<button class="btn btn-link btn-sm text-primary p-1 mx-1" title="<?= _("Modifier") ?>" onclick="afficher_users_gc_id(<?= $id ?>);">
<i class="fas fa-edit"></i>
<button class="btn btn-link btn-sm text-primary p-1 mx-1 action-icon" title="<?= _("Éditer") ?>" onclick="afficher_users_gc_id(<?= $id ?>);">
<i class="fas fa-user-edit"></i>
</button>
<button class="btn btn-link btn-sm <?= ($user_gc['reInit'] == 1) ? 'text-danger' : 'text-muted' ?> p-1 mx-1"
title="<?= _("Réinitialiser MDP") ?>" onclick="reinitpaswd_gc('<?= $code ?>');">
<button class="btn btn-link btn-sm text-info p-1 mx-1 action-icon" title="<?= _("Réinitialiser le mot de passe") ?>" onclick="reinitpaswd_gc('<?= $code ?>');">
<i class="fas fa-key"></i>
</button>
<button class="btn btn-link btn-sm <?= ($user_gc['actif'] == 1) ? 'text-danger' : 'text-success' ?> p-1 mx-1"
title="<?= ($user_gc['actif'] == 1) ? _("Désactiver") : _("Activer") ?>"
onclick="<?= ($user_gc['actif'] == 1) ? "desactiver_user_gc('$code')" : "activer_user_gc('$code')" ?>;">
<i class="fas <?= ($user_gc['actif'] == 1) ? 'fa-user-slash' : 'fa-user-check' ?>"></i>
<button class="btn btn-link btn-sm <?= $isActif ? 'text-danger' : 'text-success' ?> p-1 mx-1 action-icon"
title="<?= $isActif ? _("Désactiver l'utilisateur") : _("Activer l'utilisateur") ?>"
onclick="<?= $isActif ? "desactiver_user_gc('$code')" : "activer_user_gc('$code')" ?>;">
<i class="fas <?= $isActif ? 'fa-user-slash' : 'fa-user-check' ?>"></i>
</button>
</div>
</td>
@ -105,18 +123,22 @@
.bg-primary-ghost { background-color: rgba(33, 46, 83, 0.08); }
.bg-success-light { background-color: rgba(25, 135, 84, 0.1); }
.bg-danger-light { background-color: rgba(220, 53, 69, 0.1); }
.cursor-pointer { cursor: pointer; }
.form-switch .form-check-input { width: 2.5em; height: 1.25em; cursor: pointer; }
.btn-link { text-decoration: none; border: none; background: transparent; transition: 0.2s; }
.btn-link:hover { transform: scale(1.2); }
.form-switch .form-check-input { width: 2.2em; height: 1.1em; cursor: pointer; border-color: #dee2e6; }
.btn-link { text-decoration: none; border: none; background: transparent; transition: all 0.2s ease-in-out; }
.action-icon:hover { transform: scale(1.25); }
.datatable-users thead th { vertical-align: middle; border-bottom: 2px solid #eee; }
.table-hover tbody tr:hover { background-color: rgba(33, 46, 83, 0.02); }
</style>
<script>
// Initialisation sécurisée du DataTable
var checkDTUsers = setInterval(function() {
if (typeof initSmartTable === 'function') {
initSmartTable('.datatable-users', 'Liste_Utilisateurs_Garant', false);
initSmartTable('.datatable-users', 'Utilisateurs_Portail_Garant', false);
clearInterval(checkDTUsers);
}
}, 100);
</script>df
</script>