| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635 |
- <!DOCTYPE html>
- <html lang="fr">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Admin - Gestion des utilisateurs</title>
-
- <!-- Tailwind CSS CDN -->
- <script src="https://cdn.tailwindcss.com"></script>
- <style>
- /* Style pour les onglets actifs Preline */
- button[role="tab"].active,
- button[role="tab"][aria-selected="true"] {
- background-color: white !important;
- color: rgb(31, 41, 55) !important; /* text-gray-800 */
- border-bottom: 2px solid rgb(37, 99, 235) !important; /* border-blue-600 */
- }
- @media (prefers-color-scheme: dark) {
- button[role="tab"].active,
- button[role="tab"][aria-selected="true"] {
- background-color: rgb(38, 38, 38) !important; /* dark:bg-neutral-800 */
- color: white !important;
- }
- }
- </style>
- </head>
- <body class="bg-gray-50 dark:bg-neutral-900">
-
- <?php
- $skip_default_content = true;
- include 'menu.php';
- ?>
-
- <!-- Content -->
- <div class="pt-12 lg:pt-16 lg:ps-64">
- <div class="min-h-screen p-4 md:p-8">
- <!-- Scrollspy container for menu.php compatibility -->
- <div id="scrollspy" class="hidden"></div>
-
- <!-- Page Header -->
- <div class="mb-6">
- <h1 class="text-2xl font-semibold text-gray-800 dark:text-white">Gestion des utilisateurs</h1>
- <p class="mt-2 text-sm text-gray-600 dark:text-neutral-400">Gérez les utilisateurs et leurs droits d'accès</p>
- </div>
- <!-- End Page Header -->
- <!-- Tabs Navigation -->
- <div class="mb-6">
- <nav class="flex border-b border-gray-200 dark:border-neutral-700" aria-label="Tabs" role="tablist">
- <button type="button" class="hs-tab-active:font-semibold hs-tab-active:border-blue-600 hs-tab-active:text-blue-600 py-4 px-6 inline-flex items-center gap-x-2 border-b-2 border-transparent text-sm whitespace-nowrap text-gray-500 hover:text-blue-600 focus:outline-none focus:text-blue-600 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 dark:hover:text-blue-500 active" id="tab-utilisateurs" data-hs-tab="#tab-content-utilisateurs" aria-controls="tab-content-utilisateurs" role="tab">
- <svg class="flex-shrink-0 size-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/>
- <circle cx="9" cy="7" r="4"/>
- <path d="M22 21v-2a4 4 0 0 0-3-3.87"/>
- <path d="M16 3.13a4 4 0 0 1 0 7.75"/>
- </svg>
- Utilisateurs
- </button>
- <button type="button" class="hs-tab-active:font-semibold hs-tab-active:border-blue-600 hs-tab-active:text-blue-600 py-4 px-6 inline-flex items-center gap-x-2 border-b-2 border-transparent text-sm whitespace-nowrap text-gray-500 hover:text-blue-600 focus:outline-none focus:text-blue-600 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 dark:hover:text-blue-500" id="tab-droits" data-hs-tab="#tab-content-droits" aria-controls="tab-content-droits" role="tab">
- <svg class="flex-shrink-0 size-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <rect width="18" height="11" x="3" y="11" rx="2" ry="2"/>
- <path d="M7 11V7a5 5 0 0 1 10 0v4"/>
- </svg>
- Attribution des droits
- </button>
- </nav>
- </div>
- <!-- End Tabs Navigation -->
- <!-- Tab Contents -->
- <div class="mt-3">
- <!-- Tab 1: Utilisateurs -->
- <div id="tab-content-utilisateurs" role="tabpanel" aria-labelledby="tab-utilisateurs">
- <!-- Liste des utilisateurs -->
- <div class="flex flex-col">
- <div class="-m-1.5 overflow-x-auto">
- <div class="p-1.5 min-w-full inline-block align-middle">
- <div class="bg-white border border-gray-200 rounded-xl shadow-sm overflow-hidden dark:bg-neutral-900 dark:border-neutral-700">
- <!-- Header with Add Button -->
- <div class="px-6 py-4 border-b border-gray-200 dark:border-neutral-700 flex justify-between items-center">
- <h2 class="text-lg font-semibold text-gray-800 dark:text-white">Liste des utilisateurs</h2>
- <button type="button" id="btn-add-user" class="py-2 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 focus:outline-none focus:bg-blue-700 transition-colors" data-hs-overlay="#modal-ajouter-utilisateur">
- <svg class="size-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <path d="M5 12h14"/>
- <path d="M12 5v14"/>
- </svg>
- Nouvel utilisateur
- </button>
- </div>
- <!-- End Header -->
-
- <!-- Table -->
- <table class="min-w-full divide-y divide-gray-200 dark:divide-neutral-700">
- <thead class="bg-gray-50 dark:bg-neutral-900">
- <tr>
- <th scope="col" class="px-6 py-3 text-start">
- <span class="text-xs font-semibold uppercase text-gray-800 dark:text-neutral-200">Nom</span>
- </th>
- <th scope="col" class="px-6 py-3 text-start">
- <span class="text-xs font-semibold uppercase text-gray-800 dark:text-neutral-200">Email</span>
- </th>
- <th scope="col" class="px-6 py-3 text-start">
- <span class="text-xs font-semibold uppercase text-gray-800 dark:text-neutral-200">Date de création</span>
- </th>
- <th scope="col" class="px-6 py-3 text-end">
- <span class="text-xs font-semibold uppercase text-gray-800 dark:text-neutral-200">Actions</span>
- </th>
- </tr>
- </thead>
- <tbody class="divide-y divide-gray-200 dark:divide-neutral-700">
- <!-- Ligne 1 -->
- <tr class="hover:bg-gray-50 dark:hover:bg-neutral-800">
- <td class="px-6 py-4 whitespace-nowrap">
- <div class="flex items-center gap-x-3">
- <div class="flex-shrink-0 h-10 w-10">
- <div class="h-10 w-10 rounded-full bg-blue-100 dark:bg-blue-900/30 flex items-center justify-center">
- <span class="text-sm font-medium text-blue-800 dark:text-blue-300">JD</span>
- </div>
- </div>
- <span class="text-sm font-medium text-gray-800 dark:text-neutral-200">Jean Dupont</span>
- </div>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="text-sm text-gray-600 dark:text-neutral-400">jean.dupont@example.com</span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="text-sm text-gray-600 dark:text-neutral-400">12/01/2025</span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap text-end">
- <button type="button" class="inline-flex items-center gap-x-2 text-sm font-medium text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300" title="Supprimer l'utilisateur">
- <svg class="size-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <path d="M3 6h18"/>
- <path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/>
- <path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>
- <line x1="10" x2="10" y1="11" y2="17"/>
- <line x1="14" x2="14" y1="11" y2="17"/>
- </svg>
- Supprimer
- </button>
- </td>
- </tr>
- <!-- Ligne 2 -->
- <tr class="hover:bg-gray-50 dark:hover:bg-neutral-800">
- <td class="px-6 py-4 whitespace-nowrap">
- <div class="flex items-center gap-x-3">
- <div class="flex-shrink-0 h-10 w-10">
- <div class="h-10 w-10 rounded-full bg-purple-100 dark:bg-purple-900/30 flex items-center justify-center">
- <span class="text-sm font-medium text-purple-800 dark:text-purple-300">MM</span>
- </div>
- </div>
- <span class="text-sm font-medium text-gray-800 dark:text-neutral-200">Marie Martin</span>
- </div>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="text-sm text-gray-600 dark:text-neutral-400">marie.martin@example.com</span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="text-sm text-gray-600 dark:text-neutral-400">10/01/2025</span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap text-end">
- <button type="button" class="inline-flex items-center gap-x-2 text-sm font-medium text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300" title="Supprimer l'utilisateur">
- <svg class="size-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <path d="M3 6h18"/>
- <path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/>
- <path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>
- <line x1="10" x2="10" y1="11" y2="17"/>
- <line x1="14" x2="14" y1="11" y2="17"/>
- </svg>
- Supprimer
- </button>
- </td>
- </tr>
- <!-- Ligne 3 -->
- <tr class="hover:bg-gray-50 dark:hover:bg-neutral-800">
- <td class="px-6 py-4 whitespace-nowrap">
- <div class="flex items-center gap-x-3">
- <div class="flex-shrink-0 h-10 w-10">
- <div class="h-10 w-10 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center">
- <span class="text-sm font-medium text-green-800 dark:text-green-300">PD</span>
- </div>
- </div>
- <span class="text-sm font-medium text-gray-800 dark:text-neutral-200">Pierre Durand</span>
- </div>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="text-sm text-gray-600 dark:text-neutral-400">pierre.durand@example.com</span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="text-sm text-gray-600 dark:text-neutral-400">08/01/2025</span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap text-end">
- <button type="button" class="inline-flex items-center gap-x-2 text-sm font-medium text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300" title="Supprimer l'utilisateur">
- <svg class="size-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <path d="M3 6h18"/>
- <path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/>
- <path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>
- <line x1="10" x2="10" y1="11" y2="17"/>
- <line x1="14" x2="14" y1="11" y2="17"/>
- </svg>
- Supprimer
- </button>
- </td>
- </tr>
- <!-- Ligne 4 -->
- <tr class="hover:bg-gray-50 dark:hover:bg-neutral-800">
- <td class="px-6 py-4 whitespace-nowrap">
- <div class="flex items-center gap-x-3">
- <div class="flex-shrink-0 h-10 w-10">
- <div class="h-10 w-10 rounded-full bg-orange-100 dark:bg-orange-900/30 flex items-center justify-center">
- <span class="text-sm font-medium text-orange-800 dark:text-orange-300">SB</span>
- </div>
- </div>
- <span class="text-sm font-medium text-gray-800 dark:text-neutral-200">Sophie Bernard</span>
- </div>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="text-sm text-gray-600 dark:text-neutral-400">sophie.bernard@example.com</span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="text-sm text-gray-600 dark:text-neutral-400">05/01/2025</span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap text-end">
- <button type="button" class="inline-flex items-center gap-x-2 text-sm font-medium text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300" title="Supprimer l'utilisateur">
- <svg class="size-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <path d="M3 6h18"/>
- <path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/>
- <path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>
- <line x1="10" x2="10" y1="11" y2="17"/>
- <line x1="14" x2="14" y1="11" y2="17"/>
- </svg>
- Supprimer
- </button>
- </td>
- </tr>
- </tbody>
- </table>
- <!-- End Table -->
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- End Tab 1: Utilisateurs -->
- <!-- Tab 2: Attribution des droits -->
- <div id="tab-content-droits" class="hidden" role="tabpanel" aria-labelledby="tab-droits">
- <!-- Access Selection -->
- <div class="mb-6">
- <div class="bg-white border border-gray-200 rounded-xl shadow-sm p-6 dark:bg-neutral-800 dark:border-neutral-700">
- <div class="flex flex-col sm:flex-row items-center justify-center gap-4">
- <label class="text-base font-semibold text-gray-800 dark:text-neutral-200 whitespace-nowrap">
- Sélectionner un site
- </label>
- <div class="hs-dropdown relative inline-flex">
- <button id="hs-dropdown-access" type="button" class="hs-dropdown-toggle py-3 px-6 inline-flex items-center gap-x-3 text-base font-medium rounded-lg border-2 border-gray-300 bg-white text-gray-800 shadow-sm hover:bg-gray-50 hover:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-neutral-800 dark:border-neutral-600 dark:text-white dark:hover:bg-neutral-700 dark:hover:border-blue-500 transition-colors min-w-[200px] justify-between" aria-expanded="false">
- <span id="selected-site" class="font-semibold">Auto 33</span>
- <svg class="hs-dropdown-open:rotate-180 size-5 text-gray-600 dark:text-neutral-400 transition-transform" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <path d="m6 9 6 6 6-6"/>
- </svg>
- </button>
- <div class="hs-dropdown-menu transition-[opacity,margin] duration hs-dropdown-open:opacity-100 opacity-0 hidden min-w-[200px] bg-white shadow-lg rounded-lg p-2 mt-2 dark:bg-neutral-800 dark:border dark:border-neutral-700 z-10" role="menu" aria-labelledby="hs-dropdown-access">
- <a class="flex items-center gap-x-3.5 py-3 px-4 rounded-lg text-sm font-medium text-gray-800 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:hover:text-neutral-300 transition-colors" href="#" role="menuitem">
- Auto 33
- </a>
- <a class="flex items-center gap-x-3.5 py-3 px-4 rounded-lg text-sm font-medium text-gray-800 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:hover:text-neutral-300 transition-colors" href="#" role="menuitem">
- Admin RH
- </a>
- <a class="flex items-center gap-x-3.5 py-3 px-4 rounded-lg text-sm font-medium text-gray-800 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:hover:text-neutral-300 transition-colors" href="#" role="menuitem">
- Admin IT
- </a>
- <a class="flex items-center gap-x-3.5 py-3 px-4 rounded-lg text-sm font-medium text-gray-800 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:hover:text-neutral-300 transition-colors" href="#" role="menuitem">
- Dashboard IT
- </a>
- <a class="flex items-center gap-x-3.5 py-3 px-4 rounded-lg text-sm font-medium text-gray-800 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:hover:text-neutral-300 transition-colors" href="#" role="menuitem">
- Dashboard RH
- </a>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- End Access Selection -->
- <!-- Table des droits -->
- <div class="flex flex-col">
- <div class="-m-1.5 overflow-x-auto">
- <div class="p-1.5 min-w-full inline-block align-middle">
- <div class="bg-white border border-gray-200 rounded-xl shadow-sm overflow-hidden dark:bg-neutral-900 dark:border-neutral-700">
- <!-- Header with Add Button -->
- <div class="px-6 py-4 border-b border-gray-200 dark:border-neutral-700 flex justify-between items-center">
- <h2 class="text-lg font-semibold text-gray-800 dark:text-white">Droits d'accès pour <span id="site-title">Auto 33</span></h2>
- <button type="button" id="btn-add-droit" class="py-2 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 focus:outline-none focus:bg-blue-700 transition-colors" data-hs-overlay="#modal-ajouter-droit">
- <svg class="size-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <path d="M5 12h14"/>
- <path d="M12 5v14"/>
- </svg>
- Ajouter un accès
- </button>
- </div>
- <!-- End Header -->
-
- <!-- Table -->
- <table class="min-w-full divide-y divide-gray-200 dark:divide-neutral-700">
- <thead class="bg-gray-50 dark:bg-neutral-900">
- <tr>
- <th scope="col" class="px-6 py-3 text-start">
- <span class="text-xs font-semibold uppercase text-gray-800 dark:text-neutral-200">Utilisateur</span>
- </th>
- <th scope="col" class="px-6 py-3 text-start">
- <span class="text-xs font-semibold uppercase text-gray-800 dark:text-neutral-200">Rôle / Groupe</span>
- </th>
- <th scope="col" class="px-6 py-3 text-end">
- <span class="text-xs font-semibold uppercase text-gray-800 dark:text-neutral-200">Actions</span>
- </th>
- </tr>
- </thead>
- <tbody class="divide-y divide-gray-200 dark:divide-neutral-700">
- <!-- Ligne 1 -->
- <tr class="hover:bg-gray-50 dark:hover:bg-neutral-800">
- <td class="px-6 py-4 whitespace-nowrap">
- <div class="flex items-center gap-x-3">
- <div class="flex-shrink-0 h-10 w-10">
- <div class="h-10 w-10 rounded-full bg-blue-100 dark:bg-blue-900/30 flex items-center justify-center">
- <span class="text-sm font-medium text-blue-800 dark:text-blue-300">JD</span>
- </div>
- </div>
- <span class="text-sm font-medium text-gray-800 dark:text-neutral-200">Jean Dupont</span>
- </div>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="py-1 px-2 inline-flex items-center gap-x-1 text-xs font-medium bg-purple-100 text-purple-800 rounded-full dark:bg-purple-500/10 dark:text-purple-500">
- Comptable
- </span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap text-end">
- <button type="button" class="inline-flex items-center gap-x-2 text-sm font-medium text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300" title="Retirer l'accès">
- <svg class="size-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <path d="M3 6h18"/>
- <path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/>
- <path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>
- <line x1="10" x2="10" y1="11" y2="17"/>
- <line x1="14" x2="14" y1="11" y2="17"/>
- </svg>
- Retirer
- </button>
- </td>
- </tr>
- <!-- Ligne 2 -->
- <tr class="hover:bg-gray-50 dark:hover:bg-neutral-800">
- <td class="px-6 py-4 whitespace-nowrap">
- <div class="flex items-center gap-x-3">
- <div class="flex-shrink-0 h-10 w-10">
- <div class="h-10 w-10 rounded-full bg-orange-100 dark:bg-orange-900/30 flex items-center justify-center">
- <span class="text-sm font-medium text-orange-800 dark:text-orange-300">SB</span>
- </div>
- </div>
- <span class="text-sm font-medium text-gray-800 dark:text-neutral-200">Sophie Bernard</span>
- </div>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="py-1 px-2 inline-flex items-center gap-x-1 text-xs font-medium bg-orange-100 text-orange-800 rounded-full dark:bg-orange-500/10 dark:text-orange-500">
- Directeur
- </span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap text-end">
- <button type="button" class="inline-flex items-center gap-x-2 text-sm font-medium text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300" title="Retirer l'accès">
- <svg class="size-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <path d="M3 6h18"/>
- <path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/>
- <path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>
- <line x1="10" x2="10" y1="11" y2="17"/>
- <line x1="14" x2="14" y1="11" y2="17"/>
- </svg>
- Retirer
- </button>
- </td>
- </tr>
- </tbody>
- </table>
- <!-- End Table -->
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- End Tab 2: Attribution des droits -->
- </div>
- <!-- End Tab Contents -->
- </div>
- </div>
- <!-- End Content -->
-
- <!-- Modal Ajouter Utilisateur -->
- <div id="modal-ajouter-utilisateur" class="hs-overlay hidden size-full fixed top-0 start-0 z-[80] overflow-x-hidden overflow-y-auto pointer-events-none">
- <div class="hs-overlay-open:mt-7 hs-overlay-open:opacity-100 hs-overlay-open:duration-500 mt-0 opacity-0 ease-out transition-all sm:max-w-lg sm:w-full m-3 sm:mx-auto min-h-[calc(100%-3.5rem)] flex items-center">
- <div class="w-full flex flex-col bg-white border shadow-sm rounded-xl pointer-events-auto dark:bg-neutral-800 dark:border-neutral-700 dark:shadow-neutral-700/70">
- <!-- Header -->
- <div class="flex justify-between items-center py-4 px-6 border-b border-gray-200 dark:border-neutral-700">
- <h3 class="text-xl font-semibold text-gray-800 dark:text-white">
- Nouvel utilisateur
- </h3>
- <button type="button" class="flex justify-center items-center size-8 text-sm font-semibold rounded-lg border border-transparent text-gray-500 hover:bg-gray-100 hover:text-gray-800 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 dark:hover:bg-neutral-700 dark:hover:text-white transition-colors" data-hs-overlay="#modal-ajouter-utilisateur">
- <span class="sr-only">Fermer</span>
- <svg class="flex-shrink-0 size-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <path d="m18 6-12 12"/>
- <path d="m6 6 12 12"/>
- </svg>
- </button>
- </div>
- <!-- End Header -->
-
- <!-- Body -->
- <div class="p-6 overflow-y-auto max-h-[calc(100vh-200px)]">
- <form class="space-y-5">
- <div>
- <label for="nom" class="block text-sm font-medium text-gray-700 dark:text-neutral-300 mb-2">
- Nom complet
- </label>
- <input
- type="text"
- id="nom"
- name="nom"
- class="py-2.5 px-4 block w-full border-gray-200 rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-400 dark:placeholder-neutral-500 dark:focus:ring-neutral-600 transition-colors"
- placeholder="Jean Dupont"
- required
- >
- </div>
- <div>
- <label for="email" class="block text-sm font-medium text-gray-700 dark:text-neutral-300 mb-2">
- Adresse email
- </label>
- <input
- type="email"
- id="email"
- name="email"
- class="py-2.5 px-4 block w-full border-gray-200 rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-400 dark:placeholder-neutral-500 dark:focus:ring-neutral-600 transition-colors"
- placeholder="jean.dupont@example.com"
- required
- >
- </div>
- <div>
- <label for="password" class="block text-sm font-medium text-gray-700 dark:text-neutral-300 mb-2">
- Mot de passe temporaire
- </label>
- <input
- type="password"
- id="password"
- name="password"
- class="py-2.5 px-4 block w-full border-gray-200 rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-400 dark:placeholder-neutral-500 dark:focus:ring-neutral-600 transition-colors"
- placeholder="••••••••"
- required
- >
- <p class="mt-1 text-xs text-gray-500 dark:text-neutral-400">
- L'utilisateur devra changer son mot de passe à la première connexion
- </p>
- </div>
- </form>
- </div>
- <!-- End Body -->
-
- <!-- Footer -->
- <div class="flex justify-end items-center gap-x-3 py-4 px-6 border-t border-gray-200 dark:border-neutral-700 bg-gray-50 dark:bg-neutral-900/50">
- <button
- type="button"
- class="py-2.5 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 transition-colors"
- data-hs-overlay="#modal-ajouter-utilisateur"
- >
- Annuler
- </button>
- <button
- type="button"
- class="py-2.5 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 focus:outline-none focus:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none transition-colors"
- >
- Créer l'utilisateur
- </button>
- </div>
- <!-- End Footer -->
- </div>
- </div>
- </div>
- <!-- End Modal Ajouter Utilisateur -->
- <!-- Modal Ajouter Droit -->
- <div id="modal-ajouter-droit" class="hs-overlay hidden size-full fixed top-0 start-0 z-[80] overflow-x-hidden overflow-y-auto pointer-events-none">
- <div class="hs-overlay-open:mt-7 hs-overlay-open:opacity-100 hs-overlay-open:duration-500 mt-0 opacity-0 ease-out transition-all sm:max-w-lg sm:w-full m-3 sm:mx-auto min-h-[calc(100%-3.5rem)] flex items-center">
- <div class="w-full flex flex-col bg-white border shadow-sm rounded-xl pointer-events-auto dark:bg-neutral-800 dark:border-neutral-700 dark:shadow-neutral-700/70">
- <!-- Header -->
- <div class="flex justify-between items-center py-4 px-6 border-b border-gray-200 dark:border-neutral-700">
- <h3 class="text-xl font-semibold text-gray-800 dark:text-white">
- Ajouter un accès
- </h3>
- <button type="button" class="flex justify-center items-center size-8 text-sm font-semibold rounded-lg border border-transparent text-gray-500 hover:bg-gray-100 hover:text-gray-800 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 dark:hover:bg-neutral-700 dark:hover:text-white transition-colors" data-hs-overlay="#modal-ajouter-droit">
- <span class="sr-only">Fermer</span>
- <svg class="flex-shrink-0 size-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <path d="m18 6-12 12"/>
- <path d="m6 6 12 12"/>
- </svg>
- </button>
- </div>
- <!-- End Header -->
-
- <!-- Body -->
- <div class="p-6 overflow-y-auto max-h-[calc(100vh-200px)]">
- <form class="space-y-5">
- <div>
- <label for="utilisateur-droit" class="block text-sm font-medium text-gray-700 dark:text-neutral-300 mb-2">
- Utilisateur
- </label>
- <select
- id="utilisateur-droit"
- name="utilisateur-droit"
- class="py-2.5 px-4 block w-full border-gray-200 rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-400 dark:focus:ring-neutral-600 transition-colors"
- required
- >
- <option value="">Sélectionner un utilisateur</option>
- <option value="jean-dupont">Jean Dupont</option>
- <option value="marie-martin">Marie Martin</option>
- <option value="pierre-durand">Pierre Durand</option>
- <option value="sophie-bernard">Sophie Bernard</option>
- </select>
- </div>
- <div>
- <label for="role-droit" class="block text-sm font-medium text-gray-700 dark:text-neutral-300 mb-2">
- Rôle / Groupe
- </label>
- <select
- id="role-droit"
- name="role-droit"
- class="py-2.5 px-4 block w-full border-gray-200 rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-400 dark:focus:ring-neutral-600 transition-colors"
- required
- >
- <option value="">Sélectionner un rôle</option>
- <option value="comptable">Comptable</option>
- <option value="directeur">Directeur</option>
- <option value="admin">Administrateur</option>
- <option value="rh">RH</option>
- </select>
- </div>
- <div class="bg-blue-50 dark:bg-blue-900/20 rounded-lg p-4">
- <div class="flex gap-x-3">
- <svg class="flex-shrink-0 size-5 text-blue-600 dark:text-blue-400" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <circle cx="12" cy="12" r="10"/>
- <path d="M12 16v-4"/>
- <path d="M12 8h.01"/>
- </svg>
- <div class="flex-1">
- <p class="text-sm text-blue-800 dark:text-blue-400">
- Cet accès sera ajouté au site actuellement sélectionné : <strong id="modal-site-name">Auto 33</strong>
- </p>
- </div>
- </div>
- </div>
- </form>
- </div>
- <!-- End Body -->
-
- <!-- Footer -->
- <div class="flex justify-end items-center gap-x-3 py-4 px-6 border-t border-gray-200 dark:border-neutral-700 bg-gray-50 dark:bg-neutral-900/50">
- <button
- type="button"
- class="py-2.5 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 transition-colors"
- data-hs-overlay="#modal-ajouter-droit"
- >
- Annuler
- </button>
- <button
- type="button"
- class="py-2.5 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 focus:outline-none focus:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none transition-colors"
- >
- Ajouter l'accès
- </button>
- </div>
- <!-- End Footer -->
- </div>
- </div>
- </div>
- <!-- End Modal Ajouter Droit -->
-
- <!-- Preline UI - Chargé à la fin du body pour une initialisation correcte -->
- <script src="https://cdn.jsdelivr.net/npm/preline@2.1.0/dist/preline.js"></script>
-
- <!-- Script principal -->
- <script>
- document.addEventListener('DOMContentLoaded', function() {
- // Gérer le changement de site dans le dropdown (onglet droits)
- setTimeout(function() {
- const dropdownButton = document.getElementById('hs-dropdown-access');
- const dropdownContainer = dropdownButton?.closest('.hs-dropdown');
- const dropdownMenu = dropdownContainer?.querySelector('.hs-dropdown-menu');
- const dropdownItems = dropdownMenu?.querySelectorAll('a');
- const selectedSiteSpan = document.getElementById('selected-site');
- const siteTitle = document.getElementById('site-title');
- const modalSiteName = document.getElementById('modal-site-name');
-
- // Valeur par défaut
- let selectedSite = 'Auto 33';
-
- if (dropdownItems && dropdownItems.length > 0) {
- dropdownItems.forEach(item => {
- item.addEventListener('click', function(e) {
- e.preventDefault();
- const selectedText = this.textContent.trim();
- selectedSite = selectedText;
-
- // Mettre à jour tous les textes
- if (selectedSiteSpan) {
- selectedSiteSpan.textContent = selectedText;
- }
- if (siteTitle) {
- siteTitle.textContent = selectedText;
- }
- if (modalSiteName) {
- modalSiteName.textContent = selectedText;
- }
- });
- });
- }
- }, 200);
- });
- </script>
- </body>
- </html>
|