122 lines
7.2 KiB
PHP
Executable File
122 lines
7.2 KiB
PHP
Executable File
<?php
|
|
$this->titre = "INTER SANTE - Utilisateurs Portail Garant";
|
|
$codeGcAssureur = $this->nettoyer($gc['codeGcAssureur']);
|
|
$nomGcAssureur = $this->nettoyer($gc['libelle']);
|
|
?>
|
|
|
|
<div class="page-content animate__animated animate__fadeIn">
|
|
<div class="header-section mb-4">
|
|
<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>
|
|
</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>
|
|
</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") ?>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<input type="hidden" id="codeGcAssureur" value="<?= $codeGcAssureur ?>">
|
|
<input type="hidden" id="idGc" value="<?= $this->nettoyer($gc['id']) ?>">
|
|
|
|
<div class="card border-0 shadow-sm">
|
|
<div class="card-body p-0">
|
|
<div class="table-responsive">
|
|
<table class="table table-hover align-middle mb-0 datatable-users" style="width:100%; font-size: 9.5pt;">
|
|
<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 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"><?= _("État Compte") ?></th>
|
|
<th class="py-3 text-center" width="150px"><?= _("Actions") ?></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($users as $user_gc):
|
|
$id = $user_gc['idUtilisateur'];
|
|
$code = $user_gc['codeUtilisateur'];
|
|
?>
|
|
<tr>
|
|
<td class="ps-3 fw-bold text-primary"><?= $this->nettoyer($code) ?></td>
|
|
<td><?= $this->nettoyer($user_gc['utilisateur']) ?></td>
|
|
<td class="text-center">
|
|
<span class="badge bg-light text-dark border"><?= $user_gc['codeLangue'] ?></span>
|
|
</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' : '' ?>
|
|
onchange="gerer_acces_actes_gc('<?= $code ?>', '<?= $user_gc['actVisible'] ?>');">
|
|
</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' : '' ?>
|
|
onchange="gerer_acces_affection_gc('<?= $code ?>', '<?= $user_gc['AffectionVisible'] ?>');">
|
|
</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 else: ?>
|
|
<span class="badge rounded-pill bg-danger-light text-danger px-3"><?= _("Désactivé") ?></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>
|
|
<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 ?>');">
|
|
<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>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<style>
|
|
.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); }
|
|
</style>
|
|
|
|
<script>
|
|
// Initialisation sécurisée du DataTable
|
|
var checkDTUsers = setInterval(function() {
|
|
if (typeof initSmartTable === 'function') {
|
|
initSmartTable('.datatable-users', 'Liste_Utilisateurs_Garant', false);
|
|
clearInterval(checkDTUsers);
|
|
}
|
|
}, 100);
|
|
</script>df
|