gestion-utilisateurs.php 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  1. <!DOCTYPE html>
  2. <html lang="fr">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Admin - Gestion des utilisateurs</title>
  7. <!-- Tailwind CSS CDN -->
  8. <script src="https://cdn.tailwindcss.com"></script>
  9. <style>
  10. /* Style pour les onglets actifs Preline */
  11. button[role="tab"].active,
  12. button[role="tab"][aria-selected="true"] {
  13. background-color: white !important;
  14. color: rgb(31, 41, 55) !important; /* text-gray-800 */
  15. border-bottom: 2px solid rgb(37, 99, 235) !important; /* border-blue-600 */
  16. }
  17. @media (prefers-color-scheme: dark) {
  18. button[role="tab"].active,
  19. button[role="tab"][aria-selected="true"] {
  20. background-color: rgb(38, 38, 38) !important; /* dark:bg-neutral-800 */
  21. color: white !important;
  22. }
  23. }
  24. </style>
  25. </head>
  26. <body class="bg-gray-50 dark:bg-neutral-900">
  27. <?php
  28. $skip_default_content = true;
  29. include 'menu.php';
  30. ?>
  31. <!-- Content -->
  32. <div class="pt-12 lg:pt-16 lg:ps-64">
  33. <div class="min-h-screen p-4 md:p-8">
  34. <!-- Scrollspy container for menu.php compatibility -->
  35. <div id="scrollspy" class="hidden"></div>
  36. <!-- Page Header -->
  37. <div class="mb-6">
  38. <h1 class="text-2xl font-semibold text-gray-800 dark:text-white">Gestion des utilisateurs</h1>
  39. <p class="mt-2 text-sm text-gray-600 dark:text-neutral-400">Gérez les utilisateurs et leurs droits d'accès</p>
  40. </div>
  41. <!-- End Page Header -->
  42. <!-- Tabs Navigation -->
  43. <div class="mb-6">
  44. <nav class="flex border-b border-gray-200 dark:border-neutral-700" aria-label="Tabs" role="tablist">
  45. <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">
  46. <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">
  47. <path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/>
  48. <circle cx="9" cy="7" r="4"/>
  49. <path d="M22 21v-2a4 4 0 0 0-3-3.87"/>
  50. <path d="M16 3.13a4 4 0 0 1 0 7.75"/>
  51. </svg>
  52. Utilisateurs
  53. </button>
  54. <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">
  55. <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">
  56. <rect width="18" height="11" x="3" y="11" rx="2" ry="2"/>
  57. <path d="M7 11V7a5 5 0 0 1 10 0v4"/>
  58. </svg>
  59. Attribution des droits
  60. </button>
  61. </nav>
  62. </div>
  63. <!-- End Tabs Navigation -->
  64. <!-- Tab Contents -->
  65. <div class="mt-3">
  66. <!-- Tab 1: Utilisateurs -->
  67. <div id="tab-content-utilisateurs" role="tabpanel" aria-labelledby="tab-utilisateurs">
  68. <!-- Liste des utilisateurs -->
  69. <div class="flex flex-col">
  70. <div class="-m-1.5 overflow-x-auto">
  71. <div class="p-1.5 min-w-full inline-block align-middle">
  72. <div class="bg-white border border-gray-200 rounded-xl shadow-sm overflow-hidden dark:bg-neutral-900 dark:border-neutral-700">
  73. <!-- Header with Add Button -->
  74. <div class="px-6 py-4 border-b border-gray-200 dark:border-neutral-700 flex justify-between items-center">
  75. <h2 class="text-lg font-semibold text-gray-800 dark:text-white">Liste des utilisateurs</h2>
  76. <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">
  77. <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">
  78. <path d="M5 12h14"/>
  79. <path d="M12 5v14"/>
  80. </svg>
  81. Nouvel utilisateur
  82. </button>
  83. </div>
  84. <!-- End Header -->
  85. <!-- Table -->
  86. <table class="min-w-full divide-y divide-gray-200 dark:divide-neutral-700">
  87. <thead class="bg-gray-50 dark:bg-neutral-900">
  88. <tr>
  89. <th scope="col" class="px-6 py-3 text-start">
  90. <span class="text-xs font-semibold uppercase text-gray-800 dark:text-neutral-200">Nom</span>
  91. </th>
  92. <th scope="col" class="px-6 py-3 text-start">
  93. <span class="text-xs font-semibold uppercase text-gray-800 dark:text-neutral-200">Email</span>
  94. </th>
  95. <th scope="col" class="px-6 py-3 text-start">
  96. <span class="text-xs font-semibold uppercase text-gray-800 dark:text-neutral-200">Date de création</span>
  97. </th>
  98. <th scope="col" class="px-6 py-3 text-end">
  99. <span class="text-xs font-semibold uppercase text-gray-800 dark:text-neutral-200">Actions</span>
  100. </th>
  101. </tr>
  102. </thead>
  103. <tbody class="divide-y divide-gray-200 dark:divide-neutral-700">
  104. <!-- Ligne 1 -->
  105. <tr class="hover:bg-gray-50 dark:hover:bg-neutral-800">
  106. <td class="px-6 py-4 whitespace-nowrap">
  107. <div class="flex items-center gap-x-3">
  108. <div class="flex-shrink-0 h-10 w-10">
  109. <div class="h-10 w-10 rounded-full bg-blue-100 dark:bg-blue-900/30 flex items-center justify-center">
  110. <span class="text-sm font-medium text-blue-800 dark:text-blue-300">JD</span>
  111. </div>
  112. </div>
  113. <span class="text-sm font-medium text-gray-800 dark:text-neutral-200">Jean Dupont</span>
  114. </div>
  115. </td>
  116. <td class="px-6 py-4 whitespace-nowrap">
  117. <span class="text-sm text-gray-600 dark:text-neutral-400">jean.dupont@example.com</span>
  118. </td>
  119. <td class="px-6 py-4 whitespace-nowrap">
  120. <span class="text-sm text-gray-600 dark:text-neutral-400">12/01/2025</span>
  121. </td>
  122. <td class="px-6 py-4 whitespace-nowrap text-end">
  123. <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">
  124. <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">
  125. <path d="M3 6h18"/>
  126. <path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/>
  127. <path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>
  128. <line x1="10" x2="10" y1="11" y2="17"/>
  129. <line x1="14" x2="14" y1="11" y2="17"/>
  130. </svg>
  131. Supprimer
  132. </button>
  133. </td>
  134. </tr>
  135. <!-- Ligne 2 -->
  136. <tr class="hover:bg-gray-50 dark:hover:bg-neutral-800">
  137. <td class="px-6 py-4 whitespace-nowrap">
  138. <div class="flex items-center gap-x-3">
  139. <div class="flex-shrink-0 h-10 w-10">
  140. <div class="h-10 w-10 rounded-full bg-purple-100 dark:bg-purple-900/30 flex items-center justify-center">
  141. <span class="text-sm font-medium text-purple-800 dark:text-purple-300">MM</span>
  142. </div>
  143. </div>
  144. <span class="text-sm font-medium text-gray-800 dark:text-neutral-200">Marie Martin</span>
  145. </div>
  146. </td>
  147. <td class="px-6 py-4 whitespace-nowrap">
  148. <span class="text-sm text-gray-600 dark:text-neutral-400">marie.martin@example.com</span>
  149. </td>
  150. <td class="px-6 py-4 whitespace-nowrap">
  151. <span class="text-sm text-gray-600 dark:text-neutral-400">10/01/2025</span>
  152. </td>
  153. <td class="px-6 py-4 whitespace-nowrap text-end">
  154. <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">
  155. <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">
  156. <path d="M3 6h18"/>
  157. <path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/>
  158. <path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>
  159. <line x1="10" x2="10" y1="11" y2="17"/>
  160. <line x1="14" x2="14" y1="11" y2="17"/>
  161. </svg>
  162. Supprimer
  163. </button>
  164. </td>
  165. </tr>
  166. <!-- Ligne 3 -->
  167. <tr class="hover:bg-gray-50 dark:hover:bg-neutral-800">
  168. <td class="px-6 py-4 whitespace-nowrap">
  169. <div class="flex items-center gap-x-3">
  170. <div class="flex-shrink-0 h-10 w-10">
  171. <div class="h-10 w-10 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center">
  172. <span class="text-sm font-medium text-green-800 dark:text-green-300">PD</span>
  173. </div>
  174. </div>
  175. <span class="text-sm font-medium text-gray-800 dark:text-neutral-200">Pierre Durand</span>
  176. </div>
  177. </td>
  178. <td class="px-6 py-4 whitespace-nowrap">
  179. <span class="text-sm text-gray-600 dark:text-neutral-400">pierre.durand@example.com</span>
  180. </td>
  181. <td class="px-6 py-4 whitespace-nowrap">
  182. <span class="text-sm text-gray-600 dark:text-neutral-400">08/01/2025</span>
  183. </td>
  184. <td class="px-6 py-4 whitespace-nowrap text-end">
  185. <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">
  186. <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">
  187. <path d="M3 6h18"/>
  188. <path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/>
  189. <path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>
  190. <line x1="10" x2="10" y1="11" y2="17"/>
  191. <line x1="14" x2="14" y1="11" y2="17"/>
  192. </svg>
  193. Supprimer
  194. </button>
  195. </td>
  196. </tr>
  197. <!-- Ligne 4 -->
  198. <tr class="hover:bg-gray-50 dark:hover:bg-neutral-800">
  199. <td class="px-6 py-4 whitespace-nowrap">
  200. <div class="flex items-center gap-x-3">
  201. <div class="flex-shrink-0 h-10 w-10">
  202. <div class="h-10 w-10 rounded-full bg-orange-100 dark:bg-orange-900/30 flex items-center justify-center">
  203. <span class="text-sm font-medium text-orange-800 dark:text-orange-300">SB</span>
  204. </div>
  205. </div>
  206. <span class="text-sm font-medium text-gray-800 dark:text-neutral-200">Sophie Bernard</span>
  207. </div>
  208. </td>
  209. <td class="px-6 py-4 whitespace-nowrap">
  210. <span class="text-sm text-gray-600 dark:text-neutral-400">sophie.bernard@example.com</span>
  211. </td>
  212. <td class="px-6 py-4 whitespace-nowrap">
  213. <span class="text-sm text-gray-600 dark:text-neutral-400">05/01/2025</span>
  214. </td>
  215. <td class="px-6 py-4 whitespace-nowrap text-end">
  216. <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">
  217. <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">
  218. <path d="M3 6h18"/>
  219. <path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/>
  220. <path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>
  221. <line x1="10" x2="10" y1="11" y2="17"/>
  222. <line x1="14" x2="14" y1="11" y2="17"/>
  223. </svg>
  224. Supprimer
  225. </button>
  226. </td>
  227. </tr>
  228. </tbody>
  229. </table>
  230. <!-- End Table -->
  231. </div>
  232. </div>
  233. </div>
  234. </div>
  235. </div>
  236. <!-- End Tab 1: Utilisateurs -->
  237. <!-- Tab 2: Attribution des droits -->
  238. <div id="tab-content-droits" class="hidden" role="tabpanel" aria-labelledby="tab-droits">
  239. <!-- Access Selection -->
  240. <div class="mb-6">
  241. <div class="bg-white border border-gray-200 rounded-xl shadow-sm p-6 dark:bg-neutral-800 dark:border-neutral-700">
  242. <div class="flex flex-col sm:flex-row items-center justify-center gap-4">
  243. <label class="text-base font-semibold text-gray-800 dark:text-neutral-200 whitespace-nowrap">
  244. Sélectionner un site
  245. </label>
  246. <div class="hs-dropdown relative inline-flex">
  247. <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">
  248. <span id="selected-site" class="font-semibold">Auto 33</span>
  249. <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">
  250. <path d="m6 9 6 6 6-6"/>
  251. </svg>
  252. </button>
  253. <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">
  254. <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">
  255. Auto 33
  256. </a>
  257. <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">
  258. Admin RH
  259. </a>
  260. <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">
  261. Admin IT
  262. </a>
  263. <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">
  264. Dashboard IT
  265. </a>
  266. <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">
  267. Dashboard RH
  268. </a>
  269. </div>
  270. </div>
  271. </div>
  272. </div>
  273. </div>
  274. <!-- End Access Selection -->
  275. <!-- Table des droits -->
  276. <div class="flex flex-col">
  277. <div class="-m-1.5 overflow-x-auto">
  278. <div class="p-1.5 min-w-full inline-block align-middle">
  279. <div class="bg-white border border-gray-200 rounded-xl shadow-sm overflow-hidden dark:bg-neutral-900 dark:border-neutral-700">
  280. <!-- Header with Add Button -->
  281. <div class="px-6 py-4 border-b border-gray-200 dark:border-neutral-700 flex justify-between items-center">
  282. <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>
  283. <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">
  284. <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">
  285. <path d="M5 12h14"/>
  286. <path d="M12 5v14"/>
  287. </svg>
  288. Ajouter un accès
  289. </button>
  290. </div>
  291. <!-- End Header -->
  292. <!-- Table -->
  293. <table class="min-w-full divide-y divide-gray-200 dark:divide-neutral-700">
  294. <thead class="bg-gray-50 dark:bg-neutral-900">
  295. <tr>
  296. <th scope="col" class="px-6 py-3 text-start">
  297. <span class="text-xs font-semibold uppercase text-gray-800 dark:text-neutral-200">Utilisateur</span>
  298. </th>
  299. <th scope="col" class="px-6 py-3 text-start">
  300. <span class="text-xs font-semibold uppercase text-gray-800 dark:text-neutral-200">Rôle / Groupe</span>
  301. </th>
  302. <th scope="col" class="px-6 py-3 text-end">
  303. <span class="text-xs font-semibold uppercase text-gray-800 dark:text-neutral-200">Actions</span>
  304. </th>
  305. </tr>
  306. </thead>
  307. <tbody class="divide-y divide-gray-200 dark:divide-neutral-700">
  308. <!-- Ligne 1 -->
  309. <tr class="hover:bg-gray-50 dark:hover:bg-neutral-800">
  310. <td class="px-6 py-4 whitespace-nowrap">
  311. <div class="flex items-center gap-x-3">
  312. <div class="flex-shrink-0 h-10 w-10">
  313. <div class="h-10 w-10 rounded-full bg-blue-100 dark:bg-blue-900/30 flex items-center justify-center">
  314. <span class="text-sm font-medium text-blue-800 dark:text-blue-300">JD</span>
  315. </div>
  316. </div>
  317. <span class="text-sm font-medium text-gray-800 dark:text-neutral-200">Jean Dupont</span>
  318. </div>
  319. </td>
  320. <td class="px-6 py-4 whitespace-nowrap">
  321. <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">
  322. Comptable
  323. </span>
  324. </td>
  325. <td class="px-6 py-4 whitespace-nowrap text-end">
  326. <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">
  327. <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">
  328. <path d="M3 6h18"/>
  329. <path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/>
  330. <path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>
  331. <line x1="10" x2="10" y1="11" y2="17"/>
  332. <line x1="14" x2="14" y1="11" y2="17"/>
  333. </svg>
  334. Retirer
  335. </button>
  336. </td>
  337. </tr>
  338. <!-- Ligne 2 -->
  339. <tr class="hover:bg-gray-50 dark:hover:bg-neutral-800">
  340. <td class="px-6 py-4 whitespace-nowrap">
  341. <div class="flex items-center gap-x-3">
  342. <div class="flex-shrink-0 h-10 w-10">
  343. <div class="h-10 w-10 rounded-full bg-orange-100 dark:bg-orange-900/30 flex items-center justify-center">
  344. <span class="text-sm font-medium text-orange-800 dark:text-orange-300">SB</span>
  345. </div>
  346. </div>
  347. <span class="text-sm font-medium text-gray-800 dark:text-neutral-200">Sophie Bernard</span>
  348. </div>
  349. </td>
  350. <td class="px-6 py-4 whitespace-nowrap">
  351. <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">
  352. Directeur
  353. </span>
  354. </td>
  355. <td class="px-6 py-4 whitespace-nowrap text-end">
  356. <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">
  357. <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">
  358. <path d="M3 6h18"/>
  359. <path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/>
  360. <path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>
  361. <line x1="10" x2="10" y1="11" y2="17"/>
  362. <line x1="14" x2="14" y1="11" y2="17"/>
  363. </svg>
  364. Retirer
  365. </button>
  366. </td>
  367. </tr>
  368. </tbody>
  369. </table>
  370. <!-- End Table -->
  371. </div>
  372. </div>
  373. </div>
  374. </div>
  375. </div>
  376. <!-- End Tab 2: Attribution des droits -->
  377. </div>
  378. <!-- End Tab Contents -->
  379. </div>
  380. </div>
  381. <!-- End Content -->
  382. <!-- Modal Ajouter Utilisateur -->
  383. <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">
  384. <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">
  385. <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">
  386. <!-- Header -->
  387. <div class="flex justify-between items-center py-4 px-6 border-b border-gray-200 dark:border-neutral-700">
  388. <h3 class="text-xl font-semibold text-gray-800 dark:text-white">
  389. Nouvel utilisateur
  390. </h3>
  391. <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">
  392. <span class="sr-only">Fermer</span>
  393. <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">
  394. <path d="m18 6-12 12"/>
  395. <path d="m6 6 12 12"/>
  396. </svg>
  397. </button>
  398. </div>
  399. <!-- End Header -->
  400. <!-- Body -->
  401. <div class="p-6 overflow-y-auto max-h-[calc(100vh-200px)]">
  402. <form class="space-y-5">
  403. <div>
  404. <label for="nom" class="block text-sm font-medium text-gray-700 dark:text-neutral-300 mb-2">
  405. Nom complet
  406. </label>
  407. <input
  408. type="text"
  409. id="nom"
  410. name="nom"
  411. 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"
  412. placeholder="Jean Dupont"
  413. required
  414. >
  415. </div>
  416. <div>
  417. <label for="email" class="block text-sm font-medium text-gray-700 dark:text-neutral-300 mb-2">
  418. Adresse email
  419. </label>
  420. <input
  421. type="email"
  422. id="email"
  423. name="email"
  424. 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"
  425. placeholder="jean.dupont@example.com"
  426. required
  427. >
  428. </div>
  429. <div>
  430. <label for="password" class="block text-sm font-medium text-gray-700 dark:text-neutral-300 mb-2">
  431. Mot de passe temporaire
  432. </label>
  433. <input
  434. type="password"
  435. id="password"
  436. name="password"
  437. 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"
  438. placeholder="••••••••"
  439. required
  440. >
  441. <p class="mt-1 text-xs text-gray-500 dark:text-neutral-400">
  442. L'utilisateur devra changer son mot de passe à la première connexion
  443. </p>
  444. </div>
  445. </form>
  446. </div>
  447. <!-- End Body -->
  448. <!-- Footer -->
  449. <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">
  450. <button
  451. type="button"
  452. 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"
  453. data-hs-overlay="#modal-ajouter-utilisateur"
  454. >
  455. Annuler
  456. </button>
  457. <button
  458. type="button"
  459. 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"
  460. >
  461. Créer l'utilisateur
  462. </button>
  463. </div>
  464. <!-- End Footer -->
  465. </div>
  466. </div>
  467. </div>
  468. <!-- End Modal Ajouter Utilisateur -->
  469. <!-- Modal Ajouter Droit -->
  470. <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">
  471. <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">
  472. <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">
  473. <!-- Header -->
  474. <div class="flex justify-between items-center py-4 px-6 border-b border-gray-200 dark:border-neutral-700">
  475. <h3 class="text-xl font-semibold text-gray-800 dark:text-white">
  476. Ajouter un accès
  477. </h3>
  478. <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">
  479. <span class="sr-only">Fermer</span>
  480. <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">
  481. <path d="m18 6-12 12"/>
  482. <path d="m6 6 12 12"/>
  483. </svg>
  484. </button>
  485. </div>
  486. <!-- End Header -->
  487. <!-- Body -->
  488. <div class="p-6 overflow-y-auto max-h-[calc(100vh-200px)]">
  489. <form class="space-y-5">
  490. <div>
  491. <label for="utilisateur-droit" class="block text-sm font-medium text-gray-700 dark:text-neutral-300 mb-2">
  492. Utilisateur
  493. </label>
  494. <select
  495. id="utilisateur-droit"
  496. name="utilisateur-droit"
  497. 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"
  498. required
  499. >
  500. <option value="">Sélectionner un utilisateur</option>
  501. <option value="jean-dupont">Jean Dupont</option>
  502. <option value="marie-martin">Marie Martin</option>
  503. <option value="pierre-durand">Pierre Durand</option>
  504. <option value="sophie-bernard">Sophie Bernard</option>
  505. </select>
  506. </div>
  507. <div>
  508. <label for="role-droit" class="block text-sm font-medium text-gray-700 dark:text-neutral-300 mb-2">
  509. Rôle / Groupe
  510. </label>
  511. <select
  512. id="role-droit"
  513. name="role-droit"
  514. 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"
  515. required
  516. >
  517. <option value="">Sélectionner un rôle</option>
  518. <option value="comptable">Comptable</option>
  519. <option value="directeur">Directeur</option>
  520. <option value="admin">Administrateur</option>
  521. <option value="rh">RH</option>
  522. </select>
  523. </div>
  524. <div class="bg-blue-50 dark:bg-blue-900/20 rounded-lg p-4">
  525. <div class="flex gap-x-3">
  526. <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">
  527. <circle cx="12" cy="12" r="10"/>
  528. <path d="M12 16v-4"/>
  529. <path d="M12 8h.01"/>
  530. </svg>
  531. <div class="flex-1">
  532. <p class="text-sm text-blue-800 dark:text-blue-400">
  533. Cet accès sera ajouté au site actuellement sélectionné : <strong id="modal-site-name">Auto 33</strong>
  534. </p>
  535. </div>
  536. </div>
  537. </div>
  538. </form>
  539. </div>
  540. <!-- End Body -->
  541. <!-- Footer -->
  542. <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">
  543. <button
  544. type="button"
  545. 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"
  546. data-hs-overlay="#modal-ajouter-droit"
  547. >
  548. Annuler
  549. </button>
  550. <button
  551. type="button"
  552. 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"
  553. >
  554. Ajouter l'accès
  555. </button>
  556. </div>
  557. <!-- End Footer -->
  558. </div>
  559. </div>
  560. </div>
  561. <!-- End Modal Ajouter Droit -->
  562. <!-- Preline UI - Chargé à la fin du body pour une initialisation correcte -->
  563. <script src="https://cdn.jsdelivr.net/npm/preline@2.1.0/dist/preline.js"></script>
  564. <!-- Script principal -->
  565. <script>
  566. document.addEventListener('DOMContentLoaded', function() {
  567. // Gérer le changement de site dans le dropdown (onglet droits)
  568. setTimeout(function() {
  569. const dropdownButton = document.getElementById('hs-dropdown-access');
  570. const dropdownContainer = dropdownButton?.closest('.hs-dropdown');
  571. const dropdownMenu = dropdownContainer?.querySelector('.hs-dropdown-menu');
  572. const dropdownItems = dropdownMenu?.querySelectorAll('a');
  573. const selectedSiteSpan = document.getElementById('selected-site');
  574. const siteTitle = document.getElementById('site-title');
  575. const modalSiteName = document.getElementById('modal-site-name');
  576. // Valeur par défaut
  577. let selectedSite = 'Auto 33';
  578. if (dropdownItems && dropdownItems.length > 0) {
  579. dropdownItems.forEach(item => {
  580. item.addEventListener('click', function(e) {
  581. e.preventDefault();
  582. const selectedText = this.textContent.trim();
  583. selectedSite = selectedText;
  584. // Mettre à jour tous les textes
  585. if (selectedSiteSpan) {
  586. selectedSiteSpan.textContent = selectedText;
  587. }
  588. if (siteTitle) {
  589. siteTitle.textContent = selectedText;
  590. }
  591. if (modalSiteName) {
  592. modalSiteName.textContent = selectedText;
  593. }
  594. });
  595. });
  596. }
  597. }, 200);
  598. });
  599. </script>
  600. </body>
  601. </html>