demande-avenant.php 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707
  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>Demande d'Avenant - SIPA Automobiles</title>
  7. <!-- Tailwind CSS CDN -->
  8. <script src="https://cdn.tailwindcss.com"></script>
  9. <!-- Flatpickr CSS -->
  10. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
  11. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/preline/dist/preline.css" />
  12. <style>
  13. /* Style pour les onglets actifs Preline */
  14. button[role="tab"].active,
  15. button[role="tab"][aria-selected="true"] {
  16. background-color: white !important;
  17. color: rgb(31, 41, 55) !important;
  18. }
  19. @media (prefers-color-scheme: dark) {
  20. button[role="tab"].active,
  21. button[role="tab"][aria-selected="true"] {
  22. background-color: rgb(38, 38, 38) !important;
  23. color: white !important;
  24. }
  25. }
  26. /* Styles pour les champs conditionnels */
  27. .conditional-field {
  28. opacity: 0;
  29. max-height: 0;
  30. overflow: hidden;
  31. transition: opacity 0.5s ease-in-out, max-height 0.5s ease-in-out, transform 0.5s ease-in-out;
  32. transform: translateY(-15px) scale(0.95);
  33. pointer-events: none;
  34. }
  35. .conditional-field.is-active {
  36. opacity: 1;
  37. max-height: 3000px;
  38. transform: translateY(0) scale(1);
  39. pointer-events: auto;
  40. }
  41. /* Animations douces */
  42. .smooth-transition {
  43. transition: all 0.3s ease-in-out;
  44. }
  45. /* Animation fade-in pour les cards */
  46. @keyframes fadeInUp {
  47. from {
  48. opacity: 0;
  49. transform: translateY(20px);
  50. }
  51. to {
  52. opacity: 1;
  53. transform: translateY(0);
  54. }
  55. }
  56. @keyframes fadeOutUp {
  57. from {
  58. opacity: 1;
  59. transform: translateY(0);
  60. }
  61. to {
  62. opacity: 0;
  63. transform: translateY(-20px);
  64. }
  65. }
  66. .animate-fade-in-up {
  67. animation: fadeInUp 0.5s ease-out;
  68. }
  69. /* Classe réutilisable pour les champs readonly */
  70. .readonly-field {
  71. background-color: rgb(243, 244, 246);
  72. color: rgb(107, 114, 128);
  73. cursor: not-allowed;
  74. }
  75. @media (prefers-color-scheme: dark) {
  76. .readonly-field {
  77. background-color: rgb(38, 38, 38);
  78. color: rgb(163, 163, 163);
  79. }
  80. }
  81. /* Styles pour la validation de formulaire Preline */
  82. .error-message {
  83. display: none;
  84. color: rgb(239, 68, 68);
  85. font-size: 0.875rem;
  86. margin-top: 0.25rem;
  87. }
  88. input:invalid:not(:focus):not(:placeholder-shown) ~ .error-message,
  89. select:invalid:not(:focus) ~ .error-message,
  90. textarea:invalid:not(:focus):not(:placeholder-shown) ~ .error-message {
  91. display: block;
  92. }
  93. input:invalid:not(:focus):not(:placeholder-shown),
  94. select:invalid:not(:focus),
  95. textarea:invalid:not(:focus):not(:placeholder-shown) {
  96. border-color: rgb(239, 68, 68);
  97. }
  98. input:valid:not(:placeholder-shown),
  99. select:valid,
  100. textarea:valid:not(:placeholder-shown) {
  101. border-color: rgb(34, 197, 94);
  102. }
  103. /* Styles personnalisés pour radio buttons et checkboxes avec couleur SIPA */
  104. input[type="radio"],
  105. input[type="checkbox"] {
  106. accent-color: #21B6BA;
  107. }
  108. input[type="radio"]:focus,
  109. input[type="checkbox"]:focus {
  110. --tw-ring-color: rgba(33, 182, 186, 0.5);
  111. }
  112. /* Styles pour les sections avec avenant */
  113. .section-avenant {
  114. position: relative;
  115. }
  116. .section-avenant .btn-avenant {
  117. position: absolute;
  118. top: 1rem;
  119. right: 1rem;
  120. z-index: 10;
  121. }
  122. .section-avenant.avenant-active .btn-avenant {
  123. display: none;
  124. }
  125. .section-avenant.avenant-active .section-content-original {
  126. opacity: 0.6;
  127. }
  128. .section-avenant.avenant-active .section-content-original input,
  129. .section-avenant.avenant-active .section-content-original select,
  130. .section-avenant.avenant-active .section-content-original textarea {
  131. background-color: rgb(243, 244, 246);
  132. color: rgb(107, 114, 128);
  133. cursor: not-allowed;
  134. pointer-events: none;
  135. }
  136. @media (prefers-color-scheme: dark) {
  137. .section-avenant.avenant-active .section-content-original input,
  138. .section-avenant.avenant-active .section-content-original select,
  139. .section-avenant.avenant-active .section-content-original textarea {
  140. background-color: rgb(38, 38, 38);
  141. color: rgb(163, 163, 163);
  142. }
  143. }
  144. .section-comparison {
  145. display: none;
  146. margin-top: 1.5rem;
  147. padding-top: 1.5rem;
  148. border-top: 2px solid #21B6BA;
  149. animation: fadeInUp 0.5s ease-out;
  150. }
  151. .section-comparison.is-active {
  152. display: block;
  153. }
  154. .comparison-grid {
  155. display: grid;
  156. grid-template-columns: 1fr 1fr;
  157. gap: 1.5rem;
  158. }
  159. @media (max-width: 768px) {
  160. .comparison-grid {
  161. grid-template-columns: 1fr;
  162. }
  163. }
  164. .comparison-column {
  165. padding: 1rem;
  166. border-radius: 0.5rem;
  167. }
  168. .comparison-column.column-actuelle {
  169. background-color: rgb(243, 244, 246);
  170. border: 2px solid rgb(209, 213, 219);
  171. }
  172. .comparison-column.column-souhaitee {
  173. background-color: rgb(240, 253, 250);
  174. border: 2px solid #21B6BA;
  175. }
  176. @media (prefers-color-scheme: dark) {
  177. .comparison-column.column-actuelle {
  178. background-color: rgb(38, 38, 38);
  179. border-color: rgb(64, 64, 64);
  180. }
  181. .comparison-column.column-souhaitee {
  182. background-color: rgba(33, 182, 186, 0.1);
  183. border-color: #21B6BA;
  184. }
  185. }
  186. .comparison-column h3 {
  187. font-size: 0.875rem;
  188. font-weight: 600;
  189. margin-bottom: 1rem;
  190. padding-bottom: 0.5rem;
  191. border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  192. }
  193. .comparison-column.column-actuelle h3 {
  194. color: rgb(107, 114, 128);
  195. }
  196. .comparison-column.column-souhaitee h3 {
  197. color: #21B6BA;
  198. }
  199. /* Classe pour les champs modifiables dans l'avenant */
  200. .field-avenant {
  201. /* Les champs avec cette classe peuvent être modifiés dans la section souhaitée */
  202. }
  203. /* Styles pour les badges de notification */
  204. .notification-badge {
  205. animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  206. }
  207. @keyframes pulse {
  208. 0%, 100% {
  209. opacity: 1;
  210. }
  211. 50% {
  212. opacity: .5;
  213. }
  214. }
  215. /* Styles pour les sections PRE-avenant et Post-avenant */
  216. .section-pre-avenant {
  217. background-color: rgba(254, 242, 242, 0.5) !important;
  218. border-color: rgba(239, 68, 68, 0.3) !important;
  219. }
  220. .section-post-avenant {
  221. background-color: rgba(240, 253, 250, 0.5) !important;
  222. border-color: rgba(33, 182, 186, 0.3) !important;
  223. }
  224. @media (prefers-color-scheme: dark) {
  225. .section-pre-avenant {
  226. background-color: rgba(127, 29, 29, 0.2) !important;
  227. border-color: rgba(239, 68, 68, 0.3) !important;
  228. }
  229. .section-post-avenant {
  230. background-color: rgba(19, 78, 74, 0.2) !important;
  231. border-color: rgba(33, 182, 186, 0.3) !important;
  232. }
  233. }
  234. </style>
  235. </head>
  236. <body class="bg-gray-50 dark:bg-neutral-900">
  237. <?php
  238. $skip_default_content = true;
  239. include 'menu.php';
  240. ?>
  241. <!-- Content -->
  242. <div class="pt-12 lg:pt-16 lg:ps-64">
  243. <div class="min-h-screen p-4 md:p-8">
  244. <!-- Header -->
  245. <div class="mb-6 flex justify-between items-start">
  246. <div>
  247. <h1 class="text-2xl font-semibold text-[#21B6BA] dark:text-[#21B6BA]">Demande d'Avenant</h1>
  248. <p class="mt-1 text-sm text-gray-600 dark:text-neutral-400">Modifiez les éléments du contrat pour créer un avenant</p>
  249. </div>
  250. </div>
  251. <!-- Formulaire -->
  252. <form id="avenant-form" class="space-y-6">
  253. <!-- Champs cachés (hidden) -->
  254. <input type="hidden" id="demande_id" name="demande_id" value="">
  255. <input type="hidden" id="statut_technique" name="statut_technique" value="nouveau">
  256. <input type="hidden" id="azure_user_id" name="azure_user_id" value="">
  257. <!-- Section: Informations de suivi -->
  258. <div class="bg-white border border-gray-200 rounded-xl shadow-sm dark:bg-neutral-800 dark:border-neutral-700 smooth-transition animate-fade-in-up">
  259. <div class="p-10">
  260. <h2 class="text-lg font-semibold text-gray-800 dark:text-white mb-4">Informations de suivi</h2>
  261. <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
  262. <!-- Créé par (readonly) -->
  263. <div>
  264. <label for="cree_par" class="block text-sm font-medium mb-2 text-gray-700 dark:text-neutral-300">
  265. Créé par
  266. </label>
  267. <input type="text" id="cree_par" name="cree_par" readonly
  268. class="readonly-field py-3 px-4 block w-full border-gray-200 rounded-lg text-sm focus:border-gray-200 focus:ring-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:border-neutral-700"
  269. value="Sophie Bernard (RH)">
  270. </div>
  271. <!-- Date de création (readonly) -->
  272. <div>
  273. <label for="date_creation" class="block text-sm font-medium mb-2 text-gray-700 dark:text-neutral-300">
  274. Date de création
  275. </label>
  276. <input type="text" id="date_creation" name="date_creation" readonly
  277. class="readonly-field py-3 px-4 block w-full border-gray-200 rounded-lg text-sm focus:border-gray-200 focus:ring-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:border-neutral-700"
  278. value="03/11/2025 14:30">
  279. </div>
  280. <!-- Statut global (select) -->
  281. <div>
  282. <label for="statut_global" class="block text-sm font-medium mb-2 text-gray-700 dark:text-neutral-300">
  283. Statut de la demande
  284. </label>
  285. <div class="flex items-center gap-2">
  286. <select id="statut_global" name="statut_global" disabled
  287. class="py-3 px-4 pe-9 block w-full border border-gray-200 rounded-lg text-sm bg-gray-50 focus:border-[#21B6BA] focus:ring-[#21B6BA] disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400 dark:placeholder-neutral-500 dark:focus:ring-neutral-600">
  288. <option value="nouveau" selected>Nouveau</option>
  289. <option value="en_attente">En attente</option>
  290. <option value="en_cours">En cours</option>
  291. <option value="valide">Validé</option>
  292. <option value="supprime">Supprimé</option>
  293. </select>
  294. <button type="button" id="toggle_statut_global" class="shrink-0 inline-flex items-center justify-center size-10 text-gray-500 hover:text-[#21B6BA] dark:text-neutral-400 dark:hover:text-[#21B6BA] transition-colors">
  295. <svg class="shrink-0 size-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
  296. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path>
  297. </svg>
  298. </button>
  299. </div>
  300. </div>
  301. <!-- Site sélectionné -->
  302. <div class="md:col-span-3">
  303. <label for="site_selectionne" class="block text-sm font-medium mb-2 text-gray-700 dark:text-neutral-300">
  304. SITE SÉLECTIONNÉ <span class="text-red-500">*</span>
  305. </label>
  306. <select id="site_selectionne" name="site_selectionne" required
  307. class="py-3 px-4 pe-9 block w-full border-2 border-gray-200 bg-gray-100 rounded-lg text-sm text-gray-700 focus:border-[#21B6BA] focus:ring-[#21B6BA] disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-900 dark:border-cyan-600 dark:text-neutral-400">
  308. <option value="">Sélectionner un site</option>
  309. <option value="auto33">Auto 33</option>
  310. <option value="autoport">Auto Port</option>
  311. </select>
  312. <p class="error-message">Veuillez sélectionner un site</p>
  313. </div>
  314. </div>
  315. </div>
  316. </div>
  317. <!-- Section: CONTRAT -->
  318. <div id="section-contrat" class="bg-white border border-gray-200 rounded-xl shadow-sm dark:bg-neutral-800 dark:border-neutral-700 smooth-transition animate-fade-in-up">
  319. <div class="p-10">
  320. <h2 class="text-lg font-semibold text-gray-800 dark:text-white mb-6">CONTRAT</h2>
  321. <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
  322. <!-- Panneau gauche : Champs de saisie -->
  323. <div class="space-y-6">
  324. <!-- SERVICE -->
  325. <div>
  326. <label for="service_contrat" class="block text-sm font-medium mb-2 text-gray-700 dark:text-neutral-300">
  327. SERVICE <span class="text-red-500">*</span>
  328. </label>
  329. <select id="service_contrat" name="service_contrat" required disabled
  330. class="field-avenant py-3 px-4 pe-9 block w-full border border-gray-200 rounded-lg text-sm bg-gray-50 focus:border-[#21B6BA] focus:ring-[#21B6BA] disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400 dark:placeholder-neutral-500 dark:focus:ring-neutral-600">
  331. <option value="">Sélectionner un service</option>
  332. <option value="vente_pra" selected>Vente P.R.A.</option>
  333. <option value="vente_neuf">Vente Neuf</option>
  334. <option value="apres_vente">Après-Vente</option>
  335. <option value="pieces">Pièces</option>
  336. <option value="accueil">Accueil</option>
  337. <option value="administration">Administration</option>
  338. </select>
  339. </div>
  340. <!-- INTITULE DE POSTE -->
  341. <div>
  342. <label for="intitule_poste_contrat" class="block text-sm font-medium mb-2 text-gray-700 dark:text-neutral-300">
  343. INTITULE DE POSTE <span class="text-red-500">*</span>
  344. </label>
  345. <select id="intitule_poste_contrat" name="intitule_poste_contrat" required disabled
  346. class="field-avenant py-3 px-4 pe-9 block w-full border-2 border-gray-200 bg-gray-100 rounded-lg text-sm text-gray-700 focus:border-[#21B6BA] focus:ring-[#21B6BA] disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-900 dark:border-cyan-600 dark:text-neutral-400">
  347. <option value="">Sélectionner un intitulé</option>
  348. <option value="chef_ventes_pra" selected>Chef des ventes PRA</option>
  349. <option value="conseiller_commercial">Conseiller commercial</option>
  350. <option value="responsable_atelier">Responsable atelier</option>
  351. <option value="mecanicien">Mécanicien</option>
  352. </select>
  353. </div>
  354. <!-- ECHELON -->
  355. <div>
  356. <label for="echelon_contrat" class="block text-sm font-medium mb-2 text-gray-700 dark:text-neutral-300">
  357. ECHELON <span class="text-red-500">*</span>
  358. </label>
  359. <select id="echelon_contrat" name="echelon_contrat" required disabled
  360. class="field-avenant py-3 px-4 pe-9 block w-full border border-gray-200 rounded-lg text-sm bg-gray-50 focus:border-[#21B6BA] focus:ring-[#21B6BA] disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400 dark:placeholder-neutral-500 dark:focus:ring-neutral-600">
  361. <option value="">Sélectionner un échelon</option>
  362. <option value="III_A" selected>III A</option>
  363. <option value="III_B">III B</option>
  364. <option value="III_C">III C</option>
  365. <option value="IV_A">IV A</option>
  366. </select>
  367. </div>
  368. <!-- STATUT -->
  369. <div>
  370. <label for="statut_contrat" class="block text-sm font-medium mb-2 text-gray-700 dark:text-neutral-300">
  371. STATUT <span class="text-red-500">*</span>
  372. </label>
  373. <select id="statut_contrat" name="statut_contrat" required disabled
  374. class="field-avenant py-3 px-4 pe-9 block w-full border border-gray-200 rounded-lg text-sm bg-gray-50 focus:border-[#21B6BA] focus:ring-[#21B6BA] disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400 dark:placeholder-neutral-500 dark:focus:ring-neutral-600">
  375. <option value="">Sélectionner un statut</option>
  376. <option value="cadre" selected>Cadre</option>
  377. <option value="non_cadre">Non-cadre</option>
  378. <option value="agent_maitrise">Agent de maîtrise</option>
  379. </select>
  380. </div>
  381. </div>
  382. <!-- Panneau droit : Tableau des minima -->
  383. <div>
  384. <label class="block text-sm font-medium mb-3 text-gray-700 dark:text-neutral-300">
  385. Minima conventionnels (Convention collective de l'automobile)
  386. </label>
  387. <div class="overflow-x-auto">
  388. <table class="min-w-full divide-y divide-gray-200 dark:divide-neutral-700">
  389. <thead class="bg-gray-50 dark:bg-neutral-800">
  390. <tr>
  391. <th scope="col" class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider dark:text-neutral-400">Échelon</th>
  392. <th scope="col" class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider dark:text-neutral-400">Minima 35h00</th>
  393. <th scope="col" class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider dark:text-neutral-400">Minima 37h00</th>
  394. <th scope="col" class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider dark:text-neutral-400">Minima 39h00</th>
  395. </tr>
  396. </thead>
  397. <tbody class="bg-white divide-y divide-gray-200 dark:bg-neutral-900 dark:divide-neutral-700">
  398. <tr class="hover:bg-gray-50 dark:hover:bg-neutral-800">
  399. <td class="px-4 py-3 whitespace-nowrap text-sm font-medium text-gray-900 dark:text-white">III A</td>
  400. <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-500 dark:text-neutral-400">3804</td>
  401. <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-500 dark:text-neutral-400">4075,61</td>
  402. <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-500 dark:text-neutral-400">4347,21</td>
  403. </tr>
  404. <tr class="hover:bg-gray-50 dark:hover:bg-neutral-800">
  405. <td class="px-4 py-3 whitespace-nowrap text-sm font-medium text-gray-900 dark:text-white">III B</td>
  406. <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-500 dark:text-neutral-400">4093</td>
  407. <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-500 dark:text-neutral-400">4385,24</td>
  408. <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-500 dark:text-neutral-400">4677,48</td>
  409. </tr>
  410. </tbody>
  411. </table>
  412. </div>
  413. </div>
  414. </div>
  415. </div>
  416. </div>
  417. <!-- Section: REMUNERATION (avec possibilité d'avenant) -->
  418. <div id="section-remuneration" class="section-avenant bg-white border border-gray-200 rounded-xl shadow-sm dark:bg-neutral-800 dark:border-neutral-700 smooth-transition animate-fade-in-up">
  419. <div class="p-10">
  420. <!-- Bouton pour activer l'avenant sur cette section -->
  421. <button type="button" id="btn-avenant-remuneration" class="btn-avenant py-2 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-[#21B6BA] text-white hover:bg-[#1AA5A9] focus:outline-hidden focus:bg-[#1AA5A9] transition-colors">
  422. <svg class="shrink-0 size-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
  423. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path>
  424. </svg>
  425. Je souhaite faire un avenant sur cette partie du contrat
  426. </button>
  427. <div class="section-content-original" id="remuneration-original">
  428. <h2 class="text-lg font-semibold text-gray-800 dark:text-white mb-4">
  429. REMUNERATION<span class="avenant" style="display: none; color:#21b6ba"> PRE -avenant</span>
  430. </h2>
  431. <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
  432. <!-- Base horaire -->
  433. <div class="md:col-span-2">
  434. <label for="base_horaire" class="block text-sm font-medium mb-2 text-gray-700 dark:text-neutral-300">
  435. BASE HORAIRE
  436. </label>
  437. <select id="base_horaire" name="base_horaire" disabled
  438. class="field-avenant py-3 px-4 pe-9 block w-full border border-gray-200 rounded-lg text-sm bg-gray-50 focus:border-[#21B6BA] focus:ring-[#21B6BA] disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400 dark:placeholder-neutral-500 dark:focus:ring-neutral-600">
  439. <option value="">Sélectionner une base horaire</option>
  440. <option value="35">35h (Temps plein)</option>
  441. <option value="39">Forfait 39h avec 2h sup + 1 JRTT (2h)</option>
  442. <option value="30">30h</option>
  443. <option value="28">28h</option>
  444. </select>
  445. </div>
  446. <!-- Salaire mensuel brut -->
  447. <div class="max-w-sm space-y-3">
  448. <div>
  449. <label for="salaire" class="block text-sm font-medium mb-2 dark:text-white">
  450. SALAIRE MENSUEL BRUT SUR LA BASE HORAIRE CHOISIE <span class="text-red-500">*</span>
  451. </label>
  452. <div class="relative">
  453. <input type="text" id="salaire" name="salaire" required disabled
  454. class="field-avenant py-2.5 sm:py-3 px-4 ps-9 pe-16 block w-full border border-gray-200 rounded-lg sm:text-sm focus:z-10 focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400 dark:placeholder-neutral-500 dark:focus:ring-neutral-600"
  455. placeholder="0.00">
  456. <div class="absolute inset-y-0 start-0 flex items-center pointer-events-none z-20 ps-4">
  457. <span class="text-gray-500 dark:text-neutral-500">€</span>
  458. </div>
  459. <div class="absolute inset-y-0 end-0 flex items-center pointer-events-none z-20 pe-4">
  460. <span class="text-gray-500 dark:text-neutral-500">EUR</span>
  461. </div>
  462. </div>
  463. </div>
  464. <!-- Équivalent 35h (readonly) -->
  465. <div>
  466. <label for="salaire_35h" class="block text-sm font-medium mb-2 dark:text-white">
  467. EQUIVALENT 35h :
  468. </label>
  469. <div class="relative">
  470. <input type="text" id="salaire_35h" name="salaire_35h" readonly
  471. class="readonly-field py-2.5 sm:py-3 px-4 ps-9 pe-16 block w-full border border-gray-200 rounded-lg sm:text-sm dark:border-neutral-700"
  472. placeholder="0.00">
  473. <div class="absolute inset-y-0 start-0 flex items-center pointer-events-none z-20 ps-4">
  474. <span class="text-gray-500 dark:text-neutral-500">€</span>
  475. </div>
  476. <div class="absolute inset-y-0 end-0 flex items-center pointer-events-none z-20 pe-4">
  477. <span class="text-gray-500 dark:text-neutral-500">EUR</span>
  478. </div>
  479. </div>
  480. </div>
  481. </div>
  482. <!-- Rémunération variable -->
  483. <div class="md:col-span-2">
  484. <label class="block text-sm font-medium mb-3 text-gray-700 dark:text-neutral-300">
  485. REMUNERATION VARIABLE
  486. </label>
  487. <div class="flex gap-4">
  488. <div class="flex">
  489. <input type="radio" name="remuneration_variable" id="remuneration_variable_oui" value="oui" disabled
  490. class="field-avenant shrink-0 mt-0.5 border-gray-200 rounded-full text-[#21B6BA] focus:ring-[#21B6BA] disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:checked:bg-[#21B6BA] dark:checked:border-[#21B6BA] dark:focus:ring-offset-gray-800">
  491. <label for="remuneration_variable_oui" class="text-sm text-gray-700 ms-2 dark:text-neutral-400">Oui</label>
  492. </div>
  493. <div class="flex">
  494. <input type="radio" name="remuneration_variable" id="remuneration_variable_non" value="non" disabled
  495. class="field-avenant shrink-0 mt-0.5 border-gray-200 rounded-full text-[#21B6BA] focus:ring-[#21B6BA] disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:checked:bg-[#21B6BA] dark:checked:border-[#21B6BA] dark:focus:ring-offset-gray-800">
  496. <label for="remuneration_variable_non" class="text-sm text-gray-700 ms-2 dark:text-neutral-400">Non</label>
  497. </div>
  498. </div>
  499. </div>
  500. </div>
  501. </div>
  502. </div>
  503. </div>
  504. <!-- Boutons d'action -->
  505. <div class="flex justify-end gap-3">
  506. <button type="button" class="py-3 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 focus:outline-hidden focus: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 dark:focus:bg-neutral-700">
  507. Annuler
  508. </button>
  509. <button type="button" class="py-3 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-gray-600 text-white hover:bg-gray-700 focus:outline-hidden focus:bg-gray-700 disabled:opacity-50 disabled:pointer-events-none">
  510. Enregistrer en brouillon
  511. </button>
  512. <button type="submit" class="py-3 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-[#21B6BA] text-white hover:bg-[#1AA5A9] focus:outline-hidden focus:bg-[#1AA5A9] disabled:opacity-50 disabled:pointer-events-none">
  513. Soumettre la demande d'avenant
  514. </button>
  515. </div>
  516. </form>
  517. </div>
  518. </div>
  519. <!-- Flatpickr JS -->
  520. <script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
  521. <script src="https://cdn.jsdelivr.net/npm/flatpickr/dist/l10n/fr.js"></script>
  522. <!-- Preline JS -->
  523. <script src="https://cdn.jsdelivr.net/npm/preline/dist/preline.js"></script>
  524. <!-- Script pour gérer les avenants -->
  525. <script>
  526. document.addEventListener('DOMContentLoaded', function() {
  527. // Fonction pour activer les champs de la section originale
  528. function activateOriginalSectionFields() {
  529. const originalSection = document.getElementById('remuneration-original');
  530. if (!originalSection) return;
  531. // Activer tous les champs désactivés dans la section originale
  532. const disabledFields = originalSection.querySelectorAll('input[disabled], select[disabled]');
  533. disabledFields.forEach(field => {
  534. field.removeAttribute('disabled');
  535. field.classList.remove('disabled:opacity-50', 'disabled:pointer-events-none');
  536. // Réinitialiser les classes de style
  537. if (field.classList.contains('bg-gray-50')) {
  538. field.classList.remove('bg-gray-50');
  539. field.classList.add('bg-white');
  540. }
  541. });
  542. // Afficher le titre "-avenant"
  543. const avenantTitle = originalSection.querySelector('.avenant');
  544. if (avenantTitle) {
  545. avenantTitle.style.display = 'inline';
  546. }
  547. }
  548. // Fonction pour dupliquer la section REMUNERATION
  549. function duplicateRemunerationSection() {
  550. const originalSection = document.getElementById('remuneration-original');
  551. const sectionContainer = document.getElementById('section-remuneration');
  552. const btnAvenant = document.getElementById('btn-avenant-remuneration');
  553. if (!originalSection || !sectionContainer || !btnAvenant) return;
  554. // Vérifier si la section dupliquée existe déjà
  555. if (document.getElementById('section-remuneration-avenant')) {
  556. return; // Ne pas dupliquer si elle existe déjà
  557. }
  558. // Activer les champs de la section originale
  559. activateOriginalSectionFields();
  560. // Ajouter la classe pour le style rouge léger sur la section PRE-avenant
  561. sectionContainer.classList.add('section-pre-avenant');
  562. // Cloner le contenu de la section originale
  563. const clonedContent = originalSection.cloneNode(true);
  564. // Modifier le titre pour garder "REMUNERATION" et changer le span en "Post avenant"
  565. const title = clonedContent.querySelector('h2');
  566. if (title) {
  567. // Modifier le span "PRE -avenant" en "Post avenant"
  568. const avenantSpan = title.querySelector('.avenant');
  569. if (avenantSpan) {
  570. // Modifier le contenu du span pour "Post avenant"
  571. avenantSpan.textContent = ' Post avenant';
  572. avenantSpan.style.display = 'inline';
  573. avenantSpan.style.color = '#21b6ba';
  574. }
  575. }
  576. // Réactiver tous les champs désactivés dans la section dupliquée
  577. const disabledFields = clonedContent.querySelectorAll('input[disabled], select[disabled]');
  578. disabledFields.forEach(field => {
  579. field.removeAttribute('disabled');
  580. field.classList.remove('disabled:opacity-50', 'disabled:pointer-events-none');
  581. // Retirer les classes readonly si présentes
  582. field.classList.remove('readonly-field');
  583. // Réinitialiser les classes de style
  584. if (field.classList.contains('bg-gray-50')) {
  585. field.classList.remove('bg-gray-50');
  586. field.classList.add('bg-white');
  587. }
  588. });
  589. // Modifier les IDs et names des champs pour éviter les conflits
  590. const allFields = clonedContent.querySelectorAll('input, select, textarea, label');
  591. allFields.forEach(field => {
  592. if (field.id) {
  593. field.id = field.id + '_avenant';
  594. }
  595. if (field.name) {
  596. field.name = field.name + '_avenant';
  597. }
  598. if (field.getAttribute('for')) {
  599. field.setAttribute('for', field.getAttribute('for') + '_avenant');
  600. }
  601. });
  602. // Créer une nouvelle section complète avec le même style
  603. const newSection = document.createElement('div');
  604. newSection.id = 'section-remuneration-avenant';
  605. newSection.className = 'bg-white border border-gray-200 rounded-xl shadow-sm dark:bg-neutral-800 dark:border-neutral-700 smooth-transition animate-fade-in-up section-post-avenant';
  606. const innerDiv = document.createElement('div');
  607. innerDiv.className = 'p-10';
  608. innerDiv.appendChild(clonedContent);
  609. newSection.appendChild(innerDiv);
  610. // Insérer la nouvelle section après la section originale
  611. sectionContainer.parentNode.insertBefore(newSection, sectionContainer.nextSibling);
  612. // Masquer le bouton
  613. btnAvenant.style.display = 'none';
  614. }
  615. // Gérer le clic sur le bouton "Je souhaite faire un avenant"
  616. const btnAvenantRemuneration = document.getElementById('btn-avenant-remuneration');
  617. if (btnAvenantRemuneration) {
  618. btnAvenantRemuneration.addEventListener('click', function() {
  619. duplicateRemunerationSection();
  620. });
  621. }
  622. });
  623. </script>
  624. </body>
  625. </html>