rhsaas/Vue/Ajaxhabilitation/index.php
2026-01-16 07:11:49 +00:00

111 lines
5.3 KiB
PHP
Executable File

<div id="div_menu_profil" class="animate__animated animate__fadeIn">
<div class="row g-4">
<div id="div_utilisateur_profil_1" class="col-md-6">
<div class="card h-100 shadow-sm border-danger-subtle">
<div class="card-header bg-danger-subtle text-danger d-flex justify-content-between align-items-center py-3">
<h6 class="mb-0 fw-bold"><i class="fas fa-lock me-2"></i><?= _("Menus non accessibles") ?></h6>
<span class="badge bg-danger rounded-pill"><?= count($menus_non_accessibles) ?></span>
</div>
<div class="p-2 border-bottom bg-light">
<button type="button" class="btn btn-sm btn-outline-danger w-100 fw-bold shadow-xs"
onclick="javascript:ajouter_tous_menus_principal_profil_rh();">
<?= _("Tout ajouter") ?> <i class="fas fa-angle-double-right ms-1"></i>
</button>
</div>
<div class="table-responsive" style="max-height: 400px; overflow-y: auto;">
<table class="table table-hover align-middle mb-0">
<tbody class="small">
<?php foreach ($menus_non_accessibles as $m):
$codeMenu = $m['codeMenu'];
$libeleMenu = est_anglophone() ? $m['libelleEng'] : $m['libeleMenu'];
?>
<tr>
<td class="ps-3"><?= $libeleMenu ?></td>
<td class="text-end pe-3" width="50">
<button class="btn btn-sm btn-info text-white rounded-circle btn-transfer shadow-sm"
title="<?= _("Ajouter") ?>"
onClick="javascript:ajouter_un_menu_principal_profil_rh('<?=$codeMenu?>');">
<i class="fas fa-arrow-right"></i>
</button>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
<div id="div_utilisateur_profil_2" class="col-md-6">
<div class="card h-100 shadow-sm border-success-subtle">
<div class="card-header bg-success-subtle text-success d-flex justify-content-between align-items-center py-3">
<h6 class="mb-0 fw-bold"><i class="fas fa-check-double me-2"></i><?= _("Menus accessibles") ?></h6>
<span class="badge bg-success rounded-pill"><?= count($menus_accessibles) ?></span>
</div>
<div class="p-2 border-bottom bg-light">
<button type="button" class="btn btn-sm btn-outline-success w-100 fw-bold shadow-xs"
onclick="javascript:retirer_tous_menus_principal_profil_rh();">
<i class="fas fa-angle-double-left me-1"></i> <?= _("Tout retirer") ?>
</button>
</div>
<div class="table-responsive" style="max-height: 400px; overflow-y: auto;">
<table class="table table-hover align-middle mb-0">
<tbody class="small">
<?php foreach ($menus_accessibles as $m):
$codeMenu = $m['codeMenu'];
$libeleMenu = est_anglophone() ? $m['libelleEng'] : $m['libeleMenu'];
?>
<tr>
<td class="ps-3" width="50">
<button class="btn btn-sm btn-warning text-white rounded-circle btn-transfer shadow-sm"
title="<?= _("Retirer") ?>"
onClick="javascript:retirer_un_menu_principal_profil_rh('<?=$codeMenu?>');">
<i class="fas fa-arrow-left"></i>
</button>
</td>
<td class="text-start"><?= $libeleMenu ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<style>
/* Effets de transfert */
.btn-transfer {
width: 28px;
height: 28px;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btn-transfer:hover {
transform: scale(1.2);
}
/* Scrollbar personnalisée */
.table-responsive::-webkit-scrollbar {
width: 6px;
}
.table-responsive::-webkit-scrollbar-thumb {
background: #dee2e6;
border-radius: 10px;
}
/* Ligne de tableau au survol */
.table-hover tbody tr:hover {
background-color: #f8f9fa !important;
}
.shadow-xs { box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
</style>